@font-face {
    font-family: "AksaraSerif";
    src: url("../serif.ttf") format("truetype");
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: "AksaraScript";
    src: url("../script.ttf") format("truetype");
    font-weight: normal;
    font-display: swap;
}

/* =========================================================
   DARK DEFAULT THEME (LUXURY CINEMATIC)
========================================================= */

/* Menggunakan data-theme agar sinkron dengan sistem switch PHP di index.php */
:root, :root[data-theme="dark"] {
    /* Latar belakang diubah ke Deep Charcoal/Navy */
    --color-bg: #070A0D; 
    
    /* Surface sedikit lebih terang dari BG untuk dimensi */
    --color-surface: #0D1117; 
    --color-surface-hover: #151B23;
    
    --color-primary: #E5E7EB; /* Soft White */
    
    /* DIKUNCI: Tetap statis di mode gelap */
    --color-nav: #E5E7EB;
    --color-bg-nav: #070A0D; 
    
    /* Matte Gold yang lebih kalem dan elegan */
    --color-secondary: #C6A56B; 
    --color-primary-hover: #FFFFFF;
    --color-text-main: #F3F4F6;
    
    /* Teks redup lebih disamarkan */
    --color-text-muted: rgba(243, 244, 246, 0.55);
    
    /* Border sangat tipis dan halus */
    --color-border: rgba(255, 255, 255, 0.08);
    --color-overlay: rgba(7, 10, 13, 0.85);
}

/* =========================================================
   LIGHT MODE OVERRIDE (EDITORIAL GALLERY)
========================================================= */

/* Support untuk html.light (Tailwind class default) atau atribut data-theme */
html:not(.dark), :root[data-theme="light"] {
    /* Putih dengan sentuhan abu-abu sangat muda */
    --color-bg: #F9FAFB; 
    --color-surface: #FFFFFF; 
    --color-surface-hover: #F3F4F6;
    --color-primary: #070A0D;
    
    /* Matte Gold yang sedikit lebih gelap agar kontras di latar putih */
    --color-secondary: #B8935A; 
    --color-primary-hover: #1F2937;
    --color-text-main: #070A0D;
    --color-text-muted: rgba(7, 10, 13, 0.6);
    --color-border: rgba(7, 10, 13, 0.08);
    --color-overlay: rgba(249, 250, 251, 0.85);
    
    /* DIKUNCI: Sesuai request, jangan diubah warnanya (sama dengan dark) */
    --color-nav: #E5E7EB;
    --color-bg-nav: #070A0D; 
}

.font-aksara-serif { font-family: "AksaraSerif", "Playfair Display", serif; }
.font-aksara-script { font-family: "AksaraScript", "Great Vibes", cursive; }

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Preloader Modern */
.loader-circle {
    width: 50px; height: 50px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Toast Notifications */
.toast-msg {
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.toast-msg.fade-out {
    animation: fadeOutRight 0.4s ease forwards;
}
@keyframes slideInRight {
    0% { transform: translateX(-100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOutRight {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(-100%); opacity: 0; }
}

/* Hero Vector Variable Font Animation */
@keyframes variable-weight {
    0%, 100% { 
        font-weight: 100; 
        font-style: normal;
        letter-spacing: 0.02em; 
        opacity: 0.6; 
        transform: scale(0.98); 
    }
    50% { 
        font-weight: 700; 
        font-style: italic; 
        letter-spacing: 0.08em; 
        opacity: 1; 
        transform: scale(1.15); 
    }
}

.watermark-text {
    color: var(--color-text-main);
    opacity: 0.05;
    line-height: 0.8;
    user-select: none;
}

.letter-anim {
    display: inline-block;
    animation: variable-weight 12s ease-in-out infinite;
    transform-origin: bottom center;
}

/* Aesthetic Guides */
@keyframes scanline-rtl {
    0% { background-position: 200% 0; box-shadow: none; transform: scaleY(1); }
    50% { transform: scaleY(1.5) translateY(-1px); box-shadow: 0px 0px 15px 1px var(--color-secondary); opacity: 1; }
    100% { background-position: -100% 0; box-shadow: none; transform: scaleY(1); }
}

.aesthetic-guide {
    position: absolute;
    width: 100%; height: 1px;
    background: linear-gradient(270deg, var(--color-border) 0%, var(--color-secondary) 50%, var(--color-border) 100%);
    background-size: 200% 100%;
    z-index: 0; opacity: 0.4;
    animation: scanline-rtl 6s infinite ease-in-out;
}
.guide-1 { animation-delay: 0s; }
.guide-2 { animation-delay: 1.5s; }
.guide-3 { animation-delay: 3.0s; }
.guide-4 { animation-delay: 4.5s; }

.aesthetic-label {
    position: absolute; right: 20px; transform: translateY(-120%);
    font-size: 0.55rem; letter-spacing: 0.3em;
    color: var(--color-text-muted); text-transform: uppercase; font-weight: 600;
}

.typing-cursor {
    border-right: 2px solid var(--color-secondary); padding-right: 4px;
    animation: blink-caret 0.8s step-end infinite;
}
@keyframes blink-caret { from, to { border-color: transparent } 50% { border-color: var(--color-secondary); } }

/* Highlight selection text */
::selection { background-color: var(--color-secondary); color: var(--color-bg); }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.reveal {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* Peeking Slider & Bullets Modernization */
.peeking-slider {
    display: flex; gap: 1.5rem; overflow-x: auto; scroll-snap-type: x mandatory;
    scroll-behavior: smooth; padding: 1rem 10vw;
}
.peeking-slider::-webkit-scrollbar { display: none; }
.peeking-slide { flex: 0 0 85%; scroll-snap-align: center; position: relative; }
@media (min-width: 768px) { .peeking-slide { flex: 0 0 45%; } }

.slider-bullets { display: flex; justify-content: center; gap: 8px; }
.bullet { width: 8px; height: 8px; border-radius: 50%; background: var(--color-border); transition: all 0.3s; cursor: pointer; }
.bullet.active { background: var(--color-primary); width: 24px; border-radius: 4px; }

/* Font Tester UI Improvement */
.tester-input {
    background: transparent; border: none; border-bottom: 1px solid var(--color-border);
    color: var(--color-text-main); outline: none; width: 100%; font-family: inherit; transition: border-color 0.3s;
}
.tester-input:focus { border-bottom-color: var(--color-primary); }
.tester-input::placeholder { color: var(--color-text-muted); }

input[type=range] {
    -webkit-appearance: none; background: var(--color-border);
    height: 2px; border-radius: 2px; outline: none;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 14px; height: 14px;
    border-radius: 50%; background: var(--color-primary); cursor: pointer;
}

.font-tester-card { transition: all 0.4s ease; display: flex; flex-direction: column; }
.font-tester-card:hover { border-color: var(--color-primary); }
.tester-preview {
    transition: all 0.3s ease; position: relative;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; padding: 1.5rem; flex: 1;
}
.preview-text-content { transition: opacity 0.3s ease; white-space: nowrap; color: var(--color-text-main); }
.typing-loader {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 24px; height: 24px; border: 2px solid var(--color-border);
    border-top-color: var(--color-secondary); border-radius: 50%; animation: spin 1s linear infinite;
}
.sold-overlay {
    position: absolute; inset: 0; background: var(--color-overlay); backdrop-filter: blur(4px);
    display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 50;
}
/* Type Tester Backgrounds & Text Base Utilities */
.tester-bg-dark { background-color: transparent !important; }
.tester-bg-light { background-color: var(--color-surface-hover) !important; }

/* --- Apple-Style Word Slide Animation --- */
.word-slide-out {
    animation: slideOutUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.word-slide-in {
    animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideOutUp {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-100%); opacity: 0; }
}
@keyframes slideInUp {
    0% { transform: translateY(100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Base Animation for simple reveals */
.animate-fade-in-up {
    animation: slideInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.header-line { display:inline-block; width:36px; height:1px; background: var(--color-secondary); vertical-align:middle; margin:0 10px; }

/* =========================================================
   LOGO SYSTEM
========================================================= */

#main-logo,
#footer-logo {
    will-change: opacity;
    image-rendering: auto;
    backface-visibility: hidden;
}

/* =========================================================
   MOBILE NAVIGATION
========================================================= */

#mobile-nav-fab {
    transition: opacity .35s ease, transform .35s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

#mobile-bottom-nav {
    will-change: transform, opacity;
    transition: opacity .45s ease, transform .45s ease;
}

#mobile-bottom-nav > div {
    /* Menerapkan variabel bg navbar khusus yang tidak terpengaruh tema */
    background: rgba(7, 10, 13, 0.97) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.06);
}

/* CENTER BUTTON */
#mobile-center-menu {
    box-shadow: 0 10px 30px rgba(255,255,255,0.05);
    transition: transform .25s ease, box-shadow .25s ease;
}
#mobile-center-menu:hover {
    transform: translateX(-50%) translateY(-50%) scale(1.05);
}

/* ICONS */
#mobile-bottom-nav i {
    transition: color .25s ease, transform .25s ease;
}
#mobile-bottom-nav button:hover i,
#mobile-bottom-nav a:hover i {
    transform: translateY(-1px);
}

/* BADGES */
#cart-badge-mobile,
#wishlist-badge-mobile {
    box-shadow: 0 0 10px rgba(198, 165, 107, 0.25);
}

/* =========================================================
   MOBILE FULL MENU
========================================================= */

#mobile-full-menu {
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}
#mobile-full-menu a {
    transition: transform .35s ease, opacity .35s ease;
}
#mobile-full-menu a:hover {
    transform: scale(1.05);
    opacity: .7;
}

/* =========================================================
   MOBILE HEADER
========================================================= */

@media(max-width:768px){
    #main-header {
        transition: background .35s ease, border-color .35s ease, transform .35s ease;
    }
    /* HERO MODE */
    body:not(.scrolled-hero) #main-header {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    /* REMOVE FIXED HEADER MOBILE */
    body.scrolled-hero #main-header {
        position: relative !important;
        top: 0 !important;
    }
    /* SAFE AREA */
    #mobile-bottom-nav {
        bottom: calc( env(safe-area-inset-bottom, 0px) + 14px );
    }
    #mobile-nav-fab {
        bottom: calc( env(safe-area-inset-bottom, 0px) + 14px );
    }
    /* BETTER SPACING */
    footer { padding-bottom: 120px !important; }
}

/* =========================================================
   PREMIUM SCROLLBAR
========================================================= */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-secondary); }

/* =========================================================
   FINAL MOBILE UX FIX
========================================================= */

@media(max-width:768px){
    #main-header {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100%;
        z-index: 9900;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
    }
    #main-header nav {
        padding-top: 18px;
        padding-bottom: 18px;
    }
    #main-logo {
        width: 118px !important;
        max-width: 118px !important;
        object-fit: contain;
    }
    #mobile-nav-fab {
        position: fixed;
        left: 18px;
        width: 52px;
        height: 52px;
        border-radius: 999px;
        /* Memastikan warna bg tidak berubah terang (konsisten dengan navbar fixed) */
        background: rgba(7, 10, 13, 0.97) !important;
        border: 1px solid rgba(255,255,255,0.06);
        box-shadow: 0 10px 35px rgba(0,0,0,0.35);
        z-index: 9999;
    }
    #mobile-nav-fab:active { transform: scale(0.92); }
    #mobile-bottom-nav {
        width: calc(100% - 34px);
        max-width: 430px;
        z-index: 9998;
    }
    #mobile-bottom-nav > div {
        min-height: 68px;
        border-radius: 28px;
        /* Sama dengan atas */
        background: rgba(7, 10, 13, 0.985) !important;
        border: 1px solid rgba(255,255,255,0.06);
        box-shadow: 0 10px 40px rgba(0,0,0,0.38);
    }
    #mobile-bottom-nav button,
    #mobile-bottom-nav a {
        transition: transform .14s ease, opacity .2s ease, color .2s ease;
    }
    #mobile-bottom-nav button:active,
    #mobile-bottom-nav a:active { transform: scale(0.88); }
    #mobile-bottom-nav button:hover,
    #mobile-bottom-nav a:hover { opacity: .75; }
    #mobile-center-menu {
        width: 60px;
        height: 60px;
        z-index: 30 !important;
        pointer-events: auto !important;
        cursor: pointer;
        /* Menggunakan warna nav khusus (selalu putih/terang) */
        background: var(--color-nav) !important;
        /* Ikon bagian dalam selalu hitam/gelap */
        color: var(--color-bg-nav) !important;
        border: 5px solid var(--color-bg-nav);
        box-shadow: 0 12px 35px rgba(255,255,255,0.08);
    }
    #mobile-center-menu i {
        color: var(--color-bg-nav) !important;
        opacity: 1 !important;
    }
    #mobile-center-menu:active {
        transform: translateX(-50%) translateY(-50%) scale(0.93);
    }
    #cart-badge-mobile,
    #wishlist-badge-mobile {
        display: flex; align-items: center; justify-content: center;
        min-width: 16px; height: 16px; padding: 0 4px;
        font-size: 8px; font-weight: 700; border-radius: 999px;
        background: var(--color-secondary); color: var(--color-bg);
        box-shadow: 0 0 12px rgba(198,165,107,0.32);
    }
    #mobile-full-menu {
        /* Warna background konsisten gelap */
        background: rgba(7, 10, 13, 0.985);
        backdrop-filter: blur(34px);
        -webkit-backdrop-filter: blur(34px);
    }
    #mobile-full-menu a {
        letter-spacing: 0.02em;
        transition: transform .25s ease, opacity .25s ease;
    }
    #mobile-full-menu a:active { transform: scale(0.96); }
}

/* =========================================================
   LUXURY CINEMATIC UTILITIES (Fase 1 Tambahan)
========================================================= */

/* Efek tekstur film analog/kertas untuk depth */
.luxury-grain-overlay {
    position: absolute;
    inset: 0;
    /* Menggunakan SVG data URI untuk noise yang sangat ringan */
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noise)" opacity="0.03"/%3E%3C/svg%3E');
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: overlay;
}

/* Efek cahaya glow dramatis di background */
.radial-glow {
    position: absolute;
    width: 100vw;
    height: 100vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at center, rgba(198, 165, 107, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}