/*
 * Greyscale site styles. Tokens from projects/greyscale/DESIGN.md ("Lantern"):
 * warm paper ground, lantern amber for links and accents, mode flames as
 * decoration only, pill buttons and 16-24 px card radii. Light and dark are the
 * app's own two themes. Lora for headings, numbers and the italic wordmark;
 * Atkinson Hyperlegible Next for body and labels.
 *
 * Lora carries the Reserved Font Name "Lora" (licenses/lora-OFL.txt). These
 * files are subsets, i.e. modified copies, so @font-face uses the family name
 * "Greyscale Serif", never "Lora".
 */

@font-face {
    font-family: "Greyscale Serif";
    src: url("/greyscale/fonts/lora-var.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Greyscale Serif";
    src: url("/greyscale/fonts/lora-italic-var.woff2") format("woff2");
    font-weight: 400 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Atkinson Hyperlegible Next";
    src: url("/greyscale/fonts/atkinson-hyperlegible-next-var.woff2") format("woff2");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light dark;

    --bg: #F5EFE5;
    --surface: #FFFBF3;
    --raised: #EBE2D2;
    --ink: #2A2118;
    --ink-dim: #685A48;
    --amber: #93490F;
    --frame: #857358;
    --hairline: #D9CCB7;
    --shot-border: transparent;

    --flame-sleep: #A8551F;
    --flame-baby: #A6524A;
    --flame-focus: #8A6E20;
    --glow: #F2A65A;

    --serif: "Greyscale Serif", Georgia, "Times New Roman", serif;
    --sans: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --gutter: 1.25rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0F0C09;
        --surface: #19150F;
        --raised: #231D16;
        --ink: #F1E6D4;
        --ink-dim: #B5A68F;
        --amber: #F0B477;
        --frame: #86725A;
        --hairline: #3A3026;
        --shot-border: #86725A;

        --flame-sleep: #F2A65A;
        --flame-baby: #F0A898;
        --flame-focus: #EBD07C;
    }
}

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

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

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

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

a {
    color: var(--amber);
    text-underline-offset: 0.18em;
}

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

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

h1,
h2,
h3 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 0.6em;
}

h1 {
    font-size: clamp(2rem, 1.4rem + 3vw, 3.1rem);
}

h2 {
    font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2rem);
}

h3 {
    font-size: 1.25rem;
}

p {
    margin: 0 0 1em;
}

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

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

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

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 10;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    color: var(--ink);
    border: 2px solid var(--frame);
    border-radius: 999px;
}

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

/* Header */

.topbar {
    border-bottom: 1px solid var(--hairline);
}

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

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

.wordmark {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.6rem;
    font-weight: 500;
}

.lantern {
    width: 2rem;
    height: 2rem;
    fill: none;
    stroke: var(--ink);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lantern .glow {
    fill: var(--glow);
    stroke: none;
}

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

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

/* Hero */

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

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

.hero .sub {
    font-size: 1.2rem;
    color: var(--ink-dim);
    max-width: 34rem;
}

.get {
    margin-top: 1.5rem;
}

.get p,
.cta p {
    color: var(--ink-dim);
    font-size: 0.95rem;
}

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

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

.get .play-badge {
    margin-bottom: 0.5rem;
}

.hero-shot img {
    width: min(20rem, 100%);
    margin: 0 auto;
    border-radius: 24px;
    border: 1px solid var(--shot-border);
}

@media (min-width: 40rem) {
    .hero-grid {
        grid-template-columns: 1fr 18rem;
    }
}

@media (min-width: 60rem) {
    .hero-grid {
        grid-template-columns: 1fr 20rem;
        gap: 4rem;
    }
}

/* Sections */

.section {
    padding: 2.75rem 0;
}

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

.answer {
    font-size: 1.125rem;
    max-width: 44rem;
}

.intro {
    max-width: 44rem;
    font-family: var(--serif);
    font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.45rem);
    line-height: 1.5;
}

.detail {
    color: var(--ink-dim);
    max-width: 44rem;
}

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

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

@media (min-width: 48rem) {
    .split-media {
        grid-template-columns: 1fr 18rem;
        gap: 3rem;
    }
}

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

@media (min-width: 48rem) {
    .modes {
        grid-template-columns: repeat(3, 1fr);
    }
}

.mode {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--hairline);
    border-radius: 20px;
    padding: 1.25rem 1.25rem 1.5rem;
}

.mode h3::before {
    content: "";
    display: block;
    width: 2.5rem;
    height: 0.4rem;
    margin-bottom: 0.75rem;
    border-radius: 999px;
    background: var(--flame);
}

.mode-sleep { --flame: var(--flame-sleep); }
.mode-baby { --flame: var(--flame-baby); }
.mode-focus { --flame: var(--flame-focus); }

.groups {
    display: grid;
    gap: 0.75rem;
    margin: 1.5rem 0;
    max-width: 44rem;
}

.groups div {
    background: var(--surface);
    color: var(--ink);
    border-radius: 16px;
    padding: 0.85rem 1.1rem;
}

.groups dt {
    font-weight: 700;
}

.groups dd {
    margin: 0;
    color: var(--ink-dim);
}

.shot img {
    border-radius: 16px;
    border: 1px solid var(--shot-border);
}

.shot,
figure {
    margin: 0;
}

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

.pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 16rem));
    gap: 1rem;
    margin-top: 1.5rem;
}

.nots,
.limits {
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 44rem;
}

.nots li {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.nots svg {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.2rem;
    fill: none;
    stroke: var(--amber);
    stroke-width: 2;
    stroke-linecap: round;
}

.limits li {
    padding: 0.75rem 1.1rem;
    margin-bottom: 0.75rem;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--hairline);
    border-radius: 12px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

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

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

figcaption {
    margin-top: 0.5rem;
    color: var(--ink-dim);
    font-size: 0.95rem;
}

.qlinks {
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 44rem;
}

.qlinks a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 0.5rem;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    text-decoration: none;
}

.qlinks a:hover {
    border-color: var(--frame);
}

.qlinks svg {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: var(--amber);
    stroke-width: 2;
}

.cta {
    text-align: center;
}

/* Inner pages */

.page-head {
    padding: 2rem 0 1rem;
}

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
    color: var(--ink-dim);
    font-size: 0.95rem;
}

.crumbs li + li::before {
    content: "›";
    padding: 0 0.5rem;
}

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

.lede {
    color: var(--ink-dim);
    font-size: 1.125rem;
    max-width: 44rem;
}

.ledger {
    max-width: 46rem;
    padding-bottom: 2rem;
}

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

/* Footer */

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

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

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

.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
}

.fine {
    color: var(--ink-dim);
}

.fine a {
    display: inline-block;
    padding: 0.6rem 0;
}
