/* a6c.xyz / Frutiger Aero atmospheric descent */

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

:root {
    /* Palette */
    --bg-deep: #0a1628;
    --bg-mid: #1a5276;
    --bg-light: #d4effc;
    --accent-warm: #f8c9a0;
    --accent-cool: #7c5cbf;
    --accent-teal: #0d9488;
    --signal: #34d399;
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --glass: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.20);

    /* Scroll-driven */
    --scroll: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    background: var(--bg-deep);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    line-height: 1.65;
}

/* The continuous atmospheric gradient spans the whole page height */
#page {
    position: relative;
    background:
        linear-gradient(
            180deg,
            #050b16 0%,
            #0a1628 8%,
            #112e54 18%,
            #1a5276 30%,
            #2c6a93 42%,
            #4a78a6 50%,
            #7c5cbf 58%,
            #b87fa8 66%,
            #f8c9a0 74%,
            #e7c8d0 80%,
            #c8d8e6 86%,
            #d4effc 92%,
            #ffffff 100%
        );
    isolation: isolate;
    z-index: 1;
}

/* Atmosphere container: aurora bands and orbs behind everything */
#atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.aurora-band {
    position: absolute;
    left: -10%;
    width: 120%;
    height: 60vh;
    filter: blur(70px);
    opacity: 0.55;
    mix-blend-mode: screen;
    animation: auroraShift 60s linear infinite;
    will-change: transform, background-position;
}

.band-1 {
    top: 12%;
    background: linear-gradient(95deg,
        rgba(124, 92, 191, 0) 0%,
        rgba(124, 92, 191, 0.55) 30%,
        rgba(13, 148, 136, 0.45) 55%,
        rgba(248, 201, 160, 0.30) 80%,
        rgba(248, 201, 160, 0) 100%);
    transform: rotate(-6deg);
    animation-duration: 70s;
}

.band-2 {
    top: 42%;
    background: linear-gradient(85deg,
        rgba(248, 201, 160, 0) 0%,
        rgba(248, 201, 160, 0.50) 25%,
        rgba(124, 92, 191, 0.45) 60%,
        rgba(26, 82, 118, 0.40) 85%,
        rgba(26, 82, 118, 0) 100%);
    transform: rotate(4deg);
    animation-duration: 90s;
    animation-direction: reverse;
}

.band-3 {
    top: 70%;
    background: linear-gradient(105deg,
        rgba(13, 148, 136, 0) 0%,
        rgba(13, 148, 136, 0.40) 25%,
        rgba(212, 239, 252, 0.55) 60%,
        rgba(248, 201, 160, 0.35) 85%,
        rgba(248, 201, 160, 0) 100%);
    transform: rotate(-3deg);
    animation-duration: 80s;
}

@keyframes auroraShift {
    0%   { background-position: 0 0; }
    100% { background-position: 0 -400px; }
}

/* Luminous orbs - diffuse light sources */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    will-change: transform;
}

.orb-1 {
    width: 380px; height: 380px;
    top: 8%; left: 12%;
    background: radial-gradient(circle, rgba(248, 201, 160, 0.50) 0%, rgba(248, 201, 160, 0) 70%);
    animation: orbDrift 64s ease-in-out infinite;
    opacity: 0.85;
}

.orb-2 {
    width: 460px; height: 460px;
    top: 32%; right: 8%;
    background: radial-gradient(circle, rgba(124, 92, 191, 0.45) 0%, rgba(124, 92, 191, 0) 70%);
    animation: orbDrift 78s ease-in-out infinite reverse;
    opacity: 0.80;
}

.orb-3 {
    width: 320px; height: 320px;
    top: 58%; left: 22%;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.40) 0%, rgba(52, 211, 153, 0) 70%);
    animation: orbDrift 52s ease-in-out infinite;
    opacity: 0.65;
}

.orb-4 {
    width: 420px; height: 420px;
    top: 80%; right: 18%;
    background: radial-gradient(circle, rgba(212, 239, 252, 0.55) 0%, rgba(212, 239, 252, 0) 70%);
    animation: orbDrift 70s ease-in-out infinite reverse;
    opacity: 0.70;
}

@keyframes orbDrift {
    0%   { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(40px, -30px) scale(1.05); }
    50%  { transform: translate(-20px, 50px) scale(0.97); }
    75%  { transform: translate(-50px, -20px) scale(1.03); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Scroll progress */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, var(--signal) 0%, var(--bg-light) 100%);
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.6);
    z-index: 100;
    transition: width 80ms linear;
}

/* ----- Glass panel -- the signature surface ----- */
.glass-panel {
    position: relative;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.30),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition:
        transform 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
        backdrop-filter 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
        -webkit-backdrop-filter 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
        background 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.glass-panel:hover {
    transform: scale(1.015);
    backdrop-filter: blur(28px) saturate(1.7);
    -webkit-backdrop-filter: blur(28px) saturate(1.7);
    background: rgba(255, 255, 255, 0.16);
    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.40),
        inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass-panel { background: rgba(20, 30, 60, 0.82); }
}

.glint {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        115deg,
        transparent 0%,
        transparent 38%,
        rgba(255, 255, 255, 0.08) 45%,
        rgba(255, 255, 255, 0.20) 50%,
        rgba(255, 255, 255, 0.08) 55%,
        transparent 62%,
        transparent 100%
    );
    background-size: 250% 250%;
    background-position: 100% 100%;
    transition: background-position 600ms ease;
    mix-blend-mode: overlay;
    border-radius: inherit;
}

.glass-panel:hover .glint { background-position: 0% 0%; }

/* ----- Layer (section) base ----- */
.layer {
    position: relative;
    min-height: 100vh;
    padding: clamp(4rem, 10vh, 10rem) clamp(1.5rem, 6vw, 6rem);
    z-index: 2;
}

.mono {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.04em;
    font-size: 0.85rem;
}

/* ============== STRATOSPHERE ============== */
.stratosphere {
    display: grid;
    grid-template-columns: 1fr min(720px, 100%) 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

.strat-meta {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    align-self: start;
}

.strat-meta .meta-coord { margin-left: auto; }

.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--signal);
    display: inline-block;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.8);
}

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

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); transform: scale(1); }
    50%      { box-shadow: 0 0 0 14px rgba(52, 211, 153, 0); transform: scale(1.15); }
}

.hero-panel {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    padding: clamp(2.5rem, 5vw, 4.5rem) clamp(2rem, 4vw, 3.5rem);
    text-align: center;
    align-self: center;
}

.hero-panel .eyebrow {
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.wordmark {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: clamp(3rem, 11vw, 7rem);
    letter-spacing: -0.04em;
    color: var(--text-primary);
    line-height: 0.95;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.30), 0 6px 30px rgba(212, 239, 252, 0.30);
    background: linear-gradient(180deg, #ffffff 0%, #d4effc 75%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wordmark-dot { color: var(--signal); -webkit-text-fill-color: var(--signal); }

.hero-panel .tagline {
    margin-top: 1.5rem;
    color: var(--bg-light);
    min-height: 1.4em;
    font-size: 0.95rem;
    display: inline-block;
}

.cursor {
    color: var(--signal);
    display: inline-block;
    margin-left: 2px;
    font-family: 'IBM Plex Mono', monospace;
    transform: translateY(-1px);
    animation: blink 530ms steps(1) infinite;
}

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

.cursor.fading { animation: none; opacity: 0; transition: opacity 600ms ease; }

.strat-readouts {
    grid-column: 1 / -1;
    align-self: end;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem 2rem;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    padding-top: 1rem;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.readout-row { display: flex; justify-content: space-between; gap: 1rem; }
.readout-row span:last-child { color: var(--bg-light); }

.scroll-hint {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.7rem;
    margin-top: 1.5rem;
}

.hint-line {
    width: 1px; height: 40px;
    background: linear-gradient(180deg, var(--signal), transparent);
    animation: hintFlow 2.4s ease-in-out infinite;
}

@keyframes hintFlow {
    0%, 100% { transform: scaleY(0.6); opacity: 0.5; }
    50%      { transform: scaleY(1); opacity: 1; }
}

/* ============== TROPOSPHERE ============== */
.troposphere {
    padding-top: 6rem;
    padding-bottom: 8rem;
}

.layer-heading {
    max-width: 760px;
    margin-bottom: 3.5rem;
}

.layer-tag {
    color: var(--signal);
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: inline-block;
}

.layer-heading h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.025em;
    line-height: 1.05;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    text-shadow: 0 2px 24px rgba(212, 239, 252, 0.18);
}

.layer-lede {
    color: var(--bg-light);
    font-size: 1.1rem;
    max-width: 60ch;
    opacity: 0.92;
}

.floating-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(80px, auto);
    gap: 1.5rem;
    min-height: 70vh;
}

.float {
    padding: 1.75rem 1.75rem 1.5rem;
}

.float-a { grid-column: 1 / span 5;  grid-row: 1 / span 3; }
.float-b { grid-column: 7 / span 5;  grid-row: 1 / span 2; transform: translateY(40px); }
.float-c { grid-column: 6 / span 5;  grid-row: 3 / span 2; transform: translateY(20px); }
.float-d { grid-column: 1 / span 6;  grid-row: 4 / span 2; transform: translateY(60px); }
.float-e { grid-column: 8 / span 5;  grid-row: 5 / span 2; transform: translateY(10px); }

.panel-tag {
    color: var(--signal);
    text-transform: uppercase;
    font-size: 0.72rem;
    margin-bottom: 0.85rem;
    display: block;
}

.glass-panel h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 1.5rem;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.glass-panel p {
    color: var(--bg-light);
    font-size: 0.95rem;
    opacity: 0.88;
}

.data-list {
    margin-top: 1.25rem;
    display: grid;
    gap: 0.4rem;
    color: var(--text-secondary);
}

.data-list li {
    display: flex;
    justify-content: space-between;
    list-style: none;
    border-top: 1px dashed rgba(255, 255, 255, 0.10);
    padding-top: 0.4rem;
}

.data-list span:last-child { color: var(--bg-light); }
.data-list .ok { color: var(--signal); }

.signal-bar {
    margin-top: 1.25rem;
    height: 4px;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 2px;
    overflow: hidden;
}

.signal-bar span {
    display: block;
    height: 100%;
    width: 70%;
    background: linear-gradient(90deg, var(--accent-cool), var(--signal), var(--accent-warm));
    border-radius: 2px;
    animation: signalSweep 4s ease-in-out infinite;
}

@keyframes signalSweep {
    0%, 100% { width: 35%; }
    50%      { width: 88%; }
}

/* ============== DESCENT ============== */
.descent {
    padding-top: 6rem;
    padding-bottom: 6rem;
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 2rem;
    align-items: stretch;
}

.descent-rail {
    position: relative;
    width: 2px;
    background: linear-gradient(
        180deg,
        rgba(212, 239, 252, 0) 0%,
        rgba(212, 239, 252, 0.45) 12%,
        rgba(124, 92, 191, 0.55) 50%,
        rgba(248, 201, 160, 0.55) 80%,
        rgba(255, 255, 255, 0.10) 100%
    );
    margin-left: 30px;
}

.rail-tick {
    position: absolute;
    left: -9px;
    top: var(--y);
    width: 20px;
    height: 1px;
    background: rgba(255, 255, 255, 0.35);
}

.rail-tick::after {
    content: "";
    position: absolute;
    right: -8px;
    top: -3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bg-light);
    box-shadow: 0 0 10px rgba(212, 239, 252, 0.7);
}

.descent-stages {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 2rem;
    align-content: start;
}

.stage {
    padding: 1.75rem 1.75rem;
    position: relative;
}

.stage-1 { transform: translateY(0); }
.stage-2 { transform: translateY(40px); }
.stage-3 { transform: translateY(20px); }
.stage-4 { transform: translateY(60px); }

.stage-marker {
    position: absolute;
    top: 1.25rem; right: 1.5rem;
    color: var(--signal);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ============== SURFACE ============== */
.surface {
    padding-top: 6rem;
    padding-bottom: 8rem;
}

.grid-floor {
    position: relative;
    border-radius: 24px;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 24px 24px,
        rgba(10, 22, 40, 0.05);
    padding: clamp(1rem, 3vw, 2rem);
    overflow: hidden;
    transition: background 300ms ease;
}

.grid-floor.active {
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.18) 1px, transparent 1px) 0 0 / 24px 24px,
        rgba(10, 22, 40, 0.08);
}

#gridCanvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.tessellation {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(120px, auto);
    gap: 1rem;
}

.glass-tile {
    position: relative;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(18px) saturate(1.5);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.30);
    padding: 1.1rem 1.2rem;
    transition: transform 350ms cubic-bezier(0.25, 0.46, 0.45, 0.94), background 350ms ease;
}

.glass-tile:hover {
    transform: translateY(-4px) scale(1.01);
    background: rgba(255, 255, 255, 0.22);
}

.tile-id {
    color: var(--signal);
    font-size: 0.68rem;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.glass-tile h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.glass-tile p {
    color: var(--bg-light);
    opacity: 0.9;
    font-size: 0.85rem;
}

.tile-a { grid-column: span 3; }
.tile-b { grid-column: span 3; }
.tile-c { grid-column: span 3; }
.tile-d { grid-column: span 3; }
.tile-e { grid-column: span 4; }
.tile-f { grid-column: span 4; grid-row: span 2; }
.tile-g { grid-column: span 4; }
.tile-h { grid-column: span 4; }
.tile-i { grid-column: span 8; }

.cycle-meter {
    margin-top: 1rem;
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    overflow: hidden;
}

.cycle-meter span {
    display: block;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, var(--accent-warm), var(--accent-cool));
    border-radius: 2px;
    animation: cycleSlide 60s linear infinite;
}

@keyframes cycleSlide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* ============== GROUND / FOOTER ============== */
.ground {
    background: rgba(255, 255, 255, 0.85);
    color: #1a2740;
    padding: 2rem clamp(1.5rem, 6vw, 6rem);
    min-height: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ground-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.ground-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.ground-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.7);
    display: inline-block;
}

.ground-mark { font-size: 1.05rem; letter-spacing: -0.02em; color: #0a1628; }

.ground-nav {
    display: flex;
    gap: 1.4rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    text-transform: uppercase;
}

.ground-nav a {
    color: #1a5276;
    text-decoration: none;
    transition: color 200ms ease;
}

.ground-nav a:hover { color: var(--accent-cool); }

.ground-meta {
    display: flex;
    gap: 1.4rem;
    color: #5a6b85;
    font-size: 0.7rem;
    text-transform: uppercase;
    flex-wrap: wrap;
}

/* ============== Responsive ============== */
@media (max-width: 960px) {
    .floating-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-auto-rows: auto;
    }
    .float-a, .float-b, .float-c, .float-d, .float-e {
        grid-column: 1 / -1;
        transform: none !important;
    }
    .descent { grid-template-columns: 50px 1fr; }
    .descent-stages { grid-template-columns: 1fr; }
    .stage-1, .stage-2, .stage-3, .stage-4 { transform: none; }

    .tessellation { grid-template-columns: repeat(6, 1fr); }
    .tile-a, .tile-b, .tile-c, .tile-d, .tile-e, .tile-f, .tile-g, .tile-h { grid-column: span 3; }
    .tile-f { grid-row: span 1; }
    .tile-i { grid-column: span 6; }
}

@media (max-width: 560px) {
    .layer { padding-left: 1.25rem; padding-right: 1.25rem; }
    .stratosphere { grid-template-columns: 1fr; }
    .hero-panel { grid-column: 1 / -1; }
    .strat-meta { flex-wrap: wrap; }
    .strat-meta .meta-coord { margin-left: 0; width: 100%; }
    .descent { grid-template-columns: 1fr; }
    .descent-rail { display: none; }
    .tessellation { grid-template-columns: 1fr; }
    .tile-a, .tile-b, .tile-c, .tile-d, .tile-e, .tile-f, .tile-g, .tile-h, .tile-i { grid-column: 1 / -1; }
    .ground-inner { justify-content: flex-start; }
}

/* Reduced motion: keep gradients, calm motion */
@media (prefers-reduced-motion: reduce) {
    .aurora-band, .orb, .cycle-meter span, .signal-bar span, .pulse, .hint-line { animation: none !important; }
}
