/* prototype.quest — frutiger-aero glossy tech */
/* Palette per DESIGN.md */

:root {
    --c-deep-blueprint: #0A1628;
    --c-twilight-depth: #122240;
    --c-aurora-cyan: #00D4FF;
    --c-sunrise-amber: #FFB347;
    --c-aero-lavender: #C4A8FF;
    --c-vapor-white: #F0F6FF;
    --c-glass-edge: rgba(255, 255, 255, 0.30);
    --c-cloud-gray: #B8CCE0;
    --c-zenith-blue: #1A3A5C;
    --c-horizon-glow: #2A1A3C;
    --c-text-dark: #2A3F58;
    --c-frost-light: #C8E6FF;

    --frost-bg: rgba(255, 255, 255, 0.06);
    --frost-bg-strong: rgba(255, 255, 255, 0.10);
    --frost-border: rgba(255, 255, 255, 0.18);
    --frost-border-strong: rgba(255, 255, 255, 0.28);
    --frost-inner-line: rgba(255, 255, 255, 0.40);

    --easing-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --easing-out: cubic-bezier(0.22, 0.61, 0.36, 1);

    --font-display: "Nunito", "Inter", system-ui, sans-serif;
    --font-ui: "Inter", system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html {
    scroll-behavior: smooth;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-ui);
    font-weight: 400;
    color: var(--c-cloud-gray);
    background: var(--c-deep-blueprint);
    background-image: linear-gradient(170deg,
        #0A1628 0%,
        #122240 40%,
        #1A3A5C 70%,
        #2A1A3C 100%);
    background-attachment: fixed;
    perspective: 1200px;
    perspective-origin: 50% 30%;
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ---------- Completion meter ---------- */
.completion-meter {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(0, 212, 255, 0.06);
    z-index: 200;
    pointer-events: none;
}

.completion-meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg,
        rgba(0, 212, 255, 0.7),
        rgba(0, 212, 255, 1) 50%,
        rgba(255, 179, 71, 0.9));
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.7);
    transition: width 120ms linear;
}

/* ---------- Top nav ---------- */
.topnav {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 10px 22px;
    border-radius: 999px;
    background: rgba(10, 22, 40, 0.45);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--frost-border);
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 var(--frost-inner-line);
}

.topnav-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-right: 18px;
    border-right: 1px solid var(--frost-border);
}

.brand-mark {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%,
        #FFFFFF 0%,
        #00D4FF 40%,
        #0A1628 100%);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
    flex-shrink: 0;
}

.brand-text {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--c-vapor-white);
    letter-spacing: 0.02em;
}

.brand-dot {
    color: var(--c-aurora-cyan);
}

.topnav-links {
    display: flex;
    list-style: none;
    gap: 22px;
    margin: 0;
    padding: 0;
}

.nav-link {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--c-cloud-gray);
    text-decoration: none;
    text-transform: lowercase;
    position: relative;
    padding: 4px 2px;
    transition: color 220ms var(--easing-out);
}

.nav-link:hover {
    color: var(--c-vapor-white);
}

.nav-link.is-active {
    color: var(--c-vapor-white);
}

.nav-link.is-active::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--c-aurora-cyan);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.9);
    transform: translateY(-50%);
}

.nav-indicator {
    display: none;
}

@media (max-width: 600px) {
    .topnav {
        gap: 14px;
        padding: 8px 14px;
    }
    .topnav-brand {
        padding-right: 12px;
    }
    .topnav-links {
        gap: 14px;
    }
    .brand-text {
        font-size: 11px;
    }
    .nav-link {
        font-size: 11px;
    }
}

/* ---------- Ambient stage ---------- */
.ambient-stage {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.caustics-layer {
    position: absolute;
    inset: -10%;
    background:
        repeating-conic-gradient(from 0deg at 30% 40%,
            rgba(0, 212, 255, 0.05) 0deg,
            transparent 14deg,
            rgba(0, 212, 255, 0.04) 28deg,
            transparent 42deg),
        repeating-conic-gradient(from 30deg at 70% 65%,
            rgba(196, 168, 255, 0.04) 0deg,
            transparent 18deg,
            rgba(255, 255, 255, 0.03) 36deg,
            transparent 54deg);
    filter: blur(40px);
    mix-blend-mode: screen;
    opacity: 0.85;
    animation: causticDrift 22s linear infinite;
}

@keyframes causticDrift {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.05); }
    100% { transform: rotate(360deg) scale(1); }
}

.grid-underlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
    background-size: 60px 60px, 60px 60px;
    mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
}

.spheres {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.amb-sphere {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(0, 212, 255, 0.55) 38%,
        rgba(10, 22, 40, 0.95) 100%);
    box-shadow:
        0 0 24px rgba(0, 212, 255, 0.18),
        inset -6px -10px 18px rgba(10, 22, 40, 0.55),
        inset 4px 6px 10px rgba(255, 255, 255, 0.25);
    opacity: 0.7;
    will-change: transform;
}

.amb-sphere.amb-sphere--amber {
    background: radial-gradient(circle at 35% 35%,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(255, 179, 71, 0.6) 38%,
        rgba(42, 26, 60, 0.95) 100%);
    box-shadow:
        0 0 24px rgba(255, 179, 71, 0.22),
        inset -6px -10px 18px rgba(42, 26, 60, 0.55),
        inset 4px 6px 10px rgba(255, 255, 255, 0.25);
}

.amb-sphere.amb-sphere--lavender {
    background: radial-gradient(circle at 35% 35%,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(196, 168, 255, 0.55) 38%,
        rgba(26, 58, 92, 0.95) 100%);
    box-shadow:
        0 0 24px rgba(196, 168, 255, 0.22),
        inset -6px -10px 18px rgba(26, 58, 92, 0.55),
        inset 4px 6px 10px rgba(255, 255, 255, 0.25);
}

@keyframes sphereDrift {
    0%   { transform: translate3d(0, 0, 0); }
    50%  { transform: translate3d(0, -22px, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

.polyhedron {
    position: absolute;
    width: 360px;
    height: 360px;
    opacity: 0.7;
    pointer-events: none;
}

.polyhedron-a {
    top: 8%;
    left: -6%;
}

.polyhedron-b {
    top: 38%;
    right: -8%;
    width: 460px;
    height: 460px;
}

.polyhedron-c {
    bottom: 6%;
    left: 12%;
    width: 320px;
    height: 320px;
    opacity: 0.55;
}

.poly-rotor {
    transform-origin: center;
    transform-box: fill-box;
    animation: polyRotate 38s linear infinite;
}

.poly-rotor-rev {
    animation-duration: 46s;
    animation-direction: reverse;
}

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

/* ---------- Layout shell ---------- */
main {
    position: relative;
    z-index: 1;
}

.layer {
    position: relative;
    min-height: 100vh;
    padding: 130px 6vw 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transform-style: preserve-3d;
}

.layer-header {
    max-width: 760px;
    margin-bottom: 48px;
}

.layer-header-center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.layer-tag {
    display: inline-flex;
    align-items: baseline;
    gap: 12px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.25);
    margin-bottom: 22px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.layer-tag-num {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--c-aurora-cyan);
    letter-spacing: 0.06em;
}

.layer-tag-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(184, 204, 224, 0.85);
    letter-spacing: 0.08em;
    text-transform: lowercase;
}

.layer-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(40px, 6.4vw, 84px);
    line-height: 1.02;
    letter-spacing: -0.02em;
    color: var(--c-vapor-white);
    background: linear-gradient(180deg,
        #FFFFFF 0%,
        #C8E6FF 60%,
        #B8CCE0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
    margin-bottom: 22px;
    filter: drop-shadow(0 4px 24px rgba(0, 212, 255, 0.18));
}

.layer-lead {
    font-family: var(--font-ui);
    font-weight: 400;
    font-size: clamp(15px, 1.2vw, 18px);
    color: var(--c-cloud-gray);
    line-height: 1.7;
    max-width: 60ch;
}

.version-stamp {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(0, 212, 255, 0.7);
    letter-spacing: 0.08em;
    text-transform: lowercase;
}

/* ---------- Reveal/blur-focus ---------- */
.layer {
    transition: filter 600ms var(--easing-out), opacity 600ms var(--easing-out);
}

.is-defocused {
    filter: blur(4px);
    opacity: 0.6;
}

.is-focused {
    filter: blur(0);
    opacity: 1;
}

.spring-in {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
    transition: opacity 700ms var(--easing-spring), transform 700ms var(--easing-spring);
}

.spring-in.is-revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ---------- LAYER 0: SPARK ---------- */
.layer-spark {
    padding-top: 110px;
}

.spark-stage {
    position: relative;
    flex: 1;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: 5vw;
    min-height: calc(100vh - 200px);
}

.spark-form {
    position: relative;
    aspect-ratio: 1;
    max-width: 540px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateZ(20px);
}

.spark-form-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spark-wire {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 6px 32px rgba(0, 212, 255, 0.3));
}

.spark-rotor {
    transform-origin: center;
    transform-box: fill-box;
    animation: polyRotate 28s linear infinite;
}

.spark-glow {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background: radial-gradient(circle at center,
        rgba(0, 212, 255, 0.32) 0%,
        rgba(0, 212, 255, 0.10) 35%,
        transparent 70%);
    filter: blur(20px);
    z-index: -1;
    animation: sparkPulse 5s ease-in-out infinite;
}

@keyframes sparkPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.06); }
}

.version-stamp-spark {
    position: absolute;
    bottom: 6%;
    right: 4%;
    font-size: 12px;
    opacity: 0.6;
}

.spark-frost {
    position: relative;
    padding: 36px 36px 40px;
    border-radius: 22px;
    background: var(--frost-bg);
    backdrop-filter: blur(24px) saturate(135%);
    -webkit-backdrop-filter: blur(24px) saturate(135%);
    border: 1px solid var(--frost-border);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 var(--frost-inner-line),
        inset 0 -1px 0 rgba(0, 212, 255, 0.06);
    transform: translateZ(50px) translateX(-20px);
}

.spark-title {
    font-size: clamp(40px, 6.6vw, 76px);
}

.spark-meta {
    margin-top: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--frost-border);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--c-vapor-white);
    letter-spacing: 0.05em;
}

.meta-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--c-aurora-cyan);
    box-shadow: 0 0 6px var(--c-aurora-cyan);
}

.meta-dot-amber {
    background: var(--c-sunrise-amber);
    box-shadow: 0 0 6px var(--c-sunrise-amber);
}

.meta-dot-lavender {
    background: var(--c-aero-lavender);
    box-shadow: 0 0 6px var(--c-aero-lavender);
}

.scroll-cue {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--c-cloud-gray);
}

.scroll-cue-text {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: lowercase;
    opacity: 0.7;
}

.scroll-cue-arrow {
    width: 1px;
    height: 32px;
    background: linear-gradient(to bottom,
        rgba(0, 212, 255, 0) 0%,
        var(--c-aurora-cyan) 100%);
    position: relative;
    animation: cueDrop 2.4s ease-in-out infinite;
}

.scroll-cue-arrow::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 50%;
    width: 6px;
    height: 6px;
    border-right: 1px solid var(--c-aurora-cyan);
    border-bottom: 1px solid var(--c-aurora-cyan);
    transform: translateX(-50%) rotate(45deg);
}

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

@media (max-width: 900px) {
    .spark-stage {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .spark-frost {
        transform: none;
    }
    .spark-form {
        max-width: 360px;
    }
}

/* ---------- LAYER 1: SKETCH ---------- */
.layer-sketch {
    overflow: visible;
}

.sketch-stack {
    position: relative;
    min-height: 460px;
    margin-top: 40px;
    transform-style: preserve-3d;
}

.sketch-panel {
    position: absolute;
    width: 42%;
    min-width: 280px;
    padding: 26px 26px 28px;
    border-radius: 12px;
    background: var(--frost-bg);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--frost-border-strong);
    box-shadow:
        0 22px 50px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 var(--frost-inner-line),
        inset 0 -1px 0 rgba(0, 212, 255, 0.05);
    transition: transform 600ms var(--easing-spring),
                box-shadow 400ms var(--easing-out);
    will-change: transform;
}

.sketch-panel:hover {
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 var(--frost-inner-line),
        0 0 0 1px rgba(0, 212, 255, 0.2);
}

.sketch-panel-a {
    top: 0;
    left: 2%;
    transform: translateZ(0) rotate(-1.5deg);
    z-index: 3;
}

.sketch-panel-b {
    top: 60px;
    left: 30%;
    transform: translateZ(20px) rotate(1deg);
    z-index: 4;
}

.sketch-panel-c {
    top: 130px;
    left: 56%;
    transform: translateZ(-10px) rotate(-0.5deg);
    z-index: 2;
}

.sketch-thumb {
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: 8px;
    background: rgba(0, 212, 255, 0.04);
    border: 1px solid rgba(0, 212, 255, 0.15);
    margin-bottom: 18px;
    overflow: hidden;
    position: relative;
}

.sketch-thumb svg {
    width: 100%;
    height: 100%;
    display: block;
}

.sketch-title {
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: clamp(18px, 1.6vw, 22px);
    color: var(--c-vapor-white);
    margin-top: 8px;
    margin-bottom: 8px;
    letter-spacing: -0.005em;
}

.sketch-body {
    font-size: 14px;
    line-height: 1.65;
    color: var(--c-cloud-gray);
    margin-bottom: 16px;
}

.sketch-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(196, 168, 255, 0.12);
    border: 1px solid rgba(196, 168, 255, 0.3);
    color: var(--c-aero-lavender);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: lowercase;
}

.sketch-panel .version-stamp {
    position: absolute;
    top: 14px;
    right: 16px;
    opacity: 0.6;
}

@media (max-width: 900px) {
    .sketch-stack {
        min-height: auto;
        display: flex;
        flex-direction: column;
        gap: 18px;
    }
    .sketch-panel {
        position: relative;
        width: 100%;
        top: auto;
        left: auto;
        transform: none !important;
    }
}

/* ---------- LAYER 2: BUILD ---------- */
.build-track-wrap {
    position: relative;
}

.build-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 30px 6vw 50px 6vw;
    margin: 20px -6vw 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    perspective: 1200px;
}

.build-track::-webkit-scrollbar {
    display: none;
}

.build-card {
    flex: 0 0 auto;
    width: 260px;
    height: 400px;
    scroll-snap-align: center;
    perspective: 800px;
    transform-style: preserve-3d;
    will-change: transform;
}

.build-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 22px 22px 24px;
    border-radius: 16px;
    background: var(--frost-bg-strong);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid var(--frost-border-strong);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 2px rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 212, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition:
        transform 360ms var(--easing-spring),
        box-shadow 360ms var(--easing-out);
    will-change: transform;
    transform: perspective(800px) rotateX(0) rotateY(0);
}

.build-card:hover .build-card-inner {
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.5),
        0 0 0 1px rgba(0, 212, 255, 0.25);
}

.build-card-art {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 35%, rgba(0, 212, 255, 0.18) 0%, transparent 70%),
        linear-gradient(160deg, rgba(10, 22, 40, 0.85) 0%, rgba(26, 58, 92, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.art-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.08) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
    pointer-events: none;
}

.art-sphere-a {
    width: 70%;
    height: 70%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%,
        #FFFFFF 0%,
        #00D4FF 40%,
        #0A1628 100%);
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.5),
        inset -10px -14px 24px rgba(10, 22, 40, 0.6),
        inset 6px 8px 14px rgba(255, 255, 255, 0.3);
    position: relative;
}

.art-sphere-a::after {
    content: "";
    position: absolute;
    top: 12%;
    left: 18%;
    width: 28%;
    height: 18%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.7), transparent 70%);
    filter: blur(2px);
}

.art-cube {
    width: 60%;
    height: 60%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(20deg) rotateY(-25deg);
    animation: cubeSpin 14s linear infinite;
}

.art-cube::before, .art-cube::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(0, 212, 255, 0.7);
    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.18) 0%,
            rgba(0, 212, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    box-shadow: inset 0 0 24px rgba(0, 212, 255, 0.2);
}

.art-cube::after {
    transform: translateZ(40px);
    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.28) 0%,
            rgba(0, 212, 255, 0.2) 50%,
            rgba(255, 255, 255, 0.08) 100%);
}

@keyframes cubeSpin {
    from { transform: rotateX(20deg) rotateY(-25deg); }
    to   { transform: rotateX(20deg) rotateY(335deg); }
}

.art-torus {
    width: 75%;
    height: 75%;
    border-radius: 50%;
    border: 18px solid transparent;
    background:
        conic-gradient(from 0deg,
            rgba(255, 179, 71, 0.9) 0%,
            rgba(255, 255, 255, 0.7) 25%,
            rgba(255, 179, 71, 0.7) 50%,
            rgba(196, 168, 255, 0.7) 75%,
            rgba(255, 179, 71, 0.9) 100%) border-box;
    -webkit-mask:
        radial-gradient(circle at center, transparent 35%, #000 36%, #000 100%);
            mask:
        radial-gradient(circle at center, transparent 35%, #000 36%, #000 100%);
    box-shadow:
        0 12px 32px rgba(255, 179, 71, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.4);
    animation: torusRotate 16s linear infinite;
}

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

.art-pill {
    width: 70%;
    height: 38%;
    border-radius: 999px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(184, 204, 224, 0.6) 50%,
        rgba(10, 22, 40, 0.6) 100%);
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.45),
        inset 0 -4px 8px rgba(10, 22, 40, 0.4),
        inset 0 4px 8px rgba(255, 255, 255, 0.6);
    position: relative;
    animation: pillFloat 6s ease-in-out infinite;
}

.art-pill::after {
    content: "";
    position: absolute;
    top: 14%;
    left: 10%;
    width: 35%;
    height: 30%;
    border-radius: 999px;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.7), transparent 70%);
    filter: blur(2px);
}

@keyframes pillFloat {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50%      { transform: translateY(-10px) rotate(-6deg); }
}

.art-prism {
    width: 0;
    height: 0;
    border-left: 70px solid transparent;
    border-right: 70px solid transparent;
    border-bottom: 120px solid rgba(196, 168, 255, 0.5);
    filter:
        drop-shadow(0 0 12px rgba(196, 168, 255, 0.5))
        drop-shadow(8px 6px 20px rgba(0, 212, 255, 0.3));
    position: relative;
    animation: prismHover 7s ease-in-out infinite;
}

.art-prism::after {
    content: "";
    position: absolute;
    left: -40px;
    top: 30px;
    width: 80px;
    height: 60px;
    background: linear-gradient(110deg,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(0, 212, 255, 0.5) 50%,
        transparent 100%);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    opacity: 0.6;
    mix-blend-mode: screen;
}

@keyframes prismHover {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-8px) rotate(8deg); }
}

.card-version {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--c-aurora-cyan);
    opacity: 0.75;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.build-card-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 22px;
    color: var(--c-vapor-white);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.build-card-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--c-cloud-gray);
    opacity: 0.7;
    margin-bottom: 10px;
    letter-spacing: 0.04em;
}

.build-card-body {
    font-size: 13px;
    line-height: 1.6;
    color: var(--c-cloud-gray);
    margin-bottom: auto;
}

.build-card-foot {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.build-tag {
    padding: 4px 10px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    color: var(--c-vapor-white);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.build-tag-amber {
    color: var(--c-sunrise-amber);
    background: rgba(255, 179, 71, 0.08);
    border-color: rgba(255, 179, 71, 0.3);
}

.build-tag-lavender {
    color: var(--c-aero-lavender);
    background: rgba(196, 168, 255, 0.08);
    border-color: rgba(196, 168, 255, 0.3);
}

.lens-flare {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(0, 212, 255, 0.3) 30%,
        transparent 60%);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 200ms var(--easing-out);
    mix-blend-mode: screen;
    filter: blur(2px);
    left: 0;
    top: 0;
}

.build-card:hover .lens-flare {
    opacity: 1;
}

.track-progress {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 0;
}

.track-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--c-cloud-gray);
    opacity: 0.7;
    letter-spacing: 0.06em;
}

.track-bar {
    flex: 1;
    max-width: 240px;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.track-bar-fill {
    height: 100%;
    width: 10%;
    background: linear-gradient(90deg,
        rgba(0, 212, 255, 0.8),
        rgba(255, 179, 71, 0.7));
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
    transition: width 220ms var(--easing-out);
}

@media (max-width: 600px) {
    .build-card {
        width: 180px;
        height: 280px;
    }
    .build-card-inner {
        padding: 16px 16px 18px;
    }
    .build-card-title {
        font-size: 18px;
    }
    .build-card-body {
        font-size: 12px;
    }
}

/* ---------- LAYER 3: TEST ---------- */
.test-comparator {
    position: relative;
    width: 100%;
    aspect-ratio: 16/8;
    max-height: 540px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--frost-border-strong);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 var(--frost-inner-line);
    user-select: none;
    --divider: 50%;
}

.test-half {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.test-before {
    background:
        linear-gradient(160deg, rgba(10, 22, 40, 0.8) 0%, rgba(18, 34, 64, 0.6) 100%);
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.08) 1px, transparent 1px),
        linear-gradient(160deg, rgba(10, 22, 40, 0.85) 0%, rgba(18, 34, 64, 0.65) 100%);
    background-size: 30px 30px, 30px 30px, 100% 100%;
    clip-path: inset(0 calc(100% - var(--divider)) 0 0);
}

.test-after {
    background:
        radial-gradient(ellipse at 60% 40%, rgba(0, 212, 255, 0.18) 0%, transparent 60%),
        linear-gradient(160deg, rgba(26, 58, 92, 0.85) 0%, rgba(42, 26, 60, 0.85) 100%);
    clip-path: inset(0 0 0 var(--divider));
}

.test-art {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(60%, 380px);
    aspect-ratio: 1;
}

.test-art-svg {
    width: 100%;
    height: 100%;
}

.test-after-orb {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%,
        #FFFFFF 0%,
        #00D4FF 40%,
        #0A1628 100%);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        inset -14px -18px 30px rgba(10, 22, 40, 0.6),
        inset 8px 10px 18px rgba(255, 255, 255, 0.4);
}

.test-after-orb::after {
    content: "";
    position: absolute;
    top: 14%;
    left: 22%;
    width: 30%;
    height: 18%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.7), transparent 70%);
    filter: blur(3px);
}

.test-after-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    width: 85%;
    height: 85%;
    border-radius: 50%;
    border: 2px solid rgba(255, 179, 71, 0.5);
    box-shadow: 0 0 24px rgba(255, 179, 71, 0.25);
    animation: ringRotate 22s linear infinite;
}

.test-after-halo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.18) 0%, transparent 65%);
    filter: blur(20px);
    z-index: -1;
}

@keyframes ringRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.test-label {
    position: absolute;
    bottom: 22px;
    padding: 14px 18px;
    border-radius: 10px;
    background: rgba(10, 22, 40, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--frost-border);
    max-width: 240px;
}

.test-label-before {
    left: 22px;
}

.test-label-after {
    right: 22px;
}

.test-label .version-stamp {
    display: block;
    margin-bottom: 4px;
    opacity: 0.85;
}

.test-label h4 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 22px;
    color: var(--c-vapor-white);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.test-label p {
    font-size: 12px;
    line-height: 1.55;
    color: var(--c-cloud-gray);
    margin: 0;
}

.test-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--divider);
    width: 2px;
    transform: translateX(-50%);
    cursor: ew-resize;
    z-index: 10;
}

.test-divider-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: linear-gradient(to bottom,
        rgba(0, 212, 255, 0) 0%,
        var(--c-aurora-cyan) 20%,
        var(--c-aurora-cyan) 80%,
        rgba(0, 212, 255, 0) 100%);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.7);
    pointer-events: none;
}

.test-divider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(10, 22, 40, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--c-aurora-cyan);
    box-shadow:
        0 0 24px rgba(0, 212, 255, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: grab;
    transition: transform 200ms var(--easing-out);
}

.test-divider-handle:hover {
    transform: translate(-50%, -50%) scale(1.06);
}

.test-divider-handle:active {
    cursor: grabbing;
}

.handle-pill {
    width: 4px;
    height: 22px;
    border-radius: 2px;
    background: var(--c-aurora-cyan);
    box-shadow: 0 0 6px var(--c-aurora-cyan);
}

.handle-arrow {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.handle-arrow-l {
    border-right: 7px solid var(--c-aurora-cyan);
}

.handle-arrow-r {
    border-left: 7px solid var(--c-aurora-cyan);
}

@media (max-width: 700px) {
    .test-comparator {
        aspect-ratio: 1/1.05;
    }
    .test-label {
        bottom: 14px;
        padding: 10px 12px;
        max-width: 60%;
    }
    .test-label-before { left: 14px; }
    .test-label-after  { right: 14px; }
    .test-label h4 { font-size: 18px; }
    .test-label p  { font-size: 11px; }
    .test-divider-handle { width: 44px; height: 44px; }
}

/* ---------- LAYER 4: SHIP ---------- */
.layer-ship {
    align-items: center;
    text-align: center;
}

.layer-ship .layer-header {
    margin-left: auto;
    margin-right: auto;
}

.ship-stage {
    position: relative;
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: center;
    gap: 36px;
    margin-top: 30px;
}

.ship-halo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    max-width: 90vw;
    max-height: 90vw;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(0, 212, 255, 0.22) 0%,
        rgba(0, 212, 255, 0.10) 30%,
        transparent 65%);
    filter: blur(30px);
    pointer-events: none;
    animation: shipBreath 6s ease-in-out infinite;
}

@keyframes shipBreath {
    0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.06); }
}

.ship-artifact {
    position: relative;
    width: 280px;
    height: 280px;
    z-index: 2;
    transform-style: preserve-3d;
    perspective: 800px;
}

.ship-artifact-core {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%,
            #FFFFFF 0%,
            #C8E6FF 18%,
            #00D4FF 50%,
            #122240 90%,
            #0A1628 100%);
    box-shadow:
        0 0 120px 40px rgba(0, 212, 255, 0.18),
        0 30px 80px rgba(0, 0, 0, 0.5),
        inset -22px -28px 50px rgba(10, 22, 40, 0.6),
        inset 14px 18px 30px rgba(255, 255, 255, 0.4);
    overflow: hidden;
    animation: artifactSpin 18s linear infinite;
}

.ship-artifact-shine {
    position: absolute;
    top: 8%;
    left: 18%;
    width: 36%;
    height: 24%;
    border-radius: 50%;
    background: radial-gradient(ellipse,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(255, 255, 255, 0.2) 40%,
        transparent 70%);
    filter: blur(2px);
}

.ship-artifact-band {
    position: absolute;
    top: 50%;
    left: -10%;
    right: -10%;
    height: 18px;
    transform: translateY(-50%) rotate(-6deg);
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 179, 71, 0.5) 30%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(196, 168, 255, 0.5) 70%,
        transparent 100%);
    opacity: 0.6;
    mix-blend-mode: screen;
    filter: blur(2px);
}

.ship-artifact-stamp {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 13px;
    color: rgba(10, 22, 40, 0.85);
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 12px;
    border-radius: 999px;
    letter-spacing: 0.08em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

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

.ship-artifact-shadow {
    position: absolute;
    bottom: -38px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 26px;
    border-radius: 50%;
    background: radial-gradient(ellipse,
        rgba(0, 212, 255, 0.4) 0%,
        rgba(0, 212, 255, 0.1) 50%,
        transparent 80%);
    filter: blur(8px);
}

.ship-progress {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 3;
}

.ship-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.5));
}

.ship-progress-num {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 38px;
    color: var(--c-vapor-white);
    letter-spacing: -0.02em;
    line-height: 1;
}

.ship-progress-pct {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--c-aurora-cyan);
    margin-left: 2px;
}

.ship-progress-caption {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--c-cloud-gray);
    opacity: 0.7;
    letter-spacing: 0.08em;
    margin-top: 6px;
    text-transform: lowercase;
}

.ship-readout {
    position: relative;
    z-index: 2;
    padding: 18px 22px;
    border-radius: 12px;
    background: var(--frost-bg);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--frost-border);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 var(--frost-inner-line);
    min-width: 320px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ship-readout-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 18px;
}

.ship-readout-key {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--c-cloud-gray);
    opacity: 0.7;
    letter-spacing: 0.08em;
    text-transform: lowercase;
}

.ship-readout-val {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--c-vapor-white);
    letter-spacing: 0.04em;
}

.ship-readout-val-accent {
    color: var(--c-sunrise-amber);
}

@media (max-width: 600px) {
    .ship-artifact { width: 220px; height: 220px; }
    .ship-progress { width: 130px; height: 130px; }
    .ship-progress-num { font-size: 30px; }
    .ship-readout { min-width: 280px; padding: 14px 16px; }
}

/* ---------- Footer ---------- */
.site-foot {
    padding: 60px 6vw 70px;
    border-top: 1px solid var(--frost-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    background: rgba(10, 22, 40, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    z-index: 1;
}

.foot-mark {
    display: flex;
    align-items: center;
    gap: 9px;
}

.foot-line {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--c-cloud-gray);
    max-width: 64ch;
    line-height: 1.7;
    opacity: 0.85;
}

.foot-stamp {
    display: block;
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--c-aurora-cyan);
    opacity: 0.6;
    letter-spacing: 0.06em;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 200ms !important;
    }
    .is-defocused {
        filter: none;
        opacity: 0.85;
    }
    .spring-in {
        opacity: 1;
        transform: none;
    }
}
