/* ==========================================================================
   a6c.quest — Frutiger Aero editorial-flow stylesheet
   Typography: Commissioner variable font with Inter fallback.
   Scroll reveals are driven by the Intersection Observer API (NOT scroll
   event listeners) on the script side.
   ========================================================================== */

:root {
    /* Color tokens */
    --color-primary: #0A7CFF;          /* Cerulean Sky */
    --color-secondary: #2ED47A;        /* Leaf Glass */
    --color-bg: #F0F4F8;               /* Glacier White */
    --color-bg-soft: #E0ECF5;
    --color-bg-tint: #D4F0E7;
    --color-surface: rgba(255, 255, 255, 0.72);
    --color-white: #FFFFFF;
    --color-text: #0D1B2A;             /* Deep Graphite */
    --color-text-secondary: #4A5568;   /* Slate Mist */
    --color-accent-warm: #FF6B6B;      /* Living Coral */
    --color-accent-glow: #00D4AA;      /* Aurora Teal */

    /* Glass tokens */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: 1px solid rgba(255, 255, 255, 0.4);
    --glass-blur: blur(24px) saturate(180%);
    --glass-shadow: 0 8px 32px rgba(10, 124, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    --glass-shadow-hover: 0 16px 48px rgba(10, 124, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.8);

    /* Layout */
    --outer-margin: clamp(24px, 6vw, 80px);
    --gutter: 32px;

    /* Typography */
    --font-main: "Commissioner", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    font-weight: 400;
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--color-text);
    background: var(--color-bg);
    letter-spacing: 0.005em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Global background: a soft animated gradient wash */
body::before {
    content: "";
    position: fixed;
    inset: -20% -20% -20% -20%;
    background: linear-gradient(135deg, #F0F4F8 0%, #E0ECF5 35%, #D4F0E7 70%, #E0ECF5 100%);
    z-index: -2;
    animation: auroraShift 60s linear infinite;
    transform-origin: center;
    will-change: transform;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(900px 600px at 10% 10%, rgba(10, 124, 255, 0.10), transparent 60%),
        radial-gradient(700px 500px at 90% 30%, rgba(0, 212, 170, 0.10), transparent 60%),
        radial-gradient(900px 700px at 50% 110%, rgba(46, 212, 122, 0.10), transparent 60%);
    z-index: -1;
}

@keyframes auroraShift {
    0%   { transform: rotate(0deg) scale(1.1); }
    50%  { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1.1); }
}

/* =========================================================
   Typography
   ========================================================= */
.eyebrow {
    display: inline-block;
    font-weight: 700;
    font-size: 0.75rem;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary);
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(10, 124, 255, 0.08);
    border: 1px solid rgba(10, 124, 255, 0.18);
    margin-bottom: 24px;
}

.display {
    font-weight: 300;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 20px;
    color: var(--color-text);
}

.display-sm {
    font-size: clamp(2rem, 5vw, 3.8rem);
}

.heading {
    font-weight: 300;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.1;
    letter-spacing: -0.015em;
    margin: 0 0 24px;
    color: var(--color-text);
}

.card-title {
    font-weight: 600;
    font-size: 1.4rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 8px 0 12px;
    color: var(--color-text);
}

.card-body {
    color: var(--color-text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
}

.card-label {
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent-glow);
}

/* =========================================================
   Floating navigation pill
   ========================================================= */
.nav-pill {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(16px);
    display: flex;
    gap: 6px;
    padding: 8px;
    border-radius: 24px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 600ms ease, transform 600ms ease;
}

.nav-pill.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 18px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 280ms ease, background 280ms ease, transform 280ms ease;
    position: relative;
    overflow: hidden;
}

.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-text-secondary);
    opacity: 0.55;
    transition: background 280ms ease, opacity 280ms ease, box-shadow 280ms ease, transform 280ms ease;
}

.nav-link:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.55);
}

.nav-link:hover .nav-dot {
    background: var(--color-primary);
    opacity: 1;
    box-shadow: 0 0 12px rgba(10, 124, 255, 0.55);
}

.nav-link.active {
    color: var(--color-text);
    background: linear-gradient(135deg, rgba(10, 124, 255, 0.12), rgba(0, 212, 170, 0.12));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.nav-link.active .nav-dot {
    background: var(--color-accent-glow);
    opacity: 1;
    box-shadow: 0 0 14px rgba(0, 212, 170, 0.65);
    transform: scale(1.2);
}

@media (max-width: 640px) {
    .nav-label {
        display: none;
    }
    .nav-link {
        padding: 12px;
    }
}

/* =========================================================
   Sections (shared)
   ========================================================= */
.section {
    position: relative;
    padding: clamp(80px, 12vh, 160px) var(--outer-margin);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-header {
    max-width: 760px;
    margin: 0 auto 64px;
    text-align: center;
}

/* =========================================================
   Section 1 — The Portal (Hero)
   ========================================================= */
.section-hero {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding-top: clamp(80px, 10vh, 120px);
    padding-bottom: clamp(80px, 10vh, 120px);
    overflow: hidden;
}

.particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(1200px 800px at 30% 20%, rgba(10, 124, 255, 0.18), transparent 65%),
        radial-gradient(900px 700px at 75% 70%, rgba(0, 212, 170, 0.18), transparent 65%);
    z-index: 0;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 2;
    max-width: 880px;
    margin: 0 auto;
    text-align: center;
    padding: 0 16px;
}

.hero-lede {
    max-width: 620px;
    margin: 0 auto;
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.hero-ripple {
    position: absolute;
    left: 50%;
    top: 50%;
    width: clamp(360px, 55vw, 720px);
    height: clamp(360px, 55vw, 720px);
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0.8;
    pointer-events: none;
    animation: ripplePulse 9s ease-in-out infinite;
}

.hero-ripple svg {
    width: 100%;
    height: 100%;
    display: block;
}

@keyframes ripplePulse {
    0%, 100% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.6; }
    50%      { transform: translate(-50%, -50%) scale(1.05); opacity: 0.95; }
}

.scroll-hint {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(13, 27, 42, 0.55);
    animation: scrollBounce 2.4s ease-in-out infinite;
    z-index: 2;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.7; }
    50%      { transform: translateX(-50%) translateY(6px); opacity: 1; }
}

/* Hero text entrance */
.section-hero .eyebrow,
.section-hero .display,
.section-hero .hero-lede {
    opacity: 0;
    transform: translateY(20px) scale(1.02);
    animation: heroEntrance 1.2s ease-out forwards;
}

.section-hero .display   { animation-delay: 0.2s; }
.section-hero .hero-lede { animation-delay: 0.45s; }

@keyframes heroEntrance {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================================================
   Section 2 — The Lens (Glass card stack)
   ========================================================= */
.section-lens {
    padding-top: clamp(120px, 15vh, 200px);
    padding-bottom: clamp(120px, 15vh, 200px);
}

.glass-stack {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.glass-card {
    position: relative;
    padding: 32px;
    border-radius: 16px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    margin-top: -40px;
    transform: translateX(var(--offset, 0)) rotate(var(--tilt, 0deg));
    transition: transform 500ms cubic-bezier(.2,.8,.2,1), box-shadow 500ms ease, filter 500ms ease;
    overflow: hidden;
    cursor: default;
}

.glass-card:first-child {
    margin-top: 0;
}

.glass-card:nth-child(1) { --offset: -28px; --tilt: -1.2deg; z-index: 3; }
.glass-card:nth-child(2) { --offset:   0px; --tilt:  0deg;    z-index: 2; }
.glass-card:nth-child(3) { --offset:  28px; --tilt:  1.2deg;  z-index: 1; }

.glass-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.55), rgba(255,255,255,0) 45%);
    pointer-events: none;
    mix-blend-mode: overlay;
}

.glass-card:hover {
    transform: translateX(var(--offset, 0)) rotate(var(--tilt, 0deg)) translateY(-6px);
    box-shadow: var(--glass-shadow-hover);
    filter: brightness(1.05);
    z-index: 10;
}

.card-illustration {
    width: 96px;
    height: 96px;
    margin-bottom: 20px;
    filter: drop-shadow(0 6px 18px rgba(10, 124, 255, 0.25));
}

.card-illustration svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Click ripple overlay */
.card-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 170, 0.35) 0%, rgba(10, 124, 255, 0.15) 60%, transparent 80%);
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    animation: rippleExpand 600ms ease-out forwards;
}

@keyframes rippleExpand {
    0%   { transform: translate(-50%, -50%) scale(0);   opacity: 0; }
    15%  { opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(3);   opacity: 0; }
}

@media (max-width: 640px) {
    .glass-card:nth-child(1) { --offset: -8px;  --tilt: -0.6deg; }
    .glass-card:nth-child(3) { --offset:  8px;  --tilt:  0.6deg; }
}

/* =========================================================
   Section 3 — The Current (Editorial)
   ========================================================= */
.section-current {
    padding-top: clamp(120px, 15vh, 200px);
    padding-bottom: clamp(120px, 15vh, 200px);
}

.editorial {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
}

.editorial-paragraph {
    font-size: 1.125rem;
    line-height: 1.85;
    margin: 0 0 28px;
    color: var(--color-text);
}

.dropcap {
    float: left;
    font-weight: 300;
    font-size: 4.2rem;
    line-height: 0.9;
    padding: 8px 12px 0 0;
    color: var(--color-accent-warm);
    letter-spacing: -0.03em;
}

.pullquote {
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--color-text);
    margin: 40px 0;
    padding: 24px 0 24px 24px;
    border-left: 2px solid var(--color-accent-glow);
    quotes: none;
}

.editorial-float {
    position: absolute;
    width: 220px;
    height: 220px;
    opacity: 0.9;
    pointer-events: none;
    z-index: -1;
    animation: floatDrift 14s ease-in-out infinite;
}

.editorial-float.float-left {
    left: -280px;
    top: 40px;
}

.editorial-float.float-right {
    right: -280px;
    top: 380px;
    animation-delay: -6s;
}

.editorial-float svg {
    width: 100%;
    height: 100%;
    display: block;
}

@keyframes floatDrift {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(8px, -18px); }
}

@media (max-width: 1180px) {
    .editorial-float {
        opacity: 0.35;
    }
    .editorial-float.float-left  { left: -120px; }
    .editorial-float.float-right { right: -120px; }
}

@media (max-width: 820px) {
    .editorial-float { display: none; }
}

/* =========================================================
   Section 4 — The Depth
   ========================================================= */
.section-depth {
    padding: 0;
    overflow: hidden;
}

.depth-scene {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.depth-illustration {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    transform: scale(1);
    transition: transform 1200ms ease-out;
    will-change: transform;
}

.section-depth.visible .depth-illustration {
    transform: scale(1.05);
}

.depth-panel {
    position: relative;
    z-index: 2;
    max-width: 480px;
    padding: 32px 36px;
    border-radius: 16px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    opacity: 0;
    transition: transform 900ms cubic-bezier(.2,.8,.2,1), opacity 900ms ease-out;
}

.depth-panel-left {
    justify-self: start;
    margin-left: var(--outer-margin);
    transform: translateX(-80px);
}

.depth-panel-right {
    justify-self: end;
    margin-right: var(--outer-margin);
    transform: translateX(80px);
    margin-top: 40px;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--color-text-secondary);
}

.depth-panel-right p {
    margin: 0;
}

.section-depth.visible .depth-panel {
    opacity: 1;
    transform: translateX(0);
}

.section-depth.visible .depth-panel-right {
    transition-delay: 200ms;
}

@media (max-width: 900px) {
    .depth-scene {
        padding: 120px var(--outer-margin);
        align-content: center;
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .depth-panel-left,
    .depth-panel-right {
        justify-self: center;
        margin: 0;
    }
}

/* =========================================================
   Section 5 — The Horizon
   ========================================================= */
.section-horizon {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding-top: clamp(100px, 12vh, 160px);
    padding-bottom: 0;
}

.horizon-inner {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin: 0 auto auto;
    text-align: center;
    padding: 0 16px;
}

.horizon-lede {
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    color: var(--color-text-secondary);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.75;
}

.site-footer {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-top: auto;
    padding: 24px var(--outer-margin);
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 28px;
    border-radius: 24px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.footer-mark {
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text);
    font-size: 0.8rem;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.footer-nav a {
    text-decoration: none;
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: color 220ms ease;
}

.footer-nav a:hover {
    color: var(--color-primary);
}

.footer-meta {
    letter-spacing: 0.02em;
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .particle-canvas { display: none; }
}
