/* ==========================================================================
   TYPE SURFACES & @FONT-FACE (Geist Variable & Geist Mono)
   ========================================================================== */
@font-face {
    font-family: 'Geist';
    src: url('/assets/fonts/Geist-Variable.woff2') format('woff2-variations'),
         url('/assets/fonts/Geist-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Geist Mono';
    src: url('/assets/fonts/GeistMono-Variable.woff2') format('woff2-variations'),
         url('/assets/fonts/GeistMono-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    /* ======================================================================
       COLOR & SURFACE TOKENS (Pure White Modern UI Theme)
       ====================================================================== */
    --bg-base: #ffffff;
    --bg-surface: #ffffff;
    --bg-surface-subtle: #f8fafc;
    --bg-surface-elevated: #09090b;
    --border-subtle: #e2e8f0;
    --border-active: #cbd5e1;
    --text-primary: #09090b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent-primary: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: rgba(37, 99, 235, 0.08);

    /* ======================================================================
       TYPOGRAPHY DESIGN TOKENS (Geist Variable Architecture)
       ====================================================================== */
    --font-primary: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Discrete Variable Weights (Geist Variable 100..900) */
    --weight-thin: 100;
    --weight-extralight: 200;
    --weight-light: 300;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;
    --weight-black: 900;

    /* Semantic Weight Adaptors (Configurable on the fly) */
    --weight-heading: var(--weight-semibold);
    --weight-body: var(--weight-regular);
    --weight-nav: var(--weight-medium);
    --weight-brand: var(--weight-semibold);
    --weight-btn: var(--weight-medium);
    --weight-caption: var(--weight-light);

    /* Fluid Typographic Scale */
    --text-2xs: 0.6875rem; /* 11px */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-md: 1.125rem;   /* 18px */
    --text-lg: 1.25rem;    /* 20px */
    --text-xl: 1.5rem;     /* 24px */
    --text-2xl: 1.875rem;  /* 30px */
    --text-3xl: 2.25rem;   /* 36px */
    --text-4xl: 3rem;      /* 48px */
    --text-5xl: 3.75rem;   /* 60px */

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.2;
    --leading-snug: 1.35;
    --leading-normal: 1.6;
    --leading-relaxed: 1.75;

    /* Letter Spacing (Tracking) */
    --tracking-tightest: -0.04em;
    --tracking-tighter: -0.025em;
    --tracking-tight: -0.015em;
    --tracking-normal: 0;
    --tracking-wide: 0.04em;
    --tracking-widest: 0.08em;

    /* Layout & Motion */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition-fast: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    color-scheme: light;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--weight-body);
    line-height: var(--leading-normal);
    letter-spacing: var(--tracking-normal);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Base Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: var(--weight-heading);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--text-primary);
}

/* Material Symbols standard ligature rendering */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   PRELOADER CC (Full White Screen, Center Trio CC & Dynamic 99% Counter)
   ========================================================================== */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(28px, 6vw, 64px);
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 750ms cubic-bezier(0.65, 0, 0.35, 1),
                transform 750ms cubic-bezier(0.65, 0, 0.35, 1),
                visibility 750ms cubic-bezier(0.65, 0, 0.35, 1);
    pointer-events: all;
    user-select: none;
}

.preloader.is-dismissed {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
    pointer-events: none;
}

/* Center CC: 3 children spread with space between */
.preloader-center {
    width: 100%;
}

.preloader-trio {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    color: var(--text-primary);
    letter-spacing: var(--tracking-normal);
}

.preloader-trio-item {
    display: inline-block;
    white-space: nowrap;
}

/* Bottom-Right Counter */
.preloader-counter {
    position: absolute;
    bottom: clamp(28px, 6vw, 64px);
    right: clamp(28px, 6vw, 64px);
    display: inline-flex;
    align-items: baseline;
    font-family: var(--font-primary);
    font-size: 160px;
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-tightest);
    color: var(--text-primary);
    line-height: 0.85;
    font-variant-numeric: tabular-nums;
}

.preloader-unit {
    font-size: 60px;
    font-weight: var(--weight-thin);
    color: var(--text-muted);
    padding-left: 8px;
    line-height: 0.85;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 24px;
}

/* ==========================================================================
   HEADER CONTAINER & COMPONENT (Single CC: Header)
   ========================================================================== */

/* Header Container */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding-block: 18px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Brand Component */
.brand-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-name {
    font-family: var(--font-primary);
    font-size: var(--text-lg);
    font-weight: var(--weight-brand);
    line-height: var(--leading-none);
    letter-spacing: var(--tracking-tighter);
}

/* Navigation Component */
.site-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: var(--text-sm);
    font-weight: var(--weight-nav);
    line-height: var(--leading-none);
    letter-spacing: var(--tracking-normal);
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link--cta {
    color: #ffffff;
    background-color: var(--bg-surface-elevated);
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-surface-elevated);
    font-weight: var(--weight-btn);
    transition: all var(--transition-fast);
}

.nav-link--cta:hover {
    background-color: #27272a;
    border-color: #27272a;
    color: #ffffff;
}

.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px;
}

/* Main Content Area */
.site-main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* Responsive Header */
@media (max-width: 768px) {
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-surface);
        border-bottom: 1px solid var(--border-subtle);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
        padding: 24px;
    }

    .site-nav.is-open {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .mobile-nav-toggle {
        display: block;
    }

    /* Mobile Preloader (Half size: 80px / 32px, weight remains medium) */
    .preloader {
        padding: 24px;
    }

    .preloader-trio {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: var(--text-sm);
    }

    .preloader-counter {
        bottom: 24px;
        right: 24px;
        font-size: 80px;
    }

    .preloader-unit {
        font-size: 30px;
        font-weight: var(--weight-thin);
        padding-left: 4px;
    }
}

/* ==========================================================================
   PROTOCOL 28: CC LAYOUT & WIREFRAME INSPECTOR (Shift + X)
   Zero layout shift via outlines & tinted bounding surfaces
   ========================================================================== */
body.is-wireframe-active {
    position: relative;
}

/* Containers & Wrappers (Cyan/Blue boundary) */
body.is-wireframe-active header,
body.is-wireframe-active main,
body.is-wireframe-active section,
body.is-wireframe-active footer,
body.is-wireframe-active .container,
body.is-wireframe-active [class*="container"] {
    outline: 1px dashed rgba(37, 99, 235, 0.75);
    outline-offset: -1px;
    background-color: rgba(37, 99, 235, 0.04);
}

/* Structural Components (Emerald boundary) */
body.is-wireframe-active nav,
body.is-wireframe-active .header-inner,
body.is-wireframe-active [class*="inner"],
body.is-wireframe-active [class*="content"] {
    outline: 1px solid rgba(16, 185, 129, 0.7);
    outline-offset: -1px;
    background-color: rgba(16, 185, 129, 0.03);
}

/* Navigation lists & groups (Amber boundary) */
body.is-wireframe-active ul,
body.is-wireframe-active ol {
    outline: 1px dotted rgba(217, 119, 6, 0.7);
    outline-offset: -1px;
}

/* Interactive elements & leaf nodes (Rose boundary) */
body.is-wireframe-active a,
body.is-wireframe-active button,
body.is-wireframe-active input,
body.is-wireframe-active .brand-logo {
    outline: 1px solid rgba(225, 29, 72, 0.65);
    outline-offset: -1px;
}

/* Floating HUD Badge */
.wireframe-hud {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    padding: 8px 14px;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-normal);
    color: #38bdf8;
    background-color: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    backdrop-filter: blur(8px);
}
