/**
 * What About the Weather? — Celestial Shades System
 * Technical Deep Dive CSS — POLISHED TO PERFECTION
 *
 * Design System: ChronOS-based
 * Typography: IBM Plex Sans/Mono
 * Grid: 8px spacing
 * Animation: Fibonacci timing (89, 144, 233, 377, 610, 987ms)
 * Contrast: WCAG AA compliant
 * 
 * Every pixel. Every moment. Perfect.
 */

/* ========================================
 * CSS RESET + BASE
 * ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-dim) var(--void);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--void);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-dim);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

::selection {
    background: var(--gold);
    color: var(--void);
}

/* ========================================
 * CSS CUSTOM PROPERTIES
 * ======================================== */
:root {
    /* Typography */
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    
    /* Font Sizes - Major Third (1.25) scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-md: 1.125rem;
    --text-lg: 1.25rem;
    --text-xl: 1.5rem;
    --text-2xl: 1.875rem;
    --text-3xl: 2.25rem;
    --text-4xl: 3rem;
    --text-5xl: 4rem;
    --text-hero: clamp(4rem, 12vw, 8rem);
    
    /* Colors - Celestial Theme */
    --void: #07060B;
    --void-light: #0D0C12;
    --void-lighter: #15141B;
    
    --gold: #D4AF37;
    --gold-bright: #E5C158;
    --gold-dim: rgba(212, 175, 55, 0.6);
    --gold-faint: rgba(212, 175, 55, 0.15);
    --gold-glow: rgba(212, 175, 55, 0.25);
    --gold-subtle: rgba(212, 175, 55, 0.08);
    
    /* Celestial colors */
    --sun: #FFD700;
    --sun-glow: rgba(255, 215, 0, 0.3);
    --sun-morning: #FF8C42;
    --sun-noon: #FFF4BD;
    --sun-evening: #FF6B35;
    
    --sky-day: #87CEEB;
    --sky-dawn: #FF9F7F;
    --sky-dusk: #614B79;
    --sky-night: #0B0B15;
    
    --cloud: #B8C5D6;
    --rain: #6EA4BF;
    
    /* Direction colors */
    --north: #64D9FF;
    --south: #FF9F40;
    --east: #FFD93D;
    --west: #FF6B6B;
    
    /* Text */
    --text-primary: #F4F1EA;
    --text-secondary: rgba(244, 241, 234, 0.7);
    --text-tertiary: rgba(244, 241, 234, 0.55);
    
    /* Semantic */
    --success: #4ECB71;
    --warning: #FFAB40;
    --error: #FF6B6B;
    --info: #64D9FF;
    
    /* Spacing - 8px grid */
    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2rem;
    --space-6: 3rem;
    --space-8: 4rem;
    --space-12: 6rem;
    --space-16: 8rem;
    
    /* Borders */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.12);
    --border-gold: rgba(212, 175, 55, 0.3);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--gold-glow);
    --shadow-glow-lg: 0 0 60px var(--gold-glow), 0 0 120px var(--gold-subtle);
    --shadow-sun: 0 0 60px var(--sun-glow);
    
    /* Fibonacci timing */
    --duration-89: 89ms;
    --duration-144: 144ms;
    --duration-233: 233ms;
    --duration-377: 377ms;
    --duration-610: 610ms;
    --duration-987: 987ms;
    --duration-1597: 1597ms;
    --duration-2584: 2584ms;
    
    /* Easings */
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Z-index */
    --z-base: 1;
    --z-particles: 5;
    --z-content: 10;
    --z-nav: 100;
    --z-cursor: 9999;

    /* Atmosphere - DRAMATIC effects based on reader's real weather */
    --atmosphere-hue-shift: 0deg;
    --atmosphere-saturation: 1;
    --atmosphere-brightness: 1;
    --atmosphere-contrast: 1;
    --atmosphere-timing: 1;
    --atmosphere-particle-drift-x: 0;
    --atmosphere-particle-drift-y: -0.5;
    --atmosphere-turbulence: 0;
    --atmosphere-particle-opacity: 1;
    --atmosphere-glow: 1;
    --atmosphere-vignette: 0;
    --atmosphere-blur: 0px;
}

/* ========================================
 * ACCESSIBILITY
 * ======================================== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: var(--void);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-weight: 600;
    z-index: 10000;
    transition: top var(--duration-233) var(--ease-out);
    text-decoration: none;
}

.skip-link:focus {
    top: var(--space-2);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators - visible for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Remove focus outline on mouse click but keep for keyboard */
:focus:not(:focus-visible) {
    outline: none;
}

/* High contrast mode support */
@media (forced-colors: active) {
    .card,
    .code-block,
    .callout,
    .live-demo {
        border: 2px solid CanvasText;
    }

    .cursor,
    .cursor-ring,
    .particles-container,
    .breathing-glow {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
    .cursor, .cursor-ring, .particles-container {
        display: none !important;
    }
}

/* ========================================
 * CUSTOM CURSOR
 * ======================================== */
.cursor {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-cursor);
    transform: translate(-50%, -50%);
    transition: 
        width var(--duration-144) var(--ease-spring),
        height var(--duration-144) var(--ease-spring),
        background var(--duration-144) var(--ease-out);
    mix-blend-mode: difference;
}

.cursor-ring {
    position: fixed;
    width: 32px;
    height: 32px;
    border: 1px solid var(--gold-dim);
    border-radius: 50%;
    pointer-events: none;
    z-index: calc(var(--z-cursor) - 1);
    transform: translate(-50%, -50%);
    transition: 
        width var(--duration-233) var(--ease-out),
        height var(--duration-233) var(--ease-out),
        border-color var(--duration-233) var(--ease-out),
        opacity var(--duration-233) var(--ease-out);
}

body:hover .cursor-ring {
    opacity: 1;
}

.cursor.hovering {
    width: 16px;
    height: 16px;
    background: var(--sun);
}

.cursor-ring.hovering {
    width: 48px;
    height: 48px;
    border-color: var(--sun-glow);
}

.cursor.clicking {
    transform: translate(-50%, -50%) scale(0.8);
}

/* Hide default cursor on desktop */
@media (hover: hover) and (pointer: fine) {
    body {
        cursor: none;
    }
    
    a, button, [role="button"], input, textarea, select, label {
        cursor: none;
    }
}

/* ========================================
 * BODY + BACKGROUND
 * ======================================== */
body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--void);
    min-height: 100vh;
    overflow-x: hidden;
}

/* DRAMATIC Atmospheric color overlay - based on reader's real weather */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    background: transparent;
    filter:
        hue-rotate(var(--atmosphere-hue-shift))
        saturate(var(--atmosphere-saturation))
        brightness(var(--atmosphere-brightness))
        contrast(var(--atmosphere-contrast))
        blur(var(--atmosphere-blur));
    mix-blend-mode: color;
    opacity: 0;
    transition:
        opacity var(--duration-987) var(--ease-smooth),
        filter var(--duration-610) var(--ease-smooth);
}

/* DRAMATIC Vignette overlay for weather intensity */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9997;
    background: radial-gradient(
        ellipse 80% 60% at 50% 50%,
        transparent 30%,
        rgba(0, 0, 0, calc(var(--atmosphere-vignette) * 0.8)) 100%
    );
    opacity: 0;
    transition: opacity var(--duration-610) var(--ease-smooth);
}

/* Activate atmosphere when applied - DRAMATIC opacity */
body.atmosphere-active::before {
    opacity: 0.4;
}

body.atmosphere-active::after {
    opacity: 1;
}

/* DRAMATIC Lightning Flash Effect */
body.lightning-flash {
    animation: lightning-shake 0.1s ease-out;
}

body.lightning-flash::before {
    opacity: 0.8 !important;
    filter:
        hue-rotate(0deg)
        saturate(0.2)
        brightness(2)
        contrast(1.5) !important;
    transition: none !important;
}

body.lightning-flash .hero-sun,
body.lightning-flash .celestial-sun {
    filter: brightness(3) saturate(0) !important;
    box-shadow: 0 0 200px 100px rgba(255, 255, 255, 0.8) !important;
}

@keyframes lightning-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* Weather-specific body styles */
body[data-weather="thunderstorm"] {
    --gold: #8B9DC3;
    --gold-bright: #A0B4D4;
}

body[data-weather="rain"],
body[data-weather="heavy_rain"],
body[data-weather="showers"] {
    --gold: #7B9AAF;
}

body[data-weather="snow"],
body[data-weather="heavy_snow"] {
    --gold: #B8C5D6;
    --gold-bright: #D4E0ED;
}

body[data-weather="fog"] {
    --gold: #9A9A9A;
}

.background-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.gradient-bg {
    background: 
        radial-gradient(ellipse 100% 70% at 50% -10%, rgba(212, 175, 55, 0.12), transparent 50%),
        radial-gradient(ellipse 80% 50% at 80% 100%, rgba(100, 217, 255, 0.06), transparent 40%),
        radial-gradient(ellipse 60% 40% at 20% 80%, rgba(255, 159, 64, 0.04), transparent 40%),
        var(--void);
}

.grain-overlay {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.025;
    pointer-events: none;
    z-index: 2;  /* Below particles (z-index: 5) for proper layering */
}

/* ========================================
 * PARTICLES CANVAS — GPU-accelerated
 * ======================================== */

/* Canvas-based particle system */
.particles-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: var(--z-particles);
    /* GPU acceleration hints */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Weather particle color tokens */
:root {
    --particle-rain: rgba(110, 164, 191, 0.6);
    --particle-snow: rgba(255, 255, 255, 0.8);
    --particle-fog: rgba(180, 180, 190, 0.04);
    --particle-spark: rgba(255, 255, 200, 0.9);
    --particle-dust: rgba(212, 175, 55, 0.5);
    --particle-wind: rgba(255, 255, 255, 0.15);
    --particle-haze: rgba(180, 180, 170, 0.1);
    --particle-heat: rgba(255, 200, 100, 0.02);
    --particle-connection: rgba(212, 175, 55, 0.15);
}

/* Legacy particles container (fallback) */
.particles-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: var(--z-particles);
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: particle-float calc(8s * var(--atmosphere-timing)) ease-in-out infinite;
    filter: hue-rotate(var(--atmosphere-hue-shift));
    --particle-base-opacity: calc(0.6 * var(--atmosphere-particle-opacity));
}

@keyframes particle-float {
    0%, 100% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.6;
        transform: translateY(80vh) scale(1);
    }
    90% {
        opacity: 0.3;
        transform: translateY(10vh) scale(0.5);
    }
}

/* Breathing glow */
.breathing-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--gold-subtle), transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: breathe calc(var(--duration-2584) * var(--atmosphere-timing)) ease-in-out infinite;
    filter: blur(60px) hue-rotate(var(--atmosphere-hue-shift));
    opacity: calc(0.3 * var(--atmosphere-glow));
}

@keyframes breathe {
    0%, 100% { 
        opacity: 0.3; 
        transform: translate(-50%, -50%) scale(1); 
    }
    50% { 
        opacity: 0.5; 
        transform: translate(-50%, -50%) scale(1.1); 
    }
}

/* ========================================
 * CONTAINER + LAYOUT
 * ======================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.container-narrow {
    max-width: 800px;
}

.container-wide {
    max-width: 1400px;
}

/* ========================================
 * HERO SECTION
 * ======================================== */
/* ========================================
 * HERO SECTION — REDESIGNED
 * ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-8) var(--space-4);
    position: relative;
    overflow: hidden;
}

/* Full-width title header */
.hero-header {
    max-width: 1400px;
    margin: 0 auto var(--space-8);
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 2;
}

@media (max-width: 1024px) {
    .hero-layout {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.hero-content {
    max-width: 600px;
}

@media (max-width: 1024px) {
    .hero-header {
        margin-bottom: var(--space-6);
    }
    
    .hero-content {
        max-width: 100%;
        margin: 0 auto;
        text-align: center;
    }
}

/* Eyebrow badge */
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gold);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: var(--space-4);
}

.hero-eyebrow-icon {
    font-size: 14px;
    animation: spin-slow 30s linear infinite;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Title */
.hero-title {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: var(--space-4);
}

.hero-title-line {
    display: block;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--text-primary);
}

.hero-title-accent {
    font-size: clamp(3rem, 8vw, 6rem);
    background: linear-gradient(135deg, var(--gold) 0%, var(--sun) 50%, var(--gold-bright) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title em {
    font-style: italic;
}

/* Lead paragraph */
.hero-lead {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-4);
    max-width: 500px;
}

@media (max-width: 1024px) {
    .hero-lead {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
}

.hero-lead-emphasis {
    color: var(--text-primary);
    font-weight: 500;
    margin-top: calc(-1 * var(--space-4));
}

@media (max-width: 1024px) {
    .hero-lead {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Stats row */
.hero-stats {
    display: flex;
    gap: var(--space-6);
    flex-wrap: wrap;
}

@media (max-width: 1024px) {
    .hero-stats {
        justify-content: center;
    }
}

.stat-item {
    text-align: left;
}

@media (max-width: 1024px) {
    .stat-item {
        text-align: center;
    }
}

.stat-value {
    font-family: var(--font-mono);
    font-size: var(--text-3xl);
    font-weight: 600;
    color: var(--gold);
    display: block;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ========================================
 * COMPASS-SUNDIAL — ISOMETRIC 3D
 * ======================================== */
.hero-compass-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-bottom: 140px;
}

@media (max-width: 1024px) {
    .hero-compass-container {
        order: -1;
        margin-bottom: var(--space-6);
    }
}

.compass-sundial {
    --compass-size: clamp(240px, 28vw, 320px);
    
    width: var(--compass-size);
    height: var(--compass-size);
    position: relative;
    transition: transform var(--duration-377) var(--ease-spring);
}

.compass-sundial:hover,
.compass-sundial:focus {
    transform: scale(1.02);
    outline: none;
}

.compass-sundial:focus-visible {
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.secret-info-bar {
    position: absolute;
    left: 50%;
    bottom: -90px;
    transform: translate(-50%, 0);
    min-width: clamp(240px, 55vw, 380px);
    padding: var(--space-3) var(--space-4);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(14,14,12,0.94), rgba(26,24,20,0.94));
    border: 1px solid rgba(212, 175, 55, 0.18);
    box-shadow: 0 25px 45px rgba(0,0,0,0.55);
    color: var(--text-primary);
    gap: var(--space-3);
    display: none;
    align-items: center;
    backdrop-filter: blur(14px);
    z-index: 130;
}

.secret-info-bar.show {
    display: flex;
    animation: info-bar-pop 0.4s var(--ease-out);
}

.secret-info-bar .sib-emoji {
    font-size: 24px;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.35));
}

.secret-info-bar .sib-details {
    flex: 1;
}

.secret-info-bar .sib-title {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--gold);
}

.secret-info-bar .sib-subtitle {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.secret-info-bar .sib-meta {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.secret-info-bar button {
    background: rgba(255,255,255,0.05);
    border: none;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.secret-info-bar button:hover {
    background: rgba(255,255,255,0.12);
}

@keyframes info-bar-pop {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Compass body - flat for clarity */
.compass-body {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 50%;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Outer bezel ring */
.compass-bezel {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, #3a3428 0%, #1a1814 50%, #2a2520 100%);
    border: 3px solid rgba(212, 175, 55, 0.4);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 8px 25px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        inset 0 -4px 8px rgba(0, 0, 0, 0.3);
}

/* Bezel markings (N, E, S, W) — HIGHEST Z-INDEX */
.bezel-marking {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    transform: rotate(var(--angle));
    pointer-events: none;
    z-index: 200;
}

.bezel-marking span {
    position: absolute;
    top: 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--gold);
    transform: rotate(calc(-1 * var(--angle)));
    text-shadow: 
        0 0 4px rgba(0, 0, 0, 1),
        0 1px 2px rgba(0, 0, 0, 0.9),
        0 0 8px rgba(0, 0, 0, 0.5);
}

/* Cardinal directions - larger, prominent */
.bezel-marking:nth-child(1) span { color: var(--north); font-size: 13px; font-weight: 800; } /* N */
.bezel-marking:nth-child(3) span { color: var(--east); font-size: 13px; font-weight: 800; }  /* E */
.bezel-marking:nth-child(5) span { color: var(--south); font-size: 13px; font-weight: 800; } /* S */
.bezel-marking:nth-child(7) span { color: var(--west); font-size: 13px; font-weight: 800; }  /* W */

/* Intercardinal directions - smaller, muted */
.bezel-marking:nth-child(2) span,
.bezel-marking:nth-child(4) span,
.bezel-marking:nth-child(6) span,
.bezel-marking:nth-child(8) span {
    font-size: 9px;
    opacity: 0.6;
    top: 10px;
}

/* Compass face (inner dial) */
.compass-face {
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    background: 
        radial-gradient(circle at 30% 30%, #2a2520 0%, #1a1814 60%, #0f0e0c 100%);
    border: 2px solid rgba(212, 175, 55, 0.2);
    box-shadow:
        inset 0 4px 12px rgba(0, 0, 0, 0.5),
        inset 0 -2px 6px rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

/* Hour line SVG overlay */
.compass-hour-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    transition: opacity 0.3s ease;
}

/* Fade hour lines when map is showing */
.compass-sundial:hover .compass-hour-lines {
    opacity: 0.3;
}

/* Central gnomon (vertical pointer) */
.compass-gnomon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 30% 30%, var(--gold-bright), var(--gold), #8B7355);
    border-radius: 50%;
    box-shadow:
        0 0 14px var(--gold-bright),
        0 0 28px var(--gold-glow),
        0 6px 12px rgba(0, 0, 0, 0.5),
        inset -2px -2px 4px rgba(0, 0, 0, 0.3),
        inset 2px 2px 4px rgba(255, 255, 200, 0.5);
    z-index: 50;
}

.compass-gnomon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: #FFE680;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px var(--gold-bright);
}

/* ============================================================================
   SUNDIAL SHADOW HAND — Beautiful tapered hand pointing opposite the sun
   ============================================================================ */

.compass-shadow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 65px;
    margin-left: -4px;
    margin-top: 0;
    transform-origin: top center;
    transform: rotate(var(--shadow-angle, 180deg));
    transition: 
        transform 1.5s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.5s ease;
    z-index: 60;
    pointer-events: none;
    /* Main shadow body */
    background: linear-gradient(to bottom,
        rgba(15, 12, 10, 0.9) 0%,
        rgba(25, 20, 15, 0.85) 30%,
        rgba(20, 16, 12, 0.7) 70%,
        rgba(15, 12, 10, 0.3) 90%,
        transparent 100%
    );
    clip-path: polygon(
        40% 0%,
        60% 0%,
        55% 20%,
        52% 100%,
        48% 100%,
        45% 20%
    );
}

/* Soft blur edge for depth */
.compass-shadow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -3px;
    width: 14px;
    height: 100%;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        transparent 100%
    );
    clip-path: polygon(
        35% 0%,
        65% 0%,
        58% 20%,
        54% 100%,
        46% 100%,
        42% 20%
    );
    filter: blur(3px);
    opacity: 0.5;
}

/* Highlight edge for 3D effect */
.compass-shadow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 60%;
    margin-left: -1px;
    background: linear-gradient(to bottom,
        rgba(80, 70, 55, 0.6) 0%,
        rgba(60, 50, 40, 0.3) 50%,
        transparent 100%
    );
    border-radius: 1px;
}

/* Night mode - shadow fades */
.compass-shadow.night {
    opacity: 0.4;
}

/* Sun below horizon - very faint */
.compass-shadow.below-horizon {
    opacity: 0.15;
}

/* ============================================================================
   SUN & MOON INDICATORS — The celestial bodies
   ============================================================================ */

/* ============================================================================
   SUN INDICATOR — Brilliant golden sun, always visible
   ============================================================================ */
.compass-sun {
    position: absolute;
    left: 75%;
    top: 30%;
    width: 22px;
    height: 22px;
    transform: translate(-50%, -50%);
    z-index: 300;
    cursor: pointer;
    transition: 
        left 0.15s cubic-bezier(0.4, 0, 0.2, 1), 
        top 0.15s cubic-bezier(0.4, 0, 0.2, 1), 
        opacity 0.3s ease,
        transform 0.2s ease;
}

.compass-sun .sun-glow {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 200, 50, 0.75) 0%,
        rgba(255, 150, 0, 0.45) 40%,
        rgba(255, 100, 0, 0.15) 70%,
        transparent 100%
    );
    animation: sun-glow-pulse 2.5s ease-in-out infinite;
    pointer-events: none;
    filter: blur(1px);
}

.compass-sun .sun-dot {
    position: relative;
    width: 100%;
    height: 100%;
    background: #FFD700;
    border-radius: 50%;
    box-shadow:
        0 0 16px rgba(255, 220, 0, 1),
        0 0 32px rgba(255, 150, 0, 0.6),
        0 0 56px rgba(255, 100, 0, 0.3),
        inset -2px -2px 4px rgba(200, 100, 0, 0.3),
        inset 2px 2px 4px rgba(255, 255, 200, 0.5);
}

/* Night sun — dimmed but still visible */
.compass-sun[style*="opacity: 0.3"] .sun-dot {
    background: #cc9900;
    box-shadow: 
        0 0 8px rgba(200, 150, 0, 0.5),
        0 0 16px rgba(180, 120, 0, 0.2);
}

.compass-sun:hover {
    transform: translate(-50%, -50%) scale(1.4);
    z-index: 350;
}

.compass-sun:hover .sun-dot {
    box-shadow: 
        0 0 16px rgba(255, 200, 0, 1),
        0 0 32px rgba(255, 150, 0, 0.7),
        0 0 48px rgba(255, 100, 0, 0.4);
}

.compass-sun:active {
    transform: translate(-50%, -50%) scale(1.2);
}

@keyframes sun-glow-pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* ============================================================================
   MOON INDICATOR — Silvery moon with phase shadow
   ============================================================================ */
.compass-moon {
    position: absolute;
    left: 25%;
    top: 70%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    z-index: 299;
    cursor: pointer;
    transition: 
        left 0.15s cubic-bezier(0.4, 0, 0.2, 1), 
        top 0.15s cubic-bezier(0.4, 0, 0.2, 1), 
        opacity 0.3s ease,
        transform 0.2s ease;
}

.compass-moon .moon-glow {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, 
        rgba(220, 230, 255, 0.5) 0%,
        rgba(180, 200, 240, 0.25) 50%,
        transparent 80%
    );
    animation: moon-glow 4s ease-in-out infinite;
    pointer-events: none;
}

.compass-moon .moon-dot {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        #f8f9ff 0%,
        #e0e4f0 40%,
        #c8cee0 70%,
        #a8b0c8 100%
    );
    border-radius: 50%;
    box-shadow: 
        0 0 10px rgba(200, 220, 255, 0.8),
        0 0 20px rgba(150, 180, 220, 0.4),
        inset -3px -3px 6px rgba(80, 100, 140, 0.3),
        inset 2px 2px 4px rgba(255, 255, 255, 0.5);
    /* Crescent shadow overlay */
    position: relative;
    overflow: hidden;
}

/* Moon phase shadow — crescent effect */
.compass-moon .moon-dot::after {
    content: '';
    position: absolute;
    top: -20%;
    left: 30%;
    width: 100%;
    height: 140%;
    background: radial-gradient(ellipse at 30% 50%,
        rgba(20, 25, 40, 0.85) 0%,
        rgba(20, 25, 40, 0.6) 30%,
        transparent 60%
    );
    border-radius: 50%;
    pointer-events: none;
}

/* Below horizon — still visible but dimmed */
.compass-moon[style*="opacity: 0.25"] .moon-dot {
    background: linear-gradient(135deg,
        #d0d4e0 0%,
        #a8b0c0 50%,
        #808898 100%
    );
    box-shadow: 
        0 0 6px rgba(150, 170, 200, 0.5),
        0 0 12px rgba(120, 140, 170, 0.2);
}

.compass-moon:hover {
    transform: translate(-50%, -50%) scale(1.4);
    z-index: 350;
}

.compass-moon:hover .moon-dot {
    box-shadow: 
        0 0 14px rgba(200, 220, 255, 1),
        0 0 28px rgba(150, 180, 220, 0.6),
        0 0 42px rgba(100, 140, 200, 0.3);
}

.compass-moon:active {
    transform: translate(-50%, -50%) scale(1.2);
}

@keyframes moon-glow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.05); }
}

/* ============================================================================
   LOCATION INDICATOR — Subtle, elegant pin marker
   ============================================================================ */

.compass-location {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%);
    z-index: 280;
    cursor: pointer;
    transition: 
        left 0.1s cubic-bezier(0.4, 0, 0.2, 1),
        top 0.1s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease,
        transform 0.15s ease;
}

.compass-location .location-glow {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(212, 175, 55, 0.15) 50%,
        transparent 70%
    );
    animation: location-pulse 3s ease-in-out infinite;
    pointer-events: none;
}

.compass-location .location-dot {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 35% 35%,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 0.6) 40%,
        rgba(200, 200, 200, 0.4) 100%
    );
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        0 0 6px rgba(255, 255, 255, 0.5),
        0 1px 3px rgba(0, 0, 0, 0.3);
}

.compass-location:hover {
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 360;
}

.compass-location:hover .location-dot {
    background: radial-gradient(circle at 35% 35%,
        #ffffff 0%,
        #ffd700 60%,
        #d4af37 100%
    );
    box-shadow:
        0 0 10px rgba(212, 175, 55, 0.8),
        0 0 20px rgba(255, 255, 255, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

.compass-location:active {
    transform: translate(-50%, -50%) scale(1.3);
}

@keyframes location-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.15); }
}

/* ============================================================================
   NIXIE TUBE CLOCK — Retro-futuristic time display
   ============================================================================ */

.nixie-clock {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--space-4);
}

.nixie-display {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 20px;
    background: linear-gradient(180deg,
        rgba(10, 8, 6, 0.95) 0%,
        rgba(20, 16, 12, 0.95) 50%,
        rgba(15, 12, 8, 0.95) 100%
    );
    border-radius: 12px;
    border: 1px solid rgba(80, 60, 40, 0.6);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 200, 100, 0.05),
        inset 0 -2px 8px rgba(0, 0, 0, 0.3);
}

.nixie-tube {
    position: relative;
    width: 32px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(20, 15, 10, 0.6) 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    border-radius: 6px;
    border: 1px solid rgba(60, 45, 30, 0.5);
    box-shadow:
        inset 0 0 15px rgba(0, 0, 0, 0.8),
        inset 0 0 5px rgba(255, 150, 50, 0.05);
}

/* Glass tube effect */
.nixie-tube::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 4px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.03) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
    pointer-events: none;
}

.nixie-digit {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 400;
    color: #ff6a00;
    text-shadow:
        0 0 10px #ff6a00,
        0 0 20px #ff4500,
        0 0 30px #ff2200,
        0 0 40px rgba(255, 100, 0, 0.5);
    animation: nixie-flicker 0.1s ease-in-out infinite alternate;
    animation-play-state: paused;
}

/* Subtle cathode glow */
.nixie-tube::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 6px;
    background: radial-gradient(ellipse at center,
        rgba(255, 100, 0, 0.1) 0%,
        transparent 70%
    );
    pointer-events: none;
}

.nixie-separator {
    font-family: var(--font-mono);
    font-size: 28px;
    color: #ff6a00;
    text-shadow:
        0 0 8px #ff6a00,
        0 0 15px #ff4500;
    animation: nixie-blink 1s ease-in-out infinite;
    padding: 0 2px;
}

.nixie-seconds {
    width: 24px;
    height: 36px;
}

.nixie-seconds .nixie-digit {
    font-size: 22px;
}

.nixie-sec-sep {
    font-size: 20px;
    opacity: 0.6;
}

.nixie-timezone {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(255, 150, 80, 0.7);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 100, 0, 0.3);
}

/* Animations */
@keyframes nixie-flicker {
    0% { opacity: 0.95; }
    100% { opacity: 1; }
}

@keyframes nixie-blink {
    0%, 45% { opacity: 1; }
    50%, 95% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Digit change animation */
.nixie-digit.changing {
    animation: nixie-change 0.15s ease-out;
}

@keyframes nixie-change {
    0% { 
        transform: translateY(-2px);
        opacity: 0.5;
        filter: blur(1px);
    }
    50% {
        transform: translateY(1px);
        opacity: 0.8;
    }
    100% { 
        transform: translateY(0);
        opacity: 1;
        filter: blur(0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .nixie-display {
        padding: 8px 12px;
        gap: 2px;
    }
    
    .nixie-tube {
        width: 24px;
        height: 36px;
    }
    
    .nixie-digit {
        font-size: 24px;
    }
    
    .nixie-seconds {
        width: 18px;
        height: 28px;
    }
    
    .nixie-seconds .nixie-digit {
        font-size: 16px;
    }
    
    .nixie-separator {
        font-size: 20px;
    }
    
    .nixie-sec-sep {
        font-size: 14px;
    }
}

/* ============================================================================
   TOAST STACK — Tetris-like stacking notifications
   ============================================================================ */

.toast-stack {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    z-index: 10000;
    pointer-events: none;
}

.stack-toast {
    --stack-index: 0;
    --stack-offset-x: 0px;
    
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg,
        rgba(20, 20, 18, 0.96) 0%,
        rgba(30, 28, 24, 0.96) 100%
    );
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(212, 175, 55, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    min-width: 280px;
    max-width: 360px;
    pointer-events: auto;
    
    /* Tetris-like entrance from right */
    transform: translateX(calc(100% + 40px)) translateX(var(--stack-offset-x));
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stack-toast.show {
    transform: translateX(0) translateX(var(--stack-offset-x));
    opacity: 1;
}

.stack-toast.removing {
    transform: translateX(100%) translateX(var(--stack-offset-x)) scale(0.9);
    opacity: 0;
}

.stack-toast__emoji {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.stack-toast__content {
    flex: 1;
    min-width: 0;
}

.stack-toast__title {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-primary);
    margin-bottom: 2px;
}

.stack-toast__subtitle {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.stack-toast__meta {
    font-size: 10px;
    color: var(--gold);
    font-family: var(--font-mono);
}

.stack-toast__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.stack-toast__close:hover {
    color: var(--text-primary);
}

/* Toast type variants */
.stack-toast--location {
    border-color: rgba(212, 175, 55, 0.5);
}

.stack-toast--celestial {
    border-color: rgba(200, 210, 255, 0.4);
}

.stack-toast--weather {
    border-color: rgba(100, 200, 255, 0.4);
}

/* ============================================================================
   COMPREHENSIVE FORECAST TOAST — Full weather dashboard
   ============================================================================ */

.forecast-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(120px) scale(0.95);
    background: linear-gradient(145deg,
        rgba(18, 18, 16, 0.98) 0%,
        rgba(28, 26, 22, 0.98) 100%
    );
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 20px;
    padding: 0;
    color: var(--text-primary);
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(212, 175, 55, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 10001;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: clamp(320px, 90vw, 420px);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.forecast-toast.show {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
}

.ft-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

.ft-location {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ft-icon {
    font-size: 20px;
}

.ft-loc-info {
    display: flex;
    flex-direction: column;
}

.ft-name {
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--text-primary);
}

.ft-coords {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.ft-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.ft-close:hover {
    color: var(--text-primary);
}

.ft-current {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.ft-condition {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ft-condition-icon {
    font-size: 36px;
}

.ft-condition-name {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: capitalize;
}

.ft-temp {
    display: flex;
    align-items: flex-start;
}

.ft-temp-value {
    font-size: 48px;
    font-weight: 300;
    line-height: 1;
    color: var(--text-primary);
}

.ft-temp-unit {
    font-size: var(--text-lg);
    color: var(--text-muted);
    margin-top: 8px;
}

.ft-highlow {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-left: auto;
}

.weather-details {
    display: flex;
    gap: 16px;
    padding: 0 20px 16px;
    flex-wrap: wrap;
}

.weather-details span {
    font-size: var(--text-xs);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 20px;
}

/* 5-day forecast strip */
.forecast-days {
    display: flex;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    overflow-x: auto;
}

.forecast-day {
    flex: 1;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.forecast-day:last-child {
    border-right: none;
}

.forecast-day:hover {
    background: rgba(212, 175, 55, 0.05);
}

.fd-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fd-icon {
    font-size: 20px;
}

.fd-temps {
    display: flex;
    gap: 4px;
    font-size: var(--text-xs);
}

.fd-high {
    color: var(--text-primary);
    font-weight: 600;
}

.fd-low {
    color: var(--text-muted);
}

.fd-precip {
    font-size: 10px;
    color: #64b5f6;
}

.ft-footer {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.2);
    font-size: 10px;
    color: var(--text-muted);
}

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

/* Mobile adjustments */
@media (max-width: 480px) {
    .toast-stack {
        right: 10px;
        left: 10px;
        bottom: 80px;
    }
    
    .stack-toast {
        min-width: auto;
        max-width: none;
    }
    
    .forecast-toast {
        width: calc(100vw - 20px);
        bottom: 80px;
    }
    
    .ft-temp-value {
        font-size: 40px;
    }
    
    .forecast-day {
        min-width: 60px;
    }
}

/* Celestial toast notification */
.celestial-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(20, 20, 18, 0.95);
    border: 1px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: 12px 24px;
    color: var(--text-primary);
    font-size: var(--text-sm);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s var(--ease-out);
    max-width: 90vw;
    text-align: center;
}

.celestial-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================================================================
   WEATHER FORECAST TOAST — Beautiful GENUX Design
   ============================================================================ */

.weather-forecast-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(120px) scale(0.9);
    background: linear-gradient(
        135deg,
        rgba(20, 20, 18, 0.98) 0%,
        rgba(30, 28, 24, 0.98) 100%
    );
    border: 1px solid var(--gold);
    border-radius: 20px;
    padding: 20px 28px;
    color: var(--text-primary);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(212, 175, 55, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 220px;
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.weather-forecast-toast.show {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
}

.weather-forecast-toast::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 21px;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(212, 175, 55, 0.3) 0%,
        rgba(212, 175, 55, 0.1) 50%,
        rgba(212, 175, 55, 0.3) 100%
    );
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.wft-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.wft-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.wft-condition {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

.wft-temp-main {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin: 8px 0;
    line-height: 1;
}

.wft-current {
    font-size: 3.5rem;
    font-weight: 300;
    font-family: var(--font-mono);
    color: var(--text-primary);
    letter-spacing: -2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.wft-unit {
    font-size: 1.25rem;
    color: var(--text-tertiary);
    margin-left: 2px;
    margin-top: 8px;
    font-weight: 400;
}

.wft-highlow {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 12px 0;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.wft-high {
    font-size: var(--text-base);
    color: #ff9f43;
    font-weight: 500;
    font-family: var(--font-mono);
}

.wft-low {
    font-size: var(--text-base);
    color: #74b9ff;
    font-weight: 500;
    font-family: var(--font-mono);
}

.wft-sun-times {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 8px;
}

.wft-sunrise,
.wft-sunset {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Animation for temperature digits */
@keyframes temp-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.wft-current {
    animation: temp-pulse 3s ease-in-out infinite;
}

/* ============================================================================
   SECRET TOAST — Easter Egg Notifications
   ============================================================================ */

.secret-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(120px) scale(0.9);
    background: linear-gradient(135deg, rgba(40, 30, 20, 0.98), rgba(30, 25, 18, 0.98));
    border: 2px solid;
    border-radius: 16px;
    padding: 20px 28px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(139, 69, 19, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 10001;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 420px;
    backdrop-filter: blur(12px);
}

.secret-toast.show {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
}

/* Monmouth Coffee specific styling */
.monmouth-toast {
    border-color: #8B4513;
    background: linear-gradient(135deg, 
        rgba(60, 40, 25, 0.98), 
        rgba(40, 28, 18, 0.98)
    );
}

.secret-toast .toast-emoji {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: toast-emoji-bounce 0.6s ease-out;
}

@keyframes toast-emoji-bounce {
    0% { transform: scale(0) rotate(-20deg); }
    50% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0); }
}

.secret-toast .toast-content {
    flex: 1;
    text-align: left;
}

.secret-toast .toast-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: #D2691E;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.secret-toast .toast-subtitle {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.secret-toast .toast-trivia {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    font-style: italic;
    padding: 8px 12px;
    background: rgba(139, 69, 19, 0.15);
    border-left: 3px solid #8B4513;
    border-radius: 0 8px 8px 0;
    margin-bottom: 8px;
}

.secret-toast .toast-founded {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Home toast specific styling */
.home-toast {
    border-color: #22c55e;
    background: linear-gradient(135deg, 
        rgba(30, 50, 35, 0.98), 
        rgba(20, 35, 25, 0.98)
    );
}

.home-toast .toast-title {
    color: #4ade80;
}

.home-toast .toast-trivia {
    background: rgba(34, 197, 94, 0.15);
    border-left-color: #22c55e;
}

/* Home mode — warm green glow */
.home-mode .compass-sundial {
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(34, 197, 94, 0.15);
}

.home-mode .compass-gnomon {
    box-shadow:
        0 0 10px rgba(34, 197, 94, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Coffee steam animation for Monmouth mode */
.monmouth-mode .compass-sundial::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 50%;
    width: 40px;
    height: 60px;
    transform: translateX(-50%);
    background: 
        radial-gradient(ellipse at 30% 100%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 100%, rgba(255,255,255,0.08) 0%, transparent 50%);
    animation: coffee-steam 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 1000;
}

@keyframes coffee-steam {
    0%, 100% { 
        opacity: 0;
        transform: translateX(-50%) translateY(0) scaleY(0.8);
    }
    50% { 
        opacity: 0.6;
        transform: translateX(-50%) translateY(-20px) scaleY(1.2);
    }
}

/* Nav settings container */
.nav-settings {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Temperature unit toggle */
.unit-toggle {
    display: flex;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--gold-faint);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.unit-btn {
    padding: 4px 10px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-144) var(--ease-smooth);
}

.unit-btn:hover {
    color: var(--gold);
}

.unit-btn.active {
    background: var(--gold);
    color: var(--void);
}

[dir="rtl"] .nav-settings {
    flex-direction: row-reverse;
}

@media (max-width: 768px) {
    .nav-settings {
        gap: var(--space-2);
    }
    
    .unit-toggle {
        order: -1;
    }
}


/* Glass dome effect - purely decorative */
.compass-glass {
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    background:
        radial-gradient(ellipse 80% 60% at 30% 25%, rgba(255, 255, 255, 0.12) 0%, transparent 60%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 30%, transparent 50%);
    pointer-events: none;
    z-index: 80;
    box-shadow: inset 0 4px 16px rgba(255, 255, 255, 0.06);
}

/* ============================================================================
   GLOBE BACKGROUND — Real 3D Earth centered on location (Three.js)
   ============================================================================ */

.compass-globe-bg {
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    z-index: 1;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.85) rotateX(10deg);
    transition: 
        opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    perspective: 800px;
}

.compass-globe {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
}

/* Outer atmospheric glow ring */
.compass-globe-bg::before {
    content: '';
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        transparent 45%,
        rgba(68, 136, 255, 0.12) 55%,
        rgba(68, 136, 255, 0.2) 65%,
        rgba(68, 136, 255, 0.08) 75%,
        transparent 85%
    );
    pointer-events: none;
    z-index: -1;
    animation: atmosphere-pulse 4s ease-in-out infinite;
}

@keyframes atmosphere-pulse {
    0%, 100% { 
        opacity: 0.8;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.02);
    }
}

.secret-emoji-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 6;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.secret-emoji-layer.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.secret-emoji {
    position: absolute;
    left: 50%;
    top: 50%;
    font-size: clamp(22px, 2vw, 30px);
    color: #fff;
    text-shadow:
        0 12px 18px rgba(0,0,0,0.45),
        0 4px 8px rgba(0,0,0,0.35);
    --offset-x: 0px;
    --offset-y: 0px;
    --emoji-scale: 1;
    transform: translate(-50%, -50%) translate(var(--offset-x), var(--offset-y)) scale(var(--emoji-scale));
    animation: secret-emoji-float 3.2s ease-in-out infinite;
    cursor: pointer;
    transition: filter 0.25s ease;
}

.secret-emoji:nth-child(2) {
    animation-delay: 0.25s;
}

.secret-emoji::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 70%);
    opacity: 0.45;
    filter: blur(6px);
    pointer-events: none;
}

.secret-emoji:hover {
    filter: drop-shadow(0 16px 26px rgba(0,0,0,0.55));
}

@keyframes secret-emoji-float {
    0% { transform: translate(-50%, -50%) translate(var(--offset-x), var(--offset-y)) scale(var(--emoji-scale)); }
    50% { transform: translate(-50%, -50%) translate(var(--offset-x), calc(var(--offset-y) - 6px)) scale(var(--emoji-scale)); }
    100% { transform: translate(-50%, -50%) translate(var(--offset-x), var(--offset-y)) scale(var(--emoji-scale)); }
}

/* Subtle gold rim highlight */
.compass-globe-bg::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.15);
    pointer-events: none;
    box-shadow: 
        inset 0 0 20px rgba(212, 175, 55, 0.05),
        0 0 30px rgba(68, 136, 255, 0.1);
}

/* Show globe on compass hover/focus */
.compass-sundial:hover .compass-globe-bg,
.compass-sundial:focus-within .compass-globe-bg {
    opacity: 1;
    transform: scale(1) rotateX(0deg);
}

/* Fade hour lines when globe is visible */
.compass-sundial:hover .compass-hour-lines,
.compass-sundial:focus-within .compass-hour-lines {
    opacity: 0.3;
}

/* Pedestal base - hidden for flat design */
.compass-pedestal {
    display: none;
}

/* Hint text */
.compass-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    opacity: 0.7;
    transition: opacity var(--duration-233) var(--ease-out);
}

.compass-hint-icon {
    font-size: 16px;
}

.compass-sundial.orientation-active + .compass-hint {
    opacity: 0;
}

/* Legacy sun element (hidden) */
.hero-sun {
    display: none;
}

/* Scroll indicator */
/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--duration-233) var(--ease-out);
    text-decoration: none;
}

.scroll-indicator:hover {
    color: var(--gold);
}

.scroll-indicator:hover .scroll-arrow {
    transform: translateY(4px);
    color: var(--gold);
}

.scroll-indicator span {
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 500;
}

.scroll-arrow {
    color: var(--gold-dim);
    transition: all var(--duration-233) var(--ease-out);
    animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ========================================
 * NAVIGATION
 * ======================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(7, 6, 11, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: var(--z-nav);
    transform: translateY(-100%);
    transition: transform var(--duration-377) var(--ease-out);
}

.nav.visible {
    transform: translateY(0);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) var(--space-4);
    max-width: 1400px;
    margin: 0 auto;
}

.nav-logo {
    font-size: var(--text-lg);
    color: var(--gold);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--duration-233) var(--ease-out);
}

.nav-logo:hover {
    text-shadow: 0 0 20px var(--gold-glow);
}

.nav-links {
    display: flex;
    gap: var(--space-4);
}

.nav-link {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--duration-144) var(--ease-out);
    position: relative;
    padding: var(--space-1) 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--gold);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--duration-233) var(--ease-out);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Hamburger menu button */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: var(--space-2);
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 101;
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
    transition: all var(--duration-233) var(--ease-out);
    transform-origin: center;
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(7, 6, 11, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--space-4);
        opacity: 0;
        visibility: hidden;
        transition: all var(--duration-377) var(--ease-out);
        z-index: 100;
    }

    .nav-links.open {
        opacity: 1;
        visibility: visible;
    }

    .nav-links .nav-link {
        font-size: var(--text-2xl);
        font-family: var(--font-display);
        transform: translateY(20px);
        opacity: 0;
        transition: all var(--duration-377) var(--ease-out);
    }

    .nav-links.open .nav-link {
        transform: translateY(0);
        opacity: 1;
    }

    .nav-links.open .nav-link:nth-child(1) { transition-delay: 50ms; }
    .nav-links.open .nav-link:nth-child(2) { transition-delay: 100ms; }
    .nav-links.open .nav-link:nth-child(3) { transition-delay: 150ms; }
    .nav-links.open .nav-link:nth-child(4) { transition-delay: 200ms; }
    .nav-links.open .nav-link:nth-child(5) { transition-delay: 250ms; }
}

/* ========================================
 * SECTIONS
 * ======================================== */
.section {
    padding: var(--space-16) 0;
    position: relative;
}

.section-alt {
    background: linear-gradient(180deg, var(--void-light) 0%, var(--void) 100%);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.section-number {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--gold);
    margin-bottom: var(--space-2);
    letter-spacing: 0.3em;
    position: relative;
}

.section-number::before,
.section-number::after {
    content: '—';
    margin: 0 var(--space-2);
    opacity: 0.4;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(var(--text-3xl), 6vw, var(--text-5xl));
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: var(--space-3);
}

.section-title em {
    font-style: italic;
    color: var(--gold);
}

.section-description {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ========================================
 * CARDS
 * ======================================== */
.card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    position: relative;
    overflow: hidden;
    transition:
        transform calc(var(--duration-377) * var(--atmosphere-timing)) var(--ease-spring),
        border-color calc(var(--duration-233) * var(--atmosphere-timing)) var(--ease-out),
        box-shadow calc(var(--duration-377) * var(--atmosphere-timing)) var(--ease-out);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
    opacity: 0;
    transition: opacity var(--duration-233) var(--ease-out);
}

.card:hover {
    transform: translateY(-6px);
    border-color: var(--border-gold);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--gold-faint), transparent);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--duration-233) var(--ease-out);
}

.card:hover .card-icon {
    background: linear-gradient(135deg, var(--gold-glow), transparent);
    box-shadow: 0 0 20px var(--gold-subtle);
}

.card-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--gold);
    stroke-width: 1.5;
    fill: none;
}

.card-title {
    font-size: var(--text-lg);
    font-weight: 500;
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.card-body {
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: 1.7;
}

/* ========================================
 * CODE BLOCKS
 * ======================================== */
.code-block {
    background: var(--void);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--duration-233) var(--ease-out);
}

.code-block:hover {
    border-color: var(--border-gold);
    box-shadow: 0 0 30px var(--gold-subtle);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-2) var(--space-3);
    background: var(--void-lighter);
    border-bottom: 1px solid var(--border-subtle);
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-tertiary);
    transition: all var(--duration-144) var(--ease-out);
}

.code-block:hover .code-dot:nth-child(1) { background: #FF5F56; }
.code-block:hover .code-dot:nth-child(2) { background: #FFBD2E; }
.code-block:hover .code-dot:nth-child(3) { background: #27CA40; }

.code-title {
    margin-left: var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.code-content {
    padding: var(--space-3);
    overflow-x: auto;
}

.code-content pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.8;
}

.code-comment { color: var(--text-tertiary); }
.code-keyword { color: var(--info); }
.code-function { color: var(--gold); }
.code-string { color: var(--success); }
.code-number { color: var(--sun); }
.code-param { color: var(--text-secondary); }

/* ========================================
 * DIAGRAMS
 * ======================================== */
.diagram {
    background: linear-gradient(135deg, var(--void-light), var(--void));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin: var(--space-6) 0;
    position: relative;
    overflow: hidden;
}

.diagram::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.diagram-title {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-4);
    text-align: center;
}

/* Sun Path Diagram */
.sun-path-diagram {
    position: relative;
    height: 300px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: var(--space-4);
}

.sun-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    background: var(--sun);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--sun-glow);
    transform: translate(-50%, -50%);
    transition: all var(--duration-610) var(--ease-out);
    z-index: 10;
}

.sun-marker::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--sun-glow), transparent 70%);
    animation: sun-corona 2s ease-in-out infinite;
}

.direction-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.direction-n { background: var(--north); color: var(--void); }
.direction-s { background: var(--south); color: var(--void); }
.direction-e { background: var(--east); color: var(--void); }
.direction-w { background: var(--west); color: var(--void); }

/* ========================================
 * FORMULA DISPLAY
 * ======================================== */
.formula {
    background: linear-gradient(90deg, var(--gold-subtle), transparent);
    border-left: 3px solid var(--gold);
    padding: var(--space-4);
    margin: var(--space-4) 0;
    font-family: var(--font-mono);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    position: relative;
    overflow: hidden;
}

.formula::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100px;
    background: linear-gradient(90deg, transparent, var(--void));
    pointer-events: none;
}

.formula-title {
    font-size: var(--text-sm);
    color: var(--gold);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.formula-content {
    font-size: var(--text-lg);
    color: var(--text-primary);
    white-space: nowrap;
    overflow-x: auto;
    padding-bottom: var(--space-1);
}

.formula-description {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-top: var(--space-2);
    font-family: var(--font-sans);
}

/* ========================================
 * INTERACTIVE CONTROLS
 * ======================================== */
.control-panel {
    background: linear-gradient(135deg, var(--void-light), var(--void));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.control-group {
    margin-bottom: var(--space-4);
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.control-value {
    font-family: var(--font-mono);
    color: var(--gold);
}

.slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--void);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-144) var(--ease-out);
}

.slider:hover {
    border-color: var(--border-gold);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 44px;
    height: 44px;
    background: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--gold-glow);
    transition: all var(--duration-144) var(--ease-spring);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px var(--gold-glow);
}

.slider::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 44px;
    height: 44px;
    background: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px var(--gold-glow);
}

/* ========================================
 * TIMELINE
 * ======================================== */
.timeline {
    position: relative;
    padding-left: var(--space-8);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--gold), var(--gold-dim), var(--gold-faint));
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-6);
    transition: all var(--duration-233) var(--ease-out);
}

.timeline-item:hover {
    transform: translateX(8px);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: calc(-1 * var(--space-8) + 8px);
    width: 18px;
    height: 18px;
    background: var(--void);
    border: 2px solid var(--gold);
    border-radius: 50%;
    z-index: 1;
    transition: all var(--duration-233) var(--ease-out);
}

.timeline-item:hover .timeline-marker {
    background: var(--gold);
    box-shadow: 0 0 15px var(--gold-glow);
    transform: scale(1.2);
}

.timeline-time {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--gold);
    display: block;
    margin-bottom: var(--space-1);
    letter-spacing: 0.05em;
}

.timeline-title {
    font-size: var(--text-lg);
    font-weight: 500;
    margin-bottom: var(--space-1);
}

.timeline-description {
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: 1.7;
}

/* ========================================
 * LIVE DEMO SECTION
 * ======================================== */
.live-demo {
    background: linear-gradient(135deg, var(--void), var(--void-light));
    border: 2px solid var(--border-gold);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    position: relative;
    overflow: hidden;
}

.live-demo::before {
    content: 'LIVE';
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    color: var(--success);
    background: rgba(78, 203, 113, 0.15);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(78, 203, 113, 0.3);
    animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 rgba(78, 203, 113, 0); }
    50% { opacity: 0.7; box-shadow: 0 0 10px rgba(78, 203, 113, 0.3); }
}

.live-demo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), var(--success), var(--gold));
    background-size: 200% 100%;
    animation: gradient-slide 3s linear infinite;
}

@keyframes gradient-slide {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.demo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
}

@media (max-width: 768px) {
    .demo-grid {
        grid-template-columns: 1fr;
    }
}

.demo-visualization {
    min-height: 300px;
    background: radial-gradient(circle at center, var(--void-lighter), var(--void));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.demo-output {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

.output-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--duration-144) var(--ease-out);
}

.output-row:hover {
    background: var(--gold-subtle);
    padding-left: var(--space-2);
    padding-right: var(--space-2);
    margin: 0 calc(-1 * var(--space-2));
    border-radius: var(--radius-sm);
}

.output-row:last-child {
    border-bottom: none;
}

.output-label {
    color: var(--text-secondary);
}

.output-value {
    color: var(--text-primary);
    font-weight: 500;
}

.output-value.warning {
    color: var(--warning);
}

.output-value.good {
    color: var(--success);
}

/* ========================================
 * CALLOUTS
 * ======================================== */
.callout {
    background: linear-gradient(90deg, var(--gold-subtle), transparent);
    border-left: 3px solid var(--gold);
    padding: var(--space-4);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: var(--space-4) 0;
    position: relative;
}

.callout-title {
    font-weight: 600;
    color: var(--gold);
    margin-bottom: var(--space-1);
    font-size: var(--text-base);
}

.callout-content {
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: 1.7;
}

.callout-content code {
    background: var(--void);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--gold);
}

.callout.info {
    background: linear-gradient(90deg, rgba(100, 217, 255, 0.1), transparent);
    border-left-color: var(--info);
}

.callout.info .callout-title {
    color: var(--info);
}

.callout.warning {
    background: linear-gradient(90deg, rgba(255, 171, 64, 0.1), transparent);
    border-left-color: var(--warning);
}

.callout.warning .callout-title {
    color: var(--warning);
}

/* ========================================
 * GRIDS
 * ======================================== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
}

@media (max-width: 1024px) {
    .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
 * TABLES
 * ======================================== */
.table-wrapper {
    overflow-x: auto;
    margin: var(--space-4) 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.data-table th,
.data-table td {
    padding: var(--space-2) var(--space-3);
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
    font-weight: 500;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: var(--text-xs);
    background: var(--void-lighter);
    position: sticky;
    top: 0;
}

.data-table td {
    color: var(--text-secondary);
}

.data-table tbody tr {
    transition: all var(--duration-144) var(--ease-out);
}

.data-table tbody tr:hover {
    background: var(--gold-subtle);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

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

/* ========================================
 * SHADE INDICATOR
 * ======================================== */
.shade-indicator {
    display: inline-block;
    width: 50px;
    height: 8px;
    background: var(--void);
    border-radius: var(--radius-full);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.shade-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--warning));
    border-radius: var(--radius-full);
    transition: width var(--duration-377) var(--ease-out);
}

/* ========================================
 * FOOTER
 * ======================================== */
.footer {
    padding: var(--space-12) 0 var(--space-6);
    text-align: center;
    border-top: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, var(--void), var(--void-light));
}

.footer-kanji {
    font-size: var(--text-5xl);
    margin-bottom: var(--space-2);
    cursor: default;
    transition: all var(--duration-377) var(--ease-out);
}

.footer-kanji:hover {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 20px var(--sun-glow));
}

.footer-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    color: var(--gold);
    margin-bottom: var(--space-1);
}

.footer-subtitle {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-6);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.footer-link {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
    transition: all var(--duration-144) var(--ease-out);
}

.footer-link:hover {
    color: var(--gold);
    background: var(--gold-subtle);
}

.footer-meta {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
}

/* ========================================
 * ANIMATIONS
 * ======================================== */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity calc(var(--duration-610) * var(--atmosphere-timing)) var(--ease-out),
        transform calc(var(--duration-610) * var(--atmosphere-timing)) var(--ease-out);
}

[data-reveal].visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered reveals */
[data-reveal-delay="1"] { transition-delay: 100ms; }
[data-reveal-delay="2"] { transition-delay: 200ms; }
[data-reveal-delay="3"] { transition-delay: 300ms; }
[data-reveal-delay="4"] { transition-delay: 400ms; }
[data-reveal-delay="5"] { transition-delay: 500ms; }

/* Loading state — Dramatic sun-rise entrance */
body.loading {
    overflow: hidden;
}

body.loading .hero-content {
    opacity: 0;
    transform: translateY(40px);
}

body.loading .hero-sun {
    opacity: 0;
    transform: translateY(200px) scale(0.5);
    filter: blur(20px);
}

body.loading .hero-badge {
    opacity: 0;
    transform: translateY(20px);
}

body.loading .hero-title {
    opacity: 0;
    transform: translateY(30px);
}

body.loading .hero-subtitle {
    opacity: 0;
    transform: translateY(30px);
}

body.loading .hero-stats {
    opacity: 0;
    transform: translateY(30px);
}

body.loading .scroll-indicator {
    opacity: 0;
}

/* Entrance animation sequence */
body:not(.loading) .hero-sun {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    transition:
        opacity var(--duration-987) var(--ease-out-expo),
        transform var(--duration-1597) var(--ease-out-expo),
        filter var(--duration-987) var(--ease-out);
    transition-delay: 100ms;
}

body:not(.loading) .hero-content {
    opacity: 1;
    transform: translateY(0);
    transition: all var(--duration-987) var(--ease-out);
    transition-delay: 400ms;
}

body:not(.loading) .hero-badge {
    opacity: 1;
    transform: translateY(0);
    transition: all var(--duration-610) var(--ease-out-expo);
    transition-delay: 500ms;
}

body:not(.loading) .hero-title {
    opacity: 1;
    transform: translateY(0);
    transition: all var(--duration-987) var(--ease-out-expo);
    transition-delay: 600ms;
}

body:not(.loading) .hero-subtitle {
    opacity: 1;
    transform: translateY(0);
    transition: all var(--duration-610) var(--ease-out);
    transition-delay: 800ms;
}

body:not(.loading) .hero-stats {
    opacity: 1;
    transform: translateY(0);
    transition: all var(--duration-610) var(--ease-out);
    transition-delay: 1000ms;
}

body:not(.loading) .scroll-indicator {
    opacity: 1;
    transition: opacity var(--duration-610) var(--ease-out);
    transition-delay: 1200ms;
}

/* Count-up animation for stats */
.stat-value[data-count] {
    display: inline-block;
}

/* Typing cursor */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--gold);
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Konami unlock animation */
.konami-unlocked {
    animation: konami-flash 0.5s ease-out;
}

@keyframes konami-flash {
    0%, 100% { filter: none; }
    50% { filter: hue-rotate(180deg) brightness(1.5); }
}

/* Success checkmark animation */
.check-animation {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: draw-check var(--duration-377) var(--ease-out) forwards;
}

@keyframes draw-check {
    to { stroke-dashoffset: 0; }
}

/* ========================================
 * CELESTIAL SKY — Sun, Moon, and Sundial
 * Luxury astronomical timepiece aesthetic
 * ======================================== */

.celestial-sky {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* ========================================
 * CELESTIAL SUN
 * ======================================== */
.celestial-sun {
    --sun-hue: 45;
    --sun-saturation: 95%;
    --sun-lightness: 55%;
    --sun-scale: 1;

    position: absolute;
    width: 80px;
    height: 80px;
    transform: translate(-50%, -50%) scale(var(--sun-scale));
    pointer-events: auto;
    cursor: pointer;
    z-index: 10;
    transition:
        left var(--duration-987) var(--ease-smooth),
        top var(--duration-987) var(--ease-smooth),
        opacity var(--duration-610) var(--ease-out),
        transform var(--duration-377) var(--ease-spring);
}

.celestial-sun:hover {
    transform: translate(-50%, -50%) scale(calc(var(--sun-scale) * 1.15));
}

.celestial-sun:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 8px;
    border-radius: 50%;
}

.celestial-sun .sun-core {
    position: absolute;
    inset: 15%;
    border-radius: 50%;
    background: radial-gradient(
        circle at 35% 35%,
        hsl(var(--sun-hue), 80%, 85%) 0%,
        hsl(var(--sun-hue), var(--sun-saturation), var(--sun-lightness)) 40%,
        hsl(calc(var(--sun-hue) - 15), 100%, 45%) 100%
    );
    box-shadow:
        0 0 40px hsla(var(--sun-hue), 100%, 60%, 0.6),
        0 0 80px hsla(var(--sun-hue), 100%, 50%, 0.3),
        inset -8px -8px 20px hsla(calc(var(--sun-hue) - 20), 100%, 40%, 0.4);
    animation: sun-core-pulse 4s ease-in-out infinite;
}

@keyframes sun-core-pulse {
    0%, 100% {
        box-shadow:
            0 0 40px hsla(var(--sun-hue), 100%, 60%, 0.6),
            0 0 80px hsla(var(--sun-hue), 100%, 50%, 0.3),
            inset -8px -8px 20px hsla(calc(var(--sun-hue) - 20), 100%, 40%, 0.4);
    }
    50% {
        box-shadow:
            0 0 60px hsla(var(--sun-hue), 100%, 60%, 0.8),
            0 0 120px hsla(var(--sun-hue), 100%, 50%, 0.4),
            inset -8px -8px 20px hsla(calc(var(--sun-hue) - 20), 100%, 40%, 0.4);
    }
}

.celestial-sun .sun-corona {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        hsla(var(--sun-hue), 100%, 60%, 0.4) 0%,
        hsla(var(--sun-hue), 100%, 50%, 0.2) 40%,
        transparent 70%
    );
    animation: sun-corona-breathe 3s ease-in-out infinite;
    filter: blur(8px);
}

@keyframes sun-corona-breathe {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 0.9; }
}

.celestial-sun .sun-rays {
    position: absolute;
    inset: -30%;
    background:
        repeating-conic-gradient(
            from 0deg,
            hsla(var(--sun-hue), 100%, 60%, 0.15) 0deg,
            transparent 3deg,
            transparent 12deg,
            hsla(var(--sun-hue), 100%, 60%, 0.15) 15deg
        );
    border-radius: 50%;
    animation: sun-rays-rotate 60s linear infinite;
    filter: blur(2px);
}

@keyframes sun-rays-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.celestial-sun.below-horizon {
    filter: saturate(0.5) brightness(0.6);
}

.celestial-sun.twilight .sun-core {
    background: radial-gradient(
        circle at 35% 35%,
        hsl(25, 100%, 70%) 0%,
        hsl(15, 100%, 50%) 50%,
        hsl(5, 100%, 35%) 100%
    );
}

/* ========================================
 * CELESTIAL MOON
 * ======================================== */
.celestial-moon {
    --moon-glow: 0.5;

    position: absolute;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    z-index: 9;
    transition:
        left var(--duration-987) var(--ease-smooth),
        top var(--duration-987) var(--ease-smooth),
        opacity var(--duration-610) var(--ease-out),
        transform var(--duration-377) var(--ease-spring);
}

.celestial-moon:hover {
    transform: translate(-50%, -50%) scale(1.15);
}

.celestial-moon:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 8px;
    border-radius: 50%;
}

.celestial-moon .moon-surface {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 25%, #E8E4D9 0%, #C5C0B0 40%, #9A9588 80%, #7A756A 100%);
    box-shadow:
        inset -6px -6px 15px rgba(0, 0, 0, 0.3),
        inset 4px 4px 10px rgba(255, 255, 255, 0.1);
    /* Subtle crater texture */
    background-image:
        radial-gradient(circle at 20% 30%, rgba(0,0,0,0.08) 0%, transparent 8%),
        radial-gradient(circle at 55% 25%, rgba(0,0,0,0.06) 0%, transparent 6%),
        radial-gradient(circle at 70% 55%, rgba(0,0,0,0.1) 0%, transparent 10%),
        radial-gradient(circle at 35% 65%, rgba(0,0,0,0.07) 0%, transparent 7%),
        radial-gradient(circle at 80% 35%, rgba(0,0,0,0.05) 0%, transparent 5%),
        radial-gradient(circle at 45% 80%, rgba(0,0,0,0.08) 0%, transparent 9%),
        radial-gradient(circle at 30% 25%, #E8E4D9 0%, #C5C0B0 40%, #9A9588 80%, #7A756A 100%);
}

.celestial-moon .moon-phase-shadow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    transition: background var(--duration-610) var(--ease-smooth);
}

.celestial-moon .moon-glow {
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(200, 200, 220, calc(var(--moon-glow) * 0.3)) 0%,
        rgba(180, 180, 200, calc(var(--moon-glow) * 0.15)) 40%,
        transparent 70%
    );
    filter: blur(10px);
    pointer-events: none;
}

.celestial-moon.below-horizon {
    filter: brightness(0.4) saturate(0.5);
}

/* Moon phase dataset styles */
.celestial-moon[data-phase="new-moon"] .moon-glow {
    opacity: 0.2;
}

.celestial-moon[data-phase="full-moon"] .moon-glow {
    opacity: 1;
    box-shadow: 0 0 40px rgba(200, 200, 220, 0.4);
}

/* ========================================
 * SUNDIAL — Luxury Astronomical Timepiece
 * ======================================== */
.sundial {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(160px, 28vw, 260px);  /* Larger, more prominent */
    aspect-ratio: 1;
    pointer-events: auto;
    z-index: 15;
}

.sundial-face {
    --ambient-light: 1;

    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(
            circle at 30% 30%,
            rgba(212, 175, 55, calc(0.15 * var(--ambient-light))) 0%,
            rgba(139, 115, 36, calc(0.08 * var(--ambient-light))) 50%,
            rgba(90, 75, 24, calc(0.05 * var(--ambient-light))) 100%
        ),
        linear-gradient(
            135deg,
            rgba(255, 255, 255, calc(0.08 * var(--ambient-light))) 0%,
            transparent 50%,
            rgba(0, 0, 0, calc(0.1 * var(--ambient-light))) 100%
        ),
        #1a1815;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.05),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(212, 175, 55, 0.4);
    transition:
        box-shadow var(--duration-377) var(--ease-out),
        border-color var(--duration-377) var(--ease-out);
}

.sundial:hover .sundial-face {
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.6),
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(212, 175, 55, 0.15),
        inset 0 2px 4px rgba(255, 255, 255, 0.08),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    border-color: rgba(212, 175, 55, 0.6);
}

/* Decorative rings */
.sundial-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.25);
}

.sundial-ring-outer {
    inset: 8%;
}

.sundial-ring-inner {
    inset: 20%;
    border-style: dashed;
    border-color: rgba(212, 175, 55, 0.15);
}

/* Hour markers - simplified, only cardinals have labels */
.sundial-hour-markers {
    position: absolute;
    inset: 0;
}

.sundial-hour-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center center;
}

.sundial-hour-marker.cardinal {
    /* Position at outer edge, rotate to angle, then move outward */
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-50% + 8px));
}

.sundial-numeral {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(12px, 2.2vw, 18px);
    font-weight: 600;
    color: var(--gold-bright);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    transform: rotate(calc(-1 * var(--angle)));
    display: block;
    line-height: 1;
}

/* Subtle tick marks for non-cardinal hours */
.sundial-tick-only {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 8px;
    background: var(--gold-dim);
    transform-origin: center bottom;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-38px);
    opacity: 0.4;
}

/* Center ornament */
.sundial-center-ornament {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background:
        radial-gradient(
            circle at 30% 30%,
            var(--gold-bright) 0%,
            var(--gold) 50%,
            #8B7424 100%
        );
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    z-index: 5;
}

/* Gnomon (shadow caster) */
.sundial-gnomon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 35%;
    transform: translate(-50%, -100%);
    transform-origin: bottom center;
    background:
        linear-gradient(
            90deg,
            #4A3C1A 0%,
            #8B7424 30%,
            var(--gold) 50%,
            #8B7424 70%,
            #4A3C1A 100%
        );
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 4;
}

/* Shadow - THE CORE VISUAL MECHANISM */
.sundial-shadow {
    --shadow-rotation: 0deg;
    --shadow-length: 90%;

    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;  /* Thicker, more visible */
    height: var(--shadow-length);
    transform: translate(-50%, 0) rotate(var(--shadow-rotation));
    transform-origin: top center;
    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.85) 0%,
            rgba(0, 0, 0, 0.7) 20%,
            rgba(0, 0, 0, 0.5) 50%,
            rgba(0, 0, 0, 0.25) 80%,
            transparent 100%
        );
    border-radius: 0 0 3px 3px;
    z-index: 3;
    transition:
        transform var(--duration-987) var(--ease-smooth),  /* Slower, smoother */
        opacity var(--duration-377) var(--ease-out);
    filter: blur(2px);  /* Slightly more diffuse */
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);  /* Soft shadow around shadow */
}

/* Sundial base */
.sundial-base {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 8px;
    background:
        linear-gradient(
            to bottom,
            rgba(212, 175, 55, 0.3) 0%,
            rgba(90, 75, 24, 0.2) 100%
        );
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* ========================================
 * CELESTIAL INFO PANEL - REMOVED
 * Focus on visual mechanism, not text
 * ======================================== */
.celestial-info {
    display: none !important;
}

/* ========================================
 * RESPONSIVE ADJUSTMENTS
 * ======================================== */
@media (max-width: 768px) {
    .celestial-sun {
        width: 60px;
        height: 60px;
    }

    .celestial-moon {
        width: 45px;
        height: 45px;
    }

    .sundial {
        width: clamp(140px, 35vw, 200px);  /* Still prominent on tablet */
        bottom: 10%;
    }
}

@media (max-width: 480px) {
    .celestial-sun {
        width: 50px;
        height: 50px;
    }

    .celestial-moon {
        width: 35px;
        height: 35px;
    }

    .sundial {
        width: clamp(100px, 45vw, 140px);  /* Still visible on mobile */
        bottom: 12%;
    }

    .sundial-numeral {
        font-size: 10px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .celestial-sun,
    .celestial-moon,
    .sundial-shadow {
        transition: none;
    }

    .celestial-sun .sun-core,
    .celestial-sun .sun-corona,
    .celestial-sun .sun-rays {
        animation: none;
    }
}

/* ========================================
 * DEVICE ORIENTATION — Compass & Leveling
 * ======================================== */

/* Sundial orientation enabled state */
.sundial.orientation-enabled {
    box-shadow: 0 0 20px rgba(100, 217, 255, 0.3);
}

.sundial.orientation-enabled .sundial-face {
    border-color: rgba(100, 217, 255, 0.5);
    transform-style: preserve-3d;
    perspective: 500px;
}

/* Level indicator */
.sundial.is-level .sundial-face {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 25px rgba(78, 203, 113, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.05);
    border-color: rgba(78, 203, 113, 0.6);
}

/* Orientation indicator badge */
.orientation-indicator {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--surface-elevated);
    border: 2px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    z-index: 10;
    animation: orientation-pulse 2s ease-in-out infinite;
}

@keyframes orientation-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Celestial container compass rotation */
.celestial-sky {
    --compass-rotation: 0deg;
}

.celestial-sky.compass-active {
    transform: rotate(var(--compass-rotation));
    transition: transform 150ms ease-out;
}

/* Touch feedback for tap-to-enable */
.sundial:active:not(.orientation-enabled) {
    transform: scale(0.98);
}

.sundial:not(.orientation-enabled)::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(
        circle at center,
        rgba(100, 217, 255, 0.1) 0%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity var(--duration-233) ease;
    pointer-events: none;
}

.sundial:not(.orientation-enabled):hover::after {
    opacity: 1;
}

/* Mobile-specific: larger touch target hint */
@media (hover: none) and (pointer: coarse) {
    .sundial:not(.orientation-enabled) {
        /* Subtle pulsing hint on mobile that it's tappable */
        animation: sundial-tap-hint 3s ease-in-out infinite;
    }

    @keyframes sundial-tap-hint {
        0%, 100% { box-shadow: 0 0 0 0 rgba(100, 217, 255, 0); }
        50% { box-shadow: 0 0 0 8px rgba(100, 217, 255, 0.15); }
    }
}

/* ========================================
 * CELESTIAL VOICE — Clickable Sun Styles
 * ======================================== */

/* Make sun elements interactive */
.hero-sun,
.celestial-sun,
.sun-marker {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Focus ring for keyboard navigation */
.hero-sun:focus-visible,
.celestial-sun:focus-visible,
.sun-marker:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 8px;
}

/* Hover enhancement */
.hero-sun:hover,
.celestial-sun:hover {
    filter: brightness(1.1) saturate(1.1);
}

/* Active state - slight press effect */
.hero-sun:active,
.celestial-sun:active,
.sun-marker:active {
    transform: scale(0.98);
}

/* Speaking state - pulsing glow when voice is active */
.hero-sun.speaking,
.celestial-sun.speaking {
    animation: voice-pulse 1s ease-in-out infinite;
}

@keyframes voice-pulse {
    0%, 100% {
        box-shadow:
            0 0 60px var(--sun-glow),
            0 0 120px rgba(255, 215, 0, 0.2),
            0 0 20px rgba(212, 175, 55, 0.5);
    }
    50% {
        box-shadow:
            0 0 80px var(--sun-glow),
            0 0 160px rgba(255, 215, 0, 0.4),
            0 0 40px rgba(212, 175, 55, 0.8);
    }
}

/* Moon clickable styles */
.celestial-moon {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.celestial-moon:focus-visible {
    outline: 2px solid var(--moon-bright);
    outline-offset: 4px;
}

.celestial-moon:hover {
    filter: brightness(1.15);
}

.celestial-moon:active {
    transform: scale(0.96);
}

/* Language selector styles moved to IMPROVED LANGUAGE SELECTOR section below */

/* ========================================
 * VR ENTER BUTTON (WebXR)
 * ======================================== */
.vr-enter-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(159, 122, 234, 0.9), rgba(99, 102, 241, 0.9));
    border: none;
    border-radius: 12px;
    color: white;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-233) var(--ease-smooth);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(159, 122, 234, 0.3);
    z-index: 100;
}

.vr-enter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(159, 122, 234, 0.5);
}

.vr-enter-btn:active {
    transform: translateY(0);
}

.vr-enter-btn svg {
    opacity: 0.9;
}

.vr-enter-btn.active {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9));
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.vr-enter-btn.active span {
    display: none;
}

.vr-enter-btn.active::after {
    content: 'Exit VR';
}

.vr-enter-btn:focus-visible {
    outline: 3px solid white;
    outline-offset: 2px;
}

/* Language selector styles in IMPROVED LANGUAGE SELECTOR section */

/* ========================================
 * RTL SUPPORT (Arabic, Hebrew)
 * ======================================== */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

/* Flip layout elements for RTL */
[dir="rtl"] .nav-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-links {
    flex-direction: row-reverse;
}

[dir="rtl"] .hero-stats {
    flex-direction: row-reverse;
}

[dir="rtl"] .stat-item::after {
    right: auto;
    left: calc(-1 * var(--space-4));
}

[dir="rtl"] .card-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .timeline {
    padding-left: 0;
    padding-right: var(--space-8);
}

[dir="rtl"] .timeline::before {
    left: auto;
    right: 16px;
}

[dir="rtl"] .timeline-marker {
    left: auto;
    right: calc(-1 * var(--space-8) + 8px);
}

[dir="rtl"] .timeline-item:hover {
    transform: translateX(-8px);
}

[dir="rtl"] .formula {
    border-left: none;
    border-right: 3px solid var(--gold);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    background: linear-gradient(270deg, var(--gold-subtle), transparent);
}

[dir="rtl"] .formula::after {
    right: auto;
    left: 0;
    background: linear-gradient(270deg, transparent, var(--void));
}

[dir="rtl"] .callout {
    border-left: none;
    border-right: 3px solid var(--gold);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    background: linear-gradient(270deg, var(--gold-subtle), transparent);
}

[dir="rtl"] .section-number::before {
    margin: 0 var(--space-2) 0 0;
}

[dir="rtl"] .section-number::after {
    margin: 0 0 0 var(--space-2);
}

[dir="rtl"] .lang-selector {
    margin-left: 0;
    margin-right: var(--space-3);
    padding-left: 0;
    padding-right: var(--space-3);
    border-left: none;
    border-right: 1px solid var(--gold-faint);
}

[dir="rtl"] .output-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .control-label {
    flex-direction: row-reverse;
}

[dir="rtl"] .footer-links {
    flex-direction: row-reverse;
}

[dir="rtl"] code {
    direction: ltr;
    unicode-bidi: embed;
}

[dir="rtl"] pre {
    direction: ltr;
    unicode-bidi: embed;
    text-align: left;
}

/* ========================================
 * IMPROVED LANGUAGE SELECTOR
 * ======================================== */
.lang-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.lang-selector-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid var(--gold-faint);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--duration-144) var(--ease-smooth);
}

.lang-selector-current:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-subtle);
}

.lang-selector-current .lang-flag {
    font-size: 16px;
    line-height: 1;
}

.lang-selector-current .lang-code {
    font-weight: 500;
    letter-spacing: 0.05em;
}

.lang-selector-current .lang-chevron {
    transition: transform var(--duration-144) var(--ease-smooth);
    opacity: 0.6;
}

.lang-selector.open .lang-selector-current .lang-chevron {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--void-lighter);
    border: 1px solid var(--gold-faint);
    border-radius: 8px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--duration-233) var(--ease-out);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    max-height: 320px;
    overflow-y: auto;
}

[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

.lang-selector.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown .lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all var(--duration-89) var(--ease-smooth);
    text-transform: none;
    letter-spacing: normal;
}

[dir="rtl"] .lang-dropdown .lang-option {
    text-align: right;
    flex-direction: row-reverse;
}

.lang-dropdown .lang-option:hover {
    background: var(--gold-subtle);
    color: var(--text-primary);
}

.lang-dropdown .lang-option.active {
    background: var(--gold-faint);
    color: var(--gold);
}

.lang-dropdown .lang-option .lang-flag {
    font-size: 18px;
    line-height: 1;
}

.lang-dropdown .lang-option .lang-native {
    font-weight: 500;
    flex: 1;
}

.lang-dropdown .lang-option .lang-name {
    font-size: 11px;
    color: var(--text-tertiary);
    opacity: 0.7;
}

/* ========================================
 * ENHANCED MICROINTERACTIONS
 * ======================================== */

/* Ripple effect on buttons */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease, opacity 0.6s ease;
    opacity: 0;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
    opacity: 1;
    transition: width 0s, height 0s, opacity 0s;
}

/* Pulse animation for live elements */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 var(--gold-glow);
    }
    50% {
        box-shadow: 0 0 20px 5px var(--gold-glow);
    }
}

.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Magnetic hover effect */
.magnetic {
    transition: transform var(--duration-144) var(--ease-smooth);
}

/* Smooth scale on focus */
.scale-focus:focus-visible {
    transform: scale(1.02);
}

/* Stagger animation for lists */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    animation: stagger-in var(--duration-377) var(--ease-out) forwards;
}

@keyframes stagger-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-item:nth-child(1) { animation-delay: 50ms; }
.stagger-item:nth-child(2) { animation-delay: 100ms; }
.stagger-item:nth-child(3) { animation-delay: 150ms; }
.stagger-item:nth-child(4) { animation-delay: 200ms; }
.stagger-item:nth-child(5) { animation-delay: 250ms; }
.stagger-item:nth-child(6) { animation-delay: 300ms; }
.stagger-item:nth-child(7) { animation-delay: 350ms; }
.stagger-item:nth-child(8) { animation-delay: 400ms; }

/* Bounce on click */
.bounce-click:active {
    transform: scale(0.95);
    transition: transform var(--duration-89) var(--ease-spring);
}

/* Glow on hover for interactive elements */
.glow-hover {
    transition: box-shadow var(--duration-233) var(--ease-out);
}

.glow-hover:hover {
    box-shadow: 0 0 30px var(--gold-glow);
}

/* Text shimmer effect */
@keyframes text-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.text-shimmer {
    background: linear-gradient(
        90deg,
        var(--text-primary) 0%,
        var(--gold) 25%,
        var(--text-primary) 50%,
        var(--gold) 75%,
        var(--text-primary) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-shimmer 3s linear infinite;
}

/* Floating animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* Smooth underline animation */
.underline-animate {
    position: relative;
}

.underline-animate::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width var(--duration-233) var(--ease-out);
}

.underline-animate:hover::after {
    width: 100%;
}

/* Card tilt effect */
.card-tilt {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-tilt:hover {
    transform: rotateX(2deg) rotateY(-2deg);
}

/* Progress bar animation */
@keyframes progress-fill {
    from { width: 0; }
}

.progress-bar {
    animation: progress-fill var(--duration-987) var(--ease-out) forwards;
}

/* Icon spin on hover */
.icon-spin-hover:hover svg {
    animation: spin 0.5s ease-in-out;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Elastic scale */
.elastic-scale {
    transition: transform var(--duration-377) var(--ease-spring);
}

.elastic-scale:hover {
    transform: scale(1.05);
}

.elastic-scale:active {
    transform: scale(0.98);
}

/* ========================================
 * MOBILE IMPROVEMENTS
 * Typography, Layout, Compass, Easter Eggs
 * ======================================== */

/* Better mobile typography */
@media (max-width: 768px) {
    :root {
        --text-base: 16px;
        --text-lg: 1.125rem;
        --text-xl: 1.25rem;
        --text-2xl: 1.5rem;
        --text-3xl: 1.875rem;
        --text-4xl: 2.25rem;
    }
    
    body {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* Better line heights for mobile */
    p, .card-body, .callout-content {
        line-height: 1.7;
    }
    
    /* Code blocks scroll horizontally */
    .code-block {
        font-size: 13px;
    }
    
    .code-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .code-content pre {
        min-width: max-content;
    }
}

/* Mobile compass improvements */
@media (max-width: 768px) {
    .compass-sundial {
        --compass-size: clamp(220px, 65vw, 280px);
    }
    
    .hero-compass-container {
        margin-bottom: var(--space-4);
    }
    
    /* Make compass hint more prominent */
    .compass-hint {
        justify-content: center;
        font-size: var(--text-base);
        padding: var(--space-2) var(--space-4);
        background: rgba(0, 0, 0, 0.3);
        border-radius: 20px;
        margin-top: var(--space-3);
        opacity: 1;
    }
    
    .compass-hint-icon {
        font-size: 18px;
    }
    
    /* Tap hint pulse on compass for mobile */
    .compass-sundial:not(.orientation-active) {
        animation: compass-tap-hint 2.5s ease-in-out infinite;
    }
    
    @keyframes compass-tap-hint {
        0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
        50% { box-shadow: 0 0 0 12px rgba(212, 175, 55, 0.12); }
    }
    
    .compass-sundial:active {
        animation: none;
        transform: scale(0.97);
    }
}

/* Mobile secret info bar (easter egg toasts) */
@media (max-width: 768px) {
    .secret-info-bar {
        position: fixed;
        left: var(--space-3);
        right: var(--space-3);
        bottom: max(80px, calc(env(safe-area-inset-bottom, 16px) + 70px));
        transform: none;
        min-width: auto;
        width: auto;
        padding: var(--space-3);
        border-radius: 16px;
        flex-direction: column;
        text-align: center;
        gap: var(--space-2);
    }
    
    .secret-info-bar .sib-emoji {
        font-size: 32px;
        margin-bottom: var(--space-1);
    }
    
    .secret-info-bar .sib-title {
        font-size: 0.9rem;
    }
    
    .secret-info-bar .sib-subtitle {
        font-size: 0.85rem;
    }
    
    .secret-info-bar .sib-meta {
        font-size: 0.75rem;
        line-height: 1.5;
        max-width: 100%;
    }
    
    .secret-info-bar button {
        position: absolute;
        top: var(--space-2);
        right: var(--space-2);
        width: 32px;
        height: 32px;
    }
    
    /* Better animation for mobile */
    @keyframes info-bar-pop {
        0% { 
            opacity: 0; 
            transform: translateY(20px) scale(0.95); 
        }
        100% { 
            opacity: 1; 
            transform: translateY(0) scale(1); 
        }
    }
}

/* Mobile hero section */
@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding-top: calc(80px + var(--space-4));
        padding-bottom: var(--space-8);
    }
    
    .hero-layout {
        padding: 0 var(--space-4);
    }
    
    .hero-title {
        font-size: var(--text-3xl);
    }
    
    .hero-lead {
        font-size: var(--text-base);
    }
    
    .hero-stats {
        gap: var(--space-4);
    }
    
    .stat-value {
        font-size: var(--text-2xl);
    }
    
    .stat-label {
        font-size: var(--text-xs);
    }
    
    /* Better scroll indicator */
    .scroll-indicator {
        bottom: var(--space-3);
        font-size: var(--text-xs);
    }
}

/* Mobile navigation improvements */
@media (max-width: 768px) {
    .nav {
        padding: var(--space-2) 0;
    }
    
    .nav-content {
        padding: 0 var(--space-3);
    }
    
    .nav-logo {
        font-size: var(--text-base);
    }
    
    /* Better hamburger touch target */
    .nav-toggle {
        width: 48px;
        height: 48px;
        padding: 12px;
    }
}

/* Mobile sections */
@media (max-width: 768px) {
    .section {
        padding: var(--space-8) 0;
    }
    
    .section-number {
        font-size: var(--text-xs);
    }
    
    .section-title {
        font-size: var(--text-2xl);
    }
    
    .section-description {
        font-size: var(--text-base);
    }
    
    /* Cards */
    .card {
        padding: var(--space-4);
    }
    
    .card-title {
        font-size: var(--text-base);
    }
    
    .card-body {
        font-size: var(--text-sm);
    }
    
    /* Callouts */
    .callout {
        padding: var(--space-3);
    }
    
    .callout-title {
        font-size: var(--text-sm);
    }
    
    .callout-content {
        font-size: var(--text-sm);
    }
    
    /* Tables */
    .data-table {
        font-size: var(--text-sm);
    }
    
    .data-table th,
    .data-table td {
        padding: var(--space-2);
    }
    
    /* Timeline */
    .timeline-item {
        padding-left: var(--space-6);
    }
    
    .timeline-time {
        font-size: var(--text-xs);
    }
    
    .timeline-title {
        font-size: var(--text-base);
    }
    
    .timeline-description {
        font-size: var(--text-sm);
    }
    
    /* Formula */
    .formula {
        padding: var(--space-3);
    }
    
    .formula-content {
        font-size: var(--text-sm);
        overflow-x: auto;
    }
    
    /* Diagram */
    .diagram pre {
        font-size: 10px;
        overflow-x: auto;
    }
}

/* Mobile demo section */
@media (max-width: 768px) {
    .live-demo {
        padding: var(--space-4);
    }
    
    .control-group {
        margin-bottom: var(--space-4);
    }
    
    .control-label {
        font-size: var(--text-sm);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-1);
    }
    
    .slider {
        height: 8px;
    }
    
    /* Bigger touch target for slider thumb */
    .slider::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }
    
    .slider::-moz-range-thumb {
        width: 28px;
        height: 28px;
    }
    
    .demo-visualization {
        min-height: 200px;
    }
    
    .demo-output {
        font-size: var(--text-sm);
    }
    
    .output-label,
    .output-value {
        font-size: var(--text-sm);
    }
}

/* Mobile footer */
@media (max-width: 768px) {
    .footer {
        padding: var(--space-8) var(--space-4);
    }
    
    .footer-kanji {
        font-size: var(--text-3xl);
    }
    
    .footer-title {
        font-size: var(--text-lg);
    }
    
    .footer-subtitle {
        font-size: var(--text-sm);
    }
    
    .footer-links {
        gap: var(--space-4);
    }
    
    .footer-link {
        font-size: var(--text-sm);
    }
    
    .footer-meta {
        font-size: var(--text-xs);
    }
}

/* Small phone optimizations */
@media (max-width: 390px) {
    .compass-sundial {
        --compass-size: clamp(200px, 72vw, 250px);
    }
    
    .hero-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }
    
    .stat-item {
        text-align: center;
    }
    
    .secret-info-bar {
        left: var(--space-2);
        right: var(--space-2);
        padding: var(--space-2);
    }
    
    .secret-info-bar .sib-meta {
        font-size: 0.7rem;
    }
}

/* Safe area insets for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    .footer {
        padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom));
    }
    
    .nav {
        padding-top: env(safe-area-inset-top);
    }
    
    .nav-links.open {
        padding-top: calc(80px + env(safe-area-inset-top));
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* High-quality touch interactions */
@media (hover: none) and (pointer: coarse) {
    /* Prevent accidental text selection */
    .compass-sundial,
    .stat-item,
    .card,
    .nav-link {
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Better tap feedback */
    .card:active,
    .callout:active {
        transform: scale(0.99);
        opacity: 0.9;
    }
    
    /* Remove hover effects that don't work on touch */
    .card:hover {
        transform: none;
    }
    
    .nav-link:hover::after {
        width: 0;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-6) 0;
    }
    
    .hero-layout {
        grid-template-columns: 1fr 1fr;
        text-align: left;
    }
    
    .hero-compass-container {
        order: 0;
        margin-bottom: 0;
    }
    
    .compass-sundial {
        --compass-size: clamp(150px, 35vh, 200px);
    }
    
    .hero-content {
        align-self: center;
    }
    
    .hero-stats {
        justify-content: flex-start;
    }
}

/* ========================================
 * MICRO DISPLAYS — Watches, Glasses, Widgets
 * Meta Ray-Ban: 600×600px
 * Apple Watch Ultra: 422×514px
 * Apple Watch: ~396×484px
 * Widgets: 150px–300px
 * ======================================== */

/* Widget mode - forced via body class or URL param */
body.widget-mode,
body.glance-mode {
    --widget-mode: 1;
}

/* Detect micro viewports (watches, widgets, glasses) */
@media (max-width: 320px), (max-height: 320px) {
    body {
        --widget-mode: 1;
    }
}

/* Circular display support (W3C Round Display spec) */
@media (shape: round) {
    body {
        --widget-mode: 1;
        --is-circular: 1;
    }
}

/* When in widget mode, show ONLY the compass */
@media (max-width: 320px), (max-height: 320px) {
    /* Hide everything except compass */
    .nav,
    .hero-content,
    .hero-sun,
    .scroll-indicator,
    main,
    footer,
    .grain-overlay,
    .skip-link,
    .compass-hint,
    .compass-pedestal,
    #voice-indicator,
    .secret-info-bar {
        display: none !important;
    }
    
    /* Full-viewport background */
    body {
        overflow: hidden;
        background: radial-gradient(ellipse at center, #1a1814 0%, #0a0908 100%);
    }
    
    .background-layer {
        display: none;
    }
    
    /* Hero becomes full viewport */
    .hero {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .hero-layout {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }
    
    /* Compass fills the screen */
    .hero-compass-container {
        margin: 0;
        padding: 0;
    }
    
    .compass-sundial {
        --compass-size: min(90vw, 90vh, 90vmin);
        margin: 0;
    }
    
    /* Simplify compass for micro display */
    .compass-body {
        box-shadow: none;
    }
    
    .compass-bezel {
        border-width: 2px;
        box-shadow:
            0 4px 16px rgba(0, 0, 0, 0.5),
            inset 0 1px 2px rgba(255, 255, 255, 0.05);
    }
    
    .bezel-marking span {
        font-size: 10px;
    }
    
    .compass-glass {
        display: none;
    }
    
    /* Larger sun/moon indicators for visibility */
    .compass-sun .sun-dot {
        width: 16px;
        height: 16px;
    }
    
    .compass-moon .moon-dot {
        width: 12px;
        height: 12px;
    }
}

/* Extra small widgets (< 200px) */
@media (max-width: 200px), (max-height: 200px) {
    .compass-sundial {
        --compass-size: min(95vw, 95vh, 95vmin);
    }
    
    .compass-bezel {
        border-width: 1px;
    }
    
    .bezel-marking span {
        font-size: 8px;
    }
    
    /* Hide secondary markings */
    .bezel-marking:nth-child(2),
    .bezel-marking:nth-child(4),
    .bezel-marking:nth-child(6),
    .bezel-marking:nth-child(8) {
        display: none;
    }
    
    .compass-hour-lines {
        opacity: 0.3;
    }
    
    .compass-gnomon {
        transform: translateX(-50%) scale(0.7);
    }
}

/* Circular displays (watches) */
@media (shape: round), (device-radius: 50%) {
    .compass-sundial {
        --compass-size: min(88vw, 88vh);
    }
    
    .hero {
        border-radius: 50%;
        overflow: hidden;
    }
    
    /* Ensure compass fits in circular viewport */
    .compass-body,
    .compass-bezel,
    .compass-face {
        border-radius: 50%;
    }
}

/* Meta Ray-Ban Display optimizations (600×600) */
@media (width: 600px) and (height: 600px),
       (min-width: 580px) and (max-width: 620px) and (min-height: 580px) and (max-height: 620px) {
    body {
        --widget-mode: 1;
    }
    
    .nav,
    .hero-content,
    .hero-sun,
    .scroll-indicator,
    main,
    footer,
    .grain-overlay,
    .skip-link {
        display: none !important;
    }
    
    .hero {
        min-height: 100vh;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: radial-gradient(ellipse at center, #1a1814 0%, #0a0908 100%);
    }
    
    .compass-sundial {
        --compass-size: 520px;
    }
    
    .compass-hint {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.6);
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 14px;
    }
}

/* Apple Watch optimizations (396×484 to 422×514) */
@media (min-width: 380px) and (max-width: 440px) and (min-height: 470px) and (max-height: 530px) {
    .compass-sundial {
        --compass-size: min(340px, 85vw);
    }
    
    .compass-hint {
        display: block;
        position: fixed;
        bottom: 40px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 11px;
        padding: 4px 12px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 12px;
    }
    
    .compass-hint-icon {
        display: none;
    }
}

/* Widget glance mode - minimal info display */
body.glance-mode .compass-sundial {
    --compass-size: min(85vw, 85vh);
}

body.glance-mode .compass-face::after {
    content: attr(data-time);
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--gold);
    opacity: 0.8;
}

/* Standalone mode (PWA installed) */
@media (display-mode: standalone) {
    .nav {
        padding-top: env(safe-area-inset-top);
    }
}

/* High contrast for outdoor visibility (glasses) */
@media (prefers-contrast: more) {
    .compass-bezel {
        border-color: var(--gold);
        border-width: 3px;
    }
    
    .bezel-marking span {
        color: #fff;
        font-weight: 700;
        text-shadow: 0 0 4px #000;
    }
    
    .compass-sun .sun-dot {
        background: #ffcc00;
        box-shadow: 0 0 12px #ffcc00;
    }
    
    .compass-moon .moon-dot {
        background: #e0e0ff;
        box-shadow: 0 0 8px #e0e0ff;
    }
}

/* ============================================================================
   POLISH 200/100 — Touch Targets, Toast Fixes, Loading States
   ============================================================================ */

/* P1: Expanded touch targets for mobile (minimum 44x44px per Apple HIG) */
@media (hover: none) and (pointer: coarse) {
    /* Sun touch target */
    .compass-sun {
        min-width: 44px;
        min-height: 44px;
        width: max(44px, 22px);
        height: max(44px, 22px);
    }
    
    .compass-sun .sun-dot {
        width: 22px;
        height: 22px;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
    
    .compass-sun .sun-glow {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 42px;
        height: 42px;
        inset: auto;
    }
    
    /* Moon touch target */
    .compass-moon {
        min-width: 44px;
        min-height: 44px;
        width: max(44px, 18px);
        height: max(44px, 18px);
    }
    
    .compass-moon .moon-dot {
        width: 18px;
        height: 18px;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
    
    .compass-moon .moon-glow {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 30px;
        height: 30px;
        inset: auto;
    }
    
    /* Location indicator touch target */
    .compass-location {
        min-width: 44px;
        min-height: 44px;
    }
    
    .compass-location .location-dot {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
    
    /* Navigation items */
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: var(--space-2) var(--space-3);
    }
    
    /* Language selector */
    .lang-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Active indicator for better feedback */
    .compass-sun:active,
    .compass-moon:active,
    .compass-location:active {
        transform: translate(-50%, -50%) scale(0.92);
    }
}

/* P1: Forecast toast overflow fix on small screens */
.forecast-toast {
    max-width: calc(100vw - 32px);
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
}

@media (max-width: 480px) {
    .forecast-toast {
        position: fixed !important;
        left: 16px !important;
        right: 16px !important;
        bottom: env(safe-area-inset-bottom, 16px) !important;
        top: auto !important;
        max-width: none !important;
        width: auto !important;
        margin: 0 !important;
        border-radius: 16px !important;
    }
    
    .forecast-toast .forecast-header {
        flex-wrap: wrap;
        gap: var(--space-2);
    }
    
    .forecast-toast .forecast-days {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: var(--space-2);
        padding-bottom: var(--space-2);
    }
    
    .forecast-toast .forecast-day {
        scroll-snap-align: start;
        flex-shrink: 0;
        min-width: 60px;
    }
    
    /* Close button always visible */
    .forecast-toast .forecast-close {
        position: sticky;
        top: 0;
        right: 0;
        z-index: 10;
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 320px) {
    .forecast-toast {
        font-size: 12px;
        padding: var(--space-3);
    }
    
    .forecast-toast .forecast-temp {
        font-size: 14px;
    }
}

/* P1: Widget mode weather overlay */
.widget-weather-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        transparent 100%
    );
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: var(--font-mono);
}

body.widget-mode .widget-weather-overlay {
    display: flex;
}

.widget-weather-overlay .weather-temp {
    font-size: 20px;
    font-weight: 600;
    color: var(--gold);
}

.widget-weather-overlay .weather-condition {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: capitalize;
}

.widget-weather-overlay .weather-icon {
    font-size: 24px;
}

/* Glance mode - even more minimal */
body.glance-mode .widget-weather-overlay {
    padding: 8px 12px;
    gap: 8px;
}

body.glance-mode .widget-weather-overlay .weather-temp {
    font-size: 16px;
}

body.glance-mode .widget-weather-overlay .weather-condition {
    display: none;
}

/* P2: Location loading indicator */
.location-loading-indicator {
    position: fixed;
    top: env(safe-area-inset-top, 16px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    font-size: 12px;
    color: var(--gold);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

body.location-loading .location-loading-indicator {
    opacity: 1;
}

.location-loading-indicator .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    to { transform: rotate(360deg); }
}

/* P2: Persistent compass hint for mobile */
@media (hover: none) and (pointer: coarse) {
    .compass-hint {
        opacity: 1 !important;
        animation: compass-hint-pulse 3s ease-in-out infinite;
        background: rgba(0, 0, 0, 0.7);
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 12px;
    }
    
    /* Auto-hide after first interaction */
    body.globe-touched .compass-hint {
        animation: compass-hint-fadeout 1s ease forwards;
    }
}

@keyframes compass-hint-pulse {
    0%, 100% { 
        opacity: 0.7;
        transform: translateX(-50%);
    }
    50% { 
        opacity: 1;
        transform: translateX(-50%) scale(1.02);
    }
}

@keyframes compass-hint-fadeout {
    to {
        opacity: 0;
        pointer-events: none;
    }
}

/* P2: Haptic-friendly active states */
@media (hover: none) and (pointer: coarse) {
    .compass-sun:active .sun-dot,
    .compass-moon:active .moon-dot {
        transform: translate(-50%, -50%) scale(0.9);
        transition: transform 0.1s ease;
    }
    
    /* Visual feedback for interactive elements */
    .lang-btn:active,
    .nav-link:active,
    .compass-location:active .location-dot {
        opacity: 0.7;
        transition: opacity 0.1s ease;
    }
}

/* Widget mode - hide non-essential for glanceability */
body.widget-mode .nav,
body.widget-mode .hero-content,
body.widget-mode .hero-sun,
body.widget-mode .scroll-indicator,
body.widget-mode main,
body.widget-mode footer,
body.widget-mode .skip-link {
    display: none !important;
}

body.widget-mode .hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Safe area handling for notched devices */
@supports (padding: env(safe-area-inset-top)) {
    .forecast-toast {
        padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
    }
    
    .widget-weather-overlay {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
    
    body.widget-mode .hero {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Force GPU acceleration for smooth animations */
.compass-sun,
.compass-moon,
.compass-location,
.forecast-toast,
.widget-weather-overlay,
.location-loading-indicator {
    will-change: transform, opacity;
    backface-visibility: hidden;
}
