:root {
    --red: #98182a;
    --rose: #ff7a8e;
    --gold: #e3bf68;
    --ink: #f2f4ff;
    --mute: #b9c1e6;
    --card: rgba(255, 255, 255, 0.07);
    --line: rgba(227, 191, 104, 0.28);
    --bg1: #080c26;
    --panel: #161d4d;
    --glow: 0 0 1.2rem rgba(227, 191, 104, 0.55);
    --serif: Spectral, Georgia, "Times New Roman", serif;
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
}

html {
    font-size: clamp(12px, min(1.2vw, 2.05vh), 19px);
}

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--bg1);
    color: var(--ink);
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    opacity: 0.55;
}

body::before {
    width: 46vw;
    height: 46vw;
    left: -12vw;
    top: -18vw;
    background: radial-gradient(circle, #2e418f, transparent 70%);
}

body::after {
    width: 40vw;
    height: 40vw;
    right: -10vw;
    bottom: -16vw;
    background: radial-gradient(circle, rgba(152, 24, 42, 0.8), transparent 70%);
}

#app {
    position: relative;
    height: 100%;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    padding-top: var(--safe-t);
}

button {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}


/* ---------- 2. Header and journey line ---------- */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1.4rem 0;
}

.plate {
    display: grid;
    place-items: center;
    padding: 0.3rem 0.5rem;
    border-radius: 0.8rem;
    background: #fff;
    box-shadow: 0 0.3rem 1.2rem rgba(0, 0, 0, 0.35);
}

.plate img {
    display: block;
    height: 2.6rem;
    width: auto;
}

.ctl {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
}

.ctl button {
    padding: 0.45rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    background: #10163f;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.ctl button:hover:not(:disabled),
.ctl button[aria-pressed="true"] {
    background: #1f2a6b;
    border-color: var(--gold);
}

.ctl button:disabled {
    opacity: 0.4;
    cursor: default;
}

#count {
    margin-right: 0.3rem;
    color: var(--gold);
    font-size: 0.85rem;
    font-weight: 700;
}

#journey {
    position: relative;
    height: clamp(5.8rem, 14vh, 8.5rem);
    margin: 0 1.4rem;
}

#journey>svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.bg-line,
.pg-line {
    fill: none;
    stroke-width: 2.5;
    vector-effect: non-scaling-stroke;
}

.bg-line {
    stroke: rgba(255, 255, 255, 0.16);
}

.pg-line {
    stroke: url(#gl);
    stroke: var(--rose);
    filter: drop-shadow(0 0 4px rgba(255, 122, 142, 0.7));
}

#cr {
    transition: width 0.6s ease;
}

.node {
    position: absolute;
    width: 2rem;
    height: 2rem;
    padding: 0;
    transform: translate(-50%, -50%);
    border: 0;
    background: none;
    cursor: pointer;
}

.dot {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border: 2px solid var(--gold);
    border-radius: 50%;
    background: #0f1640;
    color: var(--gold);
    font-size: 0.8rem;
    font-weight: 800;
    transition: transform 0.25s, background 0.25s, box-shadow 0.25s;
}

.node:hover .dot {
    transform: scale(1.12);
}

.node.done .dot {
    background: #2a2350;
}

.node.active .dot {
    transform: scale(1.22);
    border-color: var(--rose);
    background: var(--red);
    color: #fff;
    box-shadow: 0 0 1.4rem rgba(255, 122, 142, 0.75);
}

.lab {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 50%;
    width: 5rem;
    transform: translateX(-50%);
    color: var(--mute);
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    pointer-events: none;
}

.node.done .lab {
    color: var(--gold);
}

.node.active .lab {
    color: #fff;
}

footer {
    padding: 0.3rem 1rem calc(0.6rem + var(--safe-b));
    color: var(--mute);
    font-size: 0.72rem;
    text-align: center;
    letter-spacing: 0.02em;
}


/* ---------- 3. Pages and typography ---------- */

#stage {
    min-height: 0;
    padding: 0 1.4rem;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
}

.page {
    min-height: 100%;
    display: grid;
    align-content: center;
    gap: 1.2rem 3rem;
    padding: 0.6rem 0 1rem;
    animation: pagein 0.45s ease both;
}

.page.out {
    animation: pageout 0.22s ease forwards;
}

.page.split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: center;
}

.page.center {
    justify-items: center;
    text-align: center;
}

.page.top {
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.15;
    color: #fff;
}

h1 {
    font-size: 3.4rem;
}

h2 {
    font-size: 2.6rem;
}

h1 em {
    font-style: normal;
    background: linear-gradient(90deg, var(--rose), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

h2 em,
.sub em {
    font-style: normal;
    color: var(--gold);
}

.head::before {
    content: "";
    display: block;
    width: 2.6rem;
    height: 3px;
    margin-bottom: 0.9rem;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--rose), var(--gold));
}

.sub {
    margin: 0.7rem 0 0;
    color: var(--mute);
    font-size: 1.2rem;
    line-height: 1.5;
}

.lede {
    margin: 0;
    max-width: 44rem;
    color: var(--mute);
    font-size: 1.25rem;
    line-height: 1.6;
}

.lede b {
    color: #fff;
}

.kick {
    margin: 0;
    color: var(--gold);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.stmt {
    margin: 0;
    color: var(--rose);
    font-family: var(--serif);
    font-size: 1.45rem;
    line-height: 1.4;
}

.foot {
    margin: 0;
    padding-top: 0.8rem;
    border-top: 1px solid var(--line);
    color: #fff;
    font-weight: 600;
    line-height: 1.5;
}

.quote {
    margin: 0;
    padding: 1rem 1.4rem;
    border-left: 4px solid var(--gold);
    border-radius: 0.2rem 1rem 1rem 0.2rem;
    background: var(--card);
    font-family: var(--serif);
    font-size: 1.5rem;
    line-height: 1.35;
}

.quote.big {
    font-size: 2rem;
}

.quote em {
    font-style: normal;
}

.quote em.neg {
    color: var(--rose);
}

.stack {
    display: grid;
    gap: 0.9rem;
}


/* Reveal: pieces rise in one after another */

.rv {
    animation: rise 0.65s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
    animation-delay: var(--d, 0ms);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
}

@keyframes pagein {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

@keyframes pageout {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}


/* ---------- 4. Components ---------- */

.card {
    padding: 1rem 1.2rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--card);
    color: var(--ink);
    line-height: 1.45;
}

.card>b {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--gold);
}

.card.hot {
    border-color: var(--rose);
    background: linear-gradient(135deg, rgba(152, 24, 42, 0.5), rgba(192, 42, 69, 0.25));
}

.card.hot>b {
    color: #fff;
}

.ico {
    width: 1.8rem;
    height: 1.8rem;
    fill: none;
    stroke: var(--gold);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ico.big {
    width: 2.8rem;
    height: 2.8rem;
}

.nb {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--gold);
    color: #201a05;
    font-size: 0.75rem;
    font-weight: 800;
}

.pill {
    display: inline-block;
    margin: 0.15rem;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
}


/* Lists with glowing bullets */

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

.cl li {
    position: relative;
    padding: 0.6rem 0 0.6rem 1.6rem;
    font-size: 1.15rem;
    line-height: 1.4;
}

.cl li::before {
    content: "";
    position: absolute;
    left: 0.2rem;
    top: 1.05rem;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: var(--glow);
}

.panel,
.panel-box {
    padding: 0.6rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--card);
}

.panel-box {
    padding: 1.2rem 1.5rem;
}

.panel-box .lede {
    color: var(--gold);
}


/* Flow charts */

.flow {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.fnode {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: grid;
    place-content: center;
    gap: 0.2rem;
    padding: 0.9rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--panel);
    font-size: 1rem;
    line-height: 1.3;
    text-align: center;
}

.fnode small {
    color: var(--mute);
    font-size: 0.8rem;
    font-weight: 500;
}

.fnode .nb {
    justify-self: center;
    margin-bottom: 0.3rem;
}

.fnode.hot {
    border-color: var(--rose);
    background: linear-gradient(135deg, #5a1228, #3a1430);
}

.fnode.skip {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.35);
    background: transparent;
    color: var(--mute);
}

.fnode.skip::after {
    content: "✕";
    position: absolute;
    top: -0.6rem;
    right: -0.4rem;
    display: grid;
    place-items: center;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-size: 0.7rem;
}

.fnode.gap {
    border: 2px dashed rgba(255, 255, 255, 0.35);
    color: var(--mute);
    animation: rise 0.65s cubic-bezier(0.2, 0.7, 0.2, 1) backwards var(--d), gapon 0.9s ease 2.4s forwards;
}

.fnode.gap::before {
    content: "";
    position: absolute;
    inset: -5px;
    border: 1.5px solid var(--gold);
    border-radius: 1.2rem;
    opacity: 0;
    animation: ping 2.2s ease-out 3.2s infinite;
}

@keyframes gapon {
    to {
        border-color: var(--gold);
        background: rgba(227, 191, 104, 0.2);
        box-shadow: 0 0 1.6rem rgba(227, 191, 104, 0.55);
        color: #fff;
    }
}

@keyframes ping {
    0% {
        opacity: 0.9;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.18);
    }
}

.farrow {
    flex: 0 0 1.7rem;
    display: grid;
    place-items: center;
}

.farrow svg {
    width: 100%;
    height: 0.9rem;
    overflow: visible;
}

.farrow path {
    fill: none;
    stroke: var(--gold);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 34;
    stroke-dashoffset: 34;
    animation: draw 0.5s ease forwards;
    animation-delay: var(--d);
}

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

.grid2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.grid3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.vcard {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.5rem;
    text-align: center;
}

.vcard>b {
    margin: 0;
    color: #fff;
}

.vcard .nb {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
}

.vcard .soft {
    color: var(--mute);
}


/* ---------- 5. Page-specific ---------- */


/* 1 Access */

.access {
    gap: 0.9rem;
}

.access .lede {
    max-width: none;
}

.access .quote {
    max-width: 48rem;
}

.access .foot {
    max-width: 56rem;
}

.wavy {
    position: relative;
    width: min(100%, 62rem);
    height: clamp(11rem, 28vh, 15rem);
    margin-top: 0.8rem;
}

.wavy svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.wavy path {
    fill: none;
    stroke: var(--gold);
    stroke-width: 2.5;
    stroke-dasharray: 7 6;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 4px rgba(227, 191, 104, 0.6));
    animation: flowdash 1.2s linear infinite;
}

@keyframes flowdash {
    to {
        stroke-dashoffset: -26;
    }
}

.wnode {
    position: absolute;
    width: min(15rem, 30%);
    padding: 0.8rem 0.9rem;
    transform: translate(-50%, -50%);
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--panel);
    box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.35);
}

.wnode.hot {
    border-color: var(--rose);
    background: linear-gradient(135deg, #5a1228, #3a1430);
}

.wnode b {
    display: block;
    font-family: var(--serif);
    font-size: 1.2rem;
}

.wnode small {
    display: block;
    margin-top: 0.25rem;
    color: var(--mute);
    font-size: 0.85rem;
    line-height: 1.3;
}


/* 2 Curiosity */

.curiosity {
    gap: 1.1rem;
}

.curiosity h1,
.curiosity .lede {
    max-width: 58rem;
}

.curiosity h1 {
    font-size: 3.6rem;
}

.curiosity .lede+.lede {
    margin-top: 0.8rem;
}


/* 3 Learning crisis */

.crisis-head .lede {
    margin: 1rem 0 1.5rem;
}


/* 4 Iceberg */

.vis {
    min-width: 0;
}

.berg {
    display: block;
    width: 100%;
    max-height: 100%;
    height: auto;
    overflow: visible;
}

.berg text {
    fill: var(--ink);
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.berg .bt-h {
    fill: #fff;
    font-size: 20px;
    font-weight: 700;
}

.berg .bt-h.gold {
    fill: var(--gold);
    font-size: 14px;
    letter-spacing: 0.1em;
}

.berg .bt-s {
    fill: var(--mute);
    font-size: 13px;
}

.berg .b-top,
.berg .b-bot,
.berg .btag {
    animation: rise 0.9s ease backwards;
}

.berg .b-top {
    animation-delay: 200ms;
}

.berg .b-bot {
    animation-delay: 600ms;
}

.berg .btag {
    animation-delay: var(--d);
    cursor: pointer;
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.2s;
}

.berg .btag rect {
    fill: rgba(16, 22, 63, 0.9);
    stroke: var(--gold);
    stroke-width: 1.2;
    transition: fill 0.2s, stroke 0.2s, filter 0.2s;
}

.berg .btag text {
    font-size: 13px;
    font-weight: 600;
    transition: fill 0.2s;
}

.berg .btag:hover,
.berg .btag:focus-visible {
    transform: scale(1.08);
    outline: 0;
}

.berg .btag:hover rect,
.berg .btag:focus-visible rect {
    fill: var(--gold);
    stroke: #fff;
    filter: drop-shadow(0 0 8px rgba(227, 191, 104, 0.8));
}

.berg .btag:hover text,
.berg .btag:focus-visible text {
    fill: #201a05;
}

.berg .wave {
    animation: drift 6s ease-in-out infinite alternate;
}

@keyframes drift {
    to {
        transform: translateX(-30px);
    }
}


/* 5 New layer */

.layer {
    gap: 1.2rem;
}

.layer-head h2 {
    font-size: 3.1rem;
}

.layer-head .sub {
    max-width: 56rem;
    font-size: 1.2rem;
}

.diagram {
    display: grid;
    align-content: center;
    gap: 1rem;
    min-width: 0;
}

.layer .quote {
    justify-self: center;
    max-width: 56rem;
    padding: 1rem 1.6rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    text-align: center;
}

.layer .quote span {
    display: block;
}

.q-sub {
    margin-top: 0.5rem;
    color: var(--gold);
}

.loop {
    position: relative;
    height: 1.7rem;
    margin: 0 3%;
}

.loop svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.loop path {
    fill: none;
    stroke: var(--rose);
    stroke-width: 2;
    stroke-dasharray: 5 4;
    vector-effect: non-scaling-stroke;
}

.loop span {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, -62%);
    padding: 0 0.6rem;
    background: #0d1340;
    color: var(--rose);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


/* 7 Healthcare vs education */

.lanes {
    display: grid;
    align-content: center;
    gap: 1rem;
}

.lane {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr);
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--card);
}

.ll {
    color: var(--mute);
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 600;
}

.ll.sed {
    color: var(--gold);
}

.lanes .stmt {
    text-align: center;
}


/* 8 Meet SED */

.intro {
    gap: 1rem;
}

.intro h1 {
    font-size: 4rem;
}

.intro .lede {
    max-width: 54rem;
    font-size: 1.35rem;
}

.intro .stmt {
    padding: 0.7rem 1.6rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 122, 142, 0.08);
}

.logo-orb {
    position: relative;
    display: grid;
    place-items: center;
    width: 9rem;
    height: 9rem;
}

.logo-orb .ring,
.orb .ring {
    position: absolute;
    inset: 0;
    border: 1px dashed rgba(227, 191, 104, 0.45);
    border-radius: 50%;
}

.logo-orb .ring.r2,
.orb .ring.r2 {
    inset: 12%;
    border: 1px solid rgba(255, 122, 142, 0.4);
}

.core {
    display: grid;
    place-items: center;
    width: 62%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 2.4rem rgba(255, 122, 142, 0.5);
}

.core img {
    width: 82%;
    height: auto;
}


/* 9 and 13 Orbit pages */

.big-head h2 {
    font-size: 3.6rem;
}

.page.orbit-page {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr);
}

.orbwrap {
    display: grid;
    place-items: center;
    padding: 0 clamp(3.5rem, 6vw, 6.5rem);
    min-width: 0;
}

.orb {
    position: relative;
    width: min(100%, 44rem, calc(100vh - 17rem));
    aspect-ratio: 1;
}

.orb .ring {
    inset: 10%;
}

.orb .ring.r2 {
    inset: 22%;
}

.orb .core {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 34%;
    transform: translate(-50%, -50%);
}

.orb .ring,
.orb .core {
    transition: opacity 0.25s ease;
    will-change: opacity;
}

.sat {
    position: absolute;
    width: max-content;
    max-width: 11rem;
    padding: 0.6rem 0.9rem;
    transform: translate(-50%, -50%);
    border: 1px solid var(--gold);
    border-radius: 0.9rem;
    background: #10163f;
    box-shadow: 0 0 1rem rgba(227, 191, 104, 0.25);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.25s ease, background 0.2s, box-shadow 0.2s, border-color 0.2s;
    will-change: opacity;
}

.orb.crowded .sat {
    max-width: 9.5rem;
    font-size: 0.92rem;
}

.sat.on {
    z-index: 3;
    border-color: #fff;
    background: linear-gradient(135deg, #7d1328, #c02a45);
    box-shadow: 0 0 1.6rem rgba(255, 122, 142, 0.7);
}

.head>.quote,
.head>.card {
    margin-top: 1.4rem;
}


/* 10 How SED works */

.how .diagram {
    grid-template-rows: minmax(0, 1.1fr) auto minmax(0, 1.3fr);
    gap: 0.4rem;
}

.how .vcard {
    gap: 0.7rem;
    font-size: 1.2rem;
}

.how .vcard .ico.big {
    width: 3.6rem;
    height: 3.6rem;
}

.how .fnode {
    padding: 1rem 0.7rem;
    font-size: 1.05rem;
}

.vconn {
    height: 3rem;
}

.vconn svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.vconn path {
    fill: none;
    stroke: var(--gold);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 3px var(--gold));
}


/* 11 What makes SED different */

.ask {
    border-left: 4px solid var(--rose);
    font-family: var(--serif);
    font-size: 1.35rem;
}

.ask>b {
    color: var(--rose);
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


/* 12 Dimensions */

.dims .diagram {
    gap: 1.2rem;
}

.dim {
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 0.7rem;
    text-align: center;
}

.dim>b {
    margin: 0;
    color: #fff;
    font-family: var(--serif);
    font-size: 1.3rem;
}

.dims .flow {
    align-self: end;
}


/* 14 Teachers and 15 Parents */

.stairs-box,
.vis:has(.pgrid) {
    display: grid;
    align-content: center;
    gap: 0.4rem;
}

.vis h3 {
    color: var(--gold);
    font-size: 1.5rem;
}

.vis>p {
    margin: 0 0 0.6rem;
    color: var(--mute);
    line-height: 1.5;
}

.stairs {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    height: min(22rem, 46vh);
}

.step {
    flex: 1;
    min-width: 0;
    height: var(--h);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.7rem 0.6rem;
    border: 1px solid var(--line);
    border-top: 3px solid var(--gold);
    border-radius: 0.9rem 0.9rem 0.3rem 0.3rem;
    background: linear-gradient(180deg, rgba(227, 191, 104, 0.22), rgba(152, 24, 42, 0.18));
    transition: transform 0.25s, box-shadow 0.25s;
}

.step:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 1.6rem rgba(227, 191, 104, 0.45);
}

.step:last-child {
    border-top-color: #fff;
    background: linear-gradient(180deg, rgba(255, 122, 142, 0.4), rgba(152, 24, 42, 0.35));
}

.step b {
    font-size: 0.95rem;
    line-height: 1.3;
}

.pgrid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
}

.pcard {
    position: relative;
    display: grid;
    align-content: start;
    gap: 0.4rem;
    padding: 0.9rem;
    font-size: 0.95rem;
}

.pcard>b {
    margin: 0;
    color: #fff;
    line-height: 1.3;
}

.pcard .nb {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
}

.pcard.hot .ico {
    stroke: #fff;
}


/* 17 Pillars */

.grid2 .vcard {
    padding: 1.4rem 1rem;
    font-size: 1.15rem;
}


/* 18 Final page */

.final {
    gap: 0.9rem;
}

.final h1 {
    max-width: 56rem;
    font-size: 2.8rem;
}

.punch {
    display: grid;
    justify-items: center;
    gap: 0.6rem;
    margin-top: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    width: min(100%, 60rem);
}

.pl {
    margin: 0;
    color: #fff;
    font-family: var(--serif);
    font-size: 1.7rem;
    font-weight: 600;
    line-height: 1.25;
    opacity: 0;
    animation: punchin 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: var(--d);
}

.pl em {
    font-style: normal;
    color: var(--gold);
    text-shadow: var(--glow);
}

.pl.p1,
.pl.p3 {
    color: var(--mute);
}

.pl.p5 {
    margin-top: 0.4rem;
    color: var(--rose);
    font-size: 2.3rem;
    text-shadow: 0 0 1.6rem rgba(255, 122, 142, 0.6);
}

.pl.p6 {
    margin-top: 0.3rem;
    padding-bottom: 0.2rem;
    background: linear-gradient(90deg, var(--gold), #fff6d6, var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 2rem;
}

@keyframes punchin {
    from {
        opacity: 0;
        transform: translateY(26px) scale(0.96);
        filter: blur(12px);
    }
    to {
        opacity: 1;
        transform: none;
        filter: blur(0);
    }
}


/* ---------- 6. Hover brief and contact panel ---------- */


/* #app.dim header,
#app.dim #journey,
#app.dim footer,
#app.dim .page> :not(.orbwrap),
#app.dim .orb .ring,
#app.dim .orb .core,
#app.dim .sat:not(.on) {
    opacity: 0.3;
    filter: blur(4px);
    transition: opacity 0.25s, filter 0.25s;
} */


/* Surrounding page: fade + light blur, with a transition both ways */

header,
#journey,
footer,
.orbit-page> :not(.orbwrap) {
    transition: opacity 0.25s ease, filter 0.25s ease;
}


/* #app.dim header,
#app.dim #journey,
#app.dim footer,
#app.dim .page> :not(.orbwrap) {
    opacity: 0.3;
    filter: blur(0px);
}


/* Orbit pieces: fade only, no blur (this is what removes the jitter) */


/* #app.dim .orb .ring,
#app.dim .orb .core,
#app.dim .sat:not(.on) {
    opacity: 0.3;
}  */

#app.focusing header,
#app.focusing #journey,
#app.focusing footer,
#app.focusing .page> :not(.orbwrap) {
    opacity: 0.3;
    filter: blur(2px);
}

#app.focusing .orb .ring,
#app.focusing .orb .core,
#app.focusing .sat:not(.on) {
    opacity: 0.3;
}

#brief {
    position: fixed;
    z-index: 20;
    left: 3vw;
    top: 50%;
    width: min(30rem, 36vw);
    padding: 1.3rem 1.5rem;
    transform: translateY(-50%) scale(0.94);
    border: 1px solid var(--gold);
    border-radius: 1.2rem;
    background: linear-gradient(135deg, rgba(31, 42, 107, 0.97), rgba(14, 20, 60, 0.97));
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5), var(--glow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}

#brief.on {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%);
    pointer-events: auto;
}

#brief h4 {
    color: var(--gold);
    font-size: 1.5rem;
}

#brief .rule {
    width: 3rem;
    height: 3px;
    margin: 0.7rem 0;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--rose), var(--gold));
}

#brief .bb {
    font-size: 1.05rem;
    line-height: 1.6;
}

#panel {
    position: fixed;
    z-index: 30;
    top: calc(4.6rem + var(--safe-t));
    right: 1.4rem;
    width: min(22rem, calc(100vw - 2.8rem));
    padding: 1.1rem 1.3rem;
    transform: translateY(-6px);
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(14, 20, 60, 0.97);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}

#panel.open {
    opacity: 1;
    visibility: visible;
    transform: none;
}

#panel h4 {
    margin-bottom: 0.7rem;
    color: var(--gold);
    font-size: 1.2rem;
}

#panel p {
    display: grid;
    gap: 0.1rem;
    margin: 0 0 0.6rem;
}

#panel span {
    color: var(--mute);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#panel a {
    justify-self: start;
    border-bottom: 1px dashed var(--gold);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

#panel a:hover {
    color: var(--gold);
}


/* ---------- 7. Responsive ---------- */


/* Large screens: let the content use the extra room */

@media (min-width: 1700px) {
    .page.split {
        gap: 1.4rem 5rem;
    }
}


/* Tablets and small laptops */

@media (max-width: 1100px) {
    .how .diagram,
    .dims .diagram {
        grid-template-rows: none;
    }
    .how .vcard {
        min-height: 7rem;
    }
    .pgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .lane {
        grid-template-columns: 1fr;
    }
    h1,
    .curiosity h1 {
        font-size: 2.8rem;
    }
    .intro h1 {
        font-size: 3.2rem;
    }
}


/* Stack two-column pages */

@media (max-width: 900px) {
    html {
        font-size: 14px;
    }
    .page.split {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.4rem;
        align-content: start;
    }
    .page.top {
        grid-template-rows: auto auto;
        align-content: start;
    }
    .lab {
        display: none;
    }
    .node.active .lab {
        display: block;
        width: max-content;
        max-width: 9rem;
        padding: 0.15rem 0.5rem;
        border-radius: 0.4rem;
        background: #10163f;
    }
    .node:first-child .lab {
        left: 0;
        transform: none;
    }
    .node:last-child .lab {
        left: auto;
        right: 0;
        transform: none;
    }
    .stairs {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
    }
    .step {
        flex: none;
        width: calc(34% + var(--h) * 0.66);
        height: auto;
        min-height: 3.6rem;
        flex-direction: row;
        align-items: center;
        padding: 0.6rem 0.8rem;
        border-top: 1px solid var(--line);
        border-left: 3px solid var(--gold);
        border-radius: 0.3rem 0.9rem 0.9rem 0.3rem;
    }
    .step:last-child {
        border-left-color: #fff;
    }
    .step .nb {
        flex: none;
    }
    .orb {
        width: min(100%, 34rem);
    }
    .flow {
        flex-direction: column;
    }
    .loop {
        display: none;
    }
    .farrow {
        flex: none;
        height: 1.4rem;
    }
    .farrow svg {
        width: 1.6rem;
        transform: rotate(90deg);
    }
    .how .diagram,
    .dims .diagram {
        grid-template-rows: none;
    }
    #brief {
        left: 4vw;
        right: 4vw;
        top: auto;
        bottom: calc(1rem + var(--safe-b));
        width: auto;
        transform: translateY(10px);
    }
    #brief.on {
        transform: none;
    }
}


/* Phones */

@media (max-width: 600px) {
    header {
        padding: 0.5rem 0.8rem 0;
    }
    #journey,
    #stage {
        margin-inline: 0;
    }
    #journey {
        margin-inline: 0.8rem;
    }
    #stage {
        padding: 0 0.9rem;
    }
    .plate img {
        height: 2.1rem;
    }
    .ctl button {
        padding: 0.35rem 0.7rem;
        font-size: 0.74rem;
    }
    .ctl .opt {
        display: none;
    }
    .node {
        width: 1.3rem;
        height: 1.3rem;
    }
    .dot {
        border-width: 1.5px;
        font-size: 0.55rem;
    }
    h1,
    .curiosity h1,
    .intro h1 {
        font-size: 2.1rem;
    }
    h2,
    .layer-head h2,
    .big-head h2 {
        font-size: 1.9rem;
    }
    .final h1 {
        font-size: 1.8rem;
    }
    .quote.big {
        font-size: 1.5rem;
    }
    .grid3 {
        grid-template-columns: minmax(0, 1fr);
    }
    .grid2 .vcard {
        padding: 1rem 0.5rem;
        font-size: 0.95rem;
    }
    .how .grid3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .how .vcard {
        padding: 0.8rem 0.4rem;
        font-size: 0.8rem;
    }
    .how .vcard .ico.big {
        width: 2.2rem;
        height: 2.2rem;
    }
    .wavy {
        height: 15rem;
    }
    .wnode {
        width: 31%;
        padding: 0.5rem 0.35rem;
    }
    .wnode b {
        font-size: 0.8rem;
    }
    .wnode small {
        font-size: 0.66rem;
    }
    .pl {
        font-size: 1.3rem;
    }
    .pl.p5 {
        font-size: 1.7rem;
    }
    .pl.p6 {
        font-size: 1.5rem;
    }
    /* Orbit pages: logo on top, boxes wrap below it */
    .orbwrap {
        padding: 0;
    }
    .orb {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.6rem;
        width: 100%;
        aspect-ratio: auto;
    }
    .orb .ring {
        display: none;
    }
    .orb .core {
        position: static;
        flex: 0 0 7.5rem;
        width: 7.5rem;
        margin: 0 30% 0.6rem;
        transform: none;
    }
    .sat {
        position: static;
        max-width: 46%;
        transform: none;
    }
}


/* Short landscape screens */

@media (max-height: 520px) and (orientation: landscape) {
    #journey {
        height: 4.5rem;
    }
    .lab {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }
}


/* Very short screens (landscape phones): smaller type so more fits */

@media (max-height: 520px) {
    html {
        font-size: 12px;
    }
}

#bRestart {
    position: static;
    justify-self: center;
    width: max-content;
    max-width: 100%;
    margin: 1.2rem auto 0.4rem;
    padding: 0.8rem 1.8rem;
    border: 1px solid var(--gold);
    border-radius: 999px;
    background: linear-gradient(135deg, #1f2a6b, #0e143c);
    box-shadow: 0 0 1.2rem rgba(227, 191, 104, 0.3);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

#bRestart:hover {
    border-color: #fff;
    background: linear-gradient(135deg, #7d1328, #c02a45);
    box-shadow: 0 0 1.6rem rgba(255, 122, 142, 0.6);
}

#stage {
    touch-action: pan-y;
}