/* Yarn's website, Direction A, "Now playing" (approved 18 October 2026, docs/WEBSITE.md).
   The visitor's system font (SF Pro on Apple devices), iOS's neutral colours and one blue. The only strong colour
   comes from the show that's playing, computed by the app's own ArtworkPalette (website/scripts/palette.swift).
   The accent is Yarn's blue at the app's 5.5:1 rule (7:1 with Increase Contrast). No letter-spacing is added:
   browsers already apply SF's own tracking. Nothing loads from another site. */

:root {
  color-scheme: light dark;
  --font-text: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --bg: #ffffff;           /* systemBackground */
  --bg-2: #f5f5f7;         /* apple.com's grey, close to secondarySystemBackground */
  --label: #1d1d1f;        /* 16.8:1 on white */
  --label-2: #6e6e73;      /* 5.07:1 on white */
  --hairline: rgb(0 0 0 / .1);
  --accent: #0264d8;       /* 5.5:1 on white */
  --on-accent: #ffffff;
  --gutter: 22px;
  /* How far the phone screens float: a close contact shadow under wide, soft ones, lit from above */
  --lift: 0 1px 2px rgb(0 0 0 / .05), 0 6px 12px -2px rgb(0 0 0 / .06), 0 20px 36px -8px rgb(0 0 0 / .12), 0 48px 80px -16px rgb(0 0 0 / .16);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000000; --bg-2: #1c1c1e; --label: #f5f5f7; --label-2: #a1a1a6; --hairline: rgb(255 255 255 / .16); --accent: #0091ff; --on-accent: #000000; }
  /* A shadow can't darken black, so in dark appearance the screens float on a faint pool of light instead */
  :root { --lift: 0 2px 4px rgb(0 0 0 / .6), 0 24px 48px -12px rgb(0 0 0 / .7), 0 40px 90px -24px rgb(255 255 255 / .1); }
}
@media (prefers-contrast: more) {
  :root { --accent: #0355b8; --label-2: #4d4d52; --hairline: rgb(0 0 0 / .3); }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --accent: #5cb8ff; --label-2: #c7c7cc; --hairline: rgb(255 255 255 / .35); }
}

/* Base */
[hidden] { display: none !important; }
html { font-size: 106.25%; -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--label); font: 400 1rem/1.47 var(--font-text); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .18em; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; text-wrap: balance; }
p, ul, ol { margin: 0; text-wrap: pretty; }
figure { margin: 0; }
/* Full width up to 1080 px of content. The width matters in the body's flex column, where auto margins would
   otherwise shrink a header or main to its contents and centre it. */
.wrap { box-sizing: border-box; width: 100%; max-width: calc(1080px + 2 * var(--gutter)); margin-inline: auto; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.skip { position: absolute; left: 12px; top: -48px; padding: 10px 14px; border-radius: 10px; background: var(--bg-2); color: var(--label); z-index: 10; }
.skip:focus { top: 12px; }

/* Header and footer. The header holds only Yarn's mark and name: Support, Press and Privacy are in the footer, and the
   App Store badge sits under the hero's paragraph. The mark is the app icon's ribbon without its tile
   (scripts/render-mark.swift). The name is set in the system's rounded face where there is one (SF Pro Rounded on
   Apple devices, whose rounded ends follow the ribbon), and in the system font elsewhere. */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--label); text-decoration: none; font-family: ui-rounded, var(--font-display); font-weight: 700; font-size: 1.47rem; }
.brand img { width: auto; height: 36px; }

.foot { margin-top: auto; border-top: 1px solid var(--hairline); padding-block: 28px 44px; font-size: .7647rem; line-height: 1.5; color: var(--label-2); }
.foot .row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.foot .made { display: flex; align-items: center; gap: 10px; color: var(--label); font-size: .8235rem; }
.foot .made img { width: auto; height: 24px; }
.foot nav { display: flex; gap: 22px; font-size: .8235rem; }
.foot a { color: var(--label); text-decoration: none; }
.foot a:hover { color: var(--accent); text-decoration: underline; }
.foot .legal { margin-top: 18px; max-width: 60em; }

/* Screens: real captures from the app, with the iPhone's display corners, floating above the page */
.screen { position: relative; border-radius: 14% / 6.45%; overflow: hidden; box-shadow: 0 0 0 1px var(--hairline), var(--lift); background: var(--bg-2); }
.screen img { width: 100%; aspect-ratio: 720 / 1564; object-fit: cover; }

/* Home: hero */
.hero { overflow-x: clip; padding-bottom: 40px; }
/* The headline and the paragraph beside it share a height. Trimmed to its cap height, the paragraph starts level with
   the top of "A finer way", and the App Store badge under it stands on the baseline of "to listen.". The headline is
   set large enough to stay the taller of the two, so the paragraph and the badge spread to its height; they stack
   below 1069 px, where the paragraph would outgrow it. */
.hero-text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 48px; padding-top: 84px; }
.hero-text > div { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.hero h1 { font-size: 4.5rem; line-height: 1.04; }
.hero h1, .intro, .status { text-box: trim-both cap alphabetic; }
.intro { font-size: 1.2353rem; line-height: 1.38; max-width: 25em; }
.status { color: var(--label-2); font-size: .9412rem; line-height: 1.5; }
/* The App Store badge is Apple's black badge (images/app-store-badge.svg, from Apple's marketing guidelines and never
   altered), at its own 40 px height, Apple's onscreen minimum, with at least a quarter of that kept clear around it.
   Taller, it would make the hero's paragraph outgrow the headline. Its note sits beside it, or below it where there's
   no room. */
.store { display: block; width: fit-content; }
.store img { width: auto; height: 40px; }
.get { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.stage { position: relative; display: grid; justify-items: center; margin-top: 72px; }
.player { position: relative; width: min(330px, 74vw); }
.player .screen { z-index: 1; }
.player .screen img { transition: opacity .18s ease-out; }
.player .screen img.fading { opacity: 0; }
.silk { position: absolute; z-index: 0; top: 0; left: 0; height: 168px; pointer-events: none; }
.picker { margin: 34px 0 0; padding: 0; border: 0; display: grid; gap: 14px; }
.picker legend { font-size: .7647rem; color: var(--label-2); padding: 0; margin: 0 0 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips label { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; font-size: .8824rem; cursor: pointer; box-shadow: inset 0 0 0 1px var(--hairline); }
.chips label:has(i) { padding: 9px 15px 9px 12px; }
.chips label i { width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--label-2)); }
.chips input:checked + label { box-shadow: inset 0 0 0 1.5px var(--dot, var(--label)); font-weight: 600; }
.chips input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 3px; }
.picker p { font-size: .8235rem; color: var(--label-2); max-width: 30em; }
/* The show picker sits centred under the player. */
.stage .picker { justify-items: center; }
.stage .picker legend { margin-inline: auto; }
.stage .chips { justify-content: center; }
.stage .picker p { text-align: center; }

/* Home: sections */
.section { padding-block: 120px; }
.section.flush { padding-top: 0; }
.section h2 { font-size: 3rem; line-height: 1.08; }
.lead { font-size: 1.2353rem; line-height: 1.38; margin-top: 18px; max-width: 30em; }
.body { margin-top: 16px; max-width: 34em; }
.fine { margin-top: 14px; font-size: .8235rem; line-height: 1.43; color: var(--label-2); max-width: 36em; }

.tabs .lead { max-width: 34em; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto; gap: 36px 48px; margin-top: 64px; }
.trio article { display: grid; grid-row: span 2; grid-template-rows: subgrid; gap: 36px; align-content: start; }
.trio .tab, .device .tab { font-size: .8824rem; font-weight: 600; color: var(--label-2); }
.trio h3, .device h3 { margin-top: 6px; font-size: 1.647rem; line-height: 1.15; }
.trio .body, .device .body { margin-top: 10px; }
.trio .screen { width: min(300px, 100%); }

/* iPad and iPhone Duo: the iPad's screen beside its words, then the Duo's player, which without the script is folded
   and open side by side at the same height. Each screen keeps its display's corners: the Duo captures have them
   painted in, which these radii cover. */
.device { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px 56px; align-items: center; margin-top: 72px; }
.device.duo { margin-top: 104px; }
.duo:not(.live) { grid-template-columns: minmax(0, 1fr); }
.device > div:first-child { max-width: 34em; }
.screen.ipad { border-radius: 2.2% / 2.93%; }
.screen.ipad img { aspect-ratio: 1440 / 1080; }
.pages { display: grid; grid-template-columns: minmax(0, 68.7fr) minmax(0, 142.15fr); gap: 40px; align-items: start; margin-top: 8px; }
.pages figure { display: grid; gap: 16px; justify-items: center; }
.pages figcaption { font-size: .8824rem; font-weight: 600; color: var(--label-2); }
.pages .screen { width: 100%; }
.screen.folded { border-radius: 11.2% / 7.7%; }
.screen.folded img { aspect-ratio: 720 / 1048; }
.screen.open { border-radius: 5.5% / 7.8%; }
.screen.open img { aspect-ratio: 1440 / 1013; }
.screen.upright { border-radius: 7.8% / 5.5%; }
.screen.upright img { aspect-ratio: 1013 / 1440; }

/* With the script, the Duo's words gain a pose picker (js/site.js), whose note keeps room for three lines, the
   longest note's length at phone widths, so the stage doesn't move as it changes. The player becomes one square
   stage that shows the pose picked in place of the last, without animation. Every pose keeps one scale, the open
   display's 951 points filling the stage: folded the display is 466 × 678 points, open 951 × 669, and upright
   669 × 951. */
.duo.live { align-items: start; }
.poses { margin-top: 28px; gap: 12px; }
.poses p { min-height: 3lh; }
.duo.live .pages { grid-template-columns: minmax(0, 1fr); margin-top: 0; aspect-ratio: 1; align-items: center; }
.duo.live figcaption { display: none; }
.duo.live .screen.folded { width: calc(466 / 951 * 100%); }
.duo.live .screen.upright { width: calc(669 / 951 * 100%); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 80px; align-items: center; }
.split.flip { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
.split.flip .screen { order: -1; }

.band { background: var(--bg-2); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 64px; margin-top: 56px; }
.facts h3, .grid h3 { font-size: 1.0588rem; line-height: 1.3; }
.facts p, .grid p { margin-top: 6px; color: var(--label-2); max-width: 30em; }
.label-line { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--hairline); font-size: .9412rem; color: var(--label-2); }
.label-line strong { color: var(--label); font-weight: 600; }

.icons { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 18px; margin: 56px 0 0; padding: 0; list-style: none; max-width: 860px; }
.icons li { display: grid; justify-items: center; gap: 10px; font-size: .8235rem; color: var(--label-2); }
.icons img { width: 100%; max-width: 104px; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 56px; margin-top: 56px; }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 44px 40px; }

.points { display: grid; gap: 22px; margin-top: 30px; max-width: 34em; }
.points h3 { font-size: 1.0588rem; line-height: 1.3; }
.points p { margin-top: 6px; color: var(--label-2); }

/* The name, set out as a dictionary entry and centred, so it reads as an aside rather than another section: the bold
   headword, its pronunciation and part of speech, then the sense. VoiceOver reads the headword and skips the phonetic
   spelling. */
.word .wrap { text-align: center; }
.word h2 { font-size: 3.5rem; }
.word dfn { font-style: normal; font-weight: 700; }
.word .say { margin-top: 12px; font-size: 1.2353rem; color: var(--label-2); }
.word .say i { margin-left: .5em; }
.word .sense { margin: 14px auto 0; font-family: var(--font-display); font-size: 1.647rem; line-height: 1.27; max-width: 22em; text-wrap: balance; }

.close { padding-block: 128px 112px; }
.close .wrap { display: grid; gap: 20px; justify-items: start; }
.close h2 { font-size: 4rem; line-height: 1.04; }

/* Long-form pages: privacy */
.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 64px; padding-block: 56px 112px; }
.toc { position: sticky; top: 24px; align-self: start; font-size: .8235rem; }
.toc p { color: var(--label-2); margin-bottom: 10px; }
.toc ol { list-style: none; padding: 0; display: grid; gap: 8px; }
.toc a { color: var(--label); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.doc article { max-width: 40em; line-height: 1.53; }
.page-title { font-size: 2.82rem; line-height: 1.07; }
.meta { margin-top: 12px; color: var(--label-2); font-size: .9412rem; }
.short { margin-top: 36px; padding: 26px 28px; border-radius: 22px; background: var(--bg-2); }
.short h2 { font-size: 1.0588rem; }
.short p { margin-top: 8px; font-size: 1.1176rem; line-height: 1.45; }
.doc section { margin-top: 52px; scroll-margin-top: 24px; }
.doc section h2 { font-size: 1.41rem; line-height: 1.2; }
.doc section p, .doc section ul { margin-top: 12px; }
.doc section ul { padding-left: 1.2em; display: grid; gap: 6px; }
.where { color: var(--label-2); }
.history { margin-top: 12px; border-top: 1px solid var(--hairline); }
.history div { display: grid; grid-template-columns: 10em minmax(0, 1fr); gap: 16px; padding-block: 10px; border-bottom: 1px solid var(--hairline); font-size: .9412rem; }
.history span:first-child { color: var(--label-2); font-variant-numeric: tabular-nums; }

/* Support and press */
.support-head, .press-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 56px; align-items: start; padding-block: 64px 56px; }
.support-head .lead, .press-head .lead { color: var(--label-2); margin-top: 14px; max-width: 26em; }
.press-head .store { margin-top: 28px; }
.contact { padding: 26px 28px; border-radius: 22px; background: var(--bg-2); display: grid; gap: 14px; }
.contact .address { font-size: 1.2353rem; font-weight: 600; user-select: all; }
.contact .button { justify-self: start; padding: 11px 20px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none; font-size: .9412rem; }
.contact p.small { font-size: .8235rem; color: var(--label-2); }
.faq { padding-bottom: 104px; }
.faq h2, .press h2 { font-size: 1.88rem; line-height: 1.12; margin-bottom: 18px; }
.faq details { border-top: 1px solid var(--hairline); }
.faq details:last-of-type { border-bottom: 1px solid var(--hairline); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 18px; font-size: 1.0588rem; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid var(--label-2); border-bottom: 2px solid var(--label-2); transform: rotate(45deg) translateY(-3px); transition: transform .2s ease-out; }
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.faq details p { padding-bottom: 20px; max-width: 40em; color: var(--label-2); }
.faq details p strong { color: var(--label); font-weight: 600; }
.press { padding-bottom: 72px; }
.press:last-child { padding-bottom: 104px; }
.press > p { max-width: 40em; color: var(--label-2); }
.press .facts { margin-top: 8px; }
.sheet { margin: 0; border-top: 1px solid var(--hairline); max-width: 46em; }
.sheet div { display: grid; grid-template-columns: 10em minmax(0, 1fr); gap: 16px; padding-block: 12px; border-bottom: 1px solid var(--hairline); }
.sheet dt { color: var(--label-2); }
.sheet dd { margin: 0; }

/* Not found */
.missing { padding-block: 120px 160px; display: grid; gap: 18px; justify-items: start; }
.missing h1 { font-size: 3rem; line-height: 1.08; }
.missing nav { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 1.0588rem; }

/* Narrower windows */
@media (max-width: 1068px) {
  .hero-text { grid-template-columns: minmax(0, 1fr); gap: 30px; padding-top: 64px; }
  .hero h1, .close h2 { font-size: 3rem; }
  .section h2 { font-size: 2.5rem; }
  .word h2 { font-size: 3rem; }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 260px); gap: 48px; }
  .split.flip { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); }
  .grid, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .icons { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .trio { gap: 32px 28px; }
  .trio h3, .device h3 { font-size: 1.41rem; }
  .device { gap: 32px 40px; }
  .pages { gap: 28px; }
}
@media (max-width: 860px) {
  .device { grid-template-columns: minmax(0, 1fr); }
  .doc { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 32px; }
  .toc { display: none; }
  .page-title { font-size: 2.12rem; }
  .support-head, .press-head { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 36px; }
}
@media (max-width: 734px) {
  .hero-text { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 46px; }
  .hero h1, .close h2 { font-size: 2.353rem; line-height: 1.08; }
  .intro, .lead { font-size: 1.1176rem; }
  .stage { margin-top: 48px; }
  .silk { height: 132px; }
  .section { padding-block: 80px; }
  .section h2 { font-size: 1.882rem; line-height: 1.12; }
  .word h2 { font-size: 2.353rem; }
  .word .say { font-size: 1.1176rem; }
  .word .sense { font-size: 1.2353rem; line-height: 1.38; }
  .trio { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 72px; margin-top: 48px; }
  .trio article { grid-row: auto; grid-template-rows: none; gap: 32px; }
  .trio .screen, .split .screen { width: min(270px, 78vw); justify-self: center; }
  .split, .split.flip { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .split.flip .screen { order: 0; }
  .device { margin-top: 56px; gap: 28px; }
  .device.duo { margin-top: 72px; }
  /* Too narrow for the Duo's two screens side by side: folded above open */
  .pages { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .pages figure:first-child .screen { width: min(250px, 66vw); }
  .facts, .grid, .grid.four { grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 40px; }
  .icons { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 10px; }
  .close { padding-block: 88px; }
  .sheet div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .missing { padding-block: 72px 112px; }
  .missing h1 { font-size: 2.12rem; }
}
@media (prefers-reduced-motion: reduce) {
  .player .screen img, .faq summary::after { transition: none; }
}
