/* ========== CSS VARIABLES ========== */
    :root {
      --primary: #8C1D18;
      --primary-light: #B22A24;
      --primary-dark: #6A1612;
      --accent: #D4AF37;
      --accent-light: #E5C654;
      --accent-dark: #B8952E;
      --depth: #1A1A1A;
      --bg: #F5F1E6;
      --bg-card: #FFFDF7;
      --fg: #1A1A1A;
      --fg-sec: #4A4540;
      --muted: #8A837A;
      --highlight: #C75B12;
      --border: #E0D8C8;
      --shadow: rgba(26,26,26,0.08);
      --shadow-lg: rgba(26,26,26,0.15);
      --glass: rgba(245,241,230,0.8);
    }
    [data-theme="dark"] {
      --bg: #141210;
      --bg-card: #1E1B18;
      --fg: #F5F1E6;
      --fg-sec: #C8C0B5;
      --muted: #8A837A;
      --border: #3A3530;
      --shadow: rgba(0,0,0,0.3);
      --shadow-lg: rgba(0,0,0,0.5);
      --glass: rgba(20,18,16,0.85);
    }

    /* ========== BASE ========== */
    * { margin:0; padding:0; box-sizing:border-box; }
    html { scroll-behavior: smooth; }
    body {
      font-family: 'Outfit', sans-serif;
      background: var(--bg);
      color: var(--fg);
      transition: background 0.4s, color 0.4s;
      overflow-x: hidden;
      min-height: 100vh;
    }
    ::selection { background: var(--accent); color: var(--depth); }
    ::-webkit-scrollbar { width: 8px; }
    ::-webkit-scrollbar-track { background: var(--bg); }
    ::-webkit-scrollbar-thumb { background: var(--accent-dark); border-radius: 4px; }

    /* ========== NAVIGATION ========== */
    .nav-main {
      position: fixed; top: 0; left: 0; right: 0; z-index: 100;
      background: var(--glass);
      backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
      border-bottom: 1px solid var(--border);
      transition: background 0.4s, border-color 0.4s;
    }
    .nav-link {
      position: relative; color: var(--muted); font-weight: 500; font-size: 0.9rem;
      transition: color 0.3s; cursor: pointer; padding: 0.25rem 0;
    }
    .nav-link:hover, .nav-link.active { color: var(--accent); }
    .nav-link.active::after {
      content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
      height: 2px; background: var(--accent); border-radius: 1px;
    }

    /* ========== HERO ========== */
    .hero-section {
      min-height: 100vh; position: relative; overflow: hidden;
      background: linear-gradient(160deg, #1A0A09 0%, #2D0F0D 30%, #3A1612 60%, #1A0A09 100%);
      display: flex; align-items: center; justify-content: center;
    }
    .hero-pattern {
      position: absolute; inset: 0; opacity: 0.15;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Crect x='12' y='12' width='36' height='36' transform='rotate(45 30 30)' fill='none' stroke='%23D4AF37' stroke-width='0.5'/%3E%3Ccircle cx='30' cy='30' r='2.5' fill='%23D4AF37' opacity='0.5'/%3E%3Cpath d='M0 30 L30 0 L60 30 L30 60Z' fill='none' stroke='%23D4AF37' stroke-width='0.3' opacity='0.4'/%3E%3C/svg%3E");
      background-size: 60px 60px;
    }
    .hero-glow {
      position: absolute; width: 500px; height: 500px; border-radius: 50%;
      background: radial-gradient(circle, rgba(212,175,55,0.12) 0%, transparent 70%);
      top: 50%; left: 50%; transform: translate(-50%, -50%);
      animation: glow-pulse 4s ease-in-out infinite;
    }
    @keyframes glow-pulse {
      0%, 100% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
      50% { transform: translate(-50%,-50%) scale(1.15); opacity: 0.7; }
    }

    /* Ornamen mengambang */
    .hero-ornament {
      position: absolute; border: 1px solid rgba(212,175,55,0.25);
      pointer-events: none;
    }
    .orn-1 { width:80px; height:80px; top:12%; left:8%; transform:rotate(45deg); animation: float-orn 8s ease-in-out infinite; }
    .orn-2 { width:50px; height:50px; top:20%; right:12%; transform:rotate(30deg); animation: float-orn 6s ease-in-out infinite 1s; border-radius:50%; }
    .orn-3 { width:120px; height:120px; bottom:15%; left:5%; transform:rotate(15deg); animation: float-orn 10s ease-in-out infinite 2s; }
    .orn-4 { width:40px; height:40px; top:60%; right:8%; transform:rotate(60deg); animation: float-orn 7s ease-in-out infinite 0.5s; border-radius:50%; }
    .orn-5 { width:70px; height:70px; bottom:25%; right:20%; transform:rotate(45deg); animation: float-orn 9s ease-in-out infinite 3s; }
    .orn-6 { width:30px; height:30px; top:35%; left:25%; transform:rotate(20deg); animation: float-orn 5s ease-in-out infinite 1.5s; border-radius:50%; }
    @keyframes float-orn {
      0%, 100% { transform: translateY(0) rotate(var(--r, 45deg)); opacity: 0.3; }
      50% { transform: translateY(-20px) rotate(calc(var(--r, 45deg) + 10deg)); opacity: 0.6; }
    }
    .orn-1 { --r: 45deg; } .orn-2 { --r: 30deg; } .orn-3 { --r: 15deg; }
    .orn-4 { --r: 60deg; } .orn-5 { --r: 45deg; } .orn-6 { --r: 20deg; }

    .hero-title {
      font-family: 'Cormorant Garamond', serif;
      font-weight: 700; font-size: clamp(2.5rem, 7vw, 5rem);
      line-height: 1.1; color: #F5F1E6;
    }
    .hero-title .accent-text { color: var(--accent); }
    .hero-subtitle {
      font-size: clamp(1rem, 2.5vw, 1.25rem); color: rgba(245,241,230,0.7);
      font-weight: 300; margin-top: 1rem; letter-spacing: 0.02em;
    }

    /* Tombol CTA */
    .btn-primary {
      display: inline-flex; align-items: center; gap: 0.5rem;
      padding: 0.85rem 2rem; background: var(--accent); color: var(--depth);
      font-weight: 600; font-size: 0.95rem; border: none; border-radius: 8px;
      cursor: pointer; transition: all 0.3s; text-decoration: none;
      box-shadow: 0 4px 15px rgba(212,175,55,0.3);
    }
    .btn-primary:hover { background: var(--accent-light); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(212,175,55,0.4); }
    .btn-secondary {
      display: inline-flex; align-items: center; gap: 0.5rem;
      padding: 0.85rem 2rem; background: transparent; color: #F5F1E6;
      font-weight: 500; font-size: 0.95rem; border: 1.5px solid rgba(212,175,55,0.5);
      border-radius: 8px; cursor: pointer; transition: all 0.3s; text-decoration: none;
    }
    .btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: rgba(212,175,55,0.08); }

    .btn-action {
      display: inline-flex; align-items: center; gap: 0.5rem;
      padding: 0.75rem 1.75rem; font-weight: 600; font-size: 0.9rem;
      border: none; border-radius: 8px; cursor: pointer; transition: all 0.3s;
      text-decoration: none;
    }
    .btn-action.primary { background: var(--primary); color: #F5F1E6; }
    .btn-action.primary:hover { background: var(--primary-light); transform: translateY(-1px); }
    .btn-action.accent { background: var(--accent); color: var(--depth); }
    .btn-action.accent:hover { background: var(--accent-light); transform: translateY(-1px); }
    .btn-action.outline {
      background: transparent; color: var(--fg); border: 1.5px solid var(--border);
    }
    .btn-action.outline:hover { border-color: var(--accent); color: var(--accent); }

    /* Scroll indicator */
    .scroll-indicator {
      position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
      display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
      color: rgba(245,241,230,0.4); font-size: 0.75rem; letter-spacing: 0.1em;
      animation: bounce-down 2s ease-in-out infinite;
    }
    @keyframes bounce-down {
      0%, 100% { transform: translateX(-50%) translateY(0); }
      50% { transform: translateX(-50%) translateY(8px); }
    }

    /* ========== PAGE SECTIONS ========== */
    .page-section {
      display: none; opacity: 0; transform: translateY(10px);
      transition: opacity 0.4s, transform 0.4s;
      min-height: calc(100vh - 70px); padding-top: 80px;
    }
    .page-section.visible { display: block; }
    .page-section.active { opacity: 1; transform: translateY(0); }

    /* ========== SECTION HEADERS ========== */
    .section-header {
      text-align: center; margin-bottom: 3rem;
    }
    .section-tag {
      display: inline-block; font-size: 0.75rem; font-weight: 600;
      letter-spacing: 0.15em; text-transform: uppercase;
      color: var(--accent); margin-bottom: 0.75rem;
      padding: 0.3rem 1rem; border: 1px solid var(--accent); border-radius: 20px;
    }
    .section-title {
      font-family: 'Cormorant Garamond', serif;
      font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700;
      color: var(--fg); line-height: 1.2;
    }
    .section-desc {
      color: var(--muted); font-size: 1rem; margin-top: 0.75rem;
      max-width: 560px; margin-left: auto; margin-right: auto;
    }

    /* ========== CARD ========== */
    .mask-card {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 16px; overflow: hidden; cursor: pointer;
      transition: all 0.35s; box-shadow: 0 2px 8px var(--shadow);
    }
    .mask-card:hover {
      transform: translateY(-6px);
      box-shadow: 0 12px 30px var(--shadow-lg);
      border-color: var(--accent-dark);
    }
    .mask-card:hover .mask-card-img img { transform: scale(1.08); }
    .mask-card-img {
      height: 220px; overflow: hidden; position: relative;
    }
    .mask-card-img img {
      width: 100%; height: 100%; object-fit: cover;
      transition: transform 0.5s;
    }
    .mask-card-cat {
      position: absolute; top: 12px; left: 12px;
      background: var(--primary); color: #F5F1E6;
      font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em;
      padding: 0.2rem 0.6rem; border-radius: 6px;
    }
    .mask-card-body { padding: 1.25rem; }
    .mask-card-name {
      font-family: 'Cormorant Garamond', serif;
      font-size: 1.3rem; font-weight: 700; color: var(--fg);
    }
    .mask-card-desc {
      color: var(--muted); font-size: 0.85rem; margin-top: 0.5rem;
      line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2;
      -webkit-box-orient: vertical; overflow: hidden;
    }

    /* ========== CAMERA PAGE ========== */
    .camera-container {
      position: relative; width: 100%; max-width: 640px;
      aspect-ratio: 4/3; border-radius: 16px; overflow: hidden;
      background: #000; margin: 0 auto;
    }
    .camera-container video {
      width: 100%; height: 100%; object-fit: cover;
    }
    .camera-frame-border {
      position: absolute; inset: 0; pointer-events: none;
    }
    .frame-corner {
      position: absolute; width: 40px; height: 40px;
      border-color: var(--accent); border-style: solid; border-width: 0;
    }
    .frame-corner.tl { top:16px; left:16px; border-top-width:3px; border-left-width:3px; border-radius:4px 0 0 0; }
    .frame-corner.tr { top:16px; right:16px; border-top-width:3px; border-right-width:3px; border-radius:0 4px 0 0; }
    .frame-corner.bl { bottom:16px; left:16px; border-bottom-width:3px; border-left-width:3px; border-radius:0 0 0 4px; }
    .frame-corner.br { bottom:16px; right:16px; border-bottom-width:3px; border-right-width:3px; border-radius:0 0 4px 0; }
    .camera-crosshair {
      position: absolute; top:50%; left:50%; transform:translate(-50%,-50%);
      width: 60px; height: 60px; opacity: 0.3;
    }
    .camera-crosshair::before, .camera-crosshair::after {
      content:''; position:absolute; background:var(--accent);
    }
    .camera-crosshair::before { width:1px; height:100%; left:50%; }
    .camera-crosshair::after { height:1px; width:100%; top:50%; }

    /* ========== UPLOAD ========== */
    .dropzone {
      border: 2px dashed var(--border); border-radius: 16px;
      padding: 3rem 2rem; text-align: center; cursor: pointer;
      transition: all 0.3s; background: var(--bg-card);
    }
    .dropzone:hover, .dropzone.dragover {
      border-color: var(--accent); background: rgba(212,175,55,0.05);
    }
    .dropzone.dragover { transform: scale(1.01); }
    .dropzone-icon {
      width: 64px; height: 64px; margin: 0 auto 1rem;
      color: var(--muted); transition: color 0.3s;
    }
    .dropzone:hover .dropzone-icon { color: var(--accent); }

    /* ========== RESULT CARD ========== */
    .result-card {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 16px; padding: 2rem; margin-top: 1.5rem;
      box-shadow: 0 4px 15px var(--shadow);
      animation: slide-up 0.5s ease-out;
    }
    @keyframes slide-up {
      from { opacity:0; transform:translateY(20px); }
      to { opacity:1; transform:translateY(0); }
    }
    .confidence-bar {
      height: 8px; border-radius: 4px; background: var(--border); overflow: hidden;
    }
    .confidence-fill {
      height: 100%; border-radius: 4px; transition: width 1s ease-out;
      background: linear-gradient(90deg, var(--primary), var(--accent));
    }

    /* ========== DETAIL PAGE ========== */
    .detail-img-wrap {
      border-radius: 16px; overflow: hidden; position: relative;
    }
    .detail-img-wrap img { width:100%; height:100%; object-fit:cover; }
    .detail-label {
      font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem;
    }
    .detail-name {
      font-family: 'Cormorant Garamond', serif;
      font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; line-height: 1.15;
    }
    .detail-section-title {
      font-family: 'Cormorant Garamond', serif;
      font-size: 1.3rem; font-weight: 700; color: var(--fg);
      margin-bottom: 0.5rem;
    }
    .detail-text { color: var(--fg-sec); line-height: 1.75; font-size: 0.95rem; }

    /* ========== ABOUT ========== */
    .tech-badge {
      display: inline-flex; align-items: center; gap: 0.5rem;
      padding: 0.6rem 1.2rem; background: var(--bg-card);
      border: 1px solid var(--border); border-radius: 10px;
      font-size: 0.9rem; font-weight: 500; color: var(--fg);
      transition: all 0.3s;
    }
    .tech-badge:hover { border-color: var(--accent); transform: translateY(-2px); }
    .team-card {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 16px; padding: 1.5rem; text-align: center;
      transition: all 0.3s;
    }
    .team-card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px var(--shadow); }
    .team-avatar {
      width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 1rem;
      object-fit: cover; border: 3px solid var(--accent);
    }

    /* ========== LOADING ========== */
    .loading-overlay {
      position: fixed; inset: 0; z-index: 200;
      background: rgba(20,18,16,0.85); backdrop-filter: blur(8px);
      display: none; align-items: center; justify-content: center;
      flex-direction: column; gap: 1.5rem;
    }
    .loading-overlay.show { display: flex; }
    .loading-diamond {
      width: 50px; height: 50px; background: var(--accent);
      transform: rotate(45deg); animation: diamond-spin 1.5s ease-in-out infinite;
      box-shadow: 0 0 30px rgba(212,175,55,0.4);
    }
    @keyframes diamond-spin {
      0% { transform: rotate(45deg) scale(1); }
      50% { transform: rotate(225deg) scale(0.7); }
      100% { transform: rotate(405deg) scale(1); }
    }
    .loading-text { color: var(--accent); font-weight: 500; letter-spacing: 0.1em; font-size: 0.9rem; }

    /* ========== TOAST ========== */
    .toast-container {
      position: fixed; top: 90px; right: 1rem; z-index: 150;
      display: flex; flex-direction: column; gap: 0.75rem;
    }
    .toast {
      display: flex; align-items: center; gap: 0.75rem;
      padding: 0.85rem 1.25rem; border-radius: 10px;
      background: var(--bg-card); border: 1px solid var(--border);
      box-shadow: 0 8px 25px var(--shadow-lg);
      font-size: 0.9rem; color: var(--fg);
      animation: toast-in 0.4s ease-out;
      max-width: 360px;
    }
    .toast.error { border-left: 4px solid #E53E3E; }
    .toast.success { border-left: 4px solid #38A169; }
    .toast.info { border-left: 4px solid var(--accent); }
    @keyframes toast-in {
      from { opacity:0; transform:translateX(40px); }
      to { opacity:1; transform:translateX(0); }
    }
    .toast-exit { animation: toast-out 0.3s ease-in forwards; }
    @keyframes toast-out {
      to { opacity:0; transform:translateX(40px); }
    }

    /* ========== MOBILE DRAWER ========== */
    .mobile-drawer {
      position: fixed; top: 0; right: -100%; width: 280px; height: 100vh;
      background: var(--bg-card); z-index: 120; border-left: 1px solid var(--border);
      transition: right 0.35s; padding: 5rem 2rem 2rem;
      box-shadow: -10px 0 30px var(--shadow-lg);
    }
    .mobile-drawer.open { right: 0; }
    .drawer-overlay {
      position: fixed; inset: 0; z-index: 115; background: rgba(0,0,0,0.4);
      opacity: 0; pointer-events: none; transition: opacity 0.3s;
    }
    .drawer-overlay.open { opacity: 1; pointer-events: auto; }
    .drawer-link {
      display: block; padding: 0.85rem 0; color: var(--fg);
      font-weight: 500; font-size: 1.05rem; border-bottom: 1px solid var(--border);
      cursor: pointer; transition: color 0.3s;
    }
    .drawer-link:hover { color: var(--accent); }

    /* ========== FOOTER ========== */
    .footer-main {
      background: var(--depth); color: rgba(245,241,230,0.6);
      padding: 3rem 1.5rem 1.5rem; margin-top: 4rem;
    }
    .footer-main a { color: var(--accent); text-decoration: none; transition: color 0.3s; }
    .footer-main a:hover { color: var(--accent-light); }

    /* ========== DIVIDER ORNAMENT ========== */
    .orn-divider {
      display: flex; align-items: center; justify-content: center;
      gap: 1rem; margin: 3rem 0; color: var(--accent); opacity: 0.4;
    }
    .orn-divider::before, .orn-divider::after {
      content: ''; flex: 1; max-width: 120px; height: 1px;
      background: linear-gradient(90deg, transparent, var(--accent), transparent);
    }

    /* ========== DARK MODE TOGGLE ========== */
    .theme-toggle {
      width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border);
      background: var(--bg-card); color: var(--fg); cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: all 0.3s; font-size: 1.1rem;
    }
    .theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

    /* ========== RESPONSIVE ========== */
    @media (max-width: 768px) {
      .camera-container { aspect-ratio: 3/4; border-radius: 12px; }
      .frame-corner { width: 28px; height: 28px; }
      .frame-corner.tl, .frame-corner.tr { top:10px; }
      .frame-corner.tl, .frame-corner.bl { left:10px; }
      .frame-corner.tr, .frame-corner.br { right:10px; }
      .frame-corner.bl, .frame-corner.br { bottom:10px; }
      .result-card { padding: 1.25rem; }
      .mask-card-img { height: 180px; }
    }

    /* ========== REDUCED MOTION ========== */
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
      }
    }

    /* ========== MISC ========== */
    .img-placeholder {
      background: linear-gradient(135deg, var(--border) 0%, var(--bg) 100%);
      display: flex; align-items: center; justify-content: center;
      color: var(--muted); font-size: 2.5rem;
    }
    .back-btn {
      display: inline-flex; align-items: center; gap: 0.4rem;
      color: var(--accent); font-weight: 500; font-size: 0.9rem;
      cursor: pointer; transition: all 0.3s; border: none; background: none;
      padding: 0.4rem 0;
    }
    .back-btn:hover { color: var(--accent-dark); gap: 0.6rem; }