/* =========================================
   OPAQE CORE DESIGN SYSTEM (CSS)
   ========================================= */

/* 1. ROOT & THEMES (Day/Night) */
:root {
    /* DEFAULT (LIGHT MODE / GALLERY) */
    --bg-color: #fbf9f4;
    --surface-color: #ffffff;
    --text-primary: #1a1817;
    --text-muted: #8a8580;
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.16);
    --accent: #b8543a;
    
    /* EASING CURVES */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-quint: cubic-bezier(0.76, 0, 0.24, 1);
    --ease-momentum: cubic-bezier(0.33, 1, 0.68, 1);

    /* TYPOGRAPHY */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* SYSTEM DARK MODE (Fallback) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #131214;
        --surface-color: #1c1a1e;
        --text-primary: #ece8e2;
        --text-muted: #a8a39c;
        --border-subtle: rgba(255, 255, 255, 0.07);
        --border-strong: rgba(255, 255, 255, 0.16);
        --accent: #d97a5e;
    }
}

/* MANUAL OVERRIDE (LIGHT) */
[data-theme="light"] {
    --bg-color: #fbf9f4;
    --surface-color: #ffffff;
    --text-primary: #1a1817;
    --text-muted: #8a8580;
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.16);
    --accent: #b8543a;
}

/* MANUAL OVERRIDE (DARK) */
[data-theme="dark"] {
    --bg-color: #131214;
    --surface-color: #1c1a1e;
    --text-primary: #ece8e2;
    --text-muted: #a8a39c;
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.16);
    --accent: #d97a5e;
}

/* 2. BASE RESETS & EFFECTS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px; /* Global base font size */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color 0.8s var(--ease-out-expo), color 0.8s var(--ease-out-expo);
    overflow-x: hidden;
}

/* Authentic Film Grain Overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    opacity: 0.03;
    mix-blend-mode: overlay;
}

/* 3. GLOBAL UI COMPONENTS */

/* INTRO REVEAL */
.intro-reveal {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 1s var(--ease-out-expo), visibility 1s var(--ease-out-expo);
}
.intro-reveal.hidden {
    opacity: 0;
    visibility: hidden;
}
.intro-logo {
    font-family: var(--font-display);
    font-size: 2.5rem;
    text-transform: uppercase;
    color: var(--text-primary);
    opacity: 0;
    animation: introFade 1.4s var(--ease-out-expo) forwards;
}
@keyframes introFade {
    0% { opacity: 0; letter-spacing: 0.1em; transform: translateY(5px); }
    100% { opacity: 1; letter-spacing: 0.25em; transform: translateY(0); }
}

/* Theme Toggle Button & Nav Icon Buttons */
.theme-toggle, .nav-icon-btn {
    background: none;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: transform 0.4s var(--ease-out-expo), border-color 0.4s var(--ease-out-expo);
}
.theme-toggle:hover, .nav-icon-btn:hover {
    transform: scale(1.05);
    border-color: var(--text-primary);
}
.theme-toggle svg, .nav-icon-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.6s var(--ease-in-out-quint);
}

/* Geneva Clock */
.geneva-clock {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Common Primary Button */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    padding: 1.2rem 3rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: background 0.4s var(--ease-out-expo), color 0.4s var(--ease-out-expo), border-color 0.4s var(--ease-out-expo);
}
.btn-primary:hover {
    background: var(--text-primary);
    color: var(--bg-color);
    border-color: var(--text-primary);
}

/* Hidden Class */
.hidden {
    display: none !important;
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }