/* ========================================
   Nosabo: home page
   Chapters, floor to ceiling, butted with no dividers. Scene chapters are the app's
   own painted cities, defocused like a camera's shallow depth of field, with a friend
   and the real app in focus in front; quiet chapters are flat fields of the brand's
   colours. One 12-column grid and one pair of margins in every chapter.
   ======================================== */

/* ========== Shared chapter type ========== */
.section-title {
    font-size: var(--step-head);
    max-width: 15ch;
}

.section-lead {
    margin-top: clamp(16px, 2vw, 28px);
    max-width: 33ch;
    font-size: var(--step-lead);
    font-weight: 700;
    line-height: 1.35;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
}

/* A real review, quoted verbatim: the words in full ink, who said it under them */
.quote {
    margin-top: clamp(32px, 4vw, 56px);
    max-width: 34ch;
}

.quote p {
    font-size: var(--step-body);
    font-weight: 800;
    line-height: 1.45;
}

.quote footer {
    margin-top: 8px;
    font-size: var(--step-small);
    font-weight: 700;
    opacity: 0.78;
}

/* ========== The phone: the real app playing in a slim bezel ========== */
.phone {
    position: relative;
    aspect-ratio: 1320 / 2868;
    padding: 2.6%;
    border-radius: 15% / 7%;
    background: #0B0B0D;
}

.phone::after { /* the Dynamic Island */
    content: '';
    position: absolute;
    top: 3.6%;
    left: 50%;
    width: 30%;
    height: 3.4%;
    border-radius: 999px;
    background: #0B0B0D;
    transform: translateX(-50%);
}

.phone__screen {
    position: absolute;
    inset: 2.6%;
    width: 94.8%;
    height: 94.8%;
    object-fit: cover;
    border-radius: 12.6% / 5.8%;
    background: var(--ground-2);
}

/* ========== Friends, standing: the still until their clip plays ========== */
.figure {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.figure img,
.figure video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: 50% 100%;
}

.figure video {
    opacity: 0;
    pointer-events: none;
}

.figure.is-idling .figure__idle,
.figure.is-emoting .figure__emote {
    opacity: 1;
}

.figure.is-idling img,
.figure.is-emoting img,
.figure.is-emoting .figure__idle {
    opacity: 0;
}

/* What a friend says: the app's white speech bubble, the line, its meaning */
.says {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 22px 18px;
    border-radius: 24px;
    background: var(--card);
    color: var(--ink);
    text-align: left;
}

.says > span:first-child,
.says__line {
    font-family: var(--font-display);
    font-size: var(--step-lead);
    font-weight: 700;
    line-height: 1.15;
}

.says__means {
    color: var(--ink-2);
    font-weight: 700;
}

.says__name {
    margin-top: 8px;
    font-family: var(--font-body);
    font-size: var(--step-small);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.3;
    color: var(--ink-2);
}

/* ========== 1. Hero ========== */
.home .site-header {
    position: fixed;
    left: 0;
    right: 0;
    background: transparent;
    color: #FFFFFF;
}

.home .site-header.is-scrolled {
    background: var(--ground);
    color: var(--ink);
}

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: max(100svh, 680px);
    color: #FFFFFF;
    background: var(--primary-ink); /* under the picture: white type still reads if it never loads */
}

.hero__scene,
.hero__scene picture,
.hero__scene img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero__scene {
    z-index: -1;
}

.hero__scene img {
    object-fit: cover;
    object-position: 50% 30%;
}

/* A neutral scrim under the type, so white reads on the bright sky */
.hero__scene::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(8, 12, 27, 0.34) 0%, rgba(8, 12, 27, 0.16) 46%, rgba(8, 12, 27, 0) 72%); /* taste-skill-ignore: neutral scrim under text on a photo */
}

.hero__inner {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
    min-height: inherit;
    padding: calc(var(--header-h) + clamp(24px, 4vh, 56px)) var(--margin) 0;
}

/* On a wide screen each chapter's words and pictures stay one group in the middle;
   only its scene or colour runs on to the edges */
.hero__inner,
.method__inner,
.words__inner,
.friends__inner,
.close__inner {
    max-width: calc(var(--content-max) + 2 * var(--margin));
    margin-inline: auto;
}

.hero__text {
    grid-column: 1 / 8;
    align-self: center;
    padding-bottom: clamp(48px, 10vh, 120px);
}

.hero__title {
    font-size: clamp(2.4rem, 0.4rem + 6vw, 6.25rem);
}

.hero__title .line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.06em;
    margin-bottom: -0.06em;
}

.hero__title [data-line] {
    display: block;
    white-space: nowrap;
}

.hero__lead {
    margin-top: clamp(20px, 2.4vw, 32px);
    max-width: 30ch;
    font-size: var(--step-lead);
    font-weight: 700;
    line-height: 1.35;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
    margin-top: clamp(28px, 3.4vw, 44px);
}

.rating {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.rating img {
    width: 28px;
    height: 28px;
}

.hero__stage {
    grid-column: 8 / 13;
    position: relative;
    align-self: stretch;
    min-height: 560px;
}

.hero__phone {
    position: absolute;
    right: 0;
    bottom: calc(-1 * clamp(80px, 13vh, 150px));
    width: clamp(250px, 23vw, 350px);
}

.hero__saba {
    position: absolute;
    left: -14%;
    bottom: 0;
    width: clamp(220px, 20vw, 310px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.says--hero {
    margin: 0 0 -2% 34%;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.says--hero::after { /* the bubble's tail, down toward her */
    content: '';
    position: absolute;
    left: 24px;
    bottom: -9px;
    width: 22px;
    height: 22px;
    border-radius: 0 0 8px 0;
    background: var(--card);
    transform: rotate(45deg);
}

/* ========== 2. Learn it. / Use it. ========== */
.pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.pair__half {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: clamp(40px, 6vh, 72px);
    padding: clamp(96px, 13vh, 150px) var(--margin) 0;
    overflow: hidden;
}

/* The two fields run to the edges; their words start where every chapter's do */
.pair__half--learn {
    padding-left: max(var(--margin), calc((100vw - var(--content-max)) / 2));
    background: var(--primary);
    color: #FFFFFF;
}

.pair__half--use {
    padding-right: max(var(--margin), calc((100vw - var(--content-max)) / 2));
    background: var(--ground);
    color: var(--ink);
}

.pair__word {
    font-size: var(--step-head);
}

.pair__text p {
    margin-top: 18px;
    max-width: 31ch;
    font-size: var(--step-lead);
    font-weight: 700;
    line-height: 1.35;
}

/* Right under its words, rising off the bottom edge */
.pair__phone {
    width: clamp(250px, 23vw, 370px);
    margin: 0 auto calc(-1 * clamp(90px, 16vh, 180px));
}

/* ========== 3. The method: the day's three ========== */
.method {
    background: var(--sunny);
    color: var(--ink);
}

.method__inner {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
    align-items: center;
    min-height: 100svh;
    padding: clamp(96px, 13vh, 150px) var(--margin);
}

.method__text {
    grid-column: 1 / 7;
}

.method__stage {
    grid-column: 8 / 13;
    justify-self: center;
}

.method__phone {
    width: clamp(260px, 24vw, 350px);
}

.method__phone .phone__screen {
    opacity: 0;
    transition: opacity var(--t-ui) ease;
}

.method__phone .phone__screen.is-active {
    opacity: 1;
}

.day {
    position: relative;
    margin-top: clamp(40px, 5vw, 64px);
    max-width: 520px;
}

.day__strip {
    display: flex;
    justify-content: space-between;
}

.day__stop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 104px;
    font-weight: 800;
    font-size: var(--step-small);
    color: var(--ink);
    opacity: 0.6;
    transition: opacity var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}

.day__stop img {
    width: 64px;
    height: 64px;
}

.day__stop[aria-selected="true"],
.day__stop.is-done {
    opacity: 1;
}

.day__stop:active {
    transform: translateY(2px);
}

/* The line joining the three, filling green as each is done (DailyLessonStrip) */
.day__track {
    position: relative;
    height: 12px;
    margin: 16px 52px 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    overflow: hidden;
}

.day__fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(var(--p, 0) * 100%);
    border-radius: inherit;
    background: var(--done);
    transition: width 420ms var(--ease-out);
}

.day__range {
    position: absolute;
    left: 38px;
    right: 38px;
    top: 98px;
    width: calc(100% - 76px);
    height: 40px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: grab;
}

.day__range::-webkit-slider-runnable-track {
    height: 40px;
    background: transparent;
}

.day__range::-moz-range-track {
    height: 40px;
    background: transparent;
}

.day__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 30px;
    height: 30px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--card);
    border-bottom: 4px solid var(--raised-edge);
}

.day__range::-moz-range-thumb {
    width: 30px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: var(--card);
    border-bottom: 4px solid var(--raised-edge);
}

.day__range:focus-visible {
    outline: none;
}

.day__range:focus-visible::-webkit-slider-thumb {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.day__steps {
    display: grid;
    margin-top: clamp(28px, 3vw, 40px);
}

.day__step {
    grid-area: 1 / 1;
}

.day__step[hidden] {
    display: block;
    visibility: hidden;
}

.day__step h3 {
    font-size: var(--step-lead);
    line-height: 1.1;
}

.day__step p {
    margin-top: 8px;
    max-width: 34ch;
    font-size: var(--step-body);
    font-weight: 700;
}

/* ========== 4. Words: the lock screen over Havana ========== */
.words {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: var(--ink);
    background: #8FC3EE;
}

.words__scene,
.words__scene picture,
.words__scene img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.words__scene {
    z-index: -1;
}

.words__scene img {
    object-fit: cover;
    object-position: 50% 40%;
}

.words__inner {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
    align-items: center;
    min-height: 100svh;
    padding: clamp(96px, 13vh, 150px) var(--margin);
}

.words__text {
    grid-column: 1 / 7;
}

.lock {
    grid-column: 8 / 13;
    justify-self: center;
    position: relative;
    width: clamp(280px, 25vw, 360px);
    aspect-ratio: 1320 / 2868;
    border-radius: 15% / 7%;
    border: 10px solid #0B0B0D;
    overflow: hidden;
    background: var(--sky);
    color: #FFFFFF;
    text-align: center;
    font-family: var(--font-body);
}

.lock__wall {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
}

.lock::before { /* a neutral scrim under the clock so white type reads on any wallpaper */
    content: '';
    position: absolute;
    inset: 0 0 55% 0;
    background: linear-gradient(rgba(8, 12, 27, 0.4), rgba(8, 12, 27, 0)); /* taste-skill-ignore: neutral scrim under text on a photo */
}

.lock__date,
.lock__time {
    position: relative;
}

.lock__date {
    margin-top: 52px;
    font-size: 0.9375rem;
    font-weight: 600;
}

.lock__time {
    font-size: 4.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

/* The notifications stack right under the clock */
.lock__stack {
    position: relative;
    display: grid;
    gap: 8px;
    margin: 22px 10px 0;
    text-align: left;
}

.note {
    display: grid;
    grid-template-columns: 34px 1fr 38px;
    gap: 10px;
    align-items: center;
    padding: 11px 12px;
    border-radius: 22px;
    background: rgba(250, 245, 240, 0.92);
    color: #1F1D1B;
    font-size: 0.8125rem;
    line-height: 1.3;
}

.note__icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

.note__title {
    font-weight: 700;
}

.note__pic {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--primary-light);
    object-fit: cover;
}

/* ========== 5. Friends: the stage becomes their city ========== */
.friends {
    background: var(--ground);
}

.friends__inner {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
    align-items: center;
    min-height: 100svh;
    padding: clamp(96px, 13vh, 150px) var(--margin);
}

.friends__text {
    grid-column: 1 / 6;
}

.picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: clamp(28px, 3vw, 40px);
    max-width: 30rem;
}

.picker__pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 6px 20px 6px 6px;
    border-radius: 999px;
    background: var(--card);
    border-bottom: 4px solid var(--raised-edge);
    font-weight: 800;
    transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease;
}

.picker__pill img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ground-2);
}

.picker__pill[aria-pressed="true"] {
    background: #E1E7FD; /* NosaboColors.knowledgePastel: the brand's own pastel, the selected surface */
    border-bottom-color: var(--primary);
    color: var(--primary-ink);
}

.picker__pill:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .picker__pill[aria-pressed="false"]:hover {
        background: var(--ground);
    }
}

.friends__langs {
    margin-top: 20px;
    font-weight: 800;
}

.stage {
    grid-column: 7 / 13;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    aspect-ratio: 1 / 1.05;
    max-height: 82svh;
    width: 100%;
    border-radius: var(--radius);
    background: var(--sky);
}

.stage__cities,
.stage__city {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.stage__cities {
    z-index: -1;
}

.stage__city {
    object-fit: cover;
    opacity: 0;
    transition: opacity 600ms var(--ease-soft);
}

.stage__city.is-active {
    opacity: 1;
}

.stage__friend {
    position: absolute;
    inset: 0;
    visibility: hidden;
}

.stage__friend.is-active {
    visibility: visible;
}

/* Sized by the stage's height, so the friend fills the frame at any width */
.stage__friend .figure {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: auto;
    height: 80%;
    transform: translateX(-50%);
}

.says--stage {
    position: absolute;
    left: 8%;
    top: 9%;
    max-width: 46%;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 280ms var(--ease-out), transform 420ms var(--ease-spring);
}

.stage__friend.is-active .says--stage {
    opacity: 1;
    transform: none;
    transition-delay: 160ms;
}

/* ========== 6. The close: the Globe's night ========== */
.close {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--night);
    color: var(--on-night);
}

.stars {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
}

.close__inner {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
    align-items: end;
    min-height: 100svh;
    padding: clamp(96px, 13vh, 150px) var(--margin) 0;
}

.close__saba {
    grid-column: 1 / 6;
    align-self: end;
    width: min(100%, 500px);
}

.close__text {
    grid-column: 7 / 13;
    align-self: center;
    padding-bottom: clamp(40px, 8vh, 96px);
}

/* The try card: the lesson board's chunky tile, a speaker and a mic */
.try {
    position: relative;
    margin-top: clamp(28px, 3vw, 40px);
    max-width: 520px;
    padding: clamp(24px, 3vw, 36px);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--ink);
}

.try__row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.try__hear,
.try__mic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--card);
    border: 0;
    border-bottom: 5px solid var(--raised-edge);
    box-sizing: border-box;
    color: var(--ink);
    transition: transform var(--t-press) var(--ease-out), border-bottom-width var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease;
}

.try__hear {
    background: var(--ground);
}

.try__hear svg,
.try__mic svg {
    width: 26px;
    height: 26px;
}

.try__hear:active,
.try__mic:active {
    transform: translateY(3px);
    border-bottom-width: 2px;
}

.try__mic {
    margin-left: auto;
    background: var(--ground);
}

.try__mic.is-listening {
    background: var(--listening);
    color: #FFFFFF;
    border-bottom-color: #C53A3A;
}

/* A word the learner says: grey with its word in ink, green once heard */
.tile {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4em;
    padding: 0.14em 0.5em 0.18em;
    border-radius: 0.36em;
    background: #ECEEF4;
    border-bottom: 0.12em solid #D3D7E2;
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1;
    transition: background-color 220ms ease, border-color 220ms ease, color 220ms ease;
}

.try .tile {
    font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem);
}

.tile.is-said {
    background: var(--done);
    border-bottom-color: var(--done-edge);
    color: #FFFFFF;
}

.tile__spark {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 22px;
    height: 22px;
    opacity: 0;
    background: var(--logo);
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

.try__status {
    margin-top: 18px;
    font-weight: 700;
    color: var(--ink-2);
}

.try__praise {
    position: absolute;
    right: clamp(24px, 3vw, 36px);
    bottom: 18px;
    font-family: var(--font-display);
    font-size: var(--step-lead);
    font-weight: 700;
    color: var(--done);
    opacity: 0;
    transform: rotate(-6deg) scale(0.9);
}

.try.is-said .try__praise {
    opacity: 1;
    transform: rotate(-6deg);
    transition: opacity 240ms var(--ease-out), transform 420ms var(--ease-spring);
}

.close__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
    margin-top: clamp(28px, 3vw, 40px);
}

.close__meta {
    font-weight: 700;
    color: var(--on-night-2);
}

/* The grant, right under the way to download */
.close__grant {
    flex-wrap: wrap; /* on a phone the mark drops under the words rather than squeezing them */
    gap: 8px 10px;
    margin-top: 28px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--on-night-2);
}

.close__fine {
    margin-top: 20px;
    font-size: var(--step-small);
    color: var(--on-night-2);
}

/* ========== 7. Footer: the name, spelled in the lesson's tiles ========== */
.site-footer--home {
    padding-top: clamp(24px, 4vw, 56px);
}

.spelled {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(6px, 1vw, 14px);
    margin-bottom: clamp(56px, 7vw, 96px);
    font-size: clamp(3.5rem, 1rem + 11vw, 11rem);
}

.spelled .tile {
    width: 100%;
    min-width: 0;
    padding: 0.04em 0 0.12em;
    background: #FFFFFF;
    border-bottom-color: #C9CEDB;
    color: var(--night);
}

.spelled .tile.is-said {
    background: var(--done);
    border-bottom-color: var(--done-edge);
    color: #FFFFFF;
}

/* ========== Tablet ========== */
@media (max-width: 1080px) {
    .hero__saba {
        left: -24%;
    }
}

/* ========== Phone and narrow tablet composition ========== */
@media (max-width: 900px) {
    .home .site-header {
        color: #FFFFFF;
    }

    .hero {
        min-height: auto;
    }

    .hero__scene::after {
        background: rgba(8, 12, 27, 0.26);
    }

    .hero__inner {
        grid-template-columns: minmax(0, 1fr);
        padding-top: calc(var(--header-h) + 12px);
    }

    .hero__text {
        grid-column: 1;
        padding-bottom: 32px;
    }

    .hero__title {
        font-size: min(10.2vw, 3rem);
    }

    .hero__actions .button {
        width: 100%;
    }

    .hero__stage {
        grid-column: 1;
        min-height: 0;
        height: min(118vw, 92svh);
        margin: 0 calc(-1 * var(--margin));
    }

    .hero__phone {
        right: 6vw;
        bottom: -22vw;
        width: min(48vw, 340px);
    }

    .hero__saba {
        left: 2vw;
        width: min(46vw, 330px);
    }

    .says--hero {
        margin-left: 18%;
        padding: 12px 16px 14px;
    }

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

    .pair__half {
        padding-top: 72px;
        gap: 36px;
    }

    .pair__phone {
        width: min(62vw, 360px);
        margin-bottom: -34vw;
    }

    .method__inner,
    .words__inner,
    .friends__inner,
    .close__inner {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 48px;
        min-height: 0;
        padding-top: 80px;
        padding-bottom: 80px;
    }

    .method__text,
    .method__stage,
    .words__text,
    .lock,
    .friends__text,
    .stage,
    .close__text,
    .close__saba {
        grid-column: 1;
    }

    .method__phone {
        width: min(64vw, 360px);
    }

    .day__strip {
        padding: 0 6px;
    }

    .day__stop {
        width: 84px;
    }

    .day__stop span {
        white-space: nowrap;
    }

    .day__track {
        margin: 16px 48px 0;
    }

    .day__range {
        left: 34px;
        right: 34px;
        width: calc(100% - 68px);
    }

    .lock {
        width: min(70vw, 360px);
    }

    .stage {
        aspect-ratio: 4 / 5;
        max-height: none;
    }

    .stage__friend .figure {
        width: 60%;
    }

    .says--stage {
        left: 6%;
        top: 6%;
        max-width: 60%;
    }

    .close__inner {
        padding-bottom: 0;
    }

    .close__text {
        order: -1;
        padding-bottom: 0;
    }

    .close__saba {
        width: min(64vw, 380px);
        justify-self: center;
    }

    .try__hear,
    .try__mic {
        width: 54px;
        height: 54px;
    }
}

/* ========== Motion (behind html.js and no-preference) ========== */
@media (prefers-reduced-motion: no-preference) {
    /* Rack focus: the street starts nearly sharp and lets go as Saba lands */
    .js .hero__deep {
        opacity: 0;
        animation: settle-in 1500ms var(--ease-soft) 250ms forwards;
    }

    .js .hero [data-line] {
        transform: translateY(105%);
        animation: line-up 900ms var(--ease-out) forwards;
        animation-delay: calc(120ms + var(--i) * 110ms);
    }

    .js .hero [data-load] {
        opacity: 0;
        transform: translateY(14px);
        animation: rise 560ms var(--ease-out) forwards;
        animation-delay: var(--d);
    }

    .js .hero__saba .figure {
        opacity: 0;
        transform: translateY(40px);
        animation: land 900ms var(--ease-spring) 620ms forwards;
    }

    /* Chapter entrances: heading, then text, then picture */
    .js [data-reveal] {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out);
    }

    .js [data-reveal].is-in {
        opacity: 1;
        transform: none;
    }

    .js .section-lead[data-reveal],
    .js .pair__phone[data-reveal] {
        transition-delay: 90ms;
    }

    .js .day[data-reveal],
    .js .picker[data-reveal],
    .js .try[data-reveal] {
        transition-delay: 160ms;
    }

    .js .quote[data-reveal],
    .js .friends__langs[data-reveal],
    .js .close__actions[data-reveal] {
        transition-delay: 240ms;
    }

    .js .day__step:not([hidden]) {
        animation: rise 420ms var(--ease-out);
    }

    /* The lock screen's words arrive one by one */
    .js .lock,
    .js .method__phone,
    .js .stage {
        opacity: 0;
        transform: translateY(40px);
        transition: opacity 800ms var(--ease-out), transform 1000ms var(--ease-out);
    }

    .js .lock.is-in,
    .js .method__phone.is-in,
    .js .stage.is-in {
        opacity: 1;
        transform: none;
    }

    .js .note {
        opacity: 0;
        transform: translateY(-16px) scale(0.96);
        transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-spring);
        transition-delay: calc(500ms + var(--n) * 500ms);
    }

    .js .lock.is-in .note {
        opacity: 1;
        transform: none;
    }

    /* A word heard: the tile jumps green, a sparkle at its corner */
    .tile.is-said {
        animation: jump 520ms var(--ease-spring);
    }

    .tile.is-said .tile__spark {
        animation: spark 700ms var(--ease-out) 120ms;
    }

    .spelled .tile.is-said {
        transition-delay: calc(var(--t) * 140ms);
        animation-delay: calc(var(--t) * 140ms);
    }

    .try__mic.is-listening {
        animation: listen 1.2s ease-in-out infinite;
    }

    .stars .tw {
        animation: twinkle 3.2s ease-in-out infinite alternate;
    }

    .stars .tw:nth-child(3n) {
        animation-delay: -1.4s;
    }

    @media (hover: hover) and (pointer: fine) {
        .figure:hover {
            transform: translateY(-4px);
            transition: transform 300ms var(--ease-spring);
        }
    }
}

@keyframes settle-in {
    to { opacity: 1; }
}

@keyframes line-up {
    to { transform: none; }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@keyframes land {
    to { opacity: 1; transform: none; }
}

@keyframes jump {
    0% { transform: none; }
    35% { transform: translateY(-10px) scale(1.06); }
    100% { transform: none; }
}

@keyframes spark {
    0% { opacity: 0; transform: scale(0.2) rotate(0); }
    40% { opacity: 1; transform: scale(1.1) rotate(45deg); }
    100% { opacity: 0; transform: scale(0.6) rotate(90deg); }
}

@keyframes listen {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes twinkle {
    from { opacity: 0.25; }
    to { opacity: 1; }
}

/* The street drifts as the hero leaves; the city behind a friend pans in its frame */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .hero__scene picture {
            animation: drift linear both;
            animation-timeline: view();
            animation-range: exit 0% exit 100%;
        }

        .words__scene img {
            animation: pan linear both;
            animation-timeline: view();
            animation-range: entry 0% exit 100%;
        }
    }
}

@keyframes drift {
    from { transform: none; }
    to { transform: translateY(12%) scale(1.06); }
}

@keyframes pan {
    from { transform: scale(1.1) translateY(-4%); }
    to { transform: scale(1.1) translateY(4%); }
}
