/*
 * Sharp site styles. Tokens from projects/assistant/DESIGN.md ("the constructed
 * grid", SharpColors light/dark): a committed cobalt plane carries the top of the
 * page as it carries the app bar; content sits on white by day and near-black blue
 * by night. Times are drawn as cell numerals on a 5 x 7 grid (decorative, the time
 * is always in text beside them). Hanken Grotesk for all text, Michroma for the
 * "Sharp" wordmark only. The app's signal orange is not used: on the site it has
 * no run, recording or error role to play. No gradients, glass or emoji.
 */

@font-face {
    font-family: "Hanken Grotesk";
    src: url("/sharp/fonts/hankengrotesk-var.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Michroma";
    src: url("/sharp/fonts/michroma-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light dark;

    --ground: #FFFFFF;
    --surface: #EEF1FF;
    --surface-high: #E1E6FF;
    --ink: #0B1240;
    --ink-2: #454D7A;
    --ink-3: #565E8C;
    --line: #D3D9F5;
    --line-strong: #8C94C0;
    --plane: #1F3FD1;
    --on-plane: #FFFFFF;
    --on-plane-muted: #C9D3FF;
    --plane-cell: #FFFFFF;
    --plane-hairline: rgba(255, 255, 255, 0.22);
    --cobalt: #1F3FD1;
    --on-cobalt: #FFFFFF;
    --cell: #1F3FD1;
    --cell-hairline: rgba(31, 63, 209, 0.16);
    --focus: #1F3FD1;

    --text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --wordmark: "Michroma", "Hanken Grotesk", system-ui, sans-serif;

    --gutter: 1.5rem;
    --wrap: 72rem;
    --r-input: 8px;
    --r-box: 10px;
    --r-button: 12px;
    --r-card: 16px;
    --r-chip: 20px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ground: #0B0F2A;
        --surface: #151B45;
        --surface-high: #1D255A;
        --ink: #E8ECFF;
        --ink-2: #B4BDEE;
        --ink-3: #8C97CF;
        --line: #2A3270;
        --line-strong: #5A64A8;
        --plane: #141C55;
        --on-plane: #FFFFFF;
        --on-plane-muted: #B9C5FF;
        --plane-cell: #8FA6FF;
        --plane-hairline: rgba(143, 166, 255, 0.24);
        --cobalt: #7590FF;
        --on-cobalt: #0B0F2A;
        --cell: #7590FF;
        --cell-hairline: rgba(117, 144, 255, 0.18);
        --focus: #9FB2FF;
    }
}

/* ---------- Base ---------- */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 1rem;
}

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--text);
    font-size: 1rem;
    line-height: 1.6;
    overflow-wrap: break-word;
}

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

svg {
    flex: none;
}

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

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

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

h1,
h2,
h3 {
    font-family: var(--text);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.015em;
    margin: 0;
    text-wrap: balance;
}

h2 {
    font-size: clamp(min(1.75rem, 8vw), 1.35rem + 1.6vw, 2.5rem);
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.25;
}

p {
    margin: 0 0 1rem;
}

p:last-child {
    margin-bottom: 0;
}

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

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

.skip-link {
    position: absolute;
    left: 1rem;
    top: -10rem;
    z-index: 10;
    padding: 0.75rem 1.25rem;
    background: var(--ground);
    color: var(--ink);
    border: 2px solid var(--cobalt);
    border-radius: var(--r-button);
    font-weight: 600;
}

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

/* ---------- Top bar: the cobalt plane, as the app bar ---------- */

.topbar {
    background: var(--plane);
    color: var(--on-plane);
}

.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;
}

.topbar :focus-visible,
.plane :focus-visible {
    outline-color: var(--on-plane);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 48px;
    color: inherit;
    text-decoration: none;
}

.brand img {
    width: 36px;
    height: 36px;
    border-radius: var(--r-box);
    box-shadow: 0 0 0 1px var(--plane-hairline);
}

.wordmark {
    font-family: var(--wordmark);
    font-weight: 400;
    font-size: 1.375rem;
    letter-spacing: 0.01em;
    line-height: 1;
}

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

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

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.35em;
}

/* ---------- Plane bands (hero and closing band) ---------- */

.plane {
    background: var(--plane);
    color: var(--on-plane);
}

.plane a:not(.play-badge) {
    color: var(--on-plane);
}

.hero {
    padding: 1.5rem 0 3rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
}

.hero h1 {
    font-size: clamp(min(2.375rem, 9vw), 1.6rem + 3vw, min(4rem, 10.5vw));
    line-height: 1.04;
    letter-spacing: -0.025em;
    margin: 0 0 1.25rem;
    max-width: 16ch;
}

.hero .answer {
    color: var(--on-plane);
    font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
    line-height: 1.55;
    max-width: 38rem;
    margin-bottom: 1.75rem;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
}

.badge-row p {
    margin: 0;
    color: var(--on-plane-muted);
    font-size: 0.9375rem;
    line-height: 1.45;
    flex: 1 1 13rem;
}

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

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

.hero-shot {
    margin: 0 auto;
    width: 100%;
    max-width: 20rem;
}

/* Framed store slides: a contrasting band so the slide edge never melts into the page */
.hero-shot img,
.shot img {
    border-radius: var(--r-card);
    box-shadow: 0 0 0 1px var(--line-strong);
}

.hero-shot img {
    box-shadow: 0 0 0 1px var(--plane-hairline);
}

.plane-end {
    padding: 2.75rem 0;
}

.plane-end .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
}

.plane-end h2 {
    margin: 0;
    max-width: 22ch;
}

.plane-end .cell-s {
    width: 34px;
    height: auto;
    fill: var(--plane-cell);
}

.plane-end .end-title {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* ---------- Cell numerals (decorative; time is in text beside them) ---------- */

.cells {
    display: block;
    width: 100%;
    max-width: 15rem;
    height: auto;
}

.cells .cell-on {
    fill: var(--cell);
}

.cells .cell-off {
    fill: none;
    stroke: var(--cell-hairline);
    stroke-width: 0.9;
}

/* ---------- Sections ---------- */

.section {
    padding: 3.5rem 0;
}

.section + .section {
    padding-top: 1rem;
}

.answer {
    font-size: 1.0625rem;
    line-height: 1.65;
    max-width: 65ch;
}

.detail {
    color: var(--ink-2);
    max-width: 65ch;
}

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

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

.shot {
    margin: 0;
}

.shot-narrow {
    max-width: 18rem;
}

.shot-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    max-width: 30rem;
}

figcaption {
    font-size: 0.875rem;
    color: var(--ink-2);
    margin-top: 0.625rem;
    line-height: 1.45;
}

/* Example card: a command and what it becomes */
.example {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    border-radius: var(--r-card);
    padding: 1.25rem;
    display: grid;
    gap: 1rem;
}

.example .said {
    margin: 0;
    display: inline-block;
    justify-self: start;
    padding: 0.5rem 1rem;
    border-radius: var(--r-chip);
    background: var(--ground);
    color: var(--ink);
    border: 1px solid var(--line);
    font-weight: 500;
}

.example .time-row {
    display: flex;
    align-items: flex-end;
    gap: 0.625rem;
}

.example .unit {
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--ink);
}

.example .what {
    margin: 0;
    font-weight: 600;
}

.example figcaption {
    margin: 0;
}

/* Groups of actions */
.groups {
    margin: 2rem 0 0;
    padding: 0;
    border-top: 1px solid var(--line);
}

.groups div {
    display: grid;
    gap: 0.25rem 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.groups dt {
    font-weight: 700;
    color: var(--cobalt);
}

.groups dd {
    margin: 0;
    max-width: 60ch;
}

/* Plain list with ruled rows */
.ruled {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    max-width: 65ch;
    border-top: 1px solid var(--line);
}

.ruled li {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--line);
}

.ruled strong {
    font-weight: 700;
}

/* Privacy facts */
.facts {
    margin: 1.5rem 0;
    padding: 0;
    border-top: 1px solid var(--line);
    max-width: 40rem;
}

.facts div {
    display: grid;
    gap: 0.125rem 1.5rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--line);
}

.facts dt {
    font-weight: 600;
}

.facts dd {
    margin: 0;
    color: var(--ink-2);
}

/* "Good to know" list */
.nots {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.875rem;
    max-width: 62ch;
}

.nots li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
}

.nots svg {
    width: 22px;
    height: 22px;
    margin-top: 0.15rem;
    fill: var(--cell);
}

/* Question links */
.qlinks {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
}

.qlinks a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 56px;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-weight: 600;
    font-size: 1.0625rem;
    text-decoration: none;
}

.qlinks a:hover span {
    text-decoration: underline;
}

.qlinks svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--cobalt);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Inner pages ---------- */

.page-head {
    padding: 1rem 0 2.5rem;
    border-bottom: 1px solid var(--line);
}

.page-head h1 {
    font-size: clamp(min(2.25rem, 9vw), 1.6rem + 2.6vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0.75rem 0 1rem;
    max-width: 20ch;
}

.lede {
    font-size: 1.125rem;
    max-width: 62ch;
}

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9375rem;
    color: var(--ink-2);
}

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

.crumbs li + li::before {
    content: "›";
    padding: 0 0.5rem;
    color: var(--ink-3);
}

.crumbs a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    color: inherit;
}

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

.toc a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 1rem;
    border-radius: var(--r-chip);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
}

.toc a:hover {
    background: var(--surface-high);
    text-decoration: underline;
}

.steps > section {
    padding: 2.75rem 0;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 1rem;
}

.steps > section:last-child {
    border-bottom: 0;
}

.steps h2 {
    font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.125rem);
}

/* A real sequence, so it is numbered */
.order {
    list-style: none;
    counter-reset: step;
    margin: 1.75rem 0 0;
    padding: 0;
    display: grid;
    max-width: 46rem;
}

.order > li {
    counter-increment: step;
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: 0 1rem;
    padding-bottom: 1.25rem;
    position: relative;
}

.order > li::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--r-box);
    background: var(--cobalt);
    color: var(--on-cobalt);
    font-weight: 700;
    font-size: 1.125rem;
}

.order > li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: calc(1.25rem - 1px);
    top: 2.75rem;
    bottom: 0.25rem;
    width: 2px;
    background: var(--line);
}

.order h3 {
    margin: 0.45rem 0 0.375rem;
}

.order p {
    margin: 0;
}

/* Tables (stack into rows at 600px and below) */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0 0;
    font-size: 0.975rem;
}

.table caption {
    text-align: left;
    color: var(--ink-2);
    font-size: 0.9375rem;
    padding-bottom: 0.75rem;
}

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

.table thead th {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--ink-2);
    border-bottom-color: var(--line-strong);
}

.table tbody th {
    font-weight: 600;
}

.ledger > section {
    padding: 2.25rem 0;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 1rem;
}

.ledger > section:last-child {
    border-bottom: 0;
}

.ledger h2 {
    font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
    margin-bottom: 0.875rem;
    max-width: 32ch;
}

/* ---------- Footer ---------- */

.footer {
    background: var(--surface);
    color: var(--ink);
    padding: 2.5rem 0 3rem;
}

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

.footer-top p {
    margin: 0;
}

.footer-top .wordmark {
    font-size: 1.25rem;
}

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

.footer-links a {
    overflow-wrap: anywhere;
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    color: var(--ink);
}

.fine {
    font-size: 0.875rem;
    color: var(--ink-2);
}

.fine p {
    margin-bottom: 0.375rem;
}

.fine a {
    color: inherit;
    display: inline-block;
    padding: 0.75rem 0;
    margin: -0.75rem 0;
}

/* ---------- Breakpoints ---------- */

@media (max-width: 37.5rem) {
    .table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .table,
    .table tbody,
    .table tr,
    .table th,
    .table td,
    .table caption {
        display: block;
        width: 100%;
    }

    .table tr {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--line);
    }

    .table th,
    .table td {
        border: 0;
        padding: 0.25rem 0;
    }

    .table [data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.8125rem;
        font-weight: 600;
        color: var(--ink-2);
    }
}

@media (min-width: 40rem) {
    :root {
        --gutter: 2rem;
    }

    .groups div,
    .facts div {
        grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
    }

    .facts div {
        grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
    }
}

@media (min-width: 60rem) {
    .hero {
        padding: 2.5rem 0 4rem;
    }

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

    .hero-shot {
        max-width: 22rem;
    }

    .section {
        padding: 5rem 0;
    }

    .section + .section {
        padding-top: 1.5rem;
    }

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

    .page-head {
        padding: 1.5rem 0 3.5rem;
    }
}
