/*
 * BiteCheck site stylesheet (sonicon.org/bitecheck/).
 * Tokens from projects/bitecheck/DESIGN.md ("The Food Guide Map"): cream water ground, ink type,
 * flat map colours used only as fills with On-Map Ink on top (both themes), grade colours A-E that
 * always carry their letter, capsules for every control, 16 px rounded blocks, no shadows.
 * Bricolage Grotesque in its three app cuts (800 display, 700 title, 600 label; OFL, no Reserved
 * Font Name), system sans for body text.
 */

@font-face {
    font-family: "Bricolage Grotesque";
    src: url("/bitecheck/fonts/bricolage-800.woff2") format("woff2");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Bricolage Grotesque";
    src: url("/bitecheck/fonts/bricolage-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Bricolage Grotesque";
    src: url("/bitecheck/fonts/bricolage-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light dark;
    --water: #F5F1E4;
    --ink: #2C2E2A;
    --ink-soft: #5B584D;
    --primary: #36701A;
    --block: #FFFDF7;
    --block-high: #EFE9D8;
    --hairline: #D6CEB7;
    --outline: #2C2E2A;
    --land: #8ED462;
    --sun: #F5E211;
    --coral: #FF705D;
    --pond: #2BA0FF;
    --lilac: #EBC1FF;
    --on-map: #1E201C;
    --grade-a: #8ED462;
    --on-grade-a: #1F3A10;
    --grade-b: #C8E15E;
    --on-grade-b: #33400A;
    --grade-c: #F5E211;
    --on-grade-c: #433C00;
    --grade-d: #FFB36B;
    --on-grade-d: #552A00;
    --grade-e: #FF705D;
    --on-grade-e: #470E06;
    --focus: #2C2E2A;
    --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 28px;
    --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --water: #1B1C19;
        --ink: #F3EFE1;
        --ink-soft: #C9C4B4;
        --primary: #8ED462;
        --block: #282924;
        --block-high: #30312C;
        --hairline: #4A4B44;
        --outline: #C9C4B4;
        --land: #86C95C;
        --sun: #E6D412;
        --coral: #F26A58;
        --pond: #3A9BEA;
        --lilac: #D9B0EE;
        --grade-a: #7CC253;
        --on-grade-a: #1A330C;
        --grade-b: #B4CC4F;
        --on-grade-b: #2C3808;
        --grade-c: #E2CF10;
        --on-grade-c: #3A3400;
        --grade-d: #F0A057;
        --on-grade-d: #4A2400;
        --grade-e: #F0604D;
        --on-grade-e: #3E0A04;
        --focus: #F3EFE1;
    }
}

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

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

body {
    margin: 0;
    background: var(--water);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

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

a {
    color: var(--primary);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
    font-family: var(--display);
    line-height: 1.1;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    text-wrap: balance;
    margin: 0 0 0.6em;
}

h1,
h2 {
    font-weight: 800;
    letter-spacing: -0.03em;
}

h1 {
    font-size: clamp(2.4rem, 1.5rem + 4.4vw, 4.4rem);
    line-height: 1;
}

h2 {
    font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem);
}

h3 {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.015em;
}

p {
    margin: 0 0 1em;
}

.num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 10;
    padding: 0.75rem 1.1rem;
    background: var(--ink);
    color: var(--water);
    border-radius: 999px;
    font-weight: 600;
}

.skip-link:focus {
    top: 1rem;
}

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

/* Top bar */

.topbar .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem 1.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 48px;
    color: var(--ink);
    text-decoration: none;
}

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

.wordmark {
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.55rem;
    letter-spacing: -0.03em;
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 1rem;
    border-radius: 999px;
    color: var(--ink);
    text-decoration: none;
    font-family: var(--display);
    font-weight: 600;
}

.site-nav a:hover {
    text-decoration: underline;
}

.site-nav a[aria-current="page"] {
    background: var(--land);
    color: var(--on-map);
}

/* On the land-green top bar the pill flips to On-Map Ink with a land label (AA in both themes) */
.field-land .site-nav a[aria-current="page"] {
    background: var(--on-map);
    color: var(--land);
}

/* Map fields: flat fills, On-Map Ink on top in both themes */

.field-land,
.field-sun,
.field-coral,
.field-pond,
.field-lilac {
    color: var(--on-map);
    --focus: #1E201C;
}

.field-land { background: var(--land); }
.field-sun { background: var(--sun); }
.field-coral { background: var(--coral); }
.field-pond { background: var(--pond); }
.field-lilac { background: var(--lilac); }

.field-land a,
.field-sun a,
.field-coral a,
.field-pond a,
.field-lilac a {
    color: var(--on-map);
}

/* Hero: a land field swelling past the frame, coast at the bottom */

.hero {
    padding: 2rem 0 3.5rem;
    border-radius: 0 0 52% 48% / 0 0 3.5rem 5rem;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    gap: 2.25rem;
    align-items: center;
}

.hero-copy {
    min-width: 0;
}

.hero .answer {
    font-size: 1.15rem;
    max-width: var(--measure);
}

.get {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    margin-top: 1.5rem;
}

.get p {
    margin: 0;
    font-size: 0.98rem;
    max-width: 22rem;
}

.play-badge {
    display: inline-block;
    border-radius: 10px;
    line-height: 0;
}

.play-badge img {
    width: 188px;
    height: auto;
}

.hero-shot {
    justify-self: center;
    width: min(100%, 21rem);
    margin: 0;
}

.hero-shot figcaption {
    margin-top: 0.6rem;
    font-size: 0.92rem;
    line-height: 1.45;
}

.shot img,
.hero-shot img {
    border: 1px solid var(--outline);
    border-radius: var(--r-md);
    background: #F5F1E4;
}

@media (min-width: 60rem) {
    .hero {
        padding: 3.5rem 0 5rem;
        border-radius: 0 0 55% 45% / 0 0 6rem 9rem;
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        gap: 4rem;
    }
}

/* Sections */

.section {
    padding: 3rem 0;
}

.section + .section {
    border-top: 1px solid var(--hairline);
}

.section > .wrap > p,
.prose > p,
.prose > ul,
.prose > ol {
    max-width: var(--measure);
}

.answer {
    max-width: var(--measure);
}

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

.field-land .detail,
.field-sun .detail,
.field-lilac .detail {
    color: var(--on-map);
}

.split {
    display: grid;
    gap: 2rem;
    align-items: start;
}

.split > * {
    min-width: 0;
}

@media (min-width: 52rem) {
    .split {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        gap: 3.5rem;
    }

    .split-flip > :first-child {
        order: 2;
    }
}

.shot {
    margin: 0;
    justify-self: center;
    width: min(100%, 19rem);
}

.shot figcaption {
    margin-top: 0.6rem;
    font-size: 0.92rem;
    color: var(--ink-soft);
    line-height: 1.45;
}

/* A rounded field block inside a section (the page's coloured moments) */

.plate {
    border-radius: var(--r-lg);
    padding: 1.6rem 1.25rem;
}

.plate > :last-child {
    margin-bottom: 0;
}

@media (min-width: 40rem) {
    .plate {
        padding: 2.25rem 2.5rem;
    }
}

/* Steps: numbered capsules */

.steps {
    counter-reset: step;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.75rem;
    max-width: 46rem;
}

.steps li {
    counter-increment: step;
    display: grid;
    grid-template-columns: 2.6rem minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
    background: var(--block);
    color: var(--ink);
    border-radius: var(--r-md);
    padding: 1rem 1.1rem;
}

.steps li::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: var(--land);
    color: var(--on-map);
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.2rem;
}

.steps p {
    margin: 0.35rem 0 0;
}

/* Grade scale: the letter rides its colour */

.grades {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0 1.25rem;
    padding: 0;
    list-style: none;
}

.grade {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.3rem 1rem 0.3rem 0.3rem;
    border-radius: 999px;
    background: var(--water);
    color: var(--ink);
    font-family: var(--display);
    font-weight: 600;
}

.grade b {
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    font-weight: 800;
    font-size: 1.1rem;
}

.grade-a b { background: var(--grade-a); color: var(--on-grade-a); }
.grade-b b { background: var(--grade-b); color: var(--on-grade-b); }
.grade-c b { background: var(--grade-c); color: var(--on-grade-c); }
.grade-d b { background: var(--grade-d); color: var(--on-grade-d); }
.grade-e b { background: var(--grade-e); color: var(--on-grade-e); }

/* Reason capsules: land lifts, coral lowers; the words carry the meaning */

.reason {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.2rem 0.85rem 0.2rem 0.25rem;
    border-radius: 999px;
    color: var(--on-map);
    font-family: var(--display);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
}

.reason::before {
    flex: none;
    display: grid;
    place-items: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: var(--on-map);
    font-family: var(--sans);
    font-weight: 700;
}

.reason.up {
    background: var(--land);
}

.reason.up::before {
    content: "+";
    color: var(--land);
}

.reason.down {
    background: var(--coral);
}

.reason.down::before {
    content: "\2212";
    color: var(--coral);
}

.reason.flat {
    background: var(--lilac);
}

.reason.flat::before {
    content: "=";
    color: var(--lilac);
}

/* Blocks and lists */

.cards {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 44rem) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.cards li {
    background: var(--block);
    color: var(--ink);
    border-radius: var(--r-md);
    padding: 1.25rem;
}

.cards h3 {
    margin-bottom: 0.4rem;
}

.cards p {
    margin: 0;
}

.facts {
    margin: 0;
    display: grid;
    gap: 0.6rem;
}

.facts div {
    background: var(--block);
    color: var(--ink);
    border-radius: var(--r-md);
    padding: 0.85rem 1rem;
}

.facts dt {
    font-family: var(--display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.facts dd {
    margin: 0.15rem 0 0;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.12rem;
    line-height: 1.3;
}

.nots {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    max-width: var(--measure);
}

.nots li {
    display: grid;
    grid-template-columns: 1.6rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.55rem 0;
}

.nots li::before {
    content: "\2212";
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.1rem;
    border-radius: 50%;
    background: var(--coral);
    color: var(--on-map);
    font-weight: 700;
}

.limits {
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.75rem;
    max-width: 48rem;
}

.limits li {
    background: var(--block);
    color: var(--ink);
    border-radius: var(--r-md);
    padding: 1rem 1.15rem;
}

.limits h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.limits p {
    margin: 0;
}

.gallery {
    display: grid;
    gap: 1.5rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 44rem) {
    .gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.gallery .shot {
    width: min(100%, 19rem);
}

/* Question bands (home) */

.bands {
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.6rem;
    max-width: 46rem;
}

.band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 52px;
    padding: 0.7rem 0.6rem 0.7rem 1.4rem;
    background: var(--land);
    color: var(--on-map);
    border-radius: 999px;
    text-decoration: none;
    font-family: var(--display);
    font-weight: 600;
    --focus: var(--ink);
}

.band:hover {
    text-decoration: underline;
}

.band svg {
    flex: none;
    width: 2rem;
    height: 2rem;
    padding: 0.45rem;
    border-radius: 50%;
    background: var(--on-map);
    fill: none;
    stroke: var(--land);
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Inner page head and breadcrumb */

.page-head {
    padding: 1.5rem 0 2.5rem;
    border-radius: 0 0 52% 48% / 0 0 2.5rem 3.5rem;
}

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    margin: 0 0 0.75rem;
    padding: 0;
    list-style: none;
    font-size: 0.95rem;
}

.crumbs li {
    display: inline-flex;
    align-items: center;
}

.crumbs li + li::before {
    content: "\203A";
    padding: 0 0.5rem;
}

.crumbs a,
.crumbs [aria-current] {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
}

.lede {
    font-size: 1.15rem;
    max-width: var(--measure);
}

.toc {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.toc a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 1rem;
    border: 1.5px solid var(--on-map);
    border-radius: 999px;
    text-decoration: none;
    font-family: var(--display);
    font-weight: 600;
}

.toc a:hover {
    text-decoration: underline;
}

/* Tables: stack into cards at 600 px and below */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.98rem;
    margin: 1.25rem 0 0;
}

caption {
    text-align: left;
    font-family: var(--display);
    font-weight: 700;
    padding-bottom: 0.5rem;
}

th,
td {
    text-align: left;
    vertical-align: top;
    padding: 0.75rem 0.9rem 0.75rem 0;
    border-bottom: 1px solid var(--hairline);
}

thead th {
    font-family: var(--display);
    font-weight: 600;
    color: var(--ink-soft);
    border-bottom: 2px solid var(--outline);
}

tbody th {
    font-weight: 600;
    width: 32%;
}

@media (max-width: 600px) {
    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
    }

    caption {
        display: block;
        width: auto;
    }

    thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    tr {
        background: var(--block);
        color: var(--ink);
        border-radius: var(--r-md);
        padding: 0.9rem 1rem;
        margin-bottom: 0.75rem;
    }

    th,
    td,
    tbody th {
        border: 0;
        padding: 0.2rem 0;
        width: auto;
    }

    td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-family: var(--display);
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--ink-soft);
    }
}

/* FAQ ledger */

.ledger section {
    padding: 1.75rem 0;
    border-top: 1px solid var(--hairline);
    max-width: 46rem;
}

.ledger h2 {
    font-size: clamp(1.35rem, 1.2rem + 0.7vw, 1.75rem);
    letter-spacing: -0.02em;
}

/* Closing call */

.closing {
    padding: 3rem 0 3.5rem;
}

.closing .plate {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
}

.closing h2 {
    margin: 0;
}

/* Footer */

.footer {
    border-top: 1px solid var(--hairline);
    padding: 2.5rem 0 3rem;
    font-size: 0.95rem;
}

.footer-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-top p {
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.25rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 0.6rem 0 0;
    margin-right: 0.6rem;
}

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

.fine p {
    margin: 0 0 0.4rem;
    max-width: 50rem;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
