/* ==========================================================================
   Homepage — Our Values (.vl), The Flight Path (.fp), Why Nebulight (.wn),
   Our Reach (.rc). Plain CSS; shares tokens from home-hero.css.
   Driven by assets/js/home/story.js. Every section's default (no JS, reduced
   motion) is its complete, fully readable state; JS "arms" the motion.
   ========================================================================== */

.vl,
.fp,
.wn,
.rc {
    --st-ink: #0c0b1d;
    --st-ink-soft: #4b4a5e;
    --st-ink-quiet: #6c6a80;
    position: relative;
    overflow: hidden;
    font-family: "Manrope", sans-serif;
}

.st-shell {
    position: relative;
    max-width: var(--hx-max);
    margin: 0 auto;
    padding: 0 var(--hx-gutter);
}

.st-label {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #7fd3f7;
}

.st-label::before {
    content: "";
    width: 1.75rem;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}

.st-label--ink {
    color: #6d28d9;
}

.st-head {
    display: grid;
    gap: 1.75rem;
    align-items: end;
    margin-bottom: clamp(3rem, 7vw, 6rem);
}

.st-title {
    margin: 1.3rem 0 0;
    font-size: clamp(2.3rem, 4.8vw, 4.4rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.st-title > span {
    display: block;
}

.st-copy {
    max-width: 32rem;
    font-size: 1.02rem;
    line-height: 1.75;
}

.st-copy p {
    margin: 0;
}

.st-copy p + p {
    margin-top: 1rem;
}

.st-copy .st-lede {
    font-size: clamp(1.1rem, 1.4vw, 1.25rem);
    font-weight: 600;
    line-height: 1.55;
}

@media (min-width: 960px) {
    .st-head {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        gap: 4rem;
    }

    .st-head .st-copy {
        justify-self: end;
        padding-bottom: 0.4rem;
    }
}

/* A single, quiet text CTA used inside section intros. */
.st-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 2.75rem;
    margin-top: 1.5rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #0c0b1d;
    text-decoration: none;
}

.st-cta-arrow {
    display: inline-grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid rgba(12, 11, 29, 0.2);
    border-radius: 0.375rem;
    transition: background-color 0.4s var(--hx-ease), border-color 0.4s var(--hx-ease), color 0.4s var(--hx-ease);
}

.st-cta-arrow svg {
    width: 0.95rem;
    height: 0.95rem;
    transition: transform 0.5s var(--hx-ease);
}

.st-cta:hover .st-cta-arrow {
    border-color: transparent;
    background: #6d28d9;
    color: #fff;
}

.st-cta:hover .st-cta-arrow svg {
    transform: translateX(2px);
}

.st-cta:focus-visible {
    outline: 2px solid #6d28d9;
    outline-offset: 4px;
    border-radius: 0.25rem;
}

/* ==========================================================================
   Our Values — light, typographic, philosophical
   ========================================================================== */

.vl {
    padding: clamp(5rem, 10vw, 9rem) 0 clamp(4.5rem, 9vw, 8rem);
    background: #f6f5fb;
    color: var(--st-ink);
}

/* One soft wash per value; the active value's wash fades in. */
.vl-wash {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.vl-wash span {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.4s var(--hx-ease);
    background:
        radial-gradient(60rem 42rem at 86% 34%, rgba(var(--c), 0.13), transparent 62%),
        radial-gradient(40rem 30rem at 6% 62%, rgba(var(--c), 0.06), transparent 60%);
}

.vl[data-active="0"] .vl-wash span:nth-child(1),
.vl[data-active="1"] .vl-wash span:nth-child(2),
.vl[data-active="2"] .vl-wash span:nth-child(3),
.vl[data-active="3"] .vl-wash span:nth-child(4) {
    opacity: 1;
}

.vl-head {
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.vl-title {
    max-width: 14ch;
}

.vl-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(12, 11, 29, 0.12);
}

.vl-item {
    display: grid;
    gap: 0.8rem;
    padding: clamp(1.5rem, 3vw, 2.4rem) 0;
    border-bottom: 1px solid rgba(12, 11, 29, 0.12);
}

.vl-n {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.74rem;
    letter-spacing: 0.2em;
    color: var(--st-ink-quiet);
}

.vl-word {
    margin: 0;
    /* Room for descenders (the y in "Catalytic") inside the gradient fill. */
    padding-bottom: 0.18em;
    margin-bottom: -0.18em;
    font-size: clamp(3rem, 13.5vw, 7.4rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.045em;
    color: var(--st-ink);
    transition: color 0.7s var(--hx-ease), -webkit-text-stroke-color 0.7s var(--hx-ease);
}

.vl-dot {
    color: rgb(var(--vl-c));
}

.vl-text {
    max-width: 24rem;
}

.vl-lead {
    margin: 0 0 0.45rem;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--st-ink);
    transition: color 0.6s var(--hx-ease);
}

.vl-body {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--st-ink-soft);
    transition: color 0.6s var(--hx-ease);
}

/* Armed: only the value at the centre of the screen is filled in. The others
   stay as outlines with fully readable (if quieter) supporting copy. */
.vl-armed .vl-item.is-active .vl-word {
    color: transparent;
    -webkit-text-stroke-color: transparent;
    background-image: linear-gradient(100deg, var(--st-ink) 0 40%, rgb(var(--vl-c)) 50%, var(--st-ink) 60% 100%);
    background-size: 280% 100%;
    background-position: 0% 0;
    -webkit-background-clip: text;
    background-clip: text;
    animation: vl-sweep 1.5s var(--hx-ease) both;
}

@keyframes vl-sweep {
    from { background-position: 100% 0; }
    to { background-position: 0% 0; }
}

.vl-armed .vl-item:not(.is-active) .vl-word {
    color: transparent;
    -webkit-text-stroke: 1.25px #8b88a0;
}

.vl-armed .vl-item:not(.is-active) .vl-dot {
    color: transparent;
}

.vl-armed .vl-item:not(.is-active) .vl-lead,
.vl-armed .vl-item:not(.is-active) .vl-body {
    color: var(--st-ink-quiet);
}

@media (min-width: 960px) {
    .vl-item {
        grid-template-columns: 3.5rem minmax(0, 1fr) minmax(0, 19rem);
        align-items: center;
        column-gap: clamp(1.5rem, 3vw, 3rem);
    }

    .vl-word {
        font-size: clamp(4.4rem, 7.8vw, 7.4rem);
    }
}

@media (min-width: 1280px) {
    .vl-item {
        grid-template-columns: 4rem minmax(0, 1fr) minmax(0, 22rem);
    }
}

/* ==========================================================================
   The Flight Path — a launch sequence
   ========================================================================== */

.fp {
    padding: clamp(5rem, 10vw, 9rem) 0 clamp(6rem, 12vw, 10.5rem);
    color: #fff;
    /* Opens on the exact colour the section above ends on. */
    background: linear-gradient(180deg, #090a10 0%, #05060f 34%, #04050d 100%);
}

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

/* A faint telemetry grid, strongest behind the sequence. */
.fp-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 5.5rem 5.5rem;
    background-position: center top;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 55%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 55%, #000 20%, transparent 75%);
}

/* Dawn on the lower edge: the section hands off into the light one below. */
.fp-horizon {
    position: absolute;
    inset: auto 0 0;
    height: 46%;
    opacity: 0.5;
    background:
        radial-gradient(60% 90% at 50% 100%, rgba(124, 58, 237, 0.32), rgba(14, 165, 233, 0.1) 45%, transparent 72%);
    transition: opacity 2s var(--hx-ease);
}

.fp-horizon::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.7) 25%, rgba(14, 165, 233, 0.9) 50%, rgba(244, 114, 182, 0.6) 75%, transparent);
}

.fp.is-launched .fp-horizon {
    opacity: 1;
}

/* The release: one restrained bloom of light centred on the 00 node. */
.fp-flare {
    position: absolute;
    width: 56rem;
    height: 56rem;
    left: 75%;
    top: 55%;
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.15);
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.5), rgba(125, 211, 252, 0.3) 16%, rgba(124, 58, 237, 0.16) 40%, transparent 70%);
    mix-blend-mode: screen;
}

.fp.is-launched .fp-flare {
    animation: fp-flare 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fp-flare {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.15); }
    18% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.35); }
}

.fp-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem 3rem;
    margin-bottom: clamp(3.5rem, 7vw, 6rem);
}

.fp-readout {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    padding: 0.55rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    font-variant-numeric: tabular-nums;
}

.fp-readout-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--hx-cyan);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.8);
}

.fp-stages {
    position: relative;
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fp-stage {
    position: relative;
}

.fp-t {
    margin: 0 0 0.6rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.24em;
    color: rgba(255, 255, 255, 0.5);
}

.fp-num {
    margin: 0;
    font-size: clamp(4.2rem, 8.6vw, 8.4rem);
    font-weight: 800;
    line-height: 0.86;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
    color: #fff;
    transition: color 0.6s var(--hx-ease), text-shadow 0.8s var(--hx-ease), -webkit-text-stroke-color 0.6s var(--hx-ease);
}

/* The trajectory: one rail segment per stage; together they read as one line. */
.fp-rail {
    position: relative;
    display: block;
    height: 1px;
    margin: 1.75rem 0;
    background: rgba(255, 255, 255, 0.14);
}

.fp-rail::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgb(var(--fp-c)), rgb(var(--fp-c-next, var(--fp-c))));
    transform: scaleX(1);
    transform-origin: left;
    transition: transform 0.9s var(--hx-ease);
}

.fp-node {
    position: absolute;
    z-index: 1;
    left: 0;
    top: 50%;
    width: 0.75rem;
    height: 0.75rem;
    margin: -0.375rem 0 0 -0.375rem;
    border-radius: 50%;
    background: rgb(var(--fp-c));
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 6px rgba(var(--fp-c), 0.16);
    transition: background-color 0.5s var(--hx-ease), box-shadow 0.8s var(--hx-ease), transform 0.6s var(--hx-ease);
}

.fp-name {
    margin: 0 0 0.6rem;
    font-size: clamp(1.35rem, 1.8vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.fp-desc {
    margin: 0;
    max-width: 19rem;
    font-size: 0.98rem;
    line-height: 1.7;
    color: rgba(226, 228, 240, 0.74);
    transition: color 0.6s var(--hx-ease);
}

/* ---------- Armed: the countdown states ---------- */

.fp-armed .fp-stage .fp-num {
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.24);
}

.fp-armed .fp-stage .fp-rail::after {
    transform: scaleX(0);
}

.fp-armed .fp-stage .fp-node {
    background: #05060f;
    box-shadow: none;
}

.fp-armed .fp-stage .fp-desc {
    color: rgba(226, 228, 240, 0.58);
}

/* Passed stages: filled, quieter. */
.fp-armed .fp-stage.is-done .fp-num {
    color: rgba(255, 255, 255, 0.34);
    -webkit-text-stroke-color: transparent;
}

.fp-armed .fp-stage.is-done .fp-rail::after {
    transform: scaleX(1);
}

.fp-armed .fp-stage.is-done .fp-node {
    background: rgba(255, 255, 255, 0.75);
}

/* The live stage: lit in its colour; its rail fills while it holds. */
.fp-armed .fp-stage.is-active .fp-num {
    color: #fff;
    -webkit-text-stroke-color: transparent;
    text-shadow: 0 0 46px rgba(var(--fp-c), 0.6);
}

.fp-armed .fp-stage.is-active .fp-rail::after {
    transform: scaleX(1);
    transition: transform var(--fp-step, 1.5s) linear;
}

.fp-armed .fp-stage.is-active .fp-num {
    animation: fp-roll 0.75s var(--hx-ease) both;
}

@keyframes fp-roll {
    from { opacity: 0.25; transform: translate3d(0, 28%, 0); }
    to { opacity: 1; transform: none; }
}

.fp-armed .fp-stage.is-active .fp-node {
    background: rgb(var(--fp-c));
    box-shadow: 0 0 0 6px rgba(var(--fp-c), 0.2), 0 0 26px rgba(var(--fp-c), 0.9);
    transform: scale(1.25);
}

.fp-armed .fp-stage.is-active .fp-desc,
.fp-armed .fp-stage.is-done .fp-desc {
    color: rgba(226, 228, 240, 0.76);
}

/* Between runs: the path dims for a beat while it resets, then counts down
   again (wide screens). */
.fp-armed .fp-stages,
.fp-armed .fp-readout {
    transition: opacity 0.6s ease;
}

.fp-armed.is-rewinding .fp-stages,
.fp-armed.is-rewinding .fp-readout {
    opacity: 0.25;
}

/* Launched: the whole path is lit; 00 keeps the light. */
.fp-armed.is-launched .fp-stage .fp-rail::after {
    transform: scaleX(1);
}

.fp-armed.is-launched .fp-stage:not(.is-active) .fp-num {
    color: rgba(255, 255, 255, 0.4);
    -webkit-text-stroke-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
    .fp-armed.is-launched .fp-stage:not(.is-active):hover .fp-num {
        color: rgba(255, 255, 255, 0.8);
    }
}

/* ---------- Wide: a horizontal timeline ---------- */

@media (min-width: 900px) {
    .fp-stages {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .fp-stage {
        padding-right: clamp(1rem, 2.4vw, 2.5rem);
    }

    /* Rails touch across the column gaps so the line is continuous. */
    .fp-rail {
        margin-right: calc(clamp(1rem, 2.4vw, 2.5rem) * -1);
    }

    /* After 00 the line runs on, out of the frame. */
    .fp-stage:last-child .fp-rail::before {
        content: "";
        position: absolute;
        left: 100%;
        top: 0;
        width: 50vw;
        height: 1px;
        background: linear-gradient(90deg, rgb(var(--fp-c)), rgba(var(--fp-c), 0));
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
    }

    .fp.is-launched .fp-stage:last-child .fp-rail::before,
    .fp:not(.fp-armed) .fp-stage:last-child .fp-rail::before {
        transform: scaleX(1);
    }
}

/* ---------- Narrow: a vertical countdown ---------- */

@media (max-width: 899px) {
    .fp-stage {
        padding: 0 0 2.75rem 2.25rem;
    }

    .fp-stage:last-child {
        padding-bottom: 0;
    }

    .fp-rail {
        position: absolute;
        left: 0.4rem;
        top: 0;
        bottom: 0;
        width: 1px;
        height: auto;
        margin: 0;
    }

    .fp-rail::after {
        background: linear-gradient(180deg, rgb(var(--fp-c)), rgb(var(--fp-c-next, var(--fp-c))));
        transform-origin: top;
    }

    .fp-armed .fp-stage .fp-rail::after {
        transform: scaleY(0);
    }

    .fp-armed .fp-stage.is-done .fp-rail::after,
    .fp-armed .fp-stage.is-active .fp-rail::after,
    .fp-armed.is-launched .fp-stage .fp-rail::after {
        transform: scaleY(1);
    }

    .fp-stage:last-child .fp-rail {
        bottom: auto;
        height: 4.5rem;
    }

    .fp-node {
        left: 50%;
        top: 2.6rem;
    }

    .fp-num {
        font-size: clamp(4rem, 19vw, 5.6rem);
        margin-bottom: 1rem;
    }

    .fp-flare {
        width: 34rem;
        height: 34rem;
    }
}

/* ==========================================================================
   Why Nebulight — a centred statement over four principles. With the script
   (assets/js/home/story.js) the principles sit side by side as tall panels: one
   opens wide with its picture and words while the others fold into slim
   strips, and they take turns. Without it (or with reduced motion) they are
   four plain cards.
   ========================================================================== */

.wn {
    padding: clamp(5rem, 10vw, 8.5rem) 0;
    background:
        radial-gradient(60rem 26rem at 50% 0%, rgba(124, 58, 237, 0.08), transparent 70%),
        radial-gradient(40rem 22rem at 100% 100%, rgba(14, 165, 233, 0.06), transparent 70%),
        #fbfbfd;
    color: var(--st-ink);
}

/* ---------- The statement ---------- */

.wn-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 60rem;
    margin: 0 auto clamp(3rem, 6vw, 4.75rem);
    text-align: center;
}

.wn-head .st-label::after {
    content: "";
    width: 1.75rem;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}

.wn .st-title {
    font-size: clamp(2.5rem, 6.4vw, 5.6rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.wn .wn-title-lit {
    color: transparent;
    background: linear-gradient(94deg, #7c3aed 0%, #0ea5e9 35%, #f472b6 65%, #7c3aed 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    /* Room for descenders inside the clipped gradient. */
    padding-bottom: 0.14em;
    margin-bottom: -0.14em;
}

@media (prefers-reduced-motion: no-preference) {
    .wn .wn-title-lit {
        animation: wn-flow 10s ease-in-out infinite alternate;
    }
}

@keyframes wn-flow {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

.wn-lede {
    max-width: 42rem;
    margin: clamp(1.5rem, 3vw, 2.1rem) 0 0;
    font-size: clamp(1.05rem, 1.35vw, 1.2rem);
    line-height: 1.7;
    color: var(--st-ink-soft);
    text-wrap: pretty;
}

.wn-cta {
    margin-top: 1.4rem;
}

/* ---------- The principles (plain cards) ---------- */

.wn-panels {
    display: grid;
    gap: 0.9rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 640px) {
    .wn-panels {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .wn-panels {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.wn-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 26rem;
    overflow: hidden;
    border-radius: 0.75rem;
    background: #07080f;
    color: #fff;
    isolation: isolate;
    box-shadow: 0 40px 70px -45px rgba(12, 11, 29, 0.6);
}

.wn-panel-img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: var(--wn-x, 50%) 50%;
}

/* Shade for the words. */
.wn-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, rgba(4, 5, 13, 0.92) 0%, rgba(4, 5, 13, 0.55) 38%, rgba(4, 5, 13, 0) 70%);
    pointer-events: none;
}

/* A fine gradient edge, lit on the open panel. */
.wn-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(140deg, rgba(124, 58, 237, 0.95), rgba(14, 165, 233, 0.6) 45%, rgba(244, 114, 182, 0) 75%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s var(--hx-ease);
}

.wn-panel-n {
    position: absolute;
    top: 1.35rem;
    left: 1.4rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.72);
}

.wn-panel-tab,
.wn-panel-bar {
    display: none;
}

.wn-panel-body {
    padding: clamp(1.4rem, 2.4vw, 2.2rem);
}

.wn-head3 {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin: 0 0 0.75rem;
}

.wn-k {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #7fd3f7;
}

.wn-item-title {
    font-size: clamp(1.5rem, 2.3vw, 2.1rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: #fff;
}

.wn-item-body {
    margin: 0;
    max-width: 26rem;
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(226, 228, 240, 0.76);
}

/* ---------- Live: one opens wide at a time ---------- */

.wn-live .wn-panels {
    display: flex;
    container-type: size;
}

.wn-live .wn-panel {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    /* Arriving: the panels rise in, one after another. */
    opacity: 0;
    transform: translate3d(0, 2.5rem, 0);
    transition:
        flex-grow 0.95s cubic-bezier(0.65, 0, 0.2, 1),
        box-shadow 0.95s var(--hx-ease),
        opacity 0.8s ease calc(var(--i, 0) * 0.1s),
        transform 1.1s var(--hx-ease) calc(var(--i, 0) * 0.1s);
}

.wn-setup .wn-panel,
.wn-setup .wn-panel *,
.wn-setup .wn-panel::before,
.wn-setup .wn-panel::after {
    transition: none !important;
}

.wn-live.is-in .wn-panel {
    opacity: 1;
    transform: none;
}

.wn-live .wn-panel.is-open {
    flex-grow: 4.6;
    box-shadow: 0 50px 90px -45px rgba(76, 29, 149, 0.55);
}

.wn-live .wn-panel.is-open::before {
    opacity: 1;
}

/* The picture stays the open panel's size, so a folded strip shows a slice
   of it rather than squeezing it. */
.wn-live .wn-panel-img {
    filter: brightness(0.5) saturate(0.75);
    transform: scale(1.12);
    transition: filter 0.9s var(--hx-ease), transform 7s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.wn-live .wn-panel.is-open .wn-panel-img {
    filter: none;
    transform: scale(1);
}

.wn-live .wn-panel::after {
    background: linear-gradient(0deg, rgba(4, 5, 13, 0.9) 0%, rgba(4, 5, 13, 0.45) 34%, rgba(4, 5, 13, 0) 62%);
}

/* The folded label. */
.wn-live .wn-panel-tab {
    display: block;
    position: absolute;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.88);
    transition: opacity 0.45s ease 0.3s;
    pointer-events: none;
}

.wn-live .wn-panel.is-open .wn-panel-tab {
    opacity: 0;
    transition-delay: 0s;
}

/* The words: hidden while folded, rising in once the panel has opened. */
.wn-live .wn-panel-body {
    position: absolute;
    left: 0;
    bottom: 0;
    pointer-events: none;
}

.wn-live .wn-panel-body > * {
    opacity: 0;
    transform: translate3d(0, 1rem, 0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.wn-live .wn-panel.is-open .wn-panel-body > * {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease 0.45s, transform 0.9s var(--hx-ease) 0.45s;
}

.wn-live .wn-panel.is-open .wn-item-body {
    transition-delay: 0.6s;
}

/* How long the open panel has left before the next takes its turn. */
.wn-live .wn-panel-bar {
    display: block;
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.wn-live .wn-panel.is-open .wn-panel-bar {
    opacity: 1;
}

.wn-panel-bar span {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #7c3aed, #0ea5e9 60%, #f472b6);
    transform: scaleX(0);
    transform-origin: left;
}

.wn-live .wn-panel.is-open .wn-panel-bar span {
    animation: wn-progress var(--wn-dur, 6.5s) linear forwards;
}

.wn-live.is-held .wn-panel.is-open .wn-panel-bar span {
    animation-play-state: paused;
}

@keyframes wn-progress {
    to { transform: scaleX(1); }
}

/* Each panel is a button over its picture. */
.wn-panel-btn {
    position: absolute;
    inset: 0;
    z-index: 3;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    cursor: pointer;
}

.wn-panel.is-open .wn-panel-btn {
    cursor: default;
}

.wn-panel-btn:focus-visible {
    outline: 2px solid #7fd3f7;
    outline-offset: -4px;
}

@media (hover: hover) and (pointer: fine) {
    .wn-live .wn-panel:not(.is-open):hover .wn-panel-img {
        filter: brightness(0.72) saturate(0.9);
    }
}

/* Wide: side by side, the folded ones with an upright label. */
@media (min-width: 900px) {
    .wn-live .wn-panels {
        gap: 0.75rem;
        height: clamp(28rem, 64vh, 38rem);
    }

    .wn-live .wn-panel-img {
        left: 50%;
        width: 64cqw;
        translate: -50% 0;
    }

    .wn-live .wn-panel-tab {
        left: 50%;
        bottom: 1.6rem;
        writing-mode: vertical-rl;
        transform: translateX(-50%) rotate(180deg);
    }

    .wn-live .wn-panel-body {
        width: min(36rem, 52cqw);
    }
}

/* Narrow: stacked, the folded ones as slim rows with their name. */
@media (max-width: 899px) {
    .wn-live .wn-panels {
        flex-direction: column;
        gap: 0.6rem;
        height: clamp(36rem, 132vw, 44rem);
    }

    .wn-live .wn-panel {
        border-radius: 0.6rem;
    }

    .wn-live .wn-panel.is-open {
        flex-grow: 5.2;
    }

    .wn-live .wn-panel-img {
        top: 50%;
        height: 70cqh;
        translate: 0 -50%;
    }

    .wn-live .wn-panel-n {
        top: 1.5rem;
    }

    .wn-live .wn-panel-tab {
        top: 1.42rem;
        left: 3.6rem;
    }

    .wn-live .wn-panel-body {
        right: 0;
    }
}

/* ==========================================================================
   Our Reach — dark, cinematic city carousel
   ========================================================================== */

.rc {
    padding: clamp(5rem, 10vw, 9rem) 0 clamp(5rem, 9vw, 8rem);
    color: #fff;
    /* Ends on the contact section's colour so that hand-off is seamless. */
    background:
        radial-gradient(50rem 30rem at 85% 10%, rgba(124, 58, 237, 0.16), transparent 62%),
        linear-gradient(180deg, #05060f 0%, #0a0b16 55%, #131315 100%);
}

/* "Boundless possibilities." in the brand colours, slowly flowing (lighter tints so
   it holds up on the dark). */
.rc .rc-title-soft {
    color: transparent;
    background: linear-gradient(94deg, #8b5cf6 0%, #38bdf8 35%, #f472b6 65%, #8b5cf6 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    padding-bottom: 0.14em;
    margin-bottom: -0.14em;
}

@media (prefers-reduced-motion: no-preference) {
    .rc .rc-title-soft {
        animation: wn-flow 10s ease-in-out infinite alternate;
    }
}

.rc-copy {
    color: rgba(222, 224, 240, 0.74);
}

.rc-copy .st-lede {
    color: #fff;
}

.rc-stage {
    position: relative;
    aspect-ratio: 4 / 3.7;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #0a0b16;
    touch-action: pan-y;
    isolation: isolate;
}

.rc-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.1s var(--hx-ease);
}

.rc-slide.is-active {
    z-index: 1;
    opacity: 1;
}

.rc-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.06);
    transition: transform 2.4s var(--hx-ease);
}

.rc-slide.is-active img {
    transform: scale(1);
    transition: transform 9s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.rc-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(0deg, rgba(4, 5, 13, 0.88) 0%, rgba(4, 5, 13, 0.3) 42%, rgba(4, 5, 13, 0) 68%),
        linear-gradient(90deg, rgba(4, 5, 13, 0.35), rgba(4, 5, 13, 0) 45%);
}

.rc-caption {
    position: absolute;
    z-index: 1;
    left: clamp(1.25rem, 3vw, 2.75rem);
    right: clamp(1.25rem, 3vw, 2.75rem);
    bottom: clamp(1.25rem, 3vw, 2.5rem);
}

.rc-caption > * {
    margin: 0;
    transition: opacity 0.8s var(--hx-ease), transform 1s var(--hx-ease);
}

.rc-slide:not(.is-active) .rc-caption > * {
    opacity: 0;
    transform: translateY(12px);
}

.rc-slide.is-active .rc-city {
    transition-delay: 0.15s;
}

.rc-slide.is-active .rc-coords {
    transition-delay: 0.25s;
}

.rc-region {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.74rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #7fd3f7;
}

.rc-city {
    margin: 0.4rem 0 0.7rem !important;
    font-size: clamp(2.6rem, 7vw, 6.2rem);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: -0.045em;
}

.rc-coords {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.64);
    font-variant-numeric: tabular-nums;
}

.rc-network {
    position: absolute;
    z-index: 2;
    top: clamp(1rem, 2.4vw, 1.75rem);
    left: clamp(1.25rem, 3vw, 2.75rem);
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    background: rgba(4, 5, 13, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.66rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.rc-network::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--hx-pink);
    box-shadow: 0 0 10px rgba(244, 114, 182, 0.9);
}

/* City names: letters rise in turn as a city arrives. */
/* Room below the line inside the mask so descenders (the "g" in Chicago)
   aren't clipped; the negative margin keeps the spacing as it was. */
.rc-letters .rc-city {
    overflow: hidden;
    padding-bottom: 0.3em;
    margin-bottom: calc(0.7rem - 0.14em) !important;
}

.rc-letters .rc-ch {
    display: inline-block;
    transform: translate3d(0, 110%, 0);
    transition: transform 0.85s var(--hx-ease);
    transition-delay: calc(0.12s + var(--i, 0) * 0.035s);
}

.rc-letters .rc-slide.is-active .rc-ch {
    transform: none;
}

/* ---------- Controls ---------- */

.rc-controls {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

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

.rc-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-height: 3.6rem;
    padding: 1rem 0 0.4rem;
    border: 0;
    background: none;
    text-align: left;
    font-family: "Manrope", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 0.58);
    cursor: pointer;
    transition: color 0.4s var(--hx-ease);
}

.rc-tab-n {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.42);
}

.rc-tab-bar {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.14);
}

.rc-tab-bar span {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--hx-purple), var(--hx-cyan));
    transform: scaleX(0);
    transform-origin: left;
}

.rc-tab:hover,
.rc-tab[aria-selected="true"] {
    color: #fff;
}

.rc-tab[aria-selected="true"] .rc-tab-bar span {
    animation: rc-progress var(--rc-dur, 5s) linear forwards;
}

.rc.is-held .rc-tab[aria-selected="true"] .rc-tab-bar span {
    animation-play-state: paused;
}

@keyframes rc-progress {
    to { transform: scaleX(1); }
}

.rc-buttons {
    display: flex;
    gap: 0.6rem;
    align-self: flex-end;
}

.rc-btn {
    display: inline-grid;
    place-items: center;
    width: 2.9rem;
    height: 2.9rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.375rem;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.4s var(--hx-ease), border-color 0.4s var(--hx-ease);
}

.rc-btn svg {
    width: 1.05rem;
    height: 1.05rem;
}

.rc-btn:hover {
    border-color: rgba(124, 58, 237, 0.8);
    background: rgba(124, 58, 237, 0.24);
}

.rc-btn .rc-icon-play,
.rc-btn.is-paused .rc-icon-pause {
    display: none;
}

.rc-btn.is-paused .rc-icon-play {
    display: block;
}

.rc-tab:focus-visible,
.rc-btn:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: 4px;
}

@media (min-width: 720px) {
    .rc-stage {
        aspect-ratio: 16 / 8.6;
    }

    .rc-controls {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 2.5rem;
    }

    .rc-tabs {
        flex: 1;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .rc-buttons {
        align-self: center;
    }
}

/* ---------- Phones and small tablets: the count in place of the tabs ----------
   The four city names give way to the count (its line filling as the city
   plays) beside the step and pause buttons; a swipe on the photograph steps
   too (assets/js/home/story.js). */

.rc-count {
    display: none;
}

@media (max-width: 899px) {
    /* A shorter run down to the contact section, which opens on a horizon
       of light (contact.css). */
    .rc {
        padding-bottom: 3rem;
    }

    .rc-controls {
        flex-direction: row;
        align-items: center;
        gap: 1.25rem;
    }

    .rc-tabs {
        display: none;
    }

    .rc-count {
        display: grid;
        flex: 1;
        gap: 0.6rem;
        min-width: 0;
    }

    .rc-count-text {
        font-family: "Space Grotesk", sans-serif;
        font-size: 0.74rem;
        font-weight: 700;
        letter-spacing: 0.2em;
        color: rgba(255, 255, 255, 0.45);
        font-variant-numeric: tabular-nums;
    }

    .rc-count-now {
        color: #fff;
    }

    .rc-count-bar {
        position: relative;
        height: 2px;
        overflow: hidden;
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.14);
    }

    .rc-count-bar span {
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, var(--hx-purple), var(--hx-cyan));
        transform: scaleX(0);
        transform-origin: left;
        animation: rc-progress var(--rc-dur, 5s) linear forwards;
    }

    .rc.is-held .rc-count-bar span {
        animation-play-state: paused;
    }

    .rc-buttons {
        align-self: center;
    }

    .rc-btn {
        -webkit-tap-highlight-color: transparent;
        transition: background-color 0.4s var(--hx-ease), border-color 0.4s var(--hx-ease), scale 0.25s var(--hx-ease);
    }

    .rc-btn:active {
        border-color: rgba(124, 58, 237, 0.8);
        background: rgba(124, 58, 237, 0.24);
        scale: 0.92;
    }
}

@media (min-width: 1200px) {
    .rc-stage {
        aspect-ratio: 16 / 7.2;
    }

    .rc-tab {
        font-size: 1.1rem;
    }
}

/* ==========================================================================
   Reduced motion: complete states, no transitions, no rotation.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .vl *,
    .fp *,
    .wn *,
    .rc *,
    .vl-wash span {
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }

    .fp-flare {
        display: none;
    }

    .wn .wn-title-lit,
    .rc .rc-title-soft,
    .vl-armed .vl-item.is-active .vl-word,
    .fp-armed .fp-stage.is-active .fp-num {
        animation: none !important;
    }

    .rc-tab[aria-selected="true"] .rc-tab-bar span,
    .rc-count-bar span {
        animation: none;
        transform: scaleX(1);
    }

    .rc-btn[data-rc-toggle] {
        display: none;
    }
}

/* ==========================================================================
   Pictures wrapping existing images (WebP with JPEG fallback) must fill
   their frames exactly as the bare <img> did.
   ========================================================================== */

.rc-slide picture {
    display: block;
    width: 100%;
    height: 100%;
}
