/*
 * Landing page styles. Colors, fonts and the glyph field follow the app:
 * Catppuccin Latte/Mocha with true-gray neutrals, Atkinson Hyperlegible for
 * reading, Press Start 2P for the wordmark and canvas labels.
 */

@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-latin-400.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;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-latin-ext-400.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-latin-700.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;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-latin-ext-700.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/press-start-2p-latin.woff2') format('woff2');
}

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #4d4d4d;
  --faint: #6b6b6b;
  --rule: #e0e0e0;
  --rule-strong: #cfcfcf;
  --field: #f5f5f5;
  --card: #ffffff;
  --glass: color-mix(in oklab, #ffffff 86%, transparent);
  --tint: color-mix(in oklab, var(--text) 4%, transparent);
  --overlay0: #a3a3a3;
  --overlay1: #8c8c8c;
  --subtext0: #5c5c5c;
  --ui-line: color-mix(in oklab, var(--overlay0) 60%, transparent);
  /* The app's node footer tags: tinted with the node's color in the light
   * theme, outlined with it in the dark one. */
  --tag-fill: 25%;
  --tag-edge: 0%;
  /* The app's translucent surface for term previews and floating panels. */
  --surface: rgb(255 255 255 / 32%);
  --surface-shadow: 0 2px 10px rgb(0 0 0 / 8%);

  --sky: #04a5e5;
  --sapphire: #209fb5;
  --blue: #1e66f5;
  --lavender: #7287fd;
  --mauve: #8839ef;
  --pink: #ea76cb;
  --peach: #fe640b;
  --teal: #179299;
  --yellow: #df8e1d;

  /* The demo project's color, set for each visit by the landing function and
   * landing.js; on the legal pages, landing.js picks one. Glyphs use it at the
   * app's opacity tiers, plus the app's theme boost. */
  --aura: #04a5e5;
  /* Text on the project color, which is light in both color schemes. */
  --on-aura: #101010;
  --dot: #c3c3c3;
  --ascii-alpha-unfocused: 0.6;
  --ascii-alpha-focused: 1;
  --ascii-alpha-boost: 0.05;
  --arrow: #1e66f5;

  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 16px rgb(0 0 0 / 5%);
  --shadow-lg: 0 2px 6px rgb(0 0 0 / 8%), 0 12px 32px rgb(0 0 0 / 9%);

  --font: 'Atkinson Hyperlegible', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --pixel: 'Press Start 2P', ui-monospace, monospace;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --page: 1200px;
  --header: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101010;
    --text: #e8e8e8;
    --muted: #c4c4c4;
    --faint: #9a9a9a;
    --rule: #2f2f2f;
    --rule-strong: #424242;
    --field: #1c1c1c;
    --card: #141414;
    --glass: color-mix(in oklab, #101010 84%, transparent);
    --overlay0: #555555;
    --overlay1: #6e6e6e;
    --subtext0: #b8b8b8;
    --tag-fill: 4%;
    --tag-edge: 50%;
    --surface: rgb(0 0 0 / 28%);
    --surface-shadow: 0 2px 10px rgb(0 0 0 / 12%);

    --sky: #89dceb;
    --sapphire: #74c7ec;
    --blue: #89b4fa;
    --lavender: #b4befe;
    --mauve: #cba6f7;
    --pink: #f5c2e7;
    --peach: #fab387;
    --teal: #94e2d5;
    --yellow: #f9e2af;

    --aura: #74c7ec;
    --dot: #484848;
    --ascii-alpha-unfocused: 0.4;
    --ascii-alpha-focused: 0.7;
    --ascii-alpha-boost: 0;
    --arrow: #89b4fa;

    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 16px rgb(0 0 0 / 25%);
    --shadow-lg: 0 2px 6px rgb(0 0 0 / 35%), 0 12px 32px rgb(0 0 0 / 40%);
  }
}

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

html {
  /* Keep the browser's tap overlay off the page; keyboard outlines and text selection stay native. */
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Settings opens these sections in new tabs. Jump there before the embedded
 * demo restores the outer page's scroll position during its own startup. */
html:has(#support-me:target, #contact:target) { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 18px/1.55 var(--font);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* The app's cursors (cursors.css): the general pointer, the click glyph on
 * controls, the term glyph on terms and text links, the I-beam over text runs
 * (landing.js wraps them in .t), and the press flash from landing.js. */
html { cursor: var(--cur-pointer); }
.t { cursor: var(--cur-text); }
a[href], .term { cursor: var(--cur-term); }
button, summary, label[for], [role="button"], select,
.button, .wordmark, .top nav a, .skip { cursor: var(--cur-click); }
:disabled, [disabled], [aria-disabled="true"] { cursor: var(--cur-click) !important; }
html.sc-pressing, html.sc-pressing * { cursor: var(--cur-press) !important; }
html.sc-disabled-pressing, html.sc-disabled-pressing * { cursor: var(--cur-ban) !important; }

body.demo-locked { overflow: hidden; }
/* The hero isolates its glyph field, so its own layer must rise above the
 * header and the sections while the demo fills the screen. */
body.demo-locked .hero { z-index: 60; }

h1, h2, h3, p, ul, ol, figure, table { margin: 0; }

a { color: var(--link, var(--blue)); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

strong { font-weight: 700; }

code, kbd {
  font-family: var(--mono);
  font-size: 0.86em;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 14px;
  background: var(--text);
  color: var(--bg);
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 12px; }

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

/* ── Wordmark ─────────────────────────────────────────────── */

/* As the app's sidebar wordmark: letters in the project's colors, rearranged
 * on hover and every 500 ms while hovered; a press shrinks it. */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font: 400 24px/1 var(--pixel);
  letter-spacing: 0;
  text-decoration: none;
  padding: 6px 2px;
  border-radius: 3px;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: center;
}
.wordmark:active { transform: scale(0.9); }
.wordmark:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }
.wordmark span {
  display: inline-block;
  color: var(--c, var(--text));
  filter: brightness(var(--b, 1));
  transition: color 180ms ease, filter 180ms ease;
}
.foot .wordmark { gap: 2px; font-size: 18px; }

/* ── Buttons ──────────────────────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: 700 16px/1.2 var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.button:hover { background: var(--tint); text-decoration: none; }
/* Open the app wears the visit's project color, as does Open the demo on
 * touch screens. */
.button.primary {
  background: var(--aura);
  border-color: var(--aura);
  color: var(--on-aura);
}
.button.primary:hover { background: color-mix(in oklab, var(--aura) 88%, var(--text)); }
.button svg { flex: none; }

/* Original cup artwork and motion from Ko-fi's Widget_2.js, served locally. */
.kofi-cup { flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .kofi-cup { animation: kofi-wiggle 3s ease infinite; }
}
@keyframes kofi-wiggle {
  0%, 60%, 100% { transform: rotate(0deg) scale(1); }
  75% { transform: rotate(0deg) scale(1.12); }
  80% { transform: rotate(0deg) scale(1.1); }
  84%, 92% { transform: rotate(-10deg) scale(1.1); }
  88%, 96% { transform: rotate(10deg) scale(1.1); }
}

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

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 var(--gutter);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
}
.top.scrolled { border-bottom-color: var(--rule); }

/* The navigation and the button sit at the right edge. */
.top .wordmark { margin-right: auto; }
.top nav {
  display: flex;
  gap: 4px;
}
.top nav a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font-size: 16px;
  padding: 8px 12px;
  border-radius: 6px;
}
.top nav a:hover { color: var(--text); background: var(--tint); }
.top .button { min-height: 40px; padding: 0 16px; }

@media (min-width: 861px) and (max-width: 1120px) {
  .top:has(nav) { gap: 8px; padding-inline: 16px; }
  .top nav { gap: 2px; }
  .top nav a { padding-inline: 4px; }
}
@media (max-width: 860px), (hover: none) and (pointer: coarse) {
  .top nav { display: none; }
}

/* ── Hero and demo ────────────────────────────────────────── */

.hero {
  position: relative;
  isolation: isolate;
  /* The glyph field covers whole cells, up to one cell wider than the hero. */
  overflow-x: clip;
  padding: clamp(48px, 9vh, 104px) var(--gutter) 40px;
  text-align: center;
}

.field {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 160px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 160px), transparent);
}

/* Panels blur the glyph field without adding a white or black tint. */
.glass {
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: transparent;
  -webkit-backdrop-filter: blur(10px) saturate(1.6);
  backdrop-filter: blur(10px) saturate(1.6);
  box-shadow: var(--surface-shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: fit-content;
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 44px) clamp(20px, 4.5vw, 56px);
}

.hero h1 {
  font-size: clamp(40px, 6.4vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  font-weight: 700;
  max-width: 22ch;
  text-wrap: balance;
}

.lede {
  max-width: 38rem;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: balance;
}
.lede strong { color: var(--text); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.hero .actions { justify-content: center; }

.fine {
  font-size: 15px;
  color: var(--faint);
}

.touch-only { display: none; }
.is-touch .touch-only { display: revert; }
.is-touch .pointer-only { display: none; }

.app-entry small { display: none; }
@media (hover: none) and (pointer: coarse), (max-width: 640px) {
  .top:has(.app-entry) { height: auto; min-height: var(--header); padding-block: 4px; }
  .button.primary.app-entry {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding-block: 5px;
  }
  .app-entry > span { text-decoration-line: line-through; }
  .app-entry small {
    display: block;
    font-size: 0.875rem;
    line-height: 1.2;
    font-weight: 400;
    white-space: normal;
    text-align: center;
    text-wrap: balance;
  }
}

.demo {
  position: relative;
  margin: clamp(56px, 9vh, 96px) auto 0;
  max-width: 1280px;
}

/* The demo holds hundreds of controls; keyboard users can pass it in one step. */
.demo > .skip { top: 12px; }
.demo > .skip:not(:focus) { clip-path: inset(50%); }
.demo-caption:focus { outline: none; }

.demo-frame {
  position: relative;
  height: clamp(520px, calc(100svh - 150px), 820px);
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: border-color 200ms ease;
}
.demo-frame.focused { border-color: var(--aura); }

.demo-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
  opacity: 0;
  transition: opacity 300ms ease;
}
.demo-frame.loaded iframe { opacity: 1; }

.demo-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--faint);
  font: 400 8px/1 var(--pixel);
  text-transform: uppercase;
  pointer-events: none;
}
.demo-frame.loaded .demo-loading { display: none; }

.demo-caption {
  width: fit-content;
  max-width: 46rem;
  margin: 20px auto 0;
  padding: 12px 18px;
  color: var(--muted);
  font-size: 16px;
  text-wrap: pretty;
}
.demo-caption strong { color: var(--text); }

/* Touch screens: the demo opens full screen, so a swipe over the
 * preview scrolls the page instead of panning the canvas. The blurred
 * preview carries a note on the demo's limits; a tap anywhere opens it. */
.demo-open, .demo-close, .demo-touch-note { display: none; }
.is-touch .demo-frame iframe { pointer-events: none; }
.is-touch .demo-frame:not(.expanded) iframe { filter: blur(3px); }
.is-touch .demo-frame:not(.expanded) .demo-touch-note {
  position: absolute;
  z-index: 1;
  top: 42%;
  left: 50%;
  display: block;
  width: min(30rem, calc(100% - 32px));
  padding: 14px 18px;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: var(--glass);
  box-shadow: var(--shadow-lg);
  color: var(--muted);
  font-size: 16px;
  text-align: center;
  text-wrap: pretty;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.demo-touch-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}
.is-touch .demo-open {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 16px 20px;
  border: 0;
  background: linear-gradient(to bottom, transparent 55%, color-mix(in oklab, var(--bg) 70%, transparent));
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.is-touch .demo-open span {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--aura);
  color: var(--on-aura);
  font-weight: 700;
  box-shadow: var(--shadow-lg);
}
.is-touch .demo-frame { height: min(68svh, 620px); }

.demo-frame.expanded {
  position: fixed;
  inset: 0;
  z-index: 40;
  height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding-top: env(safe-area-inset-top);
}
.demo-frame.expanded iframe { pointer-events: auto; }
.demo-frame.expanded .demo-open { display: none; }
.demo-frame.expanded .demo-close {
  position: absolute;
  z-index: 2;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text);
  font: 700 16px/1 var(--font);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

/* ── Sections ─────────────────────────────────────────────── */

.section {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(72px, 11vw, 136px) var(--gutter) 0;
}

.section-head {
  display: grid;
  gap: 16px;
  max-width: 44rem;
}
.section-head.center {
  margin: 0 auto;
  text-align: center;
  justify-items: center;
}

h2 {
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  font-weight: 700;
  text-wrap: balance;
}

h3 {
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 700;
  text-wrap: balance;
}

.section-head p { color: var(--muted); font-size: clamp(18px, 1.5vw, 20px); text-wrap: pretty; }

/* ── Chunked text: one sentence per line, as in the app ───── */

.chunked { display: grid; gap: 8px; }
.chunked .s {
  display: block;
  position: relative;
  padding-left: 18px;
  text-indent: -18px;
}
/* Wrapped lines of a sentence hang from a tree connector. */
.chunked .s::before {
  content: '';
  position: absolute;
  left: 5px;
  width: 8px;
  top: 1.55em;
  top: 1lh;
  bottom: 0.78em;
  bottom: 0.5lh;
  background:
    linear-gradient(var(--rule-strong), var(--rule-strong)) left top / 1px 100% no-repeat,
    linear-gradient(var(--rule-strong), var(--rule-strong)) left bottom / 100% 1px no-repeat;
}

/* ── Marked terms and their previews ──────────────────────── */

/* The app's unexplored terms (.ref-chip.unexplored) and term preview
 * (.relation-hover-preview.is-explanation), without the click icon. */
.term {
  border-radius: 2px;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--overlay1);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: text-decoration-color 0.1s;
}
.term:hover, .term[aria-describedby] { text-decoration-color: var(--text); }
.term:focus-visible { outline: 2px solid var(--overlay1); outline-offset: 2px; border-radius: 2px; }

.term-preview {
  position: fixed;
  z-index: 75;
  left: 0;
  top: 0;
  width: min(400px, calc(100vw - 16px));
  padding: 6px 8px;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--surface-shadow);
  color: var(--text);
  text-align: left;
  pointer-events: none;
}
.term-preview[hidden] { display: none; }
.term-preview-copy {
  font: 400 14px/1.35 var(--font);
  overflow-wrap: anywhere;
}
.term-preview-copy strong { font-weight: 700; }

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

/* The recordings show the app's interface at reduced size; the wider section
 * and media column keep its text legible. */
#features { --page: 1360px; }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  padding-top: clamp(64px, 9vw, 112px);
}
/* Every second feature mirrors the layout; the media keeps the wide column. */
.feature:nth-of-type(even) { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.feature:nth-of-type(even) .feature-copy { order: 2; }

.feature-copy { display: grid; gap: 18px; align-content: start; }
.feature-copy .chunked { color: var(--muted); }
.feature-copy .chunked strong { color: var(--text); }

/* Recordings and screenshots are drawn as the app's media nodes. */
.media-node {
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.media-node-head {
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1px solid var(--ui-line);
}
.media-node-body {
  position: relative;
  aspect-ratio: 16 / 10;
  background-color: var(--field);
  background-image: radial-gradient(circle at 4.5px 4.5px, var(--dot) 1px, transparent 1.6px);
  background-size: 9px 9px;
}
.media-node-body picture { display: block; height: 100%; }
.media-node-body img,
.media-node-body video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Until it has a frame, a video shows nothing and its poster shows through. */
.media-node-body video {
  position: absolute;
  inset: 0;
}
/* The app's node footer (.node-footer) with its type tags (.node-tag). */
.media-node-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 8px 8px 12px;
  border-top: 1px solid var(--ui-line);
  color: var(--overlay1);
  font: 400 11px/1.5 var(--mono);
}
.node-tag,
.media-toggle {
  padding: 1px 5px;
  border-radius: 3px;
  background: color-mix(in oklab, var(--aura) var(--tag-fill), transparent);
  outline: 1px solid color-mix(in oklab, var(--aura) var(--tag-edge), transparent);
  outline-offset: -1px;
  color: var(--subtext0);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
}
/* Added by landing.js in place of the browser's video controls: a tag that
 * is a button, as the app's node type tag (.node-tag-btn) is. */
.media-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  border: 0;
  font: inherit;
  cursor: var(--cur-click);
  transition: opacity 0.12s ease;
}
.media-toggle:is(:hover, :focus-visible) { opacity: 1; }
.media-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
/* A larger target than the tag itself, for touch screens. */
.media-toggle::after {
  content: "";
  position: absolute;
  inset: -8px -6px;
}
.media-toggle::before {
  content: "";
  width: 7px;
  height: 8px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.media-toggle[data-state="playing"]::before {
  box-sizing: border-box;
  border-inline: 2px solid currentColor;
  background: none;
  clip-path: none;
}

/* ── Other functions ──────────────────────────────────────── */

.also {
  list-style: none;
  padding: 0;
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 0 40px;
}
.also li {
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 17px;
}
.also li strong { display: block; color: var(--text); }
.cost-exceptions { margin-top: 32px; }
.cost-exceptions .also { margin-top: 14px; }

/* ── Privacy ──────────────────────────────────────────────── */

.privacy {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}
.privacy .chunked { color: var(--muted); }
.privacy .chunked strong { color: var(--text); }
.privacy-copy { display: grid; gap: 18px; }

/* A small canvas: the browser node with arrows to the services it calls. */
.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1.25fr);
  grid-template-rows: repeat(3, auto);
  gap: 14px 0;
  align-items: center;
}
.flow-node {
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.4;
}
.flow-node b { display: block; font-size: 16px; margin-bottom: 2px; }
.flow-node span { color: var(--muted); }
/* The browser node fills the height of the three services it connects to;
 * what it holds is listed as rows across its width. */
.flow-source {
  grid-column: 1;
  grid-row: 1 / span 3;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 18px 14px;
  border-color: var(--aura);
  text-align: center;
}
.flow-node.flow-source b { margin: 0; font-size: 20px; }
.flow-source ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
  color: var(--text);
  font-size: 16px;
}
.flow-source li {
  padding: 12px 10px;
  border-radius: 6px;
  background: color-mix(in oklab, var(--aura) 12%, transparent);
}
.flow-arrow {
  grid-column: 2;
  position: relative;
  height: 2px;
  margin: 0 6px 0 0;
  background: var(--arrow);
}
.flow-arrow::after {
  content: '';
  position: absolute;
  right: -6px;
  top: -5px;
  border: 6px solid transparent;
  border-right: 0;
  border-left: 8px solid var(--arrow);
}
.flow-arrow:nth-of-type(1) { grid-row: 1; }
.flow-arrow:nth-of-type(2) { grid-row: 2; }
.flow-arrow:nth-of-type(3) { grid-row: 3; }
.flow-target { grid-column: 3; }
.flow-target.t1 { grid-row: 1; }
.flow-target.t2 { grid-row: 2; }
.flow-target.t3 { grid-row: 3; }
.flow-none {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding: 10px 14px;
  border: 1px dashed var(--rule-strong);
  border-radius: 10px;
  color: var(--faint);
  font-size: 15px;
  text-align: center;
}

/* ── Get started ──────────────────────────────────────────── */

.steps {
  list-style: none;
  padding: 0;
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  color: var(--muted);
  font-size: 17px;
}
.steps li::before {
  content: counter(step);
  color: var(--aura);
  font: 400 16px/1 var(--pixel);
}
.steps li strong { color: var(--text); }
.steps + .fine { margin-top: 16px; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 72px);
  margin-top: 64px;
  align-items: start;
}
.split > div { display: grid; gap: 16px; align-content: start; }
.split p { color: var(--muted); }
.split p strong { color: var(--text); }

.roles {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}
.roles th, .roles td {
  padding: 12px 12px 12px 0;
  border-top: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.roles th { width: 38%; font-weight: 700; }
.roles td { color: var(--muted); }

/* ── License, footer ──────────────────────────────────────── */

.project-info { margin-top: 0; }
.project-info > section {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 16px;
}

.foot {
  max-width: var(--page);
  margin: clamp(96px, 12vw, 160px) auto 0;
  padding: 32px var(--gutter) 48px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  color: var(--faint);
  font-size: 15px;
}
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-left: auto; }
.foot nav a { color: var(--muted); text-decoration: none; }
.foot nav a:hover { color: var(--text); text-decoration: underline; }

/* ── Legal pages ──────────────────────────────────────────── */

.doc {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 88px) var(--gutter) 0;
}
.doc h1 { font-size: clamp(34px, 5vw, 48px); line-height: 1.1; letter-spacing: -0.015em; }
.doc h2 { font-size: 24px; margin-top: 48px; }
.doc h3 { font-size: 19px; margin-top: 28px; }
.doc p, .doc ul, .doc dl { margin-top: 14px; }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 6px; }
.doc .updated { color: var(--faint); font-size: 15px; margin-top: 12px; }
.doc .missing {
  padding: 12px 16px;
  border: 1px dashed var(--peach);
  border-radius: 8px;
  color: var(--muted);
}
.doc address { margin-top: 14px; font-style: normal; }
.doc dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; }
.doc dt { font-weight: 700; }
.doc dd { margin: 0; color: var(--muted); }

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

@media (max-width: 900px) {
  .feature, .feature:nth-of-type(even), .privacy, .split { grid-template-columns: minmax(0, 1fr); }
  .feature:nth-of-type(even) .feature-copy { order: 0; }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  .top:has(.app-entry) { gap: 8px; }
  .top .app-entry { padding-inline: 8px; }
  .top .wordmark { gap: 2px; font-size: 20px; }
  .hero { text-align: left; }
  .hero-copy { align-items: flex-start; padding: 24px 18px; }
  .demo-caption { padding: 12px 14px; }
  .section-head.center { margin: 0; text-align: left; justify-items: start; }
  .hero .actions { justify-content: flex-start; }
  .actions .button { flex: 1 1 auto; }
  /* The services stack below the browser; one trunk from the browser
   * branches into each of them. */
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow-source { grid-row: auto; }
  .flow-arrow { display: none; }
  .flow-target {
    position: relative;
    grid-column: 1;
    grid-row: auto !important;
    margin-left: 40px;
  }
  .flow-target::before {
    content: '';
    position: absolute;
    top: -16px;
    bottom: -16px;
    left: -27px;
    width: 2px;
    background: var(--arrow);
  }
  .flow-target.t3::before { bottom: calc(50% - 1px); }
  .flow-target::after {
    content: '';
    position: absolute;
    top: calc(50% - 6px);
    left: -27px;
    width: 26px;
    height: 12px;
    background: var(--arrow);
    clip-path: polygon(0 5px, calc(100% - 8px) 5px, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, calc(100% - 8px) 7px, 0 7px);
  }
  .foot nav { margin-left: 0; }
}

@media (max-width: 359px) {
  .top { gap: 12px; }
  .top .wordmark { gap: 1px; font-size: 16px; }
}

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