/* Hangry Turtle website. The look is the game's own: every face is cream (yellow for the main action), edged in dark
   brown at one weight and standing on a darker edge of its own colour, like a chunky toy; writing is brown. Headlines
   are set in the typeface of the game's Chinese interface. */

@font-face {
    font-family: "HT KuaiLe";
    src: url("fonts/kuaile-latin.woff2?v=78dbf472d3") format("woff2");
    font-display: swap;
    unicode-range: U+0020-007E, U+00A0-00FF, U+2010-205E, U+20AC, U+2122, U+2190-21FF;
}

@font-face {
    font-family: "HT KuaiLe";
    src: url("fonts/kuaile-han.woff2?v=b379664086") format("woff2");
    font-display: swap;
    unicode-range: U+2E80-2FDF, U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+FF00-FFEF;
}

:root {
    --cream: #fff5d8;
    --face: #fffbee;
    --paper: #f9eac0;
    --line: #d9bf8c;
    --brown: #5a391b;
    --brown-soft: #7a5a38;
    --yellow: #ffd042;
    --yellow-shade: #d99a12;
    --red-shade: #b53a2b;
    --peach: #ffdfb5;
    --water: #d6efe9;
    --sun: #ffe38a;
    --night: #2b1b0c;
    --stroke: 2.5px;
    --radius: 18px;
    --radius-sm: 12px;
    --container: 1160px;
    --gutter: clamp(18px, 4vw, 40px);
    --header-h: 66px;
    --section-space: clamp(64px, 9vw, 120px);
    --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 24' preserveAspectRatio='none'%3E%3Cpath d='M0 24V12C20 0 40 0 60 12s40 12 60 0v12z'/%3E%3C/svg%3E");
    --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
    --font-display: "HT KuaiLe", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, -apple-system,
        "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    color-scheme: light;
}

/* On a very wide screen the page widens a little, which also keeps the writing of the first screen clear of the turtle. */
@media (min-width: 2000px) {
    :root {
        --container: 1400px;
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--cream);
    color: var(--brown);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:lang(zh) body,
body:lang(zh) {
    line-height: 1.75;
}

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

a {
    color: inherit;
}

button {
    font: inherit;
    color: inherit;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 400;
}

ul,
ol {
    margin: 0;
    padding: 0;
}

:focus-visible {
    outline: 3px solid var(--brown);
    outline-offset: 3px;
    border-radius: 6px;
}

.container {
    width: min(var(--container), 100% - 2 * var(--gutter));
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -70px;
    z-index: 100;
    padding: 10px 16px;
    border: var(--stroke) solid var(--brown);
    border-radius: var(--radius-sm);
    background: var(--yellow);
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Header */

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    height: var(--header-h);
    border-bottom: var(--stroke) solid transparent;
    transition: background-color 0.25s, border-color 0.25s;
}

.site-header.is-solid,
.site-header.is-open {
    background: rgba(255, 245, 216, 0.93);
    border-bottom-color: var(--brown);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.brand img {
    width: 38px;
    height: 38px;
    border: 2px solid var(--brown);
    border-radius: 10px;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 21px;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.site-nav a {
    padding: 6px 12px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 17px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.site-nav a:hover {
    background: var(--yellow);
}

.lang-switch {
    display: flex;
    gap: 2px;
    padding: 3px;
    border: 2px solid var(--brown);
    border-radius: 999px;
    background: var(--face);
    flex-shrink: 0;
}

.lang-switch a {
    padding: 3px 11px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 15px;
    line-height: 1.5;
    text-decoration: none;
}

.lang-switch a:hover {
    background: var(--paper);
}

.lang-switch a[aria-current="page"] {
    background: var(--yellow);
}

.menu-button {
    display: none;
    width: 44px;
    height: 44px;
    margin-left: 2px;
    padding: 0;
    border: var(--stroke) solid var(--brown);
    border-radius: var(--radius-sm);
    background: var(--face);
    box-shadow: 0 3px 0 var(--line);
    cursor: pointer;
}

.menu-button span {
    display: block;
    width: 18px;
    height: 3px;
    margin: 3px auto;
    border-radius: 2px;
    background: var(--brown);
    transition: transform 0.2s, opacity 0.2s;
}

.site-header.is-open .menu-button span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.site-header.is-open .menu-button span:nth-child(2) {
    opacity: 0;
}

.site-header.is-open .menu-button span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 1020px) {
    .menu-button {
        display: block;
    }

    .header-inner {
        gap: 12px;
    }

    .lang-switch {
        margin-left: auto;
    }

    .site-nav {
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        margin: 0;
        padding: 10px var(--gutter) 18px;
        background: var(--cream);
        border-bottom: var(--stroke) solid var(--brown);
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
    }

    .site-header.is-open .site-nav {
        display: flex;
    }

    .site-nav a {
        padding: 11px 14px;
        font-size: 20px;
    }

    .no-js .site-nav {
        position: static;
        display: none;
    }
}

@media (max-width: 400px) {
    .brand-name {
        display: none;
    }
}

/* Language suggestion */

.lang-suggest {
    position: fixed;
    left: 50%;
    bottom: 16px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 8px 14px;
    flex-wrap: wrap;
    justify-content: center;
    width: max-content;
    max-width: calc(100% - 24px);
    padding: 10px 10px 10px 18px;
    border: var(--stroke) solid var(--brown);
    border-radius: var(--radius);
    background: var(--face);
    box-shadow: 0 6px 0 var(--line), 0 18px 40px rgba(90, 57, 27, 0.25);
    transform: translateX(-50%);
    font-size: 16px;
}

.lang-suggest[hidden] {
    display: none;
}

.lang-suggest-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-suggest .button {
    min-height: 38px;
    padding: 4px 14px;
    font-size: 16px;
    box-shadow: 0 3px 0 var(--yellow-shade);
}

.icon-button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.icon-button:hover {
    background: rgba(217, 191, 140, 0.45);
}

.icon-button svg {
    width: 22px;
    height: 22px;
}

/* Buttons */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 9px 24px;
    border: var(--stroke) solid var(--brown);
    border-radius: 16px;
    background: var(--face);
    box-shadow: 0 5px 0 var(--line);
    color: var(--brown);
    font-family: var(--font-display);
    font-size: 19px;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.08s, box-shadow 0.08s, background-color 0.2s;
}

.button:hover {
    transform: translateY(1px);
    box-shadow: 0 4px 0 var(--line);
}

.button:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 var(--line);
}

.button-primary {
    background: var(--yellow);
    box-shadow: 0 5px 0 var(--yellow-shade);
}

.button-primary:hover {
    background: #ffd95c;
    box-shadow: 0 4px 0 var(--yellow-shade);
}

.button-primary:active {
    box-shadow: 0 1px 0 var(--yellow-shade);
}

.button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Hero */

.hero {
    position: relative;
    display: grid;
    align-items: center;
    min-height: min(100vh, max(940px, 46vw));
    min-height: min(100svh, max(940px, 46vw));
    padding: calc(var(--header-h) + 34px) 0 clamp(56px, 9vh, 100px);
    overflow: hidden;
    isolation: isolate;
}

/* The picture spans the window and is never drawn larger than that: the turtle and its fish keep to the right half
   however tall the writing makes the first screen, and the writing keeps to the left. Where the picture ends before
   the first screen does, its lower edge melts into the page. */
.hero-media {
    position: absolute;
    inset: 0 0 auto;
    z-index: -2;
    display: block;
    height: 100%;
    max-height: 56.25vw;
    -webkit-mask-image: linear-gradient(180deg, #000 74%, transparent);
    mask-image: linear-gradient(180deg, #000 74%, transparent);
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The squarer picture of a tablet on its side or a window that is not wide (HERO_MID_MEDIA in build.py). */
@media (max-width: 1100px), (max-width: 1399px) and (max-aspect-ratio: 3/2) {
    .hero-media {
        max-height: 75vw;
    }
}

/* The water pales towards the writing. */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(255, 245, 216, 0.9) 0%, rgba(255, 245, 216, 0.66) 30%, rgba(255, 245, 216, 0) 60%);
}

.hero-content {
    max-width: min(600px, 46vw);
}

.eyebrow {
    display: inline-block;
    margin-bottom: 16px;
    padding: 3px 14px;
    border: 2px solid var(--brown);
    border-radius: 999px;
    background: var(--yellow);
    box-shadow: 0 3px 0 var(--yellow-shade);
    font-family: var(--font-display);
    font-size: 15px;
    line-height: 1.5;
}

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

/* The name as the game's home page writes it: yellow, edged in brown, standing on its own thickness. "Hangry Turtle"
   is 6.9 em wide in this typeface: the sizes here and under the upright layout below keep it on one line within the
   column of the writing. */
.wordmark {
    color: var(--yellow);
    font-size: clamp(34px, 5.8vw, 84px);
    line-height: 1.02;
    letter-spacing: 0.01em;
    -webkit-text-stroke: 0.07em var(--brown);
    paint-order: stroke fill;
    text-shadow: 0 0.07em 0 var(--brown);
}

/* Four characters where English has thirteen letters: they can stand much larger in the same line. */
:lang(zh) .wordmark {
    font-size: clamp(48px, 8.2vw, 116px);
    letter-spacing: 0.04em;
}

.title-secondary {
    font-size: clamp(22px, 3vw, 32px);
    letter-spacing: 0.04em;
}

.sticker {
    display: inline-block;
    margin: 4px 0 20px;
    padding: 5px 16px;
    border: var(--stroke) solid var(--brown);
    border-radius: 999px;
    background: var(--face);
    box-shadow: 0 4px 0 var(--line);
    font-family: var(--font-display);
    font-size: clamp(17px, 2vw, 21px);
    line-height: 1.4;
    transform: rotate(-3deg);
    transform-origin: left center;
}

.tagline {
    margin-bottom: 12px;
    font-family: var(--font-display);
    font-size: clamp(23px, 2.9vw, 31px);
    line-height: 1.3;
}

.lead {
    max-width: 480px;
    font-size: clamp(17px, 1.6vw, 19px);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 16px;
    margin-top: 28px;
}

.hero-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 26px;
    list-style: none;
}

.hero-facts li {
    padding: 3px 12px;
    border: 2px solid var(--brown);
    border-radius: 999px;
    background: rgba(255, 251, 238, 0.85);
    font-size: 14px;
    font-weight: 600;
}

/* On a phone or a tablet held upright the upright picture stands on top, whole, and the writing rises out of the
   water below it (HERO_NARROW_MEDIA in build.py). */
@media (max-width: 1100px) and (orientation: portrait), (max-width: 479px) {
    .hero {
        display: block;
        min-height: 0;
        padding: 0 0 56px;
    }

    .hero-media {
        position: relative;
        inset: auto;
        height: auto;
        max-height: none;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .hero-media img {
        height: auto;
        aspect-ratio: 3 / 4;
        object-position: 50% 0;
    }

    .hero::after {
        background: linear-gradient(180deg, rgba(255, 245, 216, 0) 0, rgba(255, 245, 216, 0) 62vw, var(--cream) 118vw);
    }

    .hero > .container {
        margin-top: -50vw;
    }

    .hero-content {
        max-width: none;
    }

    .lead {
        max-width: 620px;
    }

    .wordmark {
        font-size: clamp(38px, 12.4vw, 88px);
    }

    :lang(zh) .wordmark {
        font-size: clamp(60px, 20vw, 124px);
    }
}

@media (max-height: 520px) and (orientation: landscape) and (min-width: 480px) {
    .hero {
        min-height: 0;
        padding-top: calc(var(--header-h) + 22px);
    }
}

/* Sections */

.section {
    position: relative;
    padding: var(--section-space) 0;
}

.section:not(.band) + .section:not(.band) {
    padding-top: 0;
}

/* A band of colour across the page, with a wavy edge above and below it. */
.band {
    background: var(--band);
}

.band::before,
.band::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 22px;
    background: var(--band);
    -webkit-mask: var(--wave) repeat-x 0 0 / 120px 22px;
    mask: var(--wave) repeat-x 0 0 / 120px 22px;
    pointer-events: none;
}

.band::before {
    bottom: calc(100% - 1px);
}

.band::after {
    top: calc(100% - 1px);
    transform: scaleY(-1);
}

.band-hangry {
    --band: var(--peach);
}

.band-water {
    --band: var(--water);
}

.band-sun {
    --band: var(--sun);
}

.band-paper {
    --band: var(--paper);
}

.section-head {
    max-width: 760px;
    margin-bottom: clamp(30px, 5vw, 52px);
}

.section-head.centered {
    margin-inline: auto;
    text-align: center;
}

.section-title {
    font-size: clamp(31px, 4.6vw, 50px);
    line-height: 1.16;
}

.section-intro {
    margin-top: 14px;
    color: var(--brown-soft);
    font-size: clamp(17px, 1.7vw, 19px);
}

.panel {
    border: var(--stroke) solid var(--brown);
    border-radius: var(--radius);
    background: var(--face);
    box-shadow: 0 6px 0 var(--line);
}

/* A picture in the frame the game gives its cards. */
.frame {
    display: block;
    overflow: hidden;
    border: 3px solid var(--brown);
    border-radius: 22px;
    background: var(--paper);
    box-shadow: 0 7px 0 rgba(90, 57, 27, 0.26);
}

.frame img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* A screenshot of a phone, with the corners of one. */
.phone-frame {
    display: block;
    overflow: hidden;
    border: 3px solid var(--brown);
    border-radius: 24px;
    background: var(--night);
    box-shadow: 0 7px 0 var(--line);
}

.phone-frame img {
    width: 100%;
    aspect-ratio: 440 / 956;
    object-fit: cover;
    transition: transform 0.5s ease;
}

@media (hover: hover) {
    .frame:hover img,
    .phone-frame:hover img,
    .feature-media:hover img {
        transform: scale(1.03);
    }
}

/* Gameplay */

.play {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 60px);
    align-items: center;
}

.steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 18px;
    list-style: none;
}

.step {
    padding: 22px 22px 24px;
}

.step-number {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 12px;
    border: var(--stroke) solid var(--brown);
    border-radius: 50%;
    background: var(--yellow);
    box-shadow: 0 3px 0 var(--yellow-shade);
    font-family: var(--font-display);
    font-size: 21px;
    line-height: 1;
}

.step h3 {
    margin-bottom: 6px;
    font-size: 23px;
    line-height: 1.3;
}

.step p {
    color: var(--brown-soft);
    font-size: 16px;
}

.play-shots {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: clamp(14px, 2vw, 22px);
}

.phone {
    width: min(47%, 240px);
    margin: 0;
}

.phone:nth-child(2) {
    margin-top: 46px;
}

.phone figcaption {
    margin-top: 14px;
    color: var(--brown-soft);
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}

@media (max-width: 900px) {
    .play {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .steps {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Hangry */

.spotlight {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: clamp(26px, 5vw, 68px);
    align-items: center;
}

.spotlight-media {
    transform: rotate(-1.5deg);
}

.spotlight-text p:not(.eyebrow):not(.punch) {
    margin-top: 16px;
    font-size: clamp(17px, 1.7vw, 19px);
}

.punch {
    margin-top: 14px;
    color: var(--red-shade);
    font-family: var(--font-display);
    font-size: clamp(23px, 2.7vw, 30px);
    line-height: 1.3;
}

@media (max-width: 900px) {
    .spotlight {
        grid-template-columns: minmax(0, 1fr);
    }

    .spotlight-media {
        transform: none;
    }
}

/* Features */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 20px;
}

.feature {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.feature-media {
    display: block;
    overflow: hidden;
    border-bottom: var(--stroke) solid var(--brown);
    background: var(--paper);
}

.feature-media img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.feature-body {
    padding: 18px 20px 22px;
}

.feature h3 {
    margin-bottom: 6px;
    font-size: 23px;
    line-height: 1.3;
}

.feature p {
    color: var(--brown-soft);
    font-size: 16px;
}

@media (max-width: 1080px) {
    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .feature-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Basins: each one seen from above, as the game shows it */

.worlds {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 34px 18px;
    list-style: none;
    text-align: center;
}

.world-disc {
    position: relative;
    display: block;
    width: min(100%, 172px);
    margin: 0 auto 14px;
}

.world-disc img {
    width: 100%;
    aspect-ratio: 1;
    border: 3px solid var(--brown);
    border-radius: 50%;
    box-shadow: 0 6px 0 rgba(90, 57, 27, 0.3);
    object-fit: cover;
}

.world-number {
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: var(--stroke) solid var(--brown);
    border-radius: 50%;
    background: var(--yellow);
    box-shadow: 0 3px 0 var(--yellow-shade);
    font-family: var(--font-display);
    font-size: 19px;
    line-height: 1;
}

.world h3 {
    margin-bottom: 4px;
    font-size: 21px;
    line-height: 1.3;
}

.world p {
    color: var(--brown-soft);
    font-size: 15px;
    line-height: 1.5;
}

.worlds-more {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(22px, 4vw, 48px);
    align-items: center;
    margin-top: clamp(40px, 6vw, 64px);
}

.kings {
    margin: 0;
}

.kings figcaption {
    margin-top: 16px;
    color: var(--brown-soft);
    font-size: 15px;
    text-align: center;
}

.endless {
    padding: 26px 26px 28px;
}

.endless svg {
    display: block;
    width: 46px;
    height: 46px;
    margin-bottom: 10px;
}

.endless .eyebrow {
    margin-bottom: 10px;
}

.endless h3 {
    margin-bottom: 8px;
    font-size: 28px;
    line-height: 1.25;
}

.endless p:not(.eyebrow) {
    color: var(--brown-soft);
}

@media (max-width: 900px) {
    .worlds {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 520px) {
    .worlds {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 14px;
    }
}

/* Fish */

.fish-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 30px 20px;
    list-style: none;
}

.fish-picture {
    display: block;
    margin-bottom: 14px;
}

.fish-picture img {
    width: 100%;
    aspect-ratio: 1;
    border: var(--stroke) solid var(--brown);
    border-radius: var(--radius);
    box-shadow: 0 6px 0 var(--line);
    object-fit: cover;
}

.fish-card h3 {
    margin-bottom: 2px;
    font-size: 20px;
    line-height: 1.3;
}

.fish-card p {
    color: var(--brown-soft);
    font-size: 15px;
    line-height: 1.5;
}

@media (max-width: 1080px) {
    .fish-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .fish-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .fish-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 14px;
    }
}

/* Shells and hats */

.wardrobe {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(26px, 5vw, 68px);
    align-items: center;
}

.wardrobe-text p:not(.eyebrow) {
    margin-top: 16px;
}

.disc-row + .disc-row {
    margin-top: 24px;
}

.disc-label {
    margin-bottom: 10px;
    font-family: var(--font-display);
    font-size: 20px;
}

/* Four to a row: the seven shells stand four over three, and the four hats line up under them. */
.discs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 12px;
    list-style: none;
}

.discs li {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.discs img {
    width: min(100%, 104px);
    height: auto;
    aspect-ratio: 1;
    margin: 0 auto 8px;
    border: var(--stroke) solid var(--brown);
    border-radius: 50%;
    background: var(--cream);
    box-shadow: 0 4px 0 rgba(90, 57, 27, 0.28);
}

@media (max-width: 900px) {
    .wardrobe {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* One column of page wide enough for all seven shells in a row. */
@media (min-width: 641px) and (max-width: 900px) {
    .discs {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
}

/* Screenshots */

.gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 34px 22px;
    list-style: none;
}

.gallery-caption {
    margin-top: 14px;
    color: var(--brown-soft);
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}

.gallery-note {
    margin-top: 26px;
    color: var(--brown-soft);
    font-size: 14px;
    text-align: center;
}

/* A row to swipe through on a phone. */
@media (max-width: 760px) {
    .gallery {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: min(62%, 260px);
        gap: 16px;
        margin-inline: calc(-1 * var(--gutter));
        padding: 4px var(--gutter) 16px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: var(--gutter);
        -webkit-overflow-scrolling: touch;
    }

    .gallery li {
        scroll-snap-align: start;
    }
}

/* Lightbox */

html.has-dialog {
    overflow: hidden;
}

.lightbox {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--night);
    color: var(--cream);
}

.lightbox::backdrop {
    background: rgba(43, 27, 12, 0.8);
}

.lightbox[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.lightbox-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 10px 20px;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.lightbox .icon-button:hover {
    background: rgba(255, 245, 216, 0.16);
}

/* One cell of exactly the room there is: a tall screenshot is fitted into it by its height, a wide picture by its
   width. (In a cell sized by its content the picture's "at most 100% high" would mean nothing.) */
.lightbox-stage {
    position: relative;
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    min-height: 0;
    padding: 0 clamp(8px, 6vw, 88px);
    touch-action: pan-y;
}

.lightbox-stage img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: var(--radius-sm);
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-caption {
    min-height: 56px;
    padding: 14px 20px 20px;
    font-size: 15px;
    text-align: center;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    padding: 0;
    border: var(--stroke) solid var(--brown);
    border-radius: 50%;
    background: var(--yellow);
    box-shadow: 0 4px 0 var(--yellow-shade);
    color: var(--brown);
    cursor: pointer;
    transform: translateY(-50%);
}

.lightbox-nav:hover {
    background: #ffd95c;
}

.lightbox-nav svg {
    width: 24px;
    height: 24px;
}

.lightbox-prev {
    left: clamp(6px, 1.5vw, 24px);
}

.lightbox-next {
    right: clamp(6px, 1.5vw, 24px);
}

@media (max-width: 640px) {
    .lightbox-nav {
        top: auto;
        bottom: -62px;
        transform: none;
    }

    .lightbox-stage {
        padding: 0 8px;
    }

    .lightbox-caption {
        padding-inline: 72px;
    }
}

/* Pricing */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 18px;
    list-style: none;
}

.price-card {
    padding: 24px 22px 26px;
}

.price-card svg {
    display: block;
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
    padding: 9px;
    border: var(--stroke) solid var(--brown);
    border-radius: 50%;
    background: var(--yellow);
    box-shadow: 0 3px 0 var(--yellow-shade);
}

.price-card h3 {
    margin-bottom: 6px;
    font-size: 22px;
    line-height: 1.3;
}

.price-card p {
    color: var(--brown-soft);
    font-size: 16px;
}

.pricing-note {
    margin-top: 26px;
    color: var(--brown-soft);
    font-size: 14px;
    text-align: center;
}

@media (max-width: 1080px) {
    .pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .pricing-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Platforms */

.platforms {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
}

.platforms .section-head {
    margin-bottom: 0;
}

.platform-devices {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    list-style: none;
}

.platform-devices li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 2px solid var(--brown);
    border-radius: 999px;
    background: var(--face);
    font-size: 15px;
    font-weight: 600;
}

.platform-devices svg {
    width: 20px;
    height: 20px;
}

.platform-meta {
    margin-top: 20px;
    color: var(--brown-soft);
    font-size: 16px;
}

.platform-meta + .platform-meta {
    margin-top: 6px;
}

.platform-meta strong {
    color: var(--brown);
    font-weight: 700;
}

.stores {
    display: grid;
    gap: 20px;
    list-style: none;
}

.store {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
}

.store-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
}

.store-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.store-name {
    font-family: var(--font-display);
    font-size: 23px;
    line-height: 1.3;
}

.store-devices {
    color: var(--brown-soft);
    font-size: 15px;
}

.store-action {
    min-height: 46px;
    padding: 7px 18px;
    font-size: 17px;
}

.store-soon {
    padding: 6px 14px;
    border: 2px dashed var(--line);
    border-radius: 999px;
    color: var(--brown-soft);
    font-family: var(--font-display);
    font-size: 16px;
    white-space: nowrap;
}

.store-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin: 0;
    color: var(--brown-soft);
    font-size: 14px;
}

.store-facts div {
    display: flex;
    gap: 6px;
    min-width: 0;
}

.store-facts dt {
    flex: none;
    white-space: nowrap;
}

.store-facts dd {
    min-width: 0;
    margin: 0;
    color: var(--brown);
}

.store-hash {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.store-note {
    color: var(--brown-soft);
    font-size: 14px;
}

@media (max-width: 860px) {
    .platforms {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .store-main {
        flex-direction: column;
        align-items: stretch;
    }

    .store-soon {
        text-align: center;
    }
}

/* Privacy and footer */

.privacy {
    max-width: 860px;
    margin-inline: auto;
    padding: clamp(24px, 4vw, 40px);
}

.privacy h2 {
    margin-bottom: 12px;
    font-size: clamp(26px, 3vw, 32px);
}

.privacy p {
    color: var(--brown-soft);
}

.privacy p + p {
    margin-top: 12px;
}

.privacy a {
    color: var(--brown);
    text-underline-offset: 3px;
}

.privacy-more {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin-top: 18px;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--brown);
    font-family: var(--font-display);
    font-size: 18px;
    text-decoration: underline;
    text-decoration-color: var(--yellow-shade);
    text-decoration-thickness: 3px;
    text-underline-offset: 5px;
}

.text-link:hover {
    text-decoration-color: var(--brown);
}

.text-link svg {
    width: 18px;
    height: 18px;
}

.site-footer {
    margin-top: 0;
    padding: 44px 0 52px;
    background: var(--brown);
    color: #f4e3ba;
    font-size: 14px;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px 32px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--cream);
    font-size: 15px;
}

.footer-brand img {
    width: 44px;
    height: 44px;
    border: 2px solid var(--cream);
    border-radius: 11px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    list-style: none;
}

.footer-links a {
    color: var(--cream);
    font-family: var(--font-display);
    font-size: 16px;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.footer-fineprint {
    display: grid;
    gap: 6px;
    flex-basis: 100%;
    max-width: 820px;
    color: #e0cb9c;
}

.footer-fineprint a {
    color: inherit;
    text-underline-offset: 3px;
}

/* Privacy policy and help pages */

.article {
    width: min(760px, 100% - 2 * var(--gutter));
    padding-top: calc(var(--header-h) + clamp(40px, 7vw, 88px));
    padding-bottom: var(--section-space);
}

.article h1 {
    margin-top: 6px;
    font-size: clamp(34px, 5.4vw, 52px);
    line-height: 1.15;
}

.article-updated {
    margin-top: 12px;
    color: var(--brown-soft);
    font-size: 15px;
}

.article-intro {
    margin-top: 22px;
    font-size: clamp(17px, 1.7vw, 19px);
}

.article section {
    margin-top: 38px;
}

.article h2 {
    margin-bottom: 10px;
    font-size: clamp(23px, 2.6vw, 27px);
    line-height: 1.3;
}

.article section p + p,
.article section p + ul,
.article section ul + p {
    margin-top: 12px;
}

.article ul {
    display: grid;
    gap: 8px;
    padding-left: 1.25em;
}

.article p a,
.article li a {
    text-decoration-color: var(--yellow-shade);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.article-note {
    color: var(--brown-soft);
    font-size: 15px;
}

.article-back {
    margin-top: 52px;
}

/* Reveal on scroll, only when scripts run and motion is welcome */

@media screen and (prefers-reduced-motion: no-preference) {
    .js .reveal {
        opacity: 0;
        transform: translateY(18px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

    .js .reveal.is-visible {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: no-preference) and (min-width: 901px) {
    .js .spotlight-media.reveal.is-visible {
        transform: rotate(-1.5deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}

/* Chinese words on a page of another language (the language switch, the offer to switch) are set in the system's
   typeface: the page then never fetches the Chinese cut of the headline typeface for a handful of characters. Last
   in the file, so that it wins over the rules that pick the headline typeface. */
html:not(:lang(zh)) :lang(zh) {
    font-family: var(--font);
}
