/* interplanetary.quest v2 -- surreal aurora mission-control */

:root {
    --c-navy: #0E1130;
    --c-cream: #F4F2EA;
    --c-cyan: #6FE3FF;
    --c-magenta: #F2A8FF;
    --c-amber: #FFE08A;
    --c-grey: #5A5E7A;
    --c-void: #060818;
    --c-manifest: #B4C0D8;

    --sidebar-w: 320px;
    --main-pad-x: clamp(24px, 5vw, 96px);
    --main-pad-y: clamp(48px, 8vw, 128px);

    --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
    background: var(--c-navy);
    color: var(--c-cream);
    font-family: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
    font-weight: 400;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

ul, ol {
    list-style: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

/* ---------- Aurora field (fixed background layer) ---------- */
.aurora-field {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 60% 50%, #11163d 0%, var(--c-navy) 60%, var(--c-void) 100%);
}

.aurora-layer {
    position: absolute;
    inset: -20%;
    mix-blend-mode: screen;
    filter: blur(60px);
    opacity: 0.55;
    will-change: transform;
}

.aurora-cyan {
    background:
        radial-gradient(closest-side at 30% 40%, var(--c-cyan) 0%, rgba(111, 227, 255, 0) 70%);
    animation: aurora-drift-a 32s ease-in-out infinite alternate;
}

.aurora-magenta {
    background:
        radial-gradient(closest-side at 70% 60%, var(--c-magenta) 0%, rgba(242, 168, 255, 0) 70%);
    animation: aurora-drift-b 40s ease-in-out infinite alternate;
    opacity: 0.45;
}

.aurora-amber {
    background:
        radial-gradient(closest-side at 50% 80%, var(--c-amber) 0%, rgba(255, 224, 138, 0) 70%);
    animation: aurora-drift-c 24s ease-in-out infinite alternate;
    opacity: 0.32;
}

@keyframes aurora-drift-a {
    0%   { transform: translate3d(-8%, -4%, 0) scale(1.1); }
    50%  { transform: translate3d(6%, 8%, 0) scale(1.25); }
    100% { transform: translate3d(-4%, 6%, 0) scale(1.05); }
}
@keyframes aurora-drift-b {
    0%   { transform: translate3d(8%, 6%, 0) scale(1.15); }
    50%  { transform: translate3d(-6%, -4%, 0) scale(1.3); }
    100% { transform: translate3d(2%, -8%, 0) scale(1.1); }
}
@keyframes aurora-drift-c {
    0%   { transform: translate3d(0, -8%, 0) scale(1.2); }
    50%  { transform: translate3d(-10%, 4%, 0) scale(1.4); }
    100% { transform: translate3d(8%, 8%, 0) scale(1.15); }
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, var(--c-void) 0%, var(--c-navy) 60%, var(--c-void) 100%);
    border-right: 1px solid rgba(180, 192, 216, 0.08);
    z-index: 5;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 28px 22px 32px;
    min-height: 100%;
}

.sidebar-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 24px;
    border-bottom: 1px dashed rgba(180, 192, 216, 0.12);
}

.sidebar-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-top: auto;
}

.sidebar-eyebrow {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-cyan);
}

.sidebar-id {
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--c-cream);
}

/* compass */
.compass-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.compass {
    width: 84px;
    height: 84px;
    flex-shrink: 0;
}

.compass-ring {
    fill: none;
    stroke: rgba(180, 192, 216, 0.22);
    stroke-width: 1;
}
.compass-ring-inner {
    fill: none;
    stroke: rgba(180, 192, 216, 0.12);
    stroke-width: 1;
    stroke-dasharray: 2 4;
}
.compass-ticks line {
    stroke: var(--c-manifest);
    stroke-width: 1.2;
}
.compass-needle {
    transform-origin: 60px 60px;
    transform-box: fill-box;
    transition: transform 1200ms var(--ease-soft);
}
.needle-body {
    fill: var(--c-cyan);
    opacity: 0.85;
}
.needle-pivot {
    fill: var(--c-cream);
}

.compass-readout {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.compass-bearing {
    font-size: 22px;
    font-weight: 600;
    color: var(--c-cream);
    letter-spacing: -0.01em;
}

.compass-target {
    font-size: 10px;
    letter-spacing: 0.16em;
    color: var(--c-manifest);
}

/* log */
.log-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.log-row {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 10px;
    align-items: baseline;
    font-size: 12px;
    color: var(--c-manifest);
    transition: color 400ms var(--ease-soft), opacity 400ms var(--ease-soft), transform 600ms var(--ease-elastic);
}

.log-row.is-fresh {
    color: var(--c-cream);
    transform: translateX(0);
    animation: log-pop 700ms var(--ease-elastic);
}

@keyframes log-pop {
    0%   { transform: translateX(-12px); opacity: 0; }
    60%  { transform: translateX(2px);  opacity: 1; }
    100% { transform: translateX(0);    opacity: 1; }
}

.log-id {
    font-feature-settings: "tnum" 1;
    color: var(--c-cyan);
    font-size: 11px;
    letter-spacing: 0.04em;
}

.log-name {
    letter-spacing: 0.02em;
}

.log-dest {
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--c-amber);
}

/* signal */
.signal-bar {
    width: 100%;
    height: 40px;
    overflow: visible;
}

.signal-dashes rect {
    fill: var(--c-cyan);
    transition: y 600ms var(--ease-elastic), height 600ms var(--ease-elastic), fill 600ms var(--ease-soft);
}

.signal-readout {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 6px;
}
.signal-label {
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--c-manifest);
}
.signal-value {
    font-size: 16px;
    color: var(--c-cream);
    font-weight: 500;
}

/* stats */
.stat-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0;
    border-bottom: 1px solid rgba(180, 192, 216, 0.06);
    font-size: 12px;
}

.stat-line:last-child { border-bottom: none; }

.stat-key {
    color: var(--c-manifest);
    letter-spacing: 0.14em;
    font-size: 10px;
    text-transform: uppercase;
}
.stat-val {
    color: var(--c-cream);
    font-weight: 500;
    font-size: 14px;
    transition: color 400ms var(--ease-soft);
}

.stat-val.is-flash {
    color: var(--c-amber);
}

/* echo */
.aurora-strip {
    position: relative;
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--c-void);
}

.aurora-strip span {
    position: absolute;
    inset: -50%;
    filter: blur(8px);
    mix-blend-mode: screen;
}
.aurora-strip-cyan {
    background: radial-gradient(closest-side at 20% 50%, var(--c-cyan), transparent 70%);
    animation: strip-a 7s ease-in-out infinite alternate;
}
.aurora-strip-magenta {
    background: radial-gradient(closest-side at 60% 50%, var(--c-magenta), transparent 70%);
    animation: strip-b 9s ease-in-out infinite alternate;
}
.aurora-strip-amber {
    background: radial-gradient(closest-side at 80% 50%, var(--c-amber), transparent 70%);
    animation: strip-c 11s ease-in-out infinite alternate;
}

@keyframes strip-a {
    from { transform: translateX(-15%); }
    to   { transform: translateX(20%); }
}
@keyframes strip-b {
    from { transform: translateX(15%); }
    to   { transform: translateX(-20%); }
}
@keyframes strip-c {
    from { transform: translateX(0%); }
    to   { transform: translateX(-25%); }
}

.sidebar-charter {
    margin-top: 10px;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--c-grey);
}

/* ---------- Main column ---------- */
.main {
    position: relative;
    z-index: 2;
    margin-left: var(--sidebar-w);
    padding: var(--main-pad-y) var(--main-pad-x);
    min-height: 100vh;
    max-width: calc(760px + 2 * var(--main-pad-x));
}

/* ---------- Hero ---------- */
.hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    padding-bottom: 40px;
}

.hero-eyebrow {
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-cyan);
}

.hero-mark {
    font-size: clamp(56px, 11vw, 188px);
    line-height: 0.92;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--c-cream);
    word-break: break-word;
}

.hero-prop {
    font-size: clamp(18px, 2.4vw, 26px);
    line-height: 1.4;
    max-width: 28ch;
    color: var(--c-cream);
    font-weight: 400;
}

.hero-cycle {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-top: 8px;
    padding-left: 4px;
}

.cycle-dot {
    position: absolute;
    left: 0;
    top: 12px;
    width: 14px;
    height: 14px;
    background: var(--c-cyan);
    border-radius: 50%;
    transform-origin: center;
    transition:
        top 700ms var(--ease-elastic),
        transform 700ms var(--ease-elastic),
        background-color 400ms var(--ease-soft);
    box-shadow: 0 0 18px rgba(111, 227, 255, 0.6);
}

.cycle-dot.is-squashing {
    transform: scale(1.5, 0.6);
}

.cycle-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 28px;
}

.cycle-item {
    font-size: 16px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-grey);
    font-weight: 500;
    transition: color 400ms var(--ease-soft);
}

.cycle-item.is-active {
    color: var(--c-cream);
}

.hero-meta {
    margin-top: 18px;
    display: flex;
    gap: 16px;
    align-items: baseline;
    border-top: 1px dashed rgba(244, 242, 234, 0.12);
    padding-top: 18px;
}

.hero-meta-key {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--c-manifest);
    text-transform: uppercase;
}

.hero-meta-val {
    font-size: 14px;
    color: var(--c-cream);
    letter-spacing: 0.04em;
}

/* ---------- Programme ---------- */
.programme {
    padding: 60px 0 40px;
    border-top: 1px solid rgba(180, 192, 216, 0.08);
}

.programme-head {
    margin-bottom: 64px;
}

.programme-eyebrow {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-cyan);
    margin-bottom: 12px;
}

.programme-title {
    font-size: clamp(28px, 4vw, 56px);
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -0.02em;
    max-width: 18ch;
}

.chapter {
    display: grid;
    grid-template-columns: minmax(140px, 200px) 1fr;
    gap: 24px;
    padding: 36px 0;
    align-items: start;
    border-top: 1px solid rgba(180, 192, 216, 0.08);
    cursor: pointer;
}

.chapter:first-of-type { border-top: none; }

.chapter-num {
    font-size: clamp(64px, 9vw, 144px);
    line-height: 0.85;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--c-cream);
    display: inline-block;
    transform-origin: left center;
    transition:
        transform 700ms var(--ease-elastic),
        color 400ms var(--ease-soft);
}

.chapter:hover .chapter-num,
.chapter:focus-within .chapter-num {
    color: var(--c-cyan);
    animation: chapter-pulse 700ms var(--ease-elastic);
}

@keyframes chapter-pulse {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.18); }
    65%  { transform: scale(0.96); }
    100% { transform: scale(1); }
}

.chapter-body {
    max-width: 56ch;
}

.chapter-heading {
    font-size: clamp(24px, 3.4vw, 44px);
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 18px;
    position: relative;
    display: inline;
    background-image: linear-gradient(var(--c-cyan), var(--c-cyan));
    background-repeat: no-repeat;
    background-size: 0% 1px;
    background-position: 0 100%;
    transition: background-size 400ms var(--ease-soft);
    padding-bottom: 4px;
}

.chapter:hover .chapter-heading {
    background-size: 100% 1px;
}

.chapter-text {
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.7;
    color: var(--c-cream);
    margin-bottom: 18px;
}

.chapter-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding-top: 14px;
    border-top: 1px dashed rgba(244, 242, 234, 0.1);
}

.chapter-meta li {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chapter-meta li span:first-child {
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--c-manifest);
    text-transform: uppercase;
}

.chapter-meta li span:last-child {
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--c-cream);
    font-weight: 500;
}

/* ---------- Manifesto ---------- */
.manifesto {
    padding: 96px 0;
    border-top: 1px solid rgba(180, 192, 216, 0.08);
    position: relative;
}

.manifesto-head {
    margin-bottom: 56px;
}

.manifesto-eyebrow {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-cyan);
    margin-bottom: 12px;
}

.manifesto-title {
    font-size: clamp(26px, 3.6vw, 48px);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.manifesto-body {
    display: grid;
    grid-template-columns: 64px 1fr 64px;
    gap: 32px;
    align-items: center;
    max-width: 760px;
}

.manifesto-icon {
    width: 56px;
    height: 56px;
    color: var(--c-magenta);
    opacity: 0.6;
    transition: transform 700ms var(--ease-elastic), opacity 400ms var(--ease-soft);
}

.icon-leaf { color: var(--c-amber); }
.icon-window { color: var(--c-cyan); }

.manifesto-quote {
    text-align: center;
    position: relative;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

.quote-text {
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: -0.01em;
    max-width: 32ch;
    margin: 0 auto;
    transition:
        opacity 350ms var(--ease-soft),
        transform 600ms var(--ease-elastic);
}

.quote-attr {
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--c-manifest);
    text-transform: uppercase;
    transition: opacity 350ms var(--ease-soft);
}

.quote-text.is-leaving,
.quote-attr.is-leaving {
    opacity: 0;
    transform: translateY(-18px);
}

.quote-text.is-entering {
    animation: quote-pop 700ms var(--ease-elastic);
}

@keyframes quote-pop {
    0%   { opacity: 0; transform: translateY(22px) scale(0.96); }
    60%  { opacity: 1; transform: translateY(-3px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.manifesto-dots {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 36px;
}

.manifesto-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(180, 192, 216, 0.25);
    transition: background-color 400ms var(--ease-soft), transform 400ms var(--ease-elastic);
    cursor: pointer;
}

.manifesto-dot.is-active {
    background: var(--c-cyan);
    transform: scale(1.4);
    box-shadow: 0 0 12px rgba(111, 227, 255, 0.6);
}

/* ---------- Application ---------- */
.application {
    padding: 80px 0;
    border-top: 1px solid rgba(180, 192, 216, 0.08);
}

.application-head {
    margin-bottom: 36px;
    max-width: 56ch;
}

.application-eyebrow {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-cyan);
    margin-bottom: 12px;
}

.application-title {
    font-size: clamp(26px, 3.6vw, 48px);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.application-text {
    font-size: 16px;
    line-height: 1.6;
    color: var(--c-manifest);
}

.application-strip {
    position: relative;
    margin-top: 28px;
    padding: 28px 32px;
    border: 1px solid rgba(180, 192, 216, 0.18);
    background: rgba(6, 8, 24, 0.55);
    overflow: hidden;
}

.application-btn {
    width: 100%;
    padding: 22px 28px;
    background: var(--c-cream);
    color: var(--c-navy);
    font-size: clamp(20px, 2.4vw, 28px);
    font-weight: 600;
    letter-spacing: -0.01em;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transform-origin: center;
    transition: transform 600ms var(--ease-elastic), background-color 400ms var(--ease-soft), color 400ms var(--ease-soft);
    border-radius: 2px;
}

.application-btn:hover {
    background: var(--c-cyan);
}

.application-btn.is-pressed {
    animation: btn-squash 600ms var(--ease-elastic);
}

@keyframes btn-squash {
    0%   { transform: scaleY(1) scaleX(1); }
    35%  { transform: scaleY(0.92) scaleX(1.02); }
    65%  { transform: scaleY(1.04) scaleX(0.99); }
    100% { transform: scaleY(1) scaleX(1); }
}

.application-btn.is-sent {
    background: var(--c-navy);
    color: var(--c-cyan);
    border: 1px solid var(--c-cyan);
}

.application-btn-cursor {
    width: 14px;
    height: 14px;
    background: currentColor;
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 400ms var(--ease-elastic);
}

.application-btn:hover .application-btn-cursor {
    transform: scale(1.3);
}

.application-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: rgba(111, 227, 255, 0.08);
    overflow: hidden;
}

.application-progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--c-cyan), var(--c-magenta), var(--c-amber));
    transition: width 1800ms var(--ease-soft);
}

.application-progress-fill.is-running {
    width: 100%;
}

.application-receipt {
    margin-top: 16px;
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--c-cyan);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 400ms var(--ease-soft), transform 600ms var(--ease-elastic);
}

.application-receipt.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Footer ---------- */
.page-foot {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid rgba(180, 192, 216, 0.08);
}

.foot-ticker {
    overflow: hidden;
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    background: var(--c-void);
    border-top: 1px solid rgba(255, 224, 138, 0.18);
    border-bottom: 1px solid rgba(255, 224, 138, 0.18);
    margin: 0 calc(-1 * var(--main-pad-x));
    padding: 0 var(--main-pad-x);
}

.ticker-track {
    display: flex;
    white-space: nowrap;
    animation: ticker-slide 28s linear infinite;
}

.ticker-track span {
    font-size: 14px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-amber);
    text-shadow: 0 0 12px rgba(255, 224, 138, 0.35);
    padding-right: 24px;
}

@keyframes ticker-slide {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.foot-meta {
    margin-top: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px 36px;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-manifest);
}

.foot-meta span:nth-child(2) { color: var(--c-cream); }
.foot-meta span:last-child { color: var(--c-amber); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    :root {
        --sidebar-w: 100%;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(180, 192, 216, 0.12);
    }

    .sidebar-inner {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 28px;
        padding: 24px 22px;
    }

    .sidebar-block {
        border-bottom: none;
        padding-bottom: 0;
    }

    .sidebar-block:last-child {
        margin-top: 0;
        grid-column: 1 / -1;
    }

    .main {
        margin-left: 0;
        padding: 56px var(--main-pad-x) 64px;
        max-width: 100%;
    }

    .hero {
        min-height: auto;
        padding-top: 24px;
    }
}

@media (max-width: 560px) {
    .sidebar-inner {
        grid-template-columns: 1fr;
    }
    .compass-wrap { gap: 18px; }

    .chapter {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .manifesto-body {
        grid-template-columns: 1fr;
        gap: 18px;
        text-align: center;
    }

    .manifesto-icon {
        margin: 0 auto;
    }

    .application-strip {
        padding: 18px;
    }

    .application-btn {
        font-size: 18px;
        padding: 18px 18px;
    }

    .foot-meta {
        gap: 12px;
    }
}
