/* Scenes: the layout of every chapter.
   These rules work on their own as a normal long page (no JavaScript, print).
   film.css stacks the scenes on a fixed stage and adds the motion. */

.scene {
    position: relative;
    isolation: isolate;
}

.scene__light {
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        radial-gradient(55% 60% at var(--light-a-at, 12% 8%), var(--light-a, rgba(63, 139, 244, 0.14)), transparent 72%),
        radial-gradient(45% 55% at var(--light-b-at, 92% 26%), var(--light-b, rgba(80, 221, 202, 0.07)), transparent 72%);
    pointer-events: none;
}

.scene__frame {
    padding: clamp(5.5rem, 10vw, 8rem) var(--gutter);
}

.scene__inner {
    width: min(100%, var(--shell));
    margin-inline: auto;
}

/* 0. Intro */

.scene--hero .scene__frame {
    display: flex;
    min-height: 100svh;
    flex-direction: column;
    justify-content: center;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) minmax(0, 0.78fr);
    align-items: center;
    gap: clamp(2rem, 4.5vw, 4.5rem);
}

.hero__title {
    margin-bottom: clamp(1rem, 3vh, 1.75rem);
    font-size: clamp(2.75rem, min(6vw, 9.8vh), 5.4rem);
    font-weight: 720;
    letter-spacing: -0.045em;
    line-height: 0.98;
}

.hero__accent {
    color: var(--blue);
}

.hero__intro {
    max-width: 39rem;
    margin-bottom: clamp(1.25rem, 3.6vh, 2.1rem);
    color: var(--paper-soft);
    font-size: var(--text-lead);
    line-height: 1.55;
}

.hero__actions .intro {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.hero__visual {
    position: relative;
    display: grid;
    min-height: clamp(21rem, 64vh, 36rem);
    place-items: center;
}

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

.orbit-ring,
.orbit-arc {
    fill: none;
    stroke-width: 1;
}

.orbit-ring {
    stroke: rgba(106, 168, 255, 0.22);
}

.orbit-ring--dashed {
    stroke-dasharray: 3 10;
}

.orbit-arc {
    stroke: rgba(110, 231, 216, 0.4);
}

.orbit-node {
    position: absolute;
    width: 0.8rem;
    height: 0.8rem;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--aqua);
    box-shadow: 0 0 0 5px rgba(110, 231, 216, 0.1), 0 0 22px rgba(110, 231, 216, 0.45);
}

.orbit-node--one {
    top: 22%;
    left: 9%;
}

.orbit-node--two {
    right: 6%;
    bottom: 27%;
    background: var(--blue);
}

.portrait {
    --pad: clamp(0.5rem, 1.2vh, 0.7rem);
    position: relative;
    width: min(80%, 21rem);
    aspect-ratio: 4 / 5.75;
}

.portrait__card {
    --r-base: 1.5deg;
    position: absolute;
    inset: 0;
    rotate: 1.5deg;
    border: 1px solid rgba(180, 207, 238, 0.24);
    border-radius: var(--radius-lg);
    background: linear-gradient(170deg, #142740, #0c1a2c 70%);
    box-shadow: var(--shadow), 0 0 80px rgba(67, 141, 245, 0.1);
}

.portrait__photo {
    --r-base: 1.5deg;
    --photo-radius: calc(var(--radius-lg) - var(--pad));
    position: absolute;
    top: var(--pad);
    right: var(--pad);
    left: var(--pad);
    aspect-ratio: 4 / 5;
    overflow: hidden;
    rotate: 1.5deg;
    border-radius: var(--photo-radius);
    background: var(--ink-raised);
}

.portrait__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 22%;
    filter: saturate(0.9) contrast(1.03);
}

.portrait__caption {
    --r-base: 1.5deg;
    position: absolute;
    right: calc(var(--pad) + 0.4rem);
    bottom: 0;
    left: calc(var(--pad) + 0.4rem);
    display: flex;
    height: calc(100% * 0.75 / 5.75);
    align-items: center;
    rotate: 1.5deg;
    font-size: 0.86rem;
    line-height: 1.3;
}

.portrait__caption .intro {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.portrait__caption strong {
    font-weight: 650;
    white-space: nowrap;
}

.portrait__caption .intro > span {
    color: var(--mist);
    font-size: 0.8rem;
    text-align: right;
}

/* Anchored to the portrait: over its top-right corner, sticking out to the right. */
.role-card {
    position: absolute;
    z-index: 2;
    top: 3.5%;
    left: 66%;
    line-height: 1.35;
    white-space: nowrap;
}

/* The card's box sits on the inner element, so it appears together with its text. */
.role-card .intro {
    display: flex;
    flex-direction: column;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--line-strong);
    border-radius: 0.95rem;
    background: rgba(10, 23, 40, 0.86);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.role-card__label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.3rem;
    color: var(--lime);
    font-size: 0.82rem;
    font-weight: 650;
}

.role-card strong {
    font-size: 1rem;
    font-weight: 680;
}

.role-card .intro > span:last-child {
    color: var(--mist);
    font-size: 0.84rem;
}

.pulse {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 0 4px rgba(185, 243, 106, 0.12), 0 0 16px rgba(185, 243, 106, 0.5);
    animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
    50% {
        box-shadow: 0 0 0 7px rgba(185, 243, 106, 0.04), 0 0 22px rgba(185, 243, 106, 0.3);
    }
}

/* 1. Flynth */

.scene--career {
    --light-a: rgba(185, 243, 106, 0.09);
    --light-a-at: 8% 12%;
    --light-b: rgba(110, 231, 216, 0.08);
    --light-b-at: 88% 70%;
}

.career {
    display: grid;
    gap: clamp(1.1rem, 3.2vh, 2.2rem);
}

.career__head {
    display: grid;
    max-width: 50rem;
    gap: clamp(0.6rem, 1.6vh, 1rem);
}

.promotion {
    display: grid;
    max-width: 44rem;
    grid-template-columns: auto minmax(5rem, 1fr) auto;
    align-items: center;
    gap: 1.1rem;
}

.promotion__point {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.promotion__point time {
    color: var(--mist);
    font-size: var(--text-sm);
}

.promotion__point strong {
    font-weight: 650;
}

.promotion__point--end strong {
    color: var(--lime);
}

.promotion__line {
    position: relative;
    height: 2px;
    border-radius: 2px;
    background: var(--line-strong);
}

.promotion__fill {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--lime));
    box-shadow: 0 0 12px rgba(185, 243, 106, 0.35);
}

.promotion__label {
    position: absolute;
    bottom: 0.6rem;
    left: 50%;
    translate: -50% 0;
    color: var(--paper-soft);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.facets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(1rem, 2.4vw, 2rem);
}

.facet {
    padding-top: clamp(0.75rem, 1.8vh, 1.1rem);
    border-top: 1px solid var(--line-strong);
}

.facet h3 {
    margin-bottom: 0.5rem;
    font-size: var(--text-h3);
    font-weight: 660;
}

.facet p {
    color: var(--mist);
    font-size: var(--text-sm);
    line-height: 1.55;
}

.facet--number {
    border-top-color: rgba(185, 243, 106, 0.5);
}

.facet p.facet__number {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    margin-bottom: 0.45rem;
    color: var(--lime);
    font-size: clamp(2rem, min(3.4vw, 5.6vh), 3rem);
    font-stretch: 125%;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}


.facet__number > span:last-child {
    flex-basis: 100%;
    margin-top: 0.35rem;
    color: var(--paper-soft);
    font-size: var(--text-sm);
    font-stretch: 100%;
    font-weight: 600;
    letter-spacing: 0;
}

/* 2. KeyTakes */

.scene--keytakes {
    --light-a: rgba(70, 110, 255, 0.2);
    --light-a-at: 22% 40%;
    --light-b: rgba(170, 90, 230, 0.14);
    --light-b-at: 80% 70%;
}

.keytakes {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: center;
    gap: clamp(1.5rem, 4.5vw, 4.5rem);
}

.keytakes__media {
    display: grid;
    justify-items: start;
    gap: 0.9rem;
}

.window {
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: #0b1626;
    box-shadow: var(--shadow);
}

.window--keytakes {
    box-shadow: var(--shadow), 0 0 90px rgba(120, 90, 255, 0.22);
}

.window--dawn {
    box-shadow: var(--shadow), 0 0 90px rgba(255, 150, 90, 0.18);
}

.window__bar {
    display: flex;
    height: 2.1rem;
    align-items: center;
    gap: 0.8rem;
    padding: 0 0.85rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.045);
}

.window__dots {
    display: flex;
    gap: 0.35rem;
}

.window__dots i {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
}

.window__address {
    flex: 0 1 15rem;
    margin-inline: auto;
    padding: 0.15rem 0.8rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.28);
    color: var(--mist);
    font-size: 0.74rem;
    text-align: center;
}

.window__view {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000;
}

.window__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.watch-button {
    display: inline-flex;
    min-height: 2.5rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.95rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--paper-soft);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 160ms ease, color 160ms ease;
}

.watch-button:hover {
    border-color: rgba(170, 140, 255, 0.6);
    color: var(--paper);
}

.keytakes__copy {
    display: grid;
    gap: clamp(0.7rem, 1.8vh, 1rem);
}

.stream {
    color: var(--paper-soft);
    line-height: 1.6;
}

/* 3. E-mergo */

.scene--emergo {
    --light-a: rgba(110, 231, 216, 0.11);
    --light-a-at: 10% 20%;
    --light-b: rgba(106, 168, 255, 0.1);
    --light-b-at: 85% 75%;
}

.emergo {
    display: grid;
    gap: clamp(1.25rem, 4vh, 2.75rem);
}

.emergo__head {
    display: grid;
    gap: clamp(0.5rem, 1.4vh, 0.8rem);
}

.beats {
    display: grid;
    gap: 4rem;
}

.beat {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    align-items: center;
    gap: clamp(1.5rem, 4.5vw, 4.5rem);
}

.beat__copy {
    display: grid;
    gap: clamp(0.7rem, 1.8vh, 1rem);
}

.beat h3 {
    font-size: clamp(1.4rem, min(2.4vw, 4.2vh), 2rem);
    font-weight: 700;
}

.beat h3 span {
    display: block;
    margin-top: 0.35rem;
    color: var(--aqua);
    font-size: var(--text-sm);
    font-weight: 620;
    letter-spacing: 0;
}

.beat p {
    color: var(--paper-soft);
}

.meter {
    display: grid;
    grid-template-columns: auto minmax(4rem, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
}

.meter__label {
    color: var(--mist);
    font-size: var(--text-sm);
}

.meter__track {
    height: 0.5rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.meter__fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--aqua), var(--lime));
}

.meter__value {
    color: var(--lime);
    font-size: var(--text-sm);
    font-weight: 650;
}

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

.diagram__edge {
    fill: none;
    stroke: var(--aqua);
    stroke-linecap: round;
    stroke-width: 2;
}

.diagram__edge--soft {
    stroke: rgba(110, 231, 216, 0.45);
    stroke-width: 1.5;
}

.diagram__node rect {
    fill: #0e1d30;
    stroke: var(--line-strong);
    stroke-width: 1.2;
}

.diagram text {
    fill: var(--paper);
    font-family: var(--font);
    font-size: 16px;
    font-weight: 620;
    text-anchor: middle;
}

.diagram text.diagram__small {
    fill: var(--mist);
    font-size: 12.5px;
    font-weight: 500;
}

.diagram__node--answer rect {
    fill: rgba(185, 243, 106, 0.08);
    stroke: rgba(185, 243, 106, 0.6);
}

.diagram__node--answer text {
    fill: var(--lime);
}

/* The agent team: a dashed box around three agents that work together. */
.diagram__agents rect {
    fill: rgba(110, 231, 216, 0.04);
    stroke: rgba(110, 231, 216, 0.4);
    stroke-dasharray: 4 5;
    stroke-width: 1.2;
}

.diagram__agents circle {
    fill: rgba(110, 231, 216, 0.12);
    stroke: var(--aqua);
    stroke-width: 1.5;
}

.diagram__agents use {
    fill: none;
    stroke: var(--aqua);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.diagram__agents text {
    fill: var(--aqua);
    font-size: 14px;
}

.diagram__glow {
    fill: rgba(185, 243, 106, 0.22);
    stroke: var(--lime);
    stroke-width: 1.5;
    filter: drop-shadow(0 0 6px rgba(185, 243, 106, 0.6));
}

.diagram__glow--team {
    fill: rgba(185, 243, 106, 0.05);
    stroke: rgba(185, 243, 106, 0.7);
    stroke-width: 1.2;
    filter: drop-shadow(0 0 8px rgba(185, 243, 106, 0.3));
}

.diagram__packet {
    fill: var(--lime);
    filter: drop-shadow(0 0 6px rgba(185, 243, 106, 0.8));
}

.diagram__route {
    fill: none;
    stroke: none;
}

/* 4. Dawn */

.scene--dawn {
    --light-a: rgba(255, 150, 90, 0.22);
    --light-a-at: 70% 100%;
    --light-b: rgba(244, 198, 111, 0.12);
    --light-b-at: 20% 85%;
}

/* The light rises like the sun while Dawn comes in (data-fx="sunrise"). */
.scene__light--sunrise {
    background:
        radial-gradient(38% 30% at 64% 106%, rgba(255, 214, 150, 0.4), transparent 70%),
        radial-gradient(75% 58% at 62% 110%, rgba(255, 128, 86, 0.36), rgba(255, 166, 110, 0.12) 48%, transparent 76%),
        linear-gradient(to top, rgba(255, 140, 90, 0.07), transparent 40%);
}

.dawn {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    align-items: center;
    gap: clamp(1.5rem, 4.5vw, 4.5rem);
}

.dawn__copy {
    display: grid;
    gap: clamp(0.7rem, 1.8vh, 1rem);
}

.dawn__copy > p:not(.kicker, .links) {
    color: var(--paper-soft);
}

.dawn__proof {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem 1.5rem;
}

.stat {
    display: grid;
    line-height: 1.2;
}

.stat strong {
    justify-self: start;
    color: var(--amber);
    font-size: clamp(2.2rem, min(4vw, 6.6vh), 3.4rem);
    font-stretch: 125%;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat > span {
    margin-top: 0.3rem;
    color: var(--mist);
    font-size: var(--text-sm);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border: 1px solid rgba(244, 198, 111, 0.5);
    border-radius: 999px;
    background: rgba(244, 198, 111, 0.1);
    color: var(--amber);
    font-size: 0.92rem;
    font-weight: 650;
}

.slides {
    display: flex;
    height: 100%;
    translate: calc(var(--slide, 0) * -100%) 0;
}

.slides img {
    width: 100%;
    height: 100%;
    flex: 0 0 100%;
    object-fit: cover;
}

/* 5. Thesis */

.scene--thesis {
    --light-a: rgba(106, 168, 255, 0.14);
    --light-a-at: 25% 50%;
    --light-b: rgba(244, 198, 111, 0.06);
    --light-b-at: 90% 15%;
}

.thesis {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(1.5rem, 4.5vw, 4.5rem);
}

.thesis__figure,
.trial {
    padding: clamp(1.2rem, 2.6vw, 2rem);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 88% 6%, rgba(106, 168, 255, 0.16), transparent 20rem),
        var(--ink-deep);
    box-shadow: var(--shadow);
}

.thesis__figure figcaption {
    margin-bottom: clamp(1rem, 2.4vh, 1.4rem);
    font-size: var(--text-h3);
    font-weight: 650;
    line-height: 1.3;
}

.thesis__note {
    margin: -0.5rem 0 clamp(1rem, 2.4vh, 1.4rem);
    color: var(--paper-soft);
    font-size: var(--text-sm);
}

.bars {
    display: grid;
    gap: clamp(0.7rem, 1.8vh, 0.95rem);
}

.bar {
    display: grid;
    grid-template-columns: 5.2rem minmax(0, 1fr) 3rem;
    align-items: center;
    gap: 0.85rem;
}

.bar__label {
    color: var(--mist);
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
}

.bar__track {
    position: relative;
    height: 0.7rem;
    border-radius: 999px;
    background: rgba(166, 194, 226, 0.12);
}

.bar__fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--fill);
    border-radius: inherit;
    background: var(--bar-color);
}

.bar__value {
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.bar--sure {
    --bar-color: var(--amber);
}

.bar--mid {
    --bar-color: var(--blue);
}

.bar--unsure {
    --bar-color: var(--aqua);
}

/* The formula is set like an equation in a paper: centred, with a "where" line
   for its symbols. */
.formula {
    margin-top: clamp(1rem, 2.4vh, 1.4rem);
    padding-top: 0.95rem;
    border-top: 1px solid var(--line);
    color: var(--mist);
    font-size: var(--text-sm);
    text-align: center;
}

.formula math {
    font-family: var(--font-math);
}

.formula__math {
    margin: 0;
    color: var(--paper);
    font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.4rem);
}

.formula__where {
    margin-top: 0.55rem;
}

.formula__where math {
    color: var(--paper-soft);
    font-size: 1.15em;
}

/* The trial: one of the 40 from the experiment, played before the figure.
   js/trial.js sets data-state on .thesis__task (waiting, running, answered or done)
   and data-outcome once you answer. Both cards share one grid cell, so the scene
   keeps its height when they swap. */

.thesis__task {
    display: grid;
}

.thesis__task > * {
    min-width: 0;
    grid-area: 1 / 1;
}

.trial {
    display: none;
    /* The photos get smaller on short screens; the buttons keep their width. */
    --trial-width: min(100%, calc(64vh + 2.5rem));
}

.thesis__task[data-state] .trial {
    display: grid;
    align-content: center;
    gap: clamp(0.75rem, 2vh, 1.1rem);
}

.thesis__task[data-state] .thesis__figure {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.thesis__task[data-state] .trial,
.thesis__task[data-state] .thesis__figure {
    transition: opacity 320ms ease 140ms, translate 320ms ease 140ms, visibility 0s linear 0s;
}

.thesis__task[data-state="done"] .trial,
.thesis__task[data-state]:not([data-state="done"]) .thesis__figure {
    visibility: hidden;
    opacity: 0;
    translate: 0 0.75rem;
    transition: opacity 220ms ease, translate 220ms ease, visibility 0s linear 220ms;
}

.trial__step {
    color: var(--aqua);
    font-size: var(--text-sm);
    font-weight: 600;
}

.trial__head h3 {
    margin-top: 0.15rem;
    font-size: var(--text-h3);
    font-weight: 650;
    line-height: 1.3;
}

/* Two photos with the timer between them, like the experiment itself. */
.trial__faces {
    position: relative;
    display: grid;
    width: var(--trial-width);
    grid-template-columns: minmax(0, 1fr) 2rem minmax(0, 1fr);
    gap: 0.5rem;
}

.trial__photo {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.trial__timer {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 138, 122, 0.14);
}

.trial__drain {
    position: absolute;
    inset: 0;
    background: var(--aqua);
    scale: 1 var(--left, 1);
    transform-origin: bottom;
}

.trial__timer.is-low .trial__drain {
    background: var(--rose);
}

.trial__seconds {
    position: absolute;
    right: 0;
    bottom: 0.25rem;
    left: 0;
    display: grid;
    width: 1.6rem;
    height: 1.6rem;
    margin-inline: auto;
    place-items: center;
    border-radius: 50%;
    background: var(--ink-deep);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1;
}

.trial__result {
    position: absolute;
    bottom: 0.6rem;
    left: 50%;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    background: var(--rose);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    color: var(--ink-deep);
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    translate: -50% 0;
    visibility: hidden;
    opacity: 0;
    transition: opacity 260ms ease, visibility 0s linear 260ms;
}

.thesis__task[data-outcome="right"] .trial__result {
    background: var(--lime);
}

.thesis__task[data-state="answered"] .trial__result {
    visibility: visible;
    opacity: 1;
    transition: opacity 260ms ease, visibility 0s;
}

.trial__choices {
    display: grid;
    width: var(--trial-width);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.trial__choice {
    min-height: 3.1rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(110, 231, 216, 0.45);
    border-radius: var(--radius-sm);
    background: rgba(110, 231, 216, 0.08);
    cursor: pointer;
    font-weight: 650;
    line-height: 1.2;
    transition: border-color 160ms ease, background-color 160ms ease, translate 160ms ease, scale 120ms ease;
}

.trial__choice:hover {
    border-color: var(--aqua);
    background: rgba(110, 231, 216, 0.16);
    translate: 0 -2px;
}

.trial__choice:active {
    scale: 0.97;
}

/* While the clock runs, a soft ring goes round the buttons in turn, so it is
   clear they are there to be clicked. */
.thesis__task[data-state="running"] .trial__choice {
    animation: choice-pulse 1.8s ease-in-out infinite;
}

.thesis__task[data-state="running"] .trial__choice + .trial__choice {
    animation-delay: 0.9s;
}

.thesis__task[data-state="running"] .trial__choice:hover {
    animation: none;
}

@keyframes choice-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(110, 231, 216, 0);
    }

    35% {
        border-color: var(--aqua);
        box-shadow: 0 0 0 5px rgba(110, 231, 216, 0.16);
    }
}

.thesis__task[data-state="answered"] .trial__choice,
.thesis__task[data-state="done"] .trial__choice {
    pointer-events: none;
}

.thesis__task[data-state="answered"] .trial__choice.is-chosen {
    border-color: var(--rose);
    background: rgba(255, 138, 122, 0.16);
}

.thesis__task[data-outcome="right"] .trial__choice.is-chosen {
    border-color: var(--lime);
    background: rgba(185, 243, 106, 0.14);
}

.thesis__task[data-state="answered"] .trial__choice:not(.is-chosen) {
    opacity: 0.45;
}

/* Once the figure shows, its bars grow one after the other. */
.thesis__task[data-state="done"] .bar__fill {
    animation: bar-grow 1s cubic-bezier(0.65, 0, 0.35, 1) 200ms backwards;
}

.thesis__task[data-state="done"] .bar:nth-child(2) .bar__fill {
    animation-delay: 320ms;
}

.thesis__task[data-state="done"] .bar:nth-child(3) .bar__fill {
    animation-delay: 440ms;
}

.thesis__task[data-state="done"] .formula {
    animation: fade-in 500ms ease 900ms backwards;
}

@keyframes bar-grow {
    from {
        clip-path: inset(0 100% 0 0 round 999px);
    }

    to {
        clip-path: inset(0 0 0 0 round 999px);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .thesis__task * {
        animation: none !important;
        transition: none !important;
    }
}

@media print {
    .thesis__task[data-state] .trial {
        display: none;
    }

    .thesis__task[data-state] .thesis__figure {
        visibility: visible !important;
        opacity: 1 !important;
        transition: none !important;
        translate: none !important;
    }
}

.thesis__copy {
    display: grid;
    gap: clamp(0.7rem, 1.8vh, 1rem);
}

.thesis__copy > p:not(.kicker, .links) {
    color: var(--paper-soft);
}

.chapter-title--question {
    --stretch: 104%;
    font-size: clamp(1.75rem, min(3.3vw, 6vh), 2.97rem);
    line-height: 1.05;
}

/* 6. Education */

.scene--education {
    --light-a: rgba(184, 156, 255, 0.13);
    --light-a-at: 15% 25%;
    --light-b: rgba(106, 168, 255, 0.08);
    --light-b-at: 85% 80%;
}

.education {
    display: grid;
    gap: clamp(1.2rem, 3.6vh, 2.4rem);
}

.education__head {
    display: grid;
    max-width: 52rem;
    gap: clamp(0.5rem, 1.4vh, 0.8rem);
}

.degrees {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.25rem, 3.5vw, 3rem);
}

.degree {
    display: grid;
    align-content: start;
    gap: 0.55rem;
    padding-top: clamp(0.75rem, 1.8vh, 1rem);
    border-top: 1px solid var(--line-strong);
}

.degree h3 {
    font-size: var(--text-h3);
    font-weight: 660;
}

.degree > p {
    color: var(--paper-soft);
    font-size: var(--text-sm);
}

.courses {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.courses li {
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--mist);
    font-size: 0.78rem;
}

/* 7. Strengths */

.scene--capabilities {
    --light-a: rgba(106, 168, 255, 0.12);
    --light-a-at: 80% 15%;
    --light-b: rgba(110, 231, 216, 0.08);
    --light-b-at: 10% 85%;
}

.capabilities {
    display: grid;
    gap: clamp(1.25rem, 4vh, 2.6rem);
}

.strengths {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.1rem, 3.6vh, 2.4rem) clamp(1.25rem, 3vw, 2.75rem);
}

.strength {
    position: relative;
    padding-left: 1.1rem;
}

.strength::before {
    position: absolute;
    top: 0.25rem;
    bottom: 0.25rem;
    left: 0;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(var(--blue), var(--aqua));
    content: "";
}

.strength h3 {
    margin-bottom: 0.45rem;
    font-size: var(--text-h3);
    font-weight: 660;
}

.strength p {
    color: var(--mist);
    font-size: var(--text-sm);
    line-height: 1.55;
}

/* 8. Tools */

.scene--technologies {
    --light-a: rgba(110, 231, 216, 0.09);
    --light-a-at: 15% 85%;
    --light-b: rgba(106, 168, 255, 0.1);
    --light-b-at: 85% 15%;
}

.technologies {
    display: grid;
    gap: clamp(1rem, 3.2vh, 2rem);
}

.technologies__head {
    display: grid;
    gap: clamp(0.4rem, 1.2vh, 0.7rem);
}

.layers {
    display: grid;
    gap: clamp(0.4rem, 1.1vh, 0.6rem);
}

.layer {
    --layer-color: var(--blue);
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    padding: clamp(0.45rem, 1.1vh, 0.65rem) 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(90deg, color-mix(in srgb, var(--layer-color) 9%, transparent), rgba(255, 255, 255, 0.015) 40%);
}

.layer h3 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--paper-soft);
    font-size: var(--text-sm);
    font-weight: 650;
    line-height: 1.25;
}

.layer h3::before {
    width: 0.5rem;
    height: 0.5rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--layer-color);
    box-shadow: 0 0 10px var(--layer-color);
    content: "";
}

.layer--ai {
    --layer-color: var(--violet);
}

.layer--software {
    --layer-color: var(--blue);
}

.layer--data {
    --layer-color: var(--aqua);
}

.layer--cloud {
    --layer-color: #7fc4ff;
}

.layer--design {
    --layer-color: var(--amber);
}

.tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tools li {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.22rem 0.7rem 0.22rem 0.25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--paper-soft);
    font-size: 0.82rem;
    font-weight: 540;
    line-height: 1.2;
}

.tool__logo,
.tool__glyph {
    display: grid;
    width: 1.55rem;
    height: 1.55rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
}

.tool__logo {
    background: #f1f5f9;
}

.tool__logo img {
    width: 1rem;
    height: 1rem;
    object-fit: contain;
}

.tool__glyph {
    background: color-mix(in srgb, var(--layer-color) 18%, transparent);
    color: var(--layer-color);
}

.tool__glyph svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

/* 9. Certificates */

.scene--certifications {
    --light-a: rgba(244, 198, 111, 0.12);
    --light-a-at: 50% 0%;
    --light-b: rgba(106, 168, 255, 0.08);
    --light-b-at: 50% 100%;
}

.certifications {
    display: grid;
    gap: clamp(1.25rem, 4vh, 2.5rem);
}

.certifications__head {
    display: grid;
    gap: clamp(0.4rem, 1.2vh, 0.7rem);
}

.certs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.75rem, 2vw, 1.25rem);
}

.cert {
    --cert-color: var(--blue);
    position: relative;
    display: grid;
    min-height: clamp(7.25rem, 17vh, 10rem);
    align-content: space-between;
    gap: 0.6rem;
    padding: clamp(0.9rem, 2vh, 1.25rem) 1.2rem;
    border: 1px solid color-mix(in srgb, var(--cert-color) 30%, var(--line));
    border-radius: var(--radius);
    background: linear-gradient(155deg, color-mix(in srgb, var(--cert-color) 15%, var(--ink-raised)), var(--ink-raised) 62%);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.cert:nth-child(1) {
    z-index: 6;
}

.cert:nth-child(2) {
    z-index: 5;
}

.cert:nth-child(3) {
    z-index: 4;
}

.cert:nth-child(4) {
    z-index: 3;
}

.cert:nth-child(5) {
    z-index: 2;
}

.cert:nth-child(6) {
    z-index: 1;
}

.cert__code {
    color: var(--cert-color);
    font-size: clamp(1.6rem, min(2.6vw, 4.4vh), 2.3rem);
    font-stretch: 125%;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}

.cert strong {
    font-size: var(--text-base);
    font-weight: 640;
    line-height: 1.3;
}



.cert--data {
    --cert-color: #6fd6a9;
}

.cert--analytics {
    --cert-color: var(--amber);
}

.cert--cloud {
    --cert-color: #f39aa8;
}

/* 10. Contact */

.scene--contact {
    --light-a: rgba(106, 168, 255, 0.2);
    --light-a-at: 50% 100%;
    --light-b: rgba(110, 231, 216, 0.08);
    --light-b-at: 50% 0%;
}

.contact {
    display: grid;
    max-width: 46rem;
    justify-items: center;
    gap: clamp(0.8rem, 2.2vh, 1.25rem);
    text-align: center;
}

.contact__photo {
    width: clamp(4.5rem, 12vh, 7rem);
    height: clamp(4.5rem, 12vh, 7rem);
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 30%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 16px 40px rgba(0, 0, 0, 0.4);
}

.contact__text {
    max-width: 38rem;
    color: var(--paper-soft);
    font-size: var(--text-lead);
}

.contact__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.contact__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1.5rem;
    margin-top: 0.4rem;
    color: var(--mist);
    font-size: var(--text-sm);
}

.contact__meta a:hover {
    color: var(--aqua);
}

.replay {
    display: inline-flex;
    min-height: 2.6rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--mist);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease;
}

.replay:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--aqua);
}

/* Narrower screens */

/* Two columns, but not much room: shift the portrait left so the "Now" card
   stays on screen. */
@media (min-width: 52.01rem) and (max-width: 68rem) {
    .portrait {
        translate: calc(17% - 5rem) 0;
    }
}

@media (max-width: 64rem) {
    .facets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .strengths {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 52rem) {
    .hero,
    .keytakes,
    .beat,
    .dawn,
    .thesis {
        grid-template-columns: minmax(0, 1fr);
    }

    .thesis__task {
        order: 2;
    }

    .layer {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.5rem;
    }

    .degrees {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 40rem) {
    .facets,
    .strengths {
        grid-template-columns: minmax(0, 1fr);
    }

    .certs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .promotion {
        grid-template-columns: auto minmax(3rem, 1fr) auto;
        gap: 0.75rem;
    }

    .hero {
        gap: clamp(0.75rem, 2.5vh, 1.5rem);
    }

    .hero__title {
        font-size: clamp(2.2rem, min(11.2vw, 6.2vh), 3.3rem);
    }

    .hero__intro {
        font-size: 0.98rem;
    }

    .hero__visual {
        min-height: 0;
        padding-block: 0.5rem;
    }

    /* The portrait is small here, so the card moves down over the sweater and
       the portrait shifts left to keep the pair centred. */
    .portrait {
        width: min(46vw, 12.5rem);
        translate: calc(21% - 5.2rem) 0;
    }

    .role-card {
        top: auto;
        bottom: 24%;
        left: 58%;
    }

    .role-card .intro {
        padding: 0.7rem 0.85rem;
    }

    .portrait__caption .intro > span {
        display: none;
    }
}

/* Short phones */
@media (max-width: 40rem) and (max-height: 45rem) {
    .hero__title {
        font-size: clamp(1.9rem, min(10.4vw, 5.7vh), 2.6rem);
    }

    .hero__intro {
        font-size: 0.92rem;
        line-height: 1.5;
    }
}

/* The moving dots and flashes in the diagrams only make sense in film mode. */
.diagram__packet,
.diagram__glow {
    display: none;
}

/* Counters: film.js gives each one the width of its final number, so the text
   around it does not shift while it counts. */
.film [data-count] {
    display: inline-block;
    text-align: right;
}

.film .diagram__packet,
.film .diagram__glow {
    display: inline;
}

/* Short and wide screens, like a phone held sideways: keep two columns,
   size the portrait by height and drop the diagrams so every scene fits. */
@media (max-height: 500px) and (min-aspect-ratio: 4 / 3) {
    :root {
        --header-height: 3.25rem;
        --player-height: 3rem;
    }

    .hero,
    .keytakes,
    .beat,
    .dawn,
    .thesis {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
        gap: 1.5rem;
    }

    .hero__title {
        margin-bottom: 0.6rem;
        font-size: clamp(1.6rem, 9.5vh, 2.6rem);
    }

    .hero__intro {
        margin-bottom: 0.8rem;
        font-size: 0.92rem;
        line-height: 1.45;
    }

    .hero__visual {
        min-height: 0;
    }

    .portrait {
        width: auto;
        height: min(62vh, 19rem);
        translate: calc(17% - 4.6rem) 0;
    }

    .portrait__caption .intro > span {
        display: none;
    }

    .beat {
        grid-template-columns: minmax(0, 1fr);
    }

    .beat__figure {
        display: none;
    }

    .thesis__task {
        order: 0;
    }

    /* The copy pans here, but the trial stays put so it can be played. */
    .thesis__task {
        position: relative;
        top: calc(var(--pan, 0px) * -1);
        align-self: start;
    }

    .trial {
        --trial-width: min(100%, calc(56vh + 2.5rem));
    }

    .thesis__note,
    .formula__where {
        display: none;
    }

    .keytakes__media {
        order: 0;
    }
}
