/*
 * Source Serif 4, served from this domain.
 *
 * Not from `fonts.gstatic.com`. The app's own claim is "no account, no network,
 * nothing leaves the phone"; a page making that claim while handing the
 * reader's IP address to a third party on load is contradicting itself in the
 * act of saying it — a point already settled in court in Europe. It also saves
 * two DNS lookups and two TLS handshakes.
 *
 * One family in three roles. It has real optical sizes, so the display cut is
 * not the text cut enlarged: the hierarchy comes from size, weight and optics
 * inside a single voice rather than from changing voice. Taken from
 * `patiences`, which worked this out and wrote down why.
 *
 * A reader downloads the subset for their own script, not the twelve files.
 * Non-Latin scripts — Arabic, Chinese, Korean, Japanese, Thai, Hindi — fall
 * through to the system fonts, which is the right answer: better drawn than
 * anything that could be bundled, and free in weight.
 */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-cyrillic-ext-italic.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-cyrillic-italic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-greek-italic.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-vietnamese-italic.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-latin-ext-italic.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-latin-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-cyrillic-ext-normal.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-cyrillic-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-greek-normal.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-vietnamese-normal.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-latin-ext-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-latin-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
 * The app's palette, transcribed.
 *
 * Every colour below is a value from `src/ui/theme/palettes.ts` — the dark one,
 * because that is the app's own first face and because the eight exercise
 * posters are bright: white pages made them look washed out and grey, where a
 * dark ground makes them the thing you look at. The app has a light theme
 * because a phone gets held in daylight; a page does not have that problem.
 *
 * Transcribed rather than imported: this is CSS and that is TypeScript, and a
 * build step to share nineteen constants would cost more than it saves. They
 * are named identically on both sides, so a diff between the two files reads.
 */

:root {
  --ground: #12161f;
  --surface: #1a2029;
  --surface-sunken: #0d1118;
  --border: #2e3644;
  --border-soft: #262d39;
  --ink: #e8eaf0;
  --ink-soft: #c2c8d4;
  --ink-muted: #8b94a6;
  --accent: #dbaa5c;
  --accent-wash: rgba(219, 170, 92, 0.16);
  --on-accent: #12161f;
  --rest: #6fc49b;
  --scrim: rgba(10, 13, 19, 0.55);

  --radius-surface: 12px;
  --radius-button: 10px;
  --radius-pill: 999px;

  /* The app's own measure, in the app's own unit. */
  --measure: 640px;
  --page: 1080px;

  /* One face, three roles — see the README. */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  text-wrap: balance;
  font-weight: 600;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

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

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

/* ── Header ─────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}

/*
 * The mark: a ring with a hand at the top.
 *
 * Drawn in the page rather than fetched, because it is nine elements of CSS and
 * an app icon does not exist yet (P7.5). When one does, this becomes an <img>
 * and nothing else on the page changes.
 */
.mark {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-pill);
  border: 2.5px solid var(--accent);
  position: relative;
  flex: none;
}

.mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  width: 2.5px;
  height: 8px;
  background: var(--accent);
  transform: translateX(-50%);
  border-radius: 2px;
}

.nav {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--radius-button);
}

.nav a:hover {
  color: var(--ink);
  background: var(--surface);
}

.nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-wash);
}

/* ── The language menu ──────────────────────────────────────────────── */

.lang {
  position: relative;
}

.lang summary {
  list-style: none;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--radius-button);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lang summary::-webkit-details-marker {
  display: none;
}

.lang summary:hover {
  color: var(--ink);
  background: var(--surface);
}

.lang-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-surface);
  padding: 8px;
  min-width: 220px;
  max-height: 60vh;
  overflow-y: auto;
  display: grid;
  gap: 2px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.lang-menu a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 15px;
}

.lang-menu a:hover {
  background: var(--surface-sunken);
  color: var(--ink);
}

.lang-menu a[aria-current="true"] {
  color: var(--accent);
}

/* ── Hero ───────────────────────────────────────────────────────────── */

.hero {
  padding: 88px 0 72px;
}

.hero h1 {
  font-size: clamp(40px, 7vw, 68px);
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.hero .lede {
  font-size: clamp(19px, 2.2vw, 23px);
  color: var(--ink-soft);
  max-width: 34em;
}

.hero .tagline {
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* ── Store badges ───────────────────────────────────────────────────── */

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 32px;
}

.badge img {
  height: 52px;
  width: auto;
}

.badge.is-soon {
  position: relative;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.badge.is-soon img {
  opacity: 0.55;
}

.soon-note {
  color: var(--ink-muted);
  font-size: 14px;
  width: 100%;
}

/* ── The exercise grid ──────────────────────────────────────────────── */

.section {
  padding: 72px 0;
  border-top: 1px solid var(--border-soft);
}

.section h2 {
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}

.section .sub {
  color: var(--ink-muted);
  max-width: 42em;
  margin-bottom: 36px;
}

.exercises {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.exercise {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-surface);
  overflow: hidden;
}

/*
 * `height: auto` is the whole rule.
 *
 * The `height="247"` attribute on the tag is a *presentational hint* — the
 * browser turns it into `height: 247px`, a real used height — and
 * `aspect-ratio` only ever computes the side that is `auto`. Without this
 * line the card was 244 x 247 instead of 244 x 137, and `cover` answered the
 * near-square box by throwing away the left and right thirds of a 16:9
 * poster. `.carousel img` never had the bug because it sets `height: 100%`,
 * which overrides the same hint by accident.
 */
.exercise img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.exercise .body {
  padding: 13px 16px 15px;
}

.exercise h3 {
  font-size: 18px;
}

.exercise p {
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.5;
}

/* ── Features ───────────────────────────────────────────────────────── */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-surface);
  padding: 26px 24px;
}

.feature h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--accent);
}

.feature p {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.55;
}

/* ── Call to action ─────────────────────────────────────────────────── */

.cta {
  text-align: center;
  padding: 84px 0 96px;
  border-top: 1px solid var(--border-soft);
}

.cta h2 {
  font-size: clamp(30px, 4.5vw, 44px);
  margin-bottom: 10px;
}

.cta p {
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.cta .badges {
  justify-content: center;
}

/* ── Support and privacy ────────────────────────────────────────────── */

.page-head {
  padding: 72px 0 40px;
}

.page-head h1 {
  font-size: clamp(34px, 5vw, 50px);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.page-head p {
  color: var(--ink-muted);
  max-width: 40em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-surface);
  padding: 26px 24px;
  margin-bottom: 18px;
}

.card h2 {
  font-size: 22px;
  margin-bottom: 10px;
}

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

.card p,
.card li {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.62;
}

.card ul {
  margin: 0;
  padding-inline-start: 1.2em;
}

.card li + li {
  margin-top: 8px;
}

.faq {
  display: grid;
  gap: 12px;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-surface);
  padding: 4px 20px;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 0;
  font-weight: 600;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
  flex: none;
}

.faq details[open] summary::after {
  content: "−";
}

.faq .answer {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.6;
  padding-bottom: 18px;
}

.contact-link {
  font-size: 19px;
  font-weight: 600;
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--surface-sunken);
  padding: 48px 0 40px;
  color: var(--ink-muted);
  font-size: 15px;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 28px;
  margin-bottom: 32px;
}

.footer-cols h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.footer-cols a {
  color: var(--ink-soft);
  text-decoration: none;
  display: block;
  padding: 4px 0;
}

.footer-cols a:hover {
  color: var(--accent);
}

.footer-base {
  border-top: 1px solid var(--border-soft);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
}

/* ── The "coming soon" dialogue ─────────────────────────────────────── */

dialog.soon {
  border: 1px solid var(--border);
  border-radius: var(--radius-surface);
  background: var(--surface);
  color: var(--ink);
  padding: 28px;
  max-width: 420px;
  font-family: var(--serif);
}

dialog.soon::backdrop {
  background: var(--scrim);
}

dialog.soon h2 {
  font-size: 22px;
  margin-bottom: 10px;
}

dialog.soon p {
  color: var(--ink-soft);
  margin-bottom: 20px;
}

dialog.soon button {
  font: inherit;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 12px 26px;
  cursor: pointer;
}

/* ── The phone, and the carousel inside it ──────────────────────────── */

/*
 * Two columns where there is room, one where there is not.
 *
 * `minmax(0, 1fr)` on the copy rather than `1fr`: a long German headline in a
 * bare `1fr` track refuses to wrap below its longest word and pushes the phone
 * off the side of the page. The phone's track is sized to the frame itself so
 * the copy takes whatever is left.
 */
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  align-items: center;
}

.phone-rail {
  display: flex;
  justify-content: center;
}

.phone-wrap {
  width: min(100%, 320px);
}

/*
 * The frame. Dark, thin, and quiet: the screenshots are themselves dark and
 * already carry the app's colour, so a heavy bezel would be a second frame
 * around a picture that has one.
 */
.phone-shell {
  padding: 9px;
  border-radius: 38px;
  background: linear-gradient(165deg, var(--border) 0%, var(--surface-sunken) 60%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px var(--accent-wash),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/*
 * The aspect ratio is the source file's, so the box is the right shape before a
 * single image has loaded and the page never jumps as they arrive.
 */
.carousel {
  position: relative;
  aspect-ratio: 1320 / 2868;
  border-radius: 30px;
  overflow: hidden;
  background: var(--surface-sunken);
}

.carousel picture {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.carousel picture.is-active {
  opacity: 1;
}

.carousel img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

/*
 * Seven points drawn, forty-four pressable. A dot the size of the drawing would
 * be under Apple's own floor for a touch target and unusable on the phone this
 * page is mostly read on.
 */
.carousel-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--ink-muted);
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.3s ease, background-color 0.3s ease;
  position: relative;
}

.carousel-dot::after {
  content: '';
  position: absolute;
  inset: -18px;
}

.carousel-dot.is-active {
  background: var(--accent);
  opacity: 1;
}

.carousel-dot:hover {
  opacity: 0.8;
}

/*
 * Someone who has asked their system to stop animating things has asked for
 * this too. The fade goes, and so does the automatic advance — `app.js` reads
 * the same query, because a carousel that keeps changing under a reader is the
 * exact thing the setting is for.
 */
@media (prefers-reduced-motion: reduce) {
  .carousel picture {
    transition: none;
  }
}

/* ── Small screens ──────────────────────────────────────────────────── */

/* Below this the two columns cannot both be honest widths. */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
  }
  /* The copy first, then the picture — the sentence is what the page is for. */
  .hero-copy {
    text-align: center;
  }
  .hero-copy .lede {
    margin-inline: auto;
  }
  .hero-copy .badges {
    justify-content: center;
  }
}

@media (max-width: 700px) {
  body {
    font-size: 17px;
  }
  .hero {
    padding: 56px 0 48px;
  }
  .section,
  .cta {
    padding: 52px 0;
  }
  .nav a {
    padding: 8px 10px;
    font-size: 15px;
  }
}
