/* ========================================================================
   namu.style — Aurora HUD over a circuit-botanical data forest
   Palette: Aurora Gradient
   #0D0B1A Void Indigo · #1A1433 Deep Cosmos
   #7B68EE Soft Ultraviolet · #7FE5F0 Cyan Aurora · #E0B0FF Aurora Rose
   #D4C5F9 Lavender Mist · #A89CC8 Faded Wisteria · #39D98A Phosphor Green
   ======================================================================== */

:root {
    --void-indigo: #0D0B1A;
    --deep-cosmos: #1A1433;
    --soft-ultraviolet: #7B68EE;
    --cyan-aurora: #7FE5F0;
    --aurora-rose: #E0B0FF;
    --lavender-mist: #D4C5F9;
    --faded-wisteria: #A89CC8;
    --phosphor-green: #39D98A;

    --hud-inset: 24px;
    --hud-line: rgba(123, 104, 238, 0.30);
    --hud-line-strong: rgba(123, 104, 238, 0.55);
    --column-rule: rgba(224, 176, 255, 0.12);

    --serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
    --sans:  "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--void-indigo);
    color: var(--lavender-mist);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ---------- Aurora gradient field (fixed, behind everything) ---------- */
.aurora-field {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(60% 50% at 18% 20%, rgba(123, 104, 238, 0.28), transparent 70%),
        radial-gradient(55% 45% at 82% 30%, rgba(127, 229, 240, 0.20), transparent 70%),
        radial-gradient(70% 60% at 50% 90%, rgba(224, 176, 255, 0.18), transparent 75%),
        linear-gradient(135deg, rgba(123, 104, 238, 0.10), rgba(127, 229, 240, 0.08), rgba(224, 176, 255, 0.10));
    background-size: 220% 220%, 220% 220%, 220% 220%, 400% 400%;
    background-position: 0% 0%, 100% 0%, 50% 100%, 0% 0%;
    animation: aurora-drift 30s ease-in-out infinite alternate;
    mix-blend-mode: screen;
    opacity: 0.85;
}

@keyframes aurora-drift {
    0%   { background-position:  0%  0%, 100%  0%,  50% 100%,   0%   0%; }
    50%  { background-position: 30% 40%,  70% 30%,  60%  60%, 100%  50%; }
    100% { background-position: 60% 70%,  30% 80%,  40%  30%,   0% 100%; }
}

/* ---------- Cursor canvas overlay ---------- */
#cursor-canvas {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
}

/* ---------- HUD frame ---------- */
.hud {
    position: fixed;
    inset: 0;
    z-index: 8000;
    pointer-events: none;
    transition: opacity 600ms ease;
}

.hud.is-dim {
    opacity: 0.15;
}

.hud-border {
    position: absolute;
    inset: var(--hud-inset);
    border: 1px solid var(--hud-line);
}

/* Corner brackets */
.hud-corner {
    position: absolute;
    width: 32px;
    height: 32px;
    border-style: solid;
    border-color: var(--soft-ultraviolet);
}

.hud-corner::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-style: solid;
    border-color: transparent;
    background: linear-gradient(var(--corner-angle, 135deg),
                rgba(123, 104, 238, 0.7),
                rgba(127, 229, 240, 0.7),
                rgba(224, 176, 255, 0.7));
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    padding: 0;
    pointer-events: none;
    opacity: 0.7;
}

.hud-corner--tl { top: -1px;    left: -1px;    border-width: 2px 0 0 2px; }
.hud-corner--tr { top: -1px;    right: -1px;   border-width: 2px 2px 0 0; }
.hud-corner--bl { bottom: -1px; left: -1px;    border-width: 0 0 2px 2px; }
.hud-corner--br { bottom: -1px; right: -1px;   border-width: 0 2px 2px 0; }

/* Corner organisms */
.corner-organism {
    position: absolute;
    width: 64px;
    height: 64px;
    pointer-events: none;
    animation: organism-rotate 120s linear infinite;
    opacity: 0.8;
}

.corner-organism--tl { top:  18px; left:  18px; }
.corner-organism--tr { top:  18px; right: 18px; animation-direction: reverse; }
.corner-organism--bl { bottom: 18px; left:  18px; animation-direction: reverse; }
.corner-organism--br { bottom: 18px; right: 18px; }

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

/* HUD edge labels */
.hud-edge {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 18px;
    font-family: var(--sans);
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--soft-ultraviolet);
}

.hud-edge--top {
    top: -10px;
    left: 100px;
    right: 100px;
    justify-content: space-between;
    background: var(--void-indigo);
    padding: 0 14px;
    height: 20px;
}

.hud-edge--bottom {
    bottom: -10px;
    left: 100px;
    right: 100px;
    justify-content: space-between;
    background: var(--void-indigo);
    padding: 0 14px;
    height: 20px;
}

.hud-edge--left {
    left: -16px;
    top: 50%;
    transform: rotate(-90deg) translateX(50%);
    transform-origin: left center;
    background: var(--void-indigo);
    padding: 4px 12px;
    height: 16px;
}

.hud-edge--right {
    right: -16px;
    top: 50%;
    transform: rotate(90deg) translateX(-50%);
    transform-origin: right center;
    background: var(--void-indigo);
    padding: 4px 12px;
    height: 16px;
}

.hud-label {
    display: inline-block;
    color: var(--soft-ultraviolet);
    opacity: 0.75;
    font-weight: 500;
    white-space: nowrap;
    transition: color 600ms ease, opacity 600ms ease;
}

.hud-label--section { color: var(--aurora-rose); opacity: 0.85; }
.hud-label--depth   { color: var(--cyan-aurora); opacity: 0.7; }
.hud-label--coord   { opacity: 0.6; }
.hud-label--time    { opacity: 0.6; }

.hud-tick {
    color: var(--soft-ultraviolet);
    opacity: 0.35;
    letter-spacing: 0.4em;
    flex: 1;
    text-align: center;
    overflow: hidden;
}

/* HUD pip indicators */
.hud-pips {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    pointer-events: auto;
}

.hud-pip {
    width: 14px;
    height: 14px;
    border: 1px solid var(--soft-ultraviolet);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    opacity: 0.6;
    transition: opacity 300ms ease, border-color 300ms ease;
}

.hud-pip span {
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: transparent;
    transition: background 300ms ease, box-shadow 300ms ease;
}

.hud-pip.is-active {
    opacity: 1;
    border-color: var(--cyan-aurora);
}

.hud-pip.is-active span {
    background: var(--cyan-aurora);
    box-shadow: 0 0 12px var(--cyan-aurora);
}

.hud-pip:hover {
    opacity: 1;
}

/* ---------- Panels ---------- */
.panels {
    position: relative;
    z-index: 1;
    scroll-snap-type: y mandatory;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.panels::-webkit-scrollbar { width: 0; height: 0; }
.panels { scrollbar-width: none; -ms-overflow-style: none; }

.panel {
    position: relative;
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
}

.panel--canopy     { background: var(--void-indigo); }
.panel--understory { background: var(--deep-cosmos); }
.panel--trunk      { background: var(--void-indigo); }
.panel--root       { background: var(--deep-cosmos); }
.panel--mycelium   { background: var(--void-indigo); }

/* Soft depth-fog at panel edges */
.panel::before,
.panel::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 40px;
    pointer-events: none;
    z-index: 4;
}

.panel::before {
    top: 0;
    background: linear-gradient(to bottom, currentColor, transparent);
    color: var(--void-indigo);
    opacity: 0.65;
}

.panel::after {
    bottom: 0;
    background: linear-gradient(to top, currentColor, transparent);
    color: var(--void-indigo);
    opacity: 0.65;
}

.panel--understory::before, .panel--understory::after,
.panel--root::before,       .panel--root::after {
    color: var(--deep-cosmos);
}

/* ---------- Panel background layer ---------- */
.panel-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.column-rules {
    position: absolute;
    inset: 0 max(64px, calc((100% - 1080px) / 2));
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    pointer-events: none;
}

.column-rules span {
    border-left: 1px solid var(--column-rule);
    height: 100%;
}

.column-rules span:last-child {
    border-right: 1px solid var(--column-rule);
}

/* ---------- Trace layers ---------- */
.trace-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.trace-line {
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 300ms ease, opacity 300ms ease;
}

.node {
    transition: r 200ms ease, fill 200ms ease, opacity 200ms ease, filter 200ms ease;
}

.node.is-active {
    fill: var(--cyan-aurora);
    opacity: 0.9;
    filter: drop-shadow(0 0 6px var(--cyan-aurora));
}

.node--core {
    animation: pulse-core 4s ease-in-out infinite;
}

@keyframes pulse-core {
    0%, 100% { r: 8;  opacity: 0.6; filter: drop-shadow(0 0 4px var(--cyan-aurora)); }
    50%      { r: 11; opacity: 1;   filter: drop-shadow(0 0 12px var(--cyan-aurora)); }
}

/* ---------- Organic blobs ---------- */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    transition: transform 3500ms cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}

.blob--rose {
    width: 480px; height: 480px;
    top: 10%; left: 60%;
    background: radial-gradient(circle, rgba(224, 176, 255, 0.35), transparent 70%);
    animation: blob-morph-1 11s ease-in-out infinite alternate;
}

.blob--cyan {
    width: 380px; height: 380px;
    top: 50%; left: 8%;
    background: radial-gradient(circle, rgba(127, 229, 240, 0.30), transparent 70%);
    animation: blob-morph-2 13s ease-in-out infinite alternate;
}

.blob--violet {
    width: 320px; height: 320px;
    top: 65%; left: 70%;
    background: radial-gradient(circle, rgba(123, 104, 238, 0.32), transparent 70%);
    animation: blob-morph-3 9s ease-in-out infinite alternate;
}

.blob--understory-1 {
    width: 360px; height: 360px;
    top: 30%; left: 75%;
    background: radial-gradient(circle, rgba(127, 229, 240, 0.20), transparent 70%);
    animation: blob-morph-2 12s ease-in-out infinite alternate;
}

.blob--understory-2 {
    width: 280px; height: 280px;
    top: 60%; left: 5%;
    background: radial-gradient(circle, rgba(224, 176, 255, 0.18), transparent 70%);
    animation: blob-morph-1 14s ease-in-out infinite alternate;
}

.blob--trunk-major {
    width: 520px; height: 520px;
    top: 20%; left: -2%;
    background: radial-gradient(circle, rgba(123, 104, 238, 0.22), transparent 70%);
    animation: blob-morph-3 12s ease-in-out infinite alternate;
}

.blob--root-1 {
    width: 380px; height: 380px;
    top: 12%; left: 8%;
    background: radial-gradient(circle, rgba(127, 229, 240, 0.25), transparent 70%);
    animation: blob-morph-1 10s ease-in-out infinite alternate;
}

.blob--root-2 {
    width: 320px; height: 320px;
    top: 60%; left: 70%;
    background: radial-gradient(circle, rgba(123, 104, 238, 0.22), transparent 70%);
    animation: blob-morph-2 11s ease-in-out infinite alternate;
}

@keyframes blob-morph-1 {
    0%   { border-radius: 60% 40% 35% 65% / 55% 45% 55% 45%; transform: scale(1)   rotate(0deg); }
    100% { border-radius: 38% 62% 60% 40% / 45% 60% 40% 55%; transform: scale(1.1) rotate(20deg); }
}

@keyframes blob-morph-2 {
    0%   { border-radius: 45% 55% 65% 35% / 60% 40% 60% 40%; transform: scale(1)   rotate(0deg); }
    100% { border-radius: 60% 40% 40% 60% / 35% 65% 35% 65%; transform: scale(0.95) rotate(-25deg); }
}

@keyframes blob-morph-3 {
    0%   { border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%; transform: scale(1)   rotate(0deg); }
    100% { border-radius: 35% 65% 55% 45% / 55% 45% 65% 35%; transform: scale(1.08) rotate(15deg); }
}

/* ---------- Panel grid (content layer) ---------- */
.panel-grid {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 96px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    column-gap: 32px;
    align-items: center;
    min-height: 80vh;
}

/* ---------- Typography ---------- */
.eyebrow {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--soft-ultraviolet);
    margin: 0 0 28px 0;
    opacity: 0.85;
}

.eyebrow--quiet {
    color: var(--faded-wisteria);
    opacity: 0.6;
}

.display {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(56px, 8vw, 96px);
    line-height: 1.05;
    letter-spacing: -0.015em;
    color: var(--aurora-rose);
    margin: 0 0 32px 0;
}

.display em {
    font-style: italic;
    font-weight: 400;
    color: var(--cyan-aurora);
}

.heading-md {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(40px, 5vw, 64px);
    line-height: 1.08;
    letter-spacing: -0.015em;
    color: var(--aurora-rose);
    margin: 0 0 28px 0;
}

.tagline {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--cyan-aurora);
    margin: 0;
    opacity: 0.75;
}

.body {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 19px;
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: var(--lavender-mist);
    max-width: 520px;
    margin: 0 0 22px 0;
}

.body--secondary {
    color: var(--faded-wisteria);
    font-size: 17px;
}

.pull-quote {
    margin: 0 0 32px 0;
    padding: 18px 0 18px 32px;
    border-left: 1px solid rgba(127, 229, 240, 0.30);
}

.pull-quote p {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(28px, 2.6vw, 36px);
    line-height: 1.4;
    letter-spacing: -0.005em;
    color: var(--cyan-aurora);
    margin: 0;
}

/* ---------- Panel-specific content layouts ---------- */

/* Panel 1 — Canopy */
.canopy-content {
    grid-column: 2 / 6;
    padding-top: 4vh;
}

.canopy-readout {
    grid-column: 5 / 7;
    align-self: end;
    padding-bottom: 2vh;
    border-top: 1px solid var(--hud-line);
    padding-top: 18px;
}

.readout-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: var(--sans);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--faded-wisteria);
}

.readout-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(168, 156, 200, 0.12);
}

.readout-list li:last-child {
    border-bottom: none;
}

.readout-key { color: var(--soft-ultraviolet); }
.readout-val { color: var(--lavender-mist); }
.readout-val.live {
    color: var(--phosphor-green);
    position: relative;
    padding-left: 14px;
}

.readout-val.live::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 7px;
    height: 7px;
    transform: translateY(-50%);
    background: var(--phosphor-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--phosphor-green);
    animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1;   transform: translateY(-50%) scale(1); }
    50%      { opacity: 0.4; transform: translateY(-50%) scale(0.85); }
}

/* Panel 2 — Understory */
.understory-block--left {
    grid-column: 1 / 4;
    padding-top: 4vh;
}

.understory-block--right {
    grid-column: 4 / 7;
    align-self: end;
    padding-bottom: 4vh;
}

/* Panel 3 — Trunk */
.trunk-content {
    grid-column: 3 / 6;
    text-align: left;
}

/* Panel 4 — Root System */
.root-block--left {
    grid-column: 1 / 4;
    padding-top: 6vh;
}

.root-block--right {
    grid-column: 4 / 7;
    align-self: center;
}

.feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.feature-list li {
    padding: 18px 0;
    border-bottom: 1px solid rgba(127, 229, 240, 0.15);
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 18px;
    align-items: start;
}

.feature-list li:last-child { border-bottom: none; }

.feature-marker {
    font-family: var(--sans);
    font-size: 18px;
    color: var(--cyan-aurora);
    line-height: 1.3;
    text-align: center;
}

.feature-heading {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 22px;
    letter-spacing: -0.005em;
    color: var(--aurora-rose);
    margin: 0 0 6px 0;
}

/* Panel 5 — Mycelium */
.panel-bg--mycelium {
    inset: 0;
}

.mycelium-content {
    grid-column: 2 / 7;
    text-align: center;
}

.mycelium-line {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1.4;
    letter-spacing: -0.005em;
    color: var(--lavender-mist);
    margin: 0 0 36px 0;
    opacity: 0.85;
}

.mycelium-line em {
    color: var(--cyan-aurora);
    font-style: italic;
}

.mycelium-meta {
    font-family: var(--sans);
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--faded-wisteria);
    margin: 0;
    opacity: 0.6;
}

/* ---------- Panel entry stagger ---------- */
.panel .canopy-content,
.panel .canopy-readout,
.panel .understory-block,
.panel .trunk-content,
.panel .root-block,
.panel .mycelium-content {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 700ms ease, transform 700ms ease;
}

.panel.is-active .canopy-content,
.panel.is-active .understory-block--left,
.panel.is-active .trunk-content,
.panel.is-active .root-block--left,
.panel.is-active .mycelium-content {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0ms;
}

.panel.is-active .canopy-readout,
.panel.is-active .understory-block--right,
.panel.is-active .root-block--right {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 200ms;
}

.panel .trace-layer { opacity: 0; transition: opacity 800ms ease; transition-delay: 0ms; }
.panel.is-active .trace-layer { opacity: 1; transition-delay: 400ms; }

.panel .blob { opacity: 0; transition: opacity 900ms ease; transition-delay: 0ms; }
.panel.is-active .blob { opacity: 1; transition-delay: 600ms; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    :root { --hud-inset: 16px; }

    .hud-edge--top, .hud-edge--bottom {
        left: 60px;
        right: 60px;
        font-size: 9px;
        letter-spacing: 0.25em;
    }

    .hud-edge--left, .hud-edge--right {
        display: none;
    }

    .corner-organism { width: 44px; height: 44px; }

    .panel-grid {
        padding: 0 48px;
        column-gap: 16px;
    }

    .canopy-content,
    .canopy-readout,
    .understory-block--left,
    .understory-block--right,
    .trunk-content,
    .root-block--left,
    .root-block--right,
    .mycelium-content {
        grid-column: 1 / 7;
    }

    .canopy-readout {
        margin-top: 28px;
    }

    .display { font-size: clamp(40px, 11vw, 64px); }
    .heading-md { font-size: clamp(32px, 8vw, 48px); }

    .hud-pips { right: 6px; gap: 10px; }
    .hud-pip { width: 11px; height: 11px; }
}

@media (max-width: 600px) {
    .panel-grid { padding: 0 36px; }
    .body { font-size: 17px; }
    .pull-quote p { font-size: 22px; }
}
