:root {
    /* ── ACIER / GLACE PALETTE (steel + ice, cold neutrals + one blue accent) ── */
    --bg:              #0A0D12;
    --surface:         #10151F;
    --card:            rgba(16, 21, 31, 0.62);

    /* Steel neutrals + single ice-blue accent */
    --steel-900:      #0A0D12;
    --steel-800:      #10151F;
    --steel-700:      #1A2130;
    --steel-500:      #4A5568;
    --steel-300:      #8894A8;
    --steel-100:      #C8D0DE;
    --ice-blue:       #5B9DFF;
    --ice-blue-soft:  #8DBAFF;
    --ice-pale:       #E6EAF2;

    /* Aliases kept so the existing `var(--space-*)` and `var(--violet*)` calls in
       components.css resolve without a full rename. They now all point at the
       steel/ice values. */
    --space-purple:       var(--ice-blue);
    --space-purple-light: var(--ice-blue-soft);
    --space-purple-pale:  var(--ice-pale);
    --space-magenta:      var(--steel-100);
    --space-border:       var(--ice-blue);
    --violet:         var(--ice-blue);
    --violet-light:   var(--ice-blue-soft);
    --violet-pale:    var(--ice-pale);
    --accent:         var(--steel-100);

    --text-main:  var(--ice-pale);
    --text-muted: var(--steel-300);

    /* Signal colors (muted to fit the cold palette) */
    --success:     #8FE0B8;
    --warning:     #F5D58A;
    --info:        var(--ice-blue-soft);
    --danger:      #F08A8A;

    --border: rgba(200, 208, 222, 0.12);
    --glow:   rgba(91, 157, 255, 0.35);

    --primary:      var(--ice-blue);
    --primary-glow: var(--glow);
    --secondary:    var(--steel-100);

    /* Fonts & Typography Variables */
    --font-heading: 'Fraunces', 'Syne', serif;
    --font-main:    'Geist Mono', 'DM Mono', monospace;
    --font-mono:    'Geist Mono', 'DM Mono', monospace;
    --font-pixel:   'VT323', 'Geist Mono', monospace;

    /* Text Sizes & Weights */
    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-lg:   1.125rem;
    --text-xl:   1.25rem;
    --text-2xl:  1.5rem;
    --text-3xl:  2rem;
    --text-title: clamp(3.5rem, 8vw, 7rem);
    
    --weight-light: 300;
    --weight-normal: 400;
    --weight-medium: 500;
    --weight-bold: 700;
    --weight-black: 800;

    /* Layout & Margin Space Variables */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-7: 2rem;
    --space-8: 3rem;
    --space-content: 5rem;

    /* Radius scale */
    --radius-sm:   8px;
    --radius-md:   12px;
    --radius-lg:   16px;
    --radius-xl:   20px;
    --radius-pill: 999px;

    /* Motion & Interactions */
    --ease-smooth:      cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-bounce:      cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-sharp:       cubic-bezier(0.4, 0, 0.6, 1);
    
    --duration-fast:    0.2s;
    --duration-base:    0.3s;
    --duration-slow:    0.6s;
    --duration-tour:    1.2s;
    
    --transition-fast:  var(--duration-fast) var(--ease-smooth);
    --transition-base:  var(--duration-base) var(--ease-smooth);

    /* Motion */
    /* Handled above */

    /* Elevation & Glass system */
    --shadow-xs:   0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md:   0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg:   0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(200, 208, 222, 0.05);
    --glow-hover:  0 0 24px rgba(91, 157, 255, 0.35), 0 0 60px rgba(91, 157, 255, 0.12);
    --glass-bg:    rgba(10, 13, 18, 0.55);
    --glass-border: rgba(200, 208, 222, 0.18);
    --glass-blur:  blur(10px);

    /* Welcome-box — a frosted rim instead of a purple halo */
    --welcome-bg:     rgba(10, 13, 18, 0.55);
    --welcome-border: rgba(200, 208, 222, 0.25);
    --welcome-shadow: inset 0 -7px 11px rgba(200, 208, 222, 0.06);

    /* ── CARD BASE SYSTEM ── */
    --card-bg:             rgba(10, 13, 18, 0.55);
    --card-border:         rgba(200, 208, 222, 0.12);
    --card-blur:           blur(10px) saturate(120%);
    --card-padding:        var(--space-5);
    --card-radius:         var(--radius-lg);
    --card-shadow:         0 10px 30px rgba(0, 0, 0, 0.45);
    --card-shadow-hover:   0 0 30px rgba(91, 157, 255, 0.18), 0 20px 60px rgba(0, 0, 0, 0.55);
    --card-border-gradient: linear-gradient(135deg, rgba(200, 208, 222, 0.25), transparent 40%, rgba(91, 157, 255, 0.12) 60%, rgba(200, 208, 222, 0.25));

    /* Gradient overlays — ice blue fading into cold steel white */
    --gradient-primary:   linear-gradient(135deg, var(--ice-blue) 0%, var(--steel-100) 100%);
    --gradient-hover:     linear-gradient(135deg, var(--ice-blue-soft) 0%, var(--ice-pale) 100%);

    /* Grain overlay tunables (used by body::before in Phase A) */
    --grain-opacity: 0.06;
}

/* Base resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom cursor was removed — we always use the native system cursor now. */

html {
    scroll-behavior: smooth;
    background-color: var(--bg);
}

body {
    font-family: var(--font-main);
    font-size: clamp(15px, 0.15vw + 14px, 16px);
    background-color: var(--bg);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── FILM GRAIN OVERLAY ── */
body::before {
    content: '';
    position: fixed; inset: 0; z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    opacity: var(--grain-opacity, 0.06);
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* ── STAR CANVAS BACKGROUND ── */
#star-canvas {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
}

/* Cold radial wash for depth — steel top, faint ice-blue bottom */
body::after {
    content: '';
    position: fixed; inset: 0; z-index: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(26, 33, 48, 0.55) 0%, transparent 65%),
                radial-gradient(ellipse at 80% 100%, rgba(91, 157, 255, 0.05) 0%, transparent 55%);
    pointer-events: none;
}

main {
    position: relative;
    z-index: 2;
}

::selection {
    background: var(--primary);
    color: #fff;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ----------------
 * Utilities
 * ---------------- */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
}

.mono {
    font-family: var(--font-mono);
}

.welcome-box {
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 32px;
    box-shadow: var(--welcome-shadow);
    border: 1px solid var(--welcome-border);
    background: var(--welcome-bg);
    padding: 0.5rem 1rem;
    position: relative;
    width: max-content;
    max-width: 100%;
    transition: 0.45s cubic-bezier(0.6, 0.6, 0, 1) box-shadow;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 1.2px;
}

.welcome-box:hover {
    box-shadow: var(--welcome-shadow), 0 0 20px rgba(91, 157, 255, 0.22);
}

/* Welcome-text — cold white with a hairline ice-blue weight on one edge */
.welcome-text {
    color: var(--ice-pale);
    font-weight: 500;
    letter-spacing: 1.4px;
}

/* Sparkle icon inside welcome-box */
.welcome-box .sparkle {
    color: var(--ice-blue);
    font-size: 1rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(91, 157, 255, 0.45));
}

/* Shimmer Loading base components */
.shimmer {
    position: relative;
    overflow: hidden;
    background-color: var(--surface);
    border-radius: var(--radius-sm);
}

.shimmer::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    content: '';
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-100%);
    animation: shimmer-load 2s infinite;
}

@keyframes shimmer-load {
    100% {
        transform: translateX(100%);
    }
}


/* ----------------
 * Navigation
 * ---------------- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 0;
    z-index: 1000;
    transition: all 0.4s ease;
}

header.scrolled {
    padding: 0.65rem 0;
    background: rgba(10, 13, 18, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(200, 208, 222, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--ice-pale);
    letter-spacing: -1px;
    text-shadow: 0 0 10px rgba(91, 157, 255, 0.3);
    position: relative;
    z-index: 2;
}

/* ── CENTER PILL NAV ── */
.nav-links {
    display: flex;
    gap: 0;
    list-style: none;

    /* Pill container */
    background: rgba(10, 13, 18, 0.55);
    border: 1px solid rgba(200, 208, 222, 0.14);
    border-radius: 9999px;
    padding: 0.55rem 1.25rem;
    gap: 2rem;

    /* Absolute center */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 50%;
    transform: translate(-50%, -50%);

    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.nav-links a {
    color: var(--ice-pale);
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.nav-links a i {
    font-size: 0.9rem;
    color: rgba(200, 208, 222, 0.55);
    transition: all 0.3s;
}

.nav-links a:hover {
    color: var(--ice-blue);
}

.nav-links a:hover i {
    color: var(--ice-blue);
}

.nav-links a.active {
    color: var(--ice-blue);
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
}

.lang-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    color: #fff;
}

.lang-btn.active {
    color: var(--ice-pale);
    background: rgba(91, 157, 255, 0.22);
    box-shadow: 0 0 10px rgba(91, 157, 255, 0.28);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: rgba(200, 208, 222, 0.22);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(91, 157, 255, 0.55); }

/* ── READING PROGRESS — clickable slider ── */
#reading-progress-track {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: transparent;
    z-index: 1002;
    cursor: pointer;
}

#reading-progress-track:focus-visible {
    outline: 2px solid var(--ice-blue);
    outline-offset: 2px;
}

#reading-progress {
    height: 3px;
    width: 0%;
    background: var(--gradient-primary);
    pointer-events: none;
    transition: width 0.1s linear;
}

@media (prefers-reduced-motion: reduce) {
    #reading-progress {
        transition: none;
    }
}

/* ── SKIP LINK ── */
.skip-link {
    position: absolute;
    top: -48px;
    left: 1rem;
    padding: 0.5rem 1rem;
    background: var(--space-purple);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    z-index: 10001;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
    .skip-link {
        transition: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    #star-canvas {
        display: none !important;
    }
}

/* ----------------
 * Hero Section
 * ---------------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding-top: 5rem;
}

/* Hero background glow — single ice wash, no purple bloom */
.hero::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 55vw; height: 55vw;
    background: radial-gradient(circle, rgba(91, 157, 255, 0.10) 0%, transparent 65%);
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
    animation: hero-pulse 6s ease-in-out infinite alternate;
}

@keyframes hero-pulse {
    from { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    to   { opacity: 1;   transform: translate(-50%, -50%) scale(1.1); }
}

.hero-content {
    text-align: center;
    max-width: 1100px;
    padding: 0 2rem;
}

/* Hero h1 */
.hero h1 {
    font-size: var(--text-title);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-family: var(--font-heading);
    font-weight: 800;
}

.hero h1 .glow-word {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradient-shift 4s ease-in-out infinite alternate;
}

@keyframes gradient-shift {
    from { background-position: 0% 50%; }
    to   { background-position: 100% 50%; }
}
