/**
 * Styles for the public site.
 *
 * The palette is the app's own (`frontend/src/theme/colors.ts`): the brand red and
 * the sand are what someone sees in the screenshots right below, and a site in
 * different colours would look like a different product.
 *
 * No framework and no reset library: this is one page and four documents, and a
 * CSS file small enough to read top to bottom is easier to keep correct than a
 * build step that reorders a hundred utilities.
 */

:root {
    /*
     * The site cannot import a React Native module, so the values are repeated
     * here by hand — but only once. `--brand` is the single line that holds the
     * red; every other brand tone is named below it, and the rest of the sheet
     * names those names instead of typing a colour again.
     */
    --brand: #7a2a22;
    --brand-deep: #521811;
    --sand: #f3e6d5;
    --ivory: #fff9f2;
    --accent: #c9674a;
    --accent-dark: #a34328;
    --ink: #2a1512;
    --ink-soft: #664b43;

    /*
     * The brand red at the opacities this sheet asks for, and the shadow ink at
     * the ones it casts. Alpha is not a colour of its own, so these carry no
     * hue: they exist so the numbers sit in one place rather than being retyped
     * inside a gradient three hundred lines down.
     */
    --brand-06: rgba(122, 42, 34, 0.06);
    --brand-08: rgba(122, 42, 34, 0.08);
    --brand-09: rgba(122, 42, 34, 0.09);
    --brand-11: rgba(122, 42, 34, 0.11);
    --brand-12: rgba(122, 42, 34, 0.12);
    --brand-14: rgba(122, 42, 34, 0.14);
    --brand-20: rgba(122, 42, 34, 0.2);
    --brand-22: rgba(122, 42, 34, 0.22);
    --brand-40: rgba(122, 42, 34, 0.4);
    --accent-10: rgba(201, 103, 74, 0.1);
    --accent-16: rgba(201, 103, 74, 0.16);
    --accent-22: rgba(201, 103, 74, 0.22);
    --ink-06: rgba(42, 21, 18, 0.06);
    --ink-16: rgba(60, 20, 12, 0.16);
    --ink-24: rgba(42, 21, 18, 0.24);
    --ink-28: rgba(42, 21, 18, 0.28);
    --ink-30: rgba(42, 21, 18, 0.3);
    --ink-42: rgba(52, 20, 14, 0.42);
    --ink-45: rgba(42, 21, 18, 0.45);
    --ink-50: rgba(42, 21, 18, 0.5);

    /** The dark wall the phone mockup stands on, and the ink that replaces it. */
    --wall: #3a2320;
    --wall-deep: #1b0f0c;
    --wall-foot: #160c0a;
    --ink-alt: #4a3129;

    --line: var(--brand-14);
    --radius: 14px;
    --shadow: 0 1px 2px var(--ink-06), 0 8px 24px var(--ink-06);
    --width: 1080px;
    --measure: 68ch;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--ivory);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, 'Helvetica Neue',
        Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    /* Room for the sticky header when following an in-page link. */
    scroll-padding-top: 5rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--brand);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--accent-dark);
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/*
 * The big headings are ink, never brand.
 *
 * The brand brown is a warm, mid-tone red that works on a chip, a link or a
 * 0.9rem card title — small type where the colour is a accent. At 1.9rem and up
 * on an ivory background it goes muddy and loses contrast, and the page ended up
 * with some headings brown and some black for no reason a reader could see. So
 * the rule is positional, not decorative: h1 and h2 are ink, and brand is kept
 * for the small headings that sit inside a card.
 */
h1,
h2,
h3 {
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 0.6em;
}

h1,
h2 {
    color: var(--ink);
}

h1 {
    font-size: clamp(1.9rem, 4.5vw, 2.9rem);
}

h2 {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
}

h3 {
    font-size: 1.05rem;
}

p {
    margin: 0 0 1em;
}

.wrap {
    width: 100%;
    max-width: var(--width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.wrap.narrow {
    max-width: 46rem;
}

/* ---------------------------------------------------------------- header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 249, 242, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4rem;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.brand img {
    border-radius: 8px;
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
    /* The brand sits on the left, so the links and the language pill travel to
       the right edge together. */
    margin-left: auto;
}

.site-header nav a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.94rem;
}

.site-header nav a:hover,
.site-header nav a[aria-current='page'] {
    color: var(--brand);
}

.site-header nav a[aria-current='page'] {
    font-weight: 600;
}

/*
 * Outside the `nav` on purpose: it is a page-level control, not one of the
 * legal documents. Keeping it in the nav meant that on a narrow screen — where
 * the links have to scroll — the pill either wrapped onto its own line or
 * covered "Atribuciones".
 */
.site-header .lang {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    text-decoration: none;
}

.site-header .lang:hover {
    color: var(--brand);
    border-color: var(--brand);
}

/*
 * Hidden by default: above 640 px the four links are the header and there is
 * nothing to unfold. The drawer styles live in the mobile block, next to the
 * breakpoint they belong to.
 */
.nav-toggle,
.nav-backdrop {
    display: none;
}

/* ------------------------------------------------------------------ hero */

.hero {
    padding: clamp(2.5rem, 6vw, 4.5rem) 0 0;
    background: radial-gradient(circle at 20% 0%, var(--accent-16), transparent 55%),
        radial-gradient(circle at 90% 10%, var(--brand-12), transparent 45%);
}

/*
 * Two columns: the pitch on the left, one phone on the right.
 *
 * `1.05fr 0.95fr` rather than an even split because the copy carries the
 * headline and the badges and needs the room; the phone only has to be tall.
 * Below 860 px it collapses to one column with the copy first, which is the
 * order it has to be read in on a phone.
 */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2rem, 5vw, 3.5rem);
    align-items: center;
}

@media (min-width: 860px) {
    .hero-grid {
        grid-template-columns: 1.05fr 0.95fr;
    }
}

.hero-copy {
    text-align: left;
}

.hero h1 {
    margin-bottom: 1rem;
    /* The headline is the one place the size ramp is allowed to run, so the
       two-column hero has a clear focal point on the left. */
    font-size: clamp(2rem, 4.6vw, 3.1rem);
}

.hero-copy p {
    max-width: 52ch;
    color: var(--ink-soft);
    font-size: 1.06rem;
}

.hero-visual {
    display: flex;
    justify-content: center;
}

/*
 * The phone in the hero is the same component as the gallery ones, only
 * larger and with no overlap. `--phone-w` is the single knob.
 *
 * `.hero` in the selector is not decoration: `.phone` is defined further down
 * the file and would win on source order, leaving the hero phone at the
 * gallery size — which is what it looked like before this was fixed.
 */
.hero .phone-hero {
    --phone-w: clamp(13rem, 26vw, 19rem);
    margin: 0;
    /* A soft pool of light so it does not float on flat colour. */
    filter: drop-shadow(0 30px 45px var(--brand-22));
}

.hero .cta {
    justify-content: flex-start;
}

/* ------------------------------------------- las ondas del hero, de fondo */

/*
 * The hero carries the icon's idea without drawing the icon.
 *
 * The app icon is a seismic wave stylised into a shell: thick arcs in sand on
 * the brand red. Redrawing that shape here would have been a logo twice on the same
 * screen — the header already shows one. What is repeated instead is the
 * *behaviour*: something radiates outwards from a point and thins as it
 * travels. Seven irregular closed curves, centred behind the phone, a little
 * more riven the further out they go.
 *
 * The irregularity is the point. Concentric circles are a radar, which every
 * app has; a curve that is nearly-but-not-quite a circle reads as a seismogram,
 * and that is the one thing on the page nothing else looks like. It is also
 * cheaper than it sounds — the paths are generated at build time as fixed
 * numbers, so the page ships a handful of `d` attributes and no script.
 *
 * The values, and what forced each:
 *
 *   - **Opacity from 0.34 down to 0.09.** A first attempt used 0.17 to 0.05
 *     and was invisible on a real screen. The waves have to be legible as a
 *     motif while the screenshot of the app stays the hero.
 *   - **Fixed `rem`, never a percentage of the section.** A percentage tied the
 *     stroke widths to the viewport, so on a wide screen the rings grew into
 *     three broad smudges; `min()` only stops them overflowing a short window.
 *   - **No plate, no vignette, no border.** Curves only, so nothing reads as a
 *     card sitting beside the phone.
 *   - **Nothing moves.** The brief was personality, not animation.
 */
.hero--waves {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: radial-gradient(circle at 74% 45%, var(--brand-11), transparent 62%),
        radial-gradient(circle at 6% 0%, var(--accent-10), transparent 55%);
}

/*
 * The waves are anchored to the phone's own column, not to the section.
 *
 * Positioning them against the hero meant recomputing the offset for every
 * width, and the epicentre drifted three hundred points to the right of the
 * phone on a wide screen. The column is where the phone is by definition, so
 * centring on it is right at every width without a single media query.
 */
.hero-waves {
    position: absolute;
    z-index: 0;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    width: min(52rem, 170%);
    aspect-ratio: 1;
    pointer-events: none;
    /*
     * Dissolve outwards, in every direction.
     *
     * A radial fade does two jobs at once and is why there is no second rule
     * here. It stops the outer curves from ending against the section's clipped
     * edge — a straight cut is the one thing that gives away a decorative layer
     * — and it takes care of the copy for free: the paragraph ends about 73 %
     * of the way out, where the mask is already almost transparent.
     *
     * The inner stop at 34 % leaves the curves around the phone at full
     * strength, which is where they have to be read.
     */
    mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 82%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 82%);
}

.hero-waves svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.hero-waves .wave {
    fill: none;
    stroke: var(--brand);
    /* Set per curve, so the wave thins out as it travels. */
    opacity: var(--o);
}

/* The copy sits above the waves, never through them. */
.hero--waves .hero-copy {
    position: relative;
    z-index: 1;
}

/*
 * The phone's column is the waves' containing block, so it has to establish one
 * — and the phone itself is lifted over them.
 */
.hero--waves .hero-visual {
    position: relative;
}

.hero--waves .phone-hero {
    position: relative;
    z-index: 1;
}

/*
 * A tighter shadow than the plain hero's.
 *
 * The 45-point pool of light is right on flat colour, but over the curves it
 * starts to look like a hole punched in the paper. This one is short and close,
 * so the phone reads as lying on top of the print.
 */
.hero--waves .phone-hero {
    filter: drop-shadow(0 18px 30px var(--brand-20));
}

/* The seismogram closing the hero, a touch quieter over the curves. */
.hero--waves .seismo {
    opacity: 0.4;
}

/*
 * Below 860 points the hero is one column, so the waves would sit directly
 * under the copy — and a column of text over strokes is unreadable. They are
 * decoration, so they go; the warm glow stays so the section does not go flat.
 *
 * The breakpoint matches `.hero-grid`, not a value of its own: the pattern is
 * only ever drawn in the two-column layout it was composed for.
 */
@media (max-width: 859px) {
    .hero-waves {
        display: none;
    }

    .hero--waves {
        background: radial-gradient(circle at 50% 0%, var(--brand-09), transparent 62%);
    }

    /*
     * One column, one axis.
     *
     * Below this width the hero stops being two columns: the phone drops under
     * the copy, and it is centred — it always was, because the visual is a
     * `<figure>` in a grid of one. What did not follow was everything above it.
     * The copy and the badges stayed hugging the left edge with the phone
     * centred underneath, so the section read as two things that had drifted
     * apart: measured on a real window, the badges ended at x=460 while the
     * text above them reached 677, leaving 217 px of nothing on the right.
     *
     * Centring all three is what makes a stacked hero look deliberate instead of
     * broken. The paragraphs keep their 52ch measure, so centring them does not
     * stretch a line across the screen.
     */
    .hero-copy {
        text-align: center;
    }

    .hero-copy p {
        margin-left: auto;
        margin-right: auto;
    }

    .hero .cta {
        justify-content: center;
    }
}

.cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    justify-content: center;
    align-items: stretch;
    margin-top: 1.9rem;
}

/*
 * The two badges have different natural widths, so on a phone they did not fit
 * on one line and each one kept its own width, leaving a ragged stack. Below
 * 640 px they stack at one shared width, capped so a badge never becomes a
 * 600 px slab, with the icon and the label centred inside.
 *
 * There used to be a `.hero .cta { align-items: flex-start }` here, to line the
 * badges up with the left-aligned copy. The copy is centred below 860 now, so
 * the override went with it — one rule for both sections, not two that disagree.
 */
@media (max-width: 640px) {
    .cta {
        flex-direction: column;
        align-items: center;
    }

    .cta .store-badge {
        justify-content: center;
        width: min(100%, 20rem);
    }
}

.button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.button.primary {
    background: var(--brand);
    color: var(--ivory);
    box-shadow: var(--shadow);
}

.button.primary:hover {
    background: var(--brand-deep);
    color: var(--ivory);
    transform: translateY(-1px);
}

/* ---------------------------------------------------------- store badges */

/*
 * The store badges are the one place the site goes dark on purpose. A light
 * pill around the word "Descargar" is a text link in disguise; the stores both
 * ship dark badges, so the dark surface is what tells the eye it can be tapped.
 * The Google Play one keeps the brand red, the App Store one is ink — and
 * dimmed, because there is no listing yet.
 */
.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.15rem 0.5rem 0.8rem;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.store-badge:hover {
    background: var(--brand-deep);
    color: #fff;
    transform: translateY(-1px);
}

.store-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    flex: none;
}

.store-badge-icon svg {
    width: 100%;
    height: 100%;
}

.store-badge-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    text-align: left;
}

.store-badge-small {
    font-size: 0.6rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    opacity: 0.78;
}

.store-badge-brand {
    font-size: 1.18rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.store-badge--soon {
    background: var(--ink);
    opacity: 0.55;
    cursor: default;
}

.store-badge--soon:hover {
    background: var(--ink);
    transform: none;
}

/* A seismogram line under the hero: the one mark that says "this is about the
   ground moving" without a word or a map. */
.seismo {
    display: block;
    width: 100%;
    height: 46px;
    margin-top: 2.5rem;
    color: var(--accent);
    opacity: 0.5;
}

/* ------------------------------------------------------------------ stats */

.stats {
    padding: 1.9rem 0;
    background: var(--brand);
    color: var(--ivory);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem 2rem;
    text-align: center;
}

.stat strong {
    display: block;
    font-size: 1.55rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ivory);
}

.stat span {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--sand);
    opacity: 0.92;
}

/* -------------------------------------------------------------- gallery */

/*
 * The screenshots are shown as a fan of phones, not as four images in a row.
 *
 * A row of equal rectangles reads as "here are some files"; a fan, with one
 * phone forward and the others receding behind it, reads as a product. The
 * metaphor is deliberate — this is a photo of the app lying on a table.
 *
 * Layout is a plain flex row with negative margins, so the phones overlap by a
 * known amount at every width. No absolute positioning: the row still owns its
 * height, and a screenshot that fails to load cannot collapse the section.
 */
.gallery {
    position: relative;
    padding: clamp(1rem, 3vw, 2rem) 0 clamp(2rem, 5vw, 3.5rem);
    /*
     * No `overflow: hidden` here, and that is deliberate. It was there to
     * contain the glow behind the phones, but it also clipped their drop
     * shadows at the section edge — a soft shadow cut by a straight line,
     * which is exactly the artefact it looks like.
     *
     * The glow is now sized to the section (`inset: 0`, see below), so nothing
     * overflows and nothing needs clipping.
     */
}

/* Soft pool of brand light behind the fan, so the phones sit on something. */
.gallery::before {
    content: '';
    position: absolute;
    /* Fills the section instead of overflowing it: a 120vw glow would need
       `overflow: hidden` to avoid a horizontal scrollbar, and that clipping is
       what was cutting the shadows. */
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        var(--accent-22),
        var(--brand-08) 45%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
}

.gallery .wrap {
    position: relative;
    z-index: 1;
}

.shots {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0 0.5rem;
    /* The fan is a picture, not a carousel: it never scrolls sideways and the
       phones shrink together. A single column takes over on a phone. */
    overflow: visible;
}

/*
 * One phone. The width is a clamp so the whole fan scales down as a unit; the
 * overlap is a fraction of that width, which keeps the composition identical
 * from 360 px to 1080 px.
 */
/*
 * Eight of them across a 1080 px wrap: `19vw` and a 15rem cap would put the fan
 * ~1500 px wide and push it off both edges. The width and the overlap shrink
 * together, so the composition keeps the same proportions and only the scale
 * changes — which is exactly what the clamp was already doing vertically.
 */
.phone {
    --phone-w: clamp(7.5rem, 13.5vw, 12rem);
    position: relative;
    flex: 0 0 auto;
    width: var(--phone-w);
    margin: 0 -2.3rem;
    padding: 0.45rem;
    border-radius: 2rem;
    background: linear-gradient(160deg, var(--wall), var(--wall-deep) 60%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 249, 242, 0.14),
        0 2px 4px var(--ink-28),
        0 24px 48px -12px var(--ink-45);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
    transform-origin: center bottom;
}

.phone img {
    display: block;
    width: 100%;
    border-radius: 1.6rem;
    background: var(--sand);
    aspect-ratio: 9 / 19.5;
    object-fit: cover;
}

/* Drawn in CSS: the screenshots are clean captures, with no notch of their own. */
.phone::after {
    content: '';
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 32%;
    height: 0.85rem;
    border-radius: 999px;
    background: var(--wall-foot);
    z-index: 2;
}

/*
 * The fan, symmetric about the centre.
 *
 * Five phones: one upright in the middle, two leaning each way. The angle, the
 * drop and the scale all grow outward together — that is what makes it read as
 * one object instead of five pictures that happen to be near each other, and
 * the symmetry is what stops it looking accidental.
 *
 * It used to be eight, because the gallery used to hold eight screens, three of
 * them repeats of the Data tab. With the feature sections carrying their own
 * screenshots the gallery is the tour of the app again, and five fit a fan
 * without shrinking to stamps.
 *
 * The numbers are per position. A sixth screenshot means re-checking all five
 * and the count in `SCREENSHOTS`, which is what puts them on the page.
 */
.shots .phone:nth-child(1) {
    transform: translateY(2.2rem) rotate(-12deg) scale(0.84);
    z-index: 1;
}

.shots .phone:nth-child(2) {
    transform: translateY(1.1rem) rotate(-6deg) scale(0.9);
    z-index: 2;
}

.shots .phone:nth-child(3) {
    transform: translateY(0.15rem) rotate(0deg) scale(1.02);
    z-index: 3;
}

.shots .phone:nth-child(4) {
    transform: translateY(1.1rem) rotate(6deg) scale(0.9);
    z-index: 2;
}

.shots .phone:nth-child(5) {
    transform: translateY(2.2rem) rotate(12deg) scale(0.84);
    z-index: 1;
}

/* The fan is decoration; lifting a phone out of it is the reward for hovering. */
.shots .phone:hover {
    transform: translateY(-0.6rem) rotate(0deg) scale(1.06);
    box-shadow:
        inset 0 0 0 1px rgba(255, 249, 242, 0.2),
        0 2px 4px var(--ink-30),
        0 32px 60px -12px var(--ink-50);
    z-index: 5;
}

.fineprint {
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.86rem;
    margin: 0;
}

/*
 * The fan leans out of its own box: the outer phones drop by 1.6rem and rotate,
 * so their corners overflow the row and land on top of this line. A plain
 * margin bottom was not enough — the text sat underneath the rotated corners,
 * which is why it looked cut off.
 *
 * Clearance is measured from the deepest corner (1.6rem of drop plus the
 * rotation), and the z-index puts the sentence above the phones in case a
 * future tweak brings them back down.
 */
.gallery .fineprint {
    position: relative;
    z-index: 6;
    margin-top: 2.75rem;
}

/* ------------------------------------------------------------- sections */

section {
    padding: clamp(2.5rem, 6vw, 4rem) 0;
}

section.alt {
    background: var(--sand);
}

section p {
    max-width: var(--measure);
    color: var(--ink-soft);
}

section.alt p {
    color: var(--ink-alt);
}

.features .grid {
    display: grid;
    /*
     * `min(260px, 100%)` and not a bare 260px: a 280 px folded phone leaves a
     * 220 px column, and a track that insists on 260 overflows the page and
     * gives the whole site a sideways scroll. `auto-fit` still puts two columns
     * wherever they fit.
     */
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 1.25rem;
    margin-top: 1.75rem;
}

/* ------------------------------------------------------------------- data */

/*
 * Three feature sections, seven screenshots, and the middle one tinted.
 *
 * There used to be only the Data tab, with three screenshots that also lived in
 * the gallery above — the same three images downloaded twice and the same three
 * screens seen twice while scrolling. The gallery is now the tour of the app
 * (list, history, map, detail, filters, five phones that fit a fan) and each
 * feature carries its own evidence here.
 *
 * Both map sections go first because they are the map, which is what the page
 * has just shown: the month, then the density layer. The Data tab is a different
 * screen, so it follows. The tint alternates so no two neighbours read as one
 * block, which puts it on the middle of the three.
 */
.data-feature--alt {
    background: var(--sand);
}

.data-feature--alt p {
    color: var(--ink-alt);
}

.data-feature .eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--accent-dark);
    margin-bottom: 0.85rem;
}

.data-feature h2 {
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    max-width: 24ch;
}

.data-feature .lead {
    margin-top: 0.85rem;
    font-size: 1.02rem;
    max-width: 58ch;
}

/*
 * The three phones. They wrap on a narrow screen rather than shrinking to
 * stamps: at 360 px three across would be ~96 px each, and then the section is
 * decoration instead of evidence. Above the tablet breakpoint this is a centred
 * flex row; on a phone the media query below turns it into a two-column grid,
 * where a lone screenshot takes the whole row.
 */
.data-shots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(1.1rem, 2.5vw, 1.9rem);
    margin: 2.2rem 0 2.6rem;
}

.data-shot {
    flex: 0 1 13.5rem;
    max-width: 15rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    /*
     * `<figure>` brings a UA margin of 1em 40px with it. 80 px of invisible
     * width per screenshot is enough to push the second phone of a row onto its
     * own line on a 390 px screen, which is what it did before this line.
     */
    margin: 0;
}

/*
 * Reuses `.phone`, so the frame, the notch and the shadow are the gallery's and
 * not a second set that drifts. Only the overlap is cancelled: these are not a
 * fan, they are three panels side by side.
 */
.data-shot .phone {
    --phone-w: 100%;
    width: 100%;
    margin: 0;
    transform: none;
}

.data-shot .phone:hover {
    transform: translateY(-0.35rem);
}

.data-shot figcaption {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--ink-soft);
}

.data-shot figcaption b {
    display: block;
    font-size: 0.87rem;
    color: var(--brand);
    margin-bottom: 0.2rem;
}

/* The three things inside Datos that the screenshots do not show. */
.data-asks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/*
 * The card is always the *other* colour of the two the page uses.
 *
 * It used to be a flat `--sand`, which is exactly what the tinted section
 * (`.data-feature--alt`) paints its own background with, so in that one band the
 * cards dissolved and read as loose paragraphs. A single colour cannot win here:
 * sand on an ivory page is a card, sand on a sand band is a hole. So the default
 * is sand (the page is ivory) and the tinted band reverses it to ivory.
 *
 * The hairline and the shadow stay on both: they are what gives the card an edge
 * even when the two surfaces are close in value.
 */
.data-asks article {
    background: var(--sand);
    border: 1px solid var(--brand-12);
    border-radius: var(--radius);
    padding: 1rem 1.05rem;
    box-shadow: 0 1px 2px var(--ink-06);
}

.data-feature--alt .data-asks article {
    background: var(--ivory);
}

.data-asks .step {
    display: block;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    color: var(--accent-dark);
    margin-bottom: 0.4rem;
}

.data-asks h3 {
    font-size: 0.9rem;
    color: var(--brand);
    margin-bottom: 0.3rem;
}

.data-asks p {
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: none;
}

/*
 * The screenshot on the left, its cards in a column on the right.
 *
 * It used to be a stack — heading, phones in a centred row, then the cards
 * underneath — which on a 1280 px screen left the row floating in the middle of
 * the page with ~500 px of empty white at the sides and pushed the cards below
 * the fold. The screenshot and the argument underneath it are about the same
 * thing, so they read better side by side.
 *
 * A float and not a grid: the heading and the lead keep spanning the full width
 * above, and the text below simply wraps around the screenshots. A grid would
 * mean splitting the body into cells and every section would need its own
 * markup for the same result.
 *
 * Below the breakpoint nothing here applies, so phones and cards stack exactly
 * as they did — the phones are too wide to share a row with anything at 375 px.
 */
@media (min-width: 900px) {
    .data-feature .data-shots {
        float: left;
        width: 46%;
        margin: 0 2.4rem 1.4rem 0;
    }

    /* Level with the top of the screenshots, not 2rem under the headline. */
    .data-feature .data-shots + * {
        margin-top: 0;
    }

    /* One card per row: three narrow cards fit, one next to each other does not. */
    .data-feature .data-asks {
        grid-template-columns: 1fr;
        margin-top: 0;
    }

    /* 2x2 beside the phone rather than four slivers. */
    .data-feature .data-figures {
        grid-template-columns: repeat(2, 1fr);
    }

    /*
     * A section with a *pair* of screenshots needs more room than 46% gives it:
     * two 216 px phones plus the gap is already 462 px, and the floating box
     * would clip them into a squeezed row. It gets a wider share of the page and
     * the cards keep whatever is left.
     */
    .data-feature--pair .data-shots {
        width: 52%;
        margin-right: 2rem;
    }
}

/*
 * Four numbers, read from the catalogue and written into the HTML at build
 * time. A grid of 1 px gaps over a line-coloured background draws the dividers
 * without a border on any cell, which is what keeps the corners clean when it
 * collapses to 2x2 on a phone.
 */
.data-figures {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.data-figures .figure {
    background: var(--ivory);
    padding: 1.05rem 1rem;
}

.data-figures strong {
    display: block;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    letter-spacing: -0.03em;
    color: var(--brand);
    line-height: 1.1;
}

.data-figures span {
    display: block;
    font-size: 0.73rem;
    line-height: 1.45;
    color: var(--ink-soft);
    margin-top: 0.32rem;
}

/*
 * The break sits at 767 px, not 640: between the two the three phones would not
 * fit in a row yet, so they wrapped into two small ones on a wide row — three
 * screenshots at 216 px in a 700 px column with empty space either side. Below
 * the tablet width the full-width pair reads better.
 *
 * On a phone the pairs are a two-column grid, and the screenshot that ends up
 * alone in a row — the third of a trio — takes the whole row, caption included.
 * It used to keep the phone's width, which left an eight-line caption in a
 * 165 px column with half the screen empty next to it: the narrowest text on the
 * page, on the device where text is hardest to read.
 */
@media (max-width: 767px) {
    .data-shots {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.6rem 0.9rem;
        justify-items: center;
    }

    /*
     * `minmax(0, 1fr)` and `width: 100%` instead of `flex-basis`: with flex, the
     * figure's min-content width (the caption's longest word plus the frame's
     * padding) can be wider than half the row and the pair splits. A grid column
     * cannot be pushed open that way.
     *
     * Capped at 20rem: at 767 px half the row is 354 px, and a phone frame wider
     * than the gallery's 192 px starts to look like a poster.
     *
     * `container-type` is what lets the frame keep its shape down to 163 px. See
     * the `em` block below.
     */
    .data-shot {
        container-type: inline-size;
        width: 100%;
        max-width: 20rem;
    }

    /*
     * The frame has to look like the same phone at 163 px as at 216, and the
     * bezel, the corners and the notch are fixed pixels in the base rules — so
     * shrinking the frame kept the rounding and grew the bezel. At 163 px the
     * radius was 19.6 % of the width where the design means 14.8 %, and the
     * phone read as a pill. The screenshot itself never deformed: `aspect-ratio`
     * holds it at 9 / 19.5 at any width, checked from 260 to 1024 px.
     *
     * So the metrics move to `em` and the `font-size` becomes the only thing tied
     * to the container: 14.81 % is the 32 px radius the desktop frame has at
     * 216 px, and every other measurement is that same number divided down
     * (bezel 0.225em, inner corner 0.8em, notch 0.425em with its 0.375em inset).
     * The `min()` repeats the 20 rem cap, because a capped frame that keeps
     * growing its corners is the same bug in the other direction.
     */
    .data-shot .phone {
        font-size: min(14.81cqw, 2.96rem);
        padding: 0.225em;
        border-radius: 1em;
    }

    .data-shot .phone img {
        border-radius: 0.8em;
    }

    .data-shot .phone::after {
        height: 0.425em;
        top: 0.375em;
    }

    /* The odd one out sits centred rather than leaving a hole on the right. */
    .data-shots--odd .data-shot:last-child {
        grid-column: 1 / -1;
        max-width: 100%;
    }

    /*
     * The phone keeps the size it would have had at 56 % of the row and the
     * caption gets the rest of the width. `margin-inline: auto` centres the
     * frame without shrinking the caption to its content.
     *
     * The `font-size` is 14.81 % of the *figure* scaled by that same 56 %, so the
     * bezel and the corners stay proportional to a frame that is now narrower
     * than its column, and the 17 rem cap is repeated inside the `min()`.
     */
    .data-shots--odd .data-shot:last-child .phone {
        width: 56%;
        max-width: 17rem;
        margin-inline: auto;
        font-size: min(8.29cqw, 2.52rem);
    }

    /*
     * Capped again at 30rem. Between 700 and 767 px the row is 660–727 px wide,
     * and a caption at that width is ~90 characters a line in 13 px type —
     * wider than anyone reads comfortably. Below 480 px nothing changes.
     */
    .data-shots--odd .data-shot:last-child figcaption {
        max-width: 30rem;
        margin-inline: auto;
    }

    /*
     * One notch up from the 0.82rem of the desktop rule, and more so in the
     * eyebrow. 13 px is fine as a caption next to a 216 px phone on a laptop;
     * on a phone it is the smallest type on the page, held at arm's length in
     * daylight. The pairing keeps every caption in a section at the same size,
     * so the lone one does not read as a different kind of element.
     */
    .data-shot figcaption {
        font-size: 0.88rem;
        line-height: 1.6;
    }

    .data-shot figcaption b {
        font-size: 0.95rem;
    }

    .data-figures {
        grid-template-columns: repeat(2, 1fr);
    }
}

/*
 * Below 360 px — a 320 px iPhone SE, a 280 px folded Galaxy — the pair stops
 * being a pair: two phones leave 113 px each on the narrowest screen, which is a
 * stamp rather than a screenshot, and their captions fall to 16 characters a
 * line. One per row instead, with the caption across the whole width.
 *
 * The `--odd` rules are repeated for every figure rather than only the last,
 * because with one column there is no last-one-out any more.
 */
@media (max-width: 359px) {
    .data-shots {
        grid-template-columns: 1fr;
        gap: 1.4rem;
    }

    .data-shot,
    .data-shots--odd .data-shot:last-child {
        grid-column: 1 / -1;
        max-width: 100%;
    }

    /*
     * 68 % and not the 56 % of the odd rule: with a single column there is room,
     * and the phone is the evidence — the caption is only there to explain it.
     *
     * The `font-size` carries the same 68 %, so the frame keeps the bezel and the
     * corners of the desktop one instead of turning into a pill as it shrinks.
     */
    .data-shot .phone,
    .data-shots--odd .data-shot:last-child .phone {
        width: 68%;
        max-width: 17rem;
        margin-inline: auto;
        font-size: min(10.07cqw, 2.52rem);
    }

    .data-shot figcaption,
    .data-shots--odd .data-shot:last-child figcaption {
        max-width: 30rem;
        margin-inline: auto;
    }
}

/* ------------------------------------------------------------------ scale */

/*
 * The colour ramp, as a band across the page.
 *
 * The swatches are the app's own eight colours, so this block is a picture of
 * the thing it claims rather than a paragraph about it — which is the whole
 * argument for the feature being worth a section. The labels sit under the
 * swatches because ivory text inside a pale band (`2+` is nearly yellow) fails
 * contrast; that mistake is already fixed in the app's legend and it is not
 * worth repeating here.
 */
.scale-block {
    padding: clamp(2.2rem, 5vw, 3.4rem) 0;
}

.scale-intro {
    max-width: var(--measure);
    color: var(--ink-soft);
}

.ramp {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.4rem;
    margin-top: 1.6rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--ivory);
    box-shadow: var(--shadow);
}

.ramp-band {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: center;
}

.ramp-swatch {
    width: 100%;
    height: clamp(1.6rem, 4.5vw, 2.6rem);
    border-radius: 6px;
    background: var(--band);
}

.ramp-label {
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    color: var(--ink-soft);
}

.features article {
    background: var(--ivory);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.35rem 1.4rem;
    box-shadow: var(--shadow);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    margin-bottom: 0.9rem;
    border-radius: 12px;
    background: var(--brand-08);
    color: var(--brand);
}

.feature-icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.features article h3 {
    color: var(--brand);
    margin-bottom: 0.4em;
}

.features article p {
    margin: 0;
    font-size: 0.96rem;
}

.download {
    text-align: center;
}

.download p {
    margin-left: auto;
    margin-right: auto;
}

/* --------------------------------------------------------------- legal */

.legal {
    padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 4rem);
}

.legal h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
}

.legal article p {
    max-width: none;
    color: var(--ink);
}

.legal .meta {
    font-size: 0.88rem;
    color: var(--ink-soft);
}

.legal .related {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 2rem 0 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

/*
 * The language note that sits above a translated legal document.
 *
 * It says which text prevails, so it has to read as a note and not as a warning:
 * a tinted block with a rule on the left, at body size and not shrunk to fine
 * print. Someone who reads eight words of it and stops has still learned the one
 * thing that matters.
 */
.legal .note {
    margin: 1rem 0 1.75rem;
    padding: 0.85rem 1.1rem;
    max-width: none;
    font-size: 0.92rem;
    color: var(--ink-soft);
    background: var(--brand-06);
    border-left: 3px solid var(--brand-40);
    border-radius: 0 6px 6px 0;
}

/*
 * The download offer under a shared earthquake.
 *
 * Deliberately below the card and separated by a rule: the visitor came for the
 * earthquake, and an offer that appears before the data reads as an ad and gets
 * scrolled past. After it, it reads as what it is — the next step.
 */
.share-cta {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--line);
}

.share-cta h2 {
    font-size: clamp(1.15rem, 2.5vw, 1.4rem);
}

.share-cta p {
    max-width: none;
}

/*
 * The tsunami line.
 *
 * Set apart from the facts on purpose: it is the one datum on this page whose
 * consequence is not informational. Deep magenta-red on a tinted ground, with room
 * around it, so it cannot be mistaken for another table row.
 */
.quake-tsunami {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: none;
    margin: 0 0 1.25rem;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6d0016;
    background: rgba(204, 0, 51, 0.09);
    border-left: 3px solid #cc0033;
    border-radius: 0 6px 6px 0;
}

.quake-tsunami .fact-icon {
    flex: 0 0 auto;
    color: #cc0033;
}

/* -------------------------------------------------------------- beta test */

/*
 * Las instrucciones del test cerrado. Numeradas de verdad y con sitio para
 * respirar: alguien las lee una vez, en el móvil, y tiene que poder seguirlas
 * sin volver a preguntar.
 */
.beta-steps {
    counter-reset: step;
    list-style: none;
    margin: 1.25rem 0 2rem;
    padding: 0;
    display: grid;
    gap: 0.9rem;
}

.beta-steps li {
    counter-increment: step;
    position: relative;
    padding-left: 2.75rem;
    color: var(--ink);
}

.beta-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.1rem;
    width: 1.85rem;
    height: 1.85rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand);
    color: var(--ivory);
    font-size: 0.85rem;
    font-weight: 600;
}

.legal h2 {
    font-size: clamp(1.15rem, 2.5vw, 1.35rem);
    margin-top: 2.25rem;
}

.legal h3 {
    font-size: 1rem;
    margin: 1.5rem 0 0.4rem;
    color: var(--brand);
}

.legal h3 + p {
    margin-top: 0;
}

/* ---------------------------------------------------------- earthquake */

.earthquake {
    padding: clamp(2rem, 5vw, 3.5rem) 0 4rem;
}

.crumb {
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.crumb a {
    text-decoration: none;
}

.quake {
    background: var(--ivory);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

/*
 * The magnitude band, drawn like the app's detail screen: a coloured disc on the
 * sand the app uses for that block, with the label above the place.
 *
 * The disc is the whole point of this change. The severity ramp is how the app
 * communicates "how bad" everywhere — marker, list, callout, detail — and a page
 * that printed the number in plain text made the same event look like a different
 * product.
 */
.quake-summary {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 1.4rem;
    background: var(--sand);
    border-bottom: 1px solid var(--line);
}

.quake-badge {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 92px;
    height: 92px;
    margin: 0;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    /* Digits of equal width, so 1,5 and 5,5 centre the same inside the circle. */
    font-variant-numeric: tabular-nums;
}

.quake-summary-copy {
    /* Without this a long place name pushes the disc off the card. */
    min-width: 0;
}

.quake-summary-title {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand);
}

.quake-place {
    margin: 0.2rem 0 0;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
}

.quake-where {
    margin: 0.1rem 0 0;
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.quake-note {
    margin: 0.45rem 0 0;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

/*
 * Two columns of facts with an icon each, as the app's grid does it. `minmax(0,
 * 1fr)` instead of `1fr` so a long value wraps instead of widening the column.
 */
.quake-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem 1.4rem;
    margin: 0;
    padding: 1.4rem;
}

.fact dt {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--ink-soft);
}

.fact dd {
    margin: 0.15rem 0 0 0;
    /* Aligns the value with the label's text, not with its icon. */
    padding-left: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.fact-icon {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.85;
}

.quake-actions {
    padding: 0 1.4rem 1.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.92rem;
}

@media (max-width: 30rem) {
    .quake-badge {
        width: 74px;
        height: 74px;
        font-size: 1.6rem;
    }

    /*
     * Two columns stay. The app's grid also draws two on a phone and only
     * stacks a row when the value itself would not fit, so collapsing to one
     * column here would make the page taller and less like the screen it is
     * mirroring.
     */
    .quake-facts {
        gap: 1rem 1rem;
        padding: 1.2rem;
    }

    .fact dd {
        padding-left: 0;
    }
}

.loading,
.notice {
    color: var(--ink-soft);
}

.notice {
    background: var(--sand);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.4rem;
}

/* --------------------------------------------------------------- footer */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 2.25rem 0 3rem;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1rem;
}

.footer-links a {
    text-decoration: none;
}

.site-footer p {
    margin: 0;
    max-width: var(--measure);
}

/* ---------------------------------------------------------------- 404 */

.center-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.center-page .wrap {
    text-align: center;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 640px) {
    body {
        font-size: 16px;
    }

    /*
     * One row: the brand, then the language pill and the hamburger, in that
     * order. The links moved into the drawer it opens, so the second row that
     * used to scroll sideways — and the pill that wrapped with it — are gone.
     */
    .site-header {
        background: var(--ivory);
        /*
         * The blur goes with the wrap. `backdrop-filter` makes its element the
         * containing block for fixed children, and the drawer is one: left on,
         * the panel would anchor to the header's 3.5 rem instead of the screen
         * and never reach the bottom edge.
         */
        backdrop-filter: none;
    }

    .site-header .wrap {
        flex-wrap: nowrap;
        row-gap: 0;
        column-gap: 0.6rem;
        min-height: 0;
        padding-top: 0.55rem;
        padding-bottom: 0.55rem;
    }

    /* Pushes the pill and the button to the far right of the single row. */
    .brand {
        margin-right: auto;
    }

    .nav-toggle {
        display: inline-flex;
        position: relative;
        z-index: 30;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 2.5rem;
        height: 2.5rem;
        /* The border is what the eye aligns; the extra pixel is not. */
        margin-right: -0.3rem;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: transparent;
        color: var(--ink);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-toggle-bars,
    .nav-toggle-bars::before,
    .nav-toggle-bars::after {
        display: block;
        width: 18px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transition: transform 0.22s ease, background-color 0.16s ease;
    }

    .nav-toggle-bars {
        position: relative;
    }

    .nav-toggle-bars::before,
    .nav-toggle-bars::after {
        content: '';
        position: absolute;
        left: 0;
    }

    .nav-toggle-bars::before {
        top: -6px;
    }

    .nav-toggle-bars::after {
        top: 6px;
    }

    /* Three bars become the cross, not a second set of icons. */
    .nav-toggle[aria-expanded='true'] .nav-toggle-bars {
        background: transparent;
    }

    .nav-toggle[aria-expanded='true'] .nav-toggle-bars::before {
        transform: translateY(6px) rotate(45deg);
    }

    .nav-toggle[aria-expanded='true'] .nav-toggle-bars::after {
        transform: translateY(-6px) rotate(-45deg);
    }

    /*
     * Off-canvas instead of a row. `visibility` is part of the transition so the
     * links stop being focusable the moment the panel starts to slide out, and
     * come back only once it is on screen.
     */
    .site-header nav {
        position: fixed;
        inset: 0 0 0 auto;
        z-index: 20;
        width: min(82vw, 19rem);
        height: 100dvh;
        margin: 0;
        /* Clears the header so the button that opened it stays reachable. */
        padding: 4.4rem 1.35rem 1.75rem;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--ivory);
        box-shadow: -18px 0 44px var(--ink-16);
        transform: translateX(101%);
        visibility: hidden;
        transition: transform 0.26s ease, visibility 0.26s;
    }

    .site-header nav[data-open='true'] {
        transform: none;
        visibility: visible;
    }

    .site-header nav a {
        flex: 0 0 auto;
        white-space: normal;
        padding: 0.9rem 0.15rem;
        border-bottom: 1px solid var(--line);
        font-size: 1.02rem;
        font-weight: 600;
        color: var(--ink);
    }

    .site-header nav a:last-child {
        border-bottom: 0;
    }

    .site-header nav a[aria-current='page'] {
        color: var(--brand);
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 15;
        background: var(--ink-42);
        opacity: 0;
        transition: opacity 0.26s ease;
    }

    .nav-backdrop[hidden] {
        display: none;
    }

    .nav-backdrop[data-visible='true'] {
        opacity: 1;
    }

    body.nav-open {
        overflow: hidden;
    }

    /*
     * Four phones do not fit side by side on a phone, and shrinking the fan to
     * fit would make it unreadable. It becomes a carousel instead: full-size
     * phones, one at a time, with the neighbours peeking in on both sides so it
     * is obvious there is more.
     */
    .shots {
        justify-content: flex-start;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 0;
        padding-inline: 12%;
        /*
         * Room for the shadow inside the scroller.
         *
         * `overflow-x: auto` makes the browser compute `overflow-y: auto` too,
         * so the row clips vertically — and the phones' drop shadow was being
         * sliced flat, leaving a visible line across the bottom of the gallery.
         *
         * The padding alone could not fix it: the desktop shadow blurs 48 px,
         * so it still darkens the page ~70 px below the phone, and reserving
         * that much empty space inside the carousel left the phones floating in
         * a gap. The shadow is softened in the `.phone` rule below instead, and
         * this padding is sized to it.
         */
        padding-block: 2rem;
        scrollbar-width: none;
    }

    .shots::-webkit-scrollbar {
        display: none;
    }

    .phone {
        --phone-w: 62vw;
        margin: 0 0.6rem;
        transform: none !important;
        /*
         * A gentler shadow than the desktop fan's. The 48 px blur reaches ~70 px
         * below the phone, which is too much room to reserve inside a scroll
         * container — and on a single upright phone the deep shadow reads as a
         * smudge rather than as lift. This one fades out ~50 px sooner and sits
         * comfortably within the row's padding.
         */
        box-shadow:
            inset 0 0 0 1px rgba(255, 249, 242, 0.14),
            0 2px 4px var(--ink-24),
            0 10px 22px -12px var(--ink-45);
    }

    .shots .phone {
        scroll-snap-align: center;
    }

    /* The overlap is a desktop composition; on a phone each card stands alone. */
    .shots .phone:nth-child(n) {
        transform: none;
    }
}

/*
 * Motion is decoration here; anyone who asked the system for less of it should
 * not get a hover that lifts a button.
 */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .button {
        transition: none;
    }

    .button.primary:hover {
        transform: none;
    }

    /* The drawer still opens and closes; it just arrives instead of sliding. */
    .nav-toggle-bars,
    .nav-toggle-bars::before,
    .nav-toggle-bars::after,
    .site-header nav,
    .nav-backdrop {
        transition: none;
    }
}
