/* tavihost.com: one stylesheet for every page.
   The tokens are the app's (TaviTheme.swift, v4): quiet near-monochrome in both
   themes, amber for "needs you" and for the encrypted session, nothing else loud. */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --surface: #f5f5f7;
  --raised: #ffffff;
  --fill: #eaeaee;
  --separator: #e3e3e8;
  --card-border: #ececf0;
  --control-line: #d1d1d6;

  --fg: #0b0b0d;
  --fg2: #55555d;
  --fg3: #6e6e76;

  --primary: #0b0b0d;
  --on-primary: #ffffff;

  --amber: #e8a93c;
  /* The diagram's session line: amber dark enough for 3:1 on white. */
  --amber-stroke: #bf8020;
  --amber-ink: #935600;
  --amber-soft: #fff5e3;
  --amber-line: #f1d9ae;
  --green: #1fa374;
  --green-ink: #11704e;
  --blue-ink: #1a5fd0;
  --red-ink: #bf2429;

  --term-bg: #fafafb;
  --term-fg: #1c1c20;
  --term-dim: #6a6a72;
  --diff-add: rgba(31, 163, 116, 0.1);
  --diff-remove: rgba(229, 72, 77, 0.09);

  --bar: rgba(255, 255, 255, 0.86);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.05), 0 24px 60px rgba(17, 17, 26, 0.14);
  --bezel: #0b0b0d;
  --bezel-ring: #2b2b30;
  --mark-ring: transparent;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;

  --max: 1160px;
  --gutter: 20px;
  --radius: 18px;
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0b;
    --surface: #141416;
    --raised: #1c1c1f;
    --fill: #26262a;
    --separator: #232326;
    --card-border: #232326;
    --control-line: #3a3a40;

    --fg: #f5f5f7;
    --fg2: #a1a1a8;
    --fg3: #83838b;

    --primary: #f5f5f7;
    --on-primary: #0a0a0b;

    --amber-stroke: #e8a93c;
    --amber-ink: #edb04a;
    --amber-soft: #241c10;
    --amber-line: #4a3a1f;
    --green: #43b98c;
    --green-ink: #52c69a;
    --blue-ink: #76adff;
    --red-ink: #f4847e;

    --term-bg: #000000;
    --term-fg: #e6e6e9;
    --term-dim: #83838b;
    --diff-add: rgba(67, 185, 140, 0.13);
    --diff-remove: rgba(240, 113, 106, 0.13);

    --bar: rgba(10, 10, 11, 0.84);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.4), 0 30px 80px rgba(0, 0, 0, 0.6);
    --bezel: #1c1c1f;
    --bezel-ring: #3a3a40;
    --mark-ring: rgba(255, 255, 255, 0.12);
  }
}

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

/* Line icons: drawn on a 24-unit grid in the current text colour. */
.i {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

p {
  margin: 0;
  text-wrap: pretty;
}

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

a:hover {
  text-decoration-color: currentColor;
}

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

:focus-visible {
  outline: 2px solid var(--amber-ink);
  outline-offset: 3px;
}

::selection {
  background: var(--amber-soft);
  color: var(--fg);
}

.visually-hidden {
  position: absolute !important;
  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: 12px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--separator);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

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

.mark {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 7px;
  box-shadow: 0 0 0 1px var(--mark-ring);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--fg2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--fg);
}

.site-nav .nav-wide {
  display: none;
}

.site-nav .btn {
  margin-left: 6px;
}

@media (min-width: 720px) {
  .site-nav {
    gap: 8px;
  }
  .site-nav .nav-wide {
    display: inline-block;
  }
}

@media (max-width: 380px) {
  .site-nav a {
    padding-inline: 7px;
  }
  .site-nav .btn {
    margin-left: 2px;
  }
}

/* ---------- Buttons and the command ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 16px/1 var(--font);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

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

.btn--primary:hover {
  opacity: 0.88;
}

.btn--secondary {
  background: transparent;
  color: var(--fg);
  border-color: var(--control-line);
}

.btn--secondary:hover {
  border-color: var(--fg3);
}

.btn--small {
  height: 36px;
  padding: 0 16px;
  font-size: 14.5px;
}

.site-nav .btn--small {
  color: var(--on-primary);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.cmd {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  max-width: 100%;
  padding: 0 6px 0 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  font-family: var(--mono);
  font-size: 15px;
}

.cmd__prompt {
  color: var(--fg3);
  user-select: none;
  -webkit-user-select: none;
}

.cmd code {
  flex: 1 1 auto;
  min-width: 0;
  font-size: inherit;
  color: var(--fg);
  white-space: nowrap;
  overflow-x: auto;
  user-select: all;
  -webkit-user-select: all;
  scrollbar-width: none;
}

.copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--fg2);
  font: 500 14px/1 var(--font);
  cursor: pointer;
}

.copy[hidden] {
  display: none;
}

.copy:hover {
  background: var(--fill);
  color: var(--fg);
}

.copy svg {
  width: 16px;
  height: 16px;
}

.copy .icon-done {
  display: none;
}

.copy.is-copied {
  color: var(--green-ink);
}

.copy.is-copied .icon-copy {
  display: none;
}

.copy.is-copied .icon-done {
  display: block;
}

/* ---------- Shared type ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--fg3);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  color: var(--fg2);
  font-size: 13.5px;
  font-weight: 500;
}

.dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--amber);
}

.dot--green {
  background: var(--green);
}

.dot--idle {
  background: var(--fg3);
}

.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--control-line);
  color: var(--fg2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  vertical-align: 2px;
}

.section {
  padding-block: clamp(64px, 8.5vw, 112px);
}

.section--surface {
  background: var(--surface);
}

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

.section--surface + .section {
  border-top: 0;
}

.section__head {
  max-width: 720px;
  margin-bottom: clamp(40px, 6vw, 64px);
}

.section__head h2 {
  font-size: clamp(32px, 4.6vw, 50px);
}

.lead {
  margin-top: 20px;
  color: var(--fg2);
  font-size: clamp(18px, 1.7vw, 20px);
  line-height: 1.5;
}

.more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-decoration: none;
}

.more::after {
  content: "→";
  transition: transform 0.15s ease;
}

.more:hover::after {
  transform: translateX(3px);
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(40px, 7vw, 96px) clamp(56px, 7vw, 96px);
  overflow: hidden;
}

.hero .wrap {
  display: grid;
  gap: 56px;
  align-items: center;
}

.hero__copy {
  max-width: 600px;
}

.hero h1 {
  font-size: clamp(42px, 5.2vw, 72px);
  letter-spacing: -0.036em;
  line-height: 1.03;
}

.hero h1 .soft {
  color: var(--fg3);
}

.hero .lead {
  margin-top: 24px;
  max-width: 540px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
}

.hero__actions .cmd {
  flex: 0 1 auto;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: var(--fg3);
  font-size: 14.5px;
}

.hero__facts li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero__facts svg {
  width: 15px;
  height: 15px;
  color: var(--green-ink);
}

@media (max-width: 599px) {
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero__actions .btn {
    width: 100%;
  }
}

@media (min-width: 1100px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr) 600px;
    gap: 40px;
  }
}

/* The stage: the same session in a terminal on the computer and in Tavi on the phone. */

.stage {
  position: relative;
  width: 100%;
  max-width: 600px;
  height: 600px;
  margin-inline: auto;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 10% -10% 0 10%;
  background: radial-gradient(closest-side, var(--amber-soft), transparent);
  opacity: 0.9;
  pointer-events: none;
}

@media (max-width: 639px) {
  .stage {
    height: auto;
  }
  .stage .term {
    display: none;
  }
  .stage .phone {
    position: relative;
    margin-inline: auto;
  }
}

/* Terminal window */

.term {
  position: absolute;
  left: 0;
  top: 64px;
  width: 470px;
  border-radius: 14px;
  background: var(--term-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}

.term__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--separator);
  background: var(--surface);
}

.term__dots {
  display: flex;
  gap: 7px;
}

.term__dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--control-line);
}

.term__title {
  color: var(--fg3);
  font-size: 12.5px;
  font-weight: 500;
}

.term__body {
  margin: 0;
  padding: 18px 20px 22px;
  color: var(--term-fg);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre;
  overflow: hidden;
}

.t-dim {
  color: var(--term-dim);
}

.t-ok {
  color: var(--green-ink);
}

.t-amber {
  color: var(--amber-ink);
}

.t-add {
  display: inline-block;
  min-width: 100%;
  background: var(--diff-add);
  color: var(--green-ink);
}

.t-rem {
  display: inline-block;
  min-width: 100%;
  background: var(--diff-remove);
  color: var(--red-ink);
}

.t-cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.2em;
  border-radius: 2px;
  background: var(--amber);
}

@media (prefers-reduced-motion: no-preference) {
  .t-cursor {
    animation: blink 1.1s steps(1) infinite;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Phone */

.phone {
  position: absolute;
  right: 0;
  top: 0;
  width: 272px;
  aspect-ratio: 9 / 19.4;
  padding: 9px;
  border-radius: 50px;
  background: var(--bezel);
  box-shadow: 0 0 0 1px var(--bezel-ring), var(--shadow-lift);
}

.phone__screen {
  position: relative;
  height: 100%;
  border-radius: 41px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.phone__island {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 78px;
  height: 23px;
  margin-left: -39px;
  border-radius: 999px;
  background: #000;
}

.phone__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 4px 22px 0 28px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg);
}

.phone__status svg {
  height: 10px;
  width: auto;
  color: var(--fg);
}

.app-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 14px 10px 8px;
  border-bottom: 1px solid var(--separator);
}

.app-head svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--fg2);
}

.app-head__title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.app-head__sub {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--fg3);
  font-size: 10.5px;
  white-space: nowrap;
}

.app-head__sub .dot {
  width: 6px;
  height: 6px;
}

.app-head__sub b {
  color: var(--amber-ink);
  font-weight: 500;
}

.app-term {
  margin: 0;
  padding: 12px 16px 0;
  color: var(--term-dim);
  font-size: 9.6px;
  line-height: 1.75;
  white-space: pre;
  overflow: hidden;
  flex: 1 1 auto;
}

.app-term .hi {
  color: var(--term-fg);
}

.sheet {
  margin: 0 7px 7px;
  padding: 16px 16px 12px;
  border-radius: 30px 30px 34px 34px;
  background: var(--raised);
  border: 1px solid var(--card-border);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08);
}

.sheet__who {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--amber-ink);
  font-size: 11px;
  font-weight: 600;
}

.sheet__who .dot {
  width: 6px;
  height: 6px;
}

.sheet__q {
  margin-top: 6px;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sheet__cmd {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--term-bg);
  border: 1px solid var(--card-border);
  font-family: var(--mono);
  font-size: 10.5px;
}

.sheet__cmd span {
  color: var(--fg3);
}

.sheet__note {
  margin-top: 7px;
  color: var(--fg3);
  font-size: 10px;
}

.sheet__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  margin-top: 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.sheet__btn--primary {
  margin-top: 12px;
  background: var(--primary);
  color: var(--on-primary);
}

.sheet__btn--secondary {
  border: 1px solid var(--control-line);
}

.sheet__btn--plain {
  color: var(--fg2);
  font-weight: 500;
  height: 28px;
}

/* ---------- What it is ---------- */

.pillars {
  display: grid;
  gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 840px) {
  .pillars {
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
  }
}

.pillars li {
  padding-top: 22px;
  border-top: 1px solid var(--separator);
}

.pillars h3,
.step h3,
.tile h3,
.works h3 {
  font-size: 19px;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.pillars p,
.step p,
.tile p,
.works p {
  margin-top: 8px;
  color: var(--fg2);
  font-size: 16px;
  line-height: 1.55;
}

.icon {
  width: 22px;
  height: 22px;
  margin-bottom: 16px;
  color: var(--fg);
}

/* ---------- How it works ---------- */

.steps {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 900px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--raised);
  border: 1px solid var(--card-border);
  overflow: hidden;
}

.step__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 236px;
  padding: 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--card-border);
}

.step__text {
  padding: 24px 24px 28px;
}

.step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-bottom: 14px;
  border-radius: 50%;
  border: 1px solid var(--control-line);
  color: var(--fg2);
  font-size: 13px;
  font-weight: 600;
}

.mini-term {
  width: 100%;
  max-width: 300px;
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--term-bg);
  border: 1px solid var(--card-border);
  color: var(--term-fg);
  font-size: 11.5px;
  line-height: 1.75;
  white-space: pre;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.pairing {
  display: flex;
  align-items: center;
  gap: 18px;
}

.qr {
  width: 118px;
  height: 118px;
  padding: 9px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
}

.qr path {
  fill: #0b0b0d;
}

.fingerprint {
  display: grid;
  gap: 4px;
  color: var(--fg3);
  font-size: 11.5px;
}

.fingerprint code {
  color: var(--fg);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.fingerprint .match {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--green-ink);
  font-weight: 600;
}

.fingerprint .match svg {
  width: 13px;
  height: 13px;
}

.routes {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 260px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.routes li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--raised);
  border: 1px solid var(--card-border);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.routes small {
  margin-left: auto;
  color: var(--fg3);
  font-size: 12px;
  font-weight: 500;
}

/* ---------- Connection and security ---------- */

.net {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 960px) {
  .net {
    grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
    gap: 72px;
  }
}

.net .section__head {
  margin-bottom: 36px;
}

.net__figure {
  margin: 0;
  padding: 28px 20px 22px;
  border-radius: 24px;
  background: var(--raised);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
}

.net__figure svg {
  width: 100%;
  max-width: 440px;
  height: auto;
  margin-inline: auto;
}

.net__figure svg text {
  font-family: var(--font);
}

.d-device {
  fill: none;
  stroke: var(--fg2);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.d-device-fill {
  fill: var(--fg2);
}

.d-stream {
  fill: none;
  stroke: var(--amber-stroke);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.d-box {
  fill: var(--surface);
  stroke: var(--fg3);
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
}

.d-label {
  fill: var(--fg);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.d-sub {
  fill: var(--fg3);
  font-size: 12px;
}

.d-badge {
  fill: var(--amber-soft);
  stroke: var(--amber-line);
}

.d-lock {
  fill: none;
  stroke: var(--amber-ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin: 18px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--separator);
  color: var(--fg2);
  font-size: 13.5px;
  list-style: none;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend .swatch-stream {
  width: 22px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--amber-stroke);
}

.legend .swatch-box {
  width: 16px;
  height: 12px;
  border-radius: 3px;
  border: 1.2px dashed var(--fg3);
}

.route-list {
  display: grid;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 2px 14px;
}

.route-list svg {
  grid-row: span 2;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--fg2);
}

.route-list strong {
  font-size: 17px;
  font-weight: 600;
}

.route-list li > span {
  color: var(--fg2);
  font-size: 16px;
}

.route-list .tag {
  margin-left: 4px;
}

.net__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 36px;
}

/* ---------- Features ---------- */

.bento {
  display: grid;
  gap: 16px;
}

@media (min-width: 720px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1040px) {
  .bento {
    grid-template-columns: repeat(6, 1fr);
  }
  .tile {
    grid-column: span 2;
  }
  .tile--wide {
    grid-column: span 3;
  }
}

.tile {
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
  border-radius: var(--radius);
  background: var(--raised);
  border: 1px solid var(--card-border);
}

.section--surface .tile {
  box-shadow: var(--shadow-soft);
}

@media (min-width: 720px) {
  .tile {
    padding: 28px;
  }
}

/* On a phone the small tiles read as a list: icon beside the words. */
@media (max-width: 719px) {
  .tile:not(.tile--wide) {
    display: grid;
    grid-template-columns: 22px 1fr;
    column-gap: 14px;
    padding: 20px;
  }
  .tile:not(.tile--wide) .icon {
    grid-row: span 2;
    margin: 1px 0 0;
  }
  .tile:not(.tile--wide) p {
    margin-top: 4px;
  }
}

@media (min-width: 720px) and (max-width: 1039px) {
  .tile--wide {
    grid-column: span 2;
  }
}

.tile__visual {
  margin: 28px -4px 0;
  margin-top: auto;
  padding-top: 28px;
}

.tile .tag {
  margin-left: 6px;
}

/* Needs-you card, as on the app's home */

.needs {
  border-radius: 16px;
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  padding: 6px 0;
}

.needs__head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px 4px;
  color: var(--amber-ink);
  font-size: 13px;
  font-weight: 600;
}

.needs__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
}

.needs__row + .needs__row {
  border-top: 1px solid var(--amber-line);
}

.badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--raised);
  border: 1px solid var(--card-border);
  color: var(--fg2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.badge .dot {
  position: absolute;
  right: -1px;
  bottom: 0;
  width: 9px;
  height: 9px;
  box-shadow: 0 0 0 2px var(--amber-soft);
}

.needs__text {
  min-width: 0;
  flex: 1;
}

.needs__title {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.3;
}

.needs__meta {
  margin-top: 2px;
  color: var(--fg2);
  font-size: 12.5px;
}

.chev {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--fg3);
}

/* Computers, as on the app's home */

.machines {
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  margin: 0;
  padding: 0;
  list-style: none;
}

.machines li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.machines li + li {
  border-top: 1px solid var(--separator);
}

.machines svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--fg2);
}

.machines .name {
  flex: 1;
  font-size: 14.5px;
  font-weight: 500;
}

.machines .health {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg3);
  font-size: 12.5px;
}

.machines .health .dot {
  width: 6px;
  height: 6px;
}

.machines .is-asleep .name {
  color: var(--fg3);
}

/* ---------- Works with ---------- */

.works {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 900px) {
  .works {
    grid-template-columns: repeat(3, 1fr);
  }
}

.works li {
  padding: 24px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--raised);
}

.works .tag {
  margin-left: 6px;
}

@media (min-width: 720px) {
  .works li {
    padding: 28px;
  }
}

/* ---------- Pro ---------- */

.pro {
  margin-top: 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  padding: 28px 32px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--card-border);
}

.pro__name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pro p {
  flex: 1 1 380px;
  color: var(--fg2);
}

/* ---------- FAQ ---------- */

.split {
  display: grid;
  gap: 0;
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 64px;
  }
  .split .section__head {
    margin-bottom: 0;
  }
}

.faq {
  border-top: 1px solid var(--separator);
}

.faq details {
  border-bottom: 1px solid var(--separator);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.012em;
  cursor: pointer;
  list-style: none;
}

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

.faq summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-right: 1.8px solid var(--fg3);
  border-bottom: 1.8px solid var(--fg3);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.faq details > div {
  padding: 0 40px 24px 0;
  color: var(--fg2);
}

.faq details > div p + p {
  margin-top: 12px;
}

.faq__more {
  margin-top: 32px;
}

/* ---------- Beta ---------- */

.cta {
  display: grid;
  gap: 40px;
  padding: clamp(28px, 5vw, 64px);
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--card-border);
}

/* The closing panel is ink in both themes, like the app icon. */
.cta--ink {
  color-scheme: dark;
  --surface: #141416;
  --raised: #1c1c1f;
  --fill: #26262a;
  --separator: #2a2a2e;
  --card-border: #2a2a2e;
  --control-line: #3a3a40;
  --fg: #f5f5f7;
  --fg2: #a1a1a8;
  --fg3: #8e8e96;
  --primary: #f5f5f7;
  --on-primary: #0a0a0b;
  --green-ink: #52c69a;
  --amber-ink: #edb04a;
  background: #0b0b0d;
  border-color: #0b0b0d;
  color: var(--fg);
}

@media (prefers-color-scheme: dark) {
  .cta--ink {
    background: #141416;
    border-color: #232326;
    --raised: #0a0a0b;
  }
}

.cta--ink a:not(.btn) {
  text-decoration-color: var(--fg3);
}

.mark--lg {
  width: 56px;
  height: 56px;
  margin-bottom: 28px;
  border-radius: 13px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

@media (min-width: 900px) {
  .cta {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
}

.cta h2 {
  font-size: clamp(32px, 4.4vw, 48px);
}

.cta h3 {
  font-size: 20px;
  letter-spacing: -0.015em;
}

.cta p {
  margin-top: 14px;
  color: var(--fg2);
}

.cta .btn {
  margin-top: 28px;
}

.cta__setup {
  padding-top: 32px;
  border-top: 1px solid var(--separator);
}

@media (min-width: 900px) {
  .cta__setup {
    padding: 0 0 0 64px;
    border-top: 0;
    border-left: 1px solid var(--separator);
  }
}

.cta__setup .cmd {
  margin-top: 20px;
  background: var(--raised);
}

.cta__setup .fine {
  margin-top: 14px;
  color: var(--fg3);
  font-size: 14.5px;
}

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

.site-footer {
  border-top: 1px solid var(--separator);
  padding-block: 48px 40px;
  color: var(--fg2);
  font-size: 15px;
}

.site-footer .wrap {
  display: grid;
  gap: 28px;
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer nav a {
  color: var(--fg2);
  text-decoration: none;
}

.site-footer nav a:hover {
  color: var(--fg);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--separator);
  color: var(--fg3);
  font-size: 13.5px;
}

.site-footer__bottom a {
  color: var(--fg3);
}

/* ---------- Document pages: help, privacy, terms, security ---------- */

.doc-hero {
  padding-block: clamp(48px, 7vw, 88px) clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--separator);
}

.doc-hero h1 {
  font-size: clamp(38px, 5.4vw, 60px);
  letter-spacing: -0.035em;
}

.doc-hero .lead {
  max-width: 680px;
}

.doc-hero .meta {
  margin-top: 20px;
  color: var(--fg3);
  font-size: 14.5px;
}

.doc {
  display: grid;
  gap: 40px;
  padding-block: 48px clamp(80px, 10vw, 120px);
}

@media (min-width: 960px) {
  .doc {
    grid-template-columns: 220px minmax(0, 720px);
    gap: 72px;
    padding-top: 56px;
  }
}

.toc {
  align-self: start;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  font-size: 14.5px;
}

.toc h2 {
  margin-bottom: 10px;
  color: var(--fg3);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.toc ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
  padding: 5px 0;
  color: var(--fg2);
  text-decoration: none;
  line-height: 1.35;
}

.toc a:hover {
  color: var(--fg);
}

@media (min-width: 960px) {
  .toc {
    position: sticky;
    top: calc(var(--header-h) + 32px);
    padding: 0;
    background: none;
    border: 0;
  }
}

@media (max-width: 959px) {
  .toc ol {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0 16px;
  }
}

.prose {
  min-width: 0;
  font-size: 17px;
  line-height: 1.65;
}

.prose > section + section {
  margin-top: 56px;
}

.prose h2 {
  margin-bottom: 16px;
  font-size: clamp(24px, 2.6vw, 28px);
  letter-spacing: -0.022em;
  line-height: 1.2;
}

.prose h3 {
  margin: 32px 0 10px;
  font-size: 19px;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.prose p,
.prose ul,
.prose ol,
.prose dl,
.prose pre,
.prose .note,
.prose .table {
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

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

.prose li::marker {
  color: var(--fg3);
}

.prose :not(pre) > code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  font-size: 0.86em;
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.prose .net__figure {
  margin: 8px 0 20px;
}

.prose pre {
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--term-bg);
  border: 1px solid var(--card-border);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: auto;
}

.prose .dim {
  color: var(--fg3);
}

.prose .cmd {
  margin: 12px 0 16px;
}

.prose .cmd code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
}

.note {
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  color: var(--fg2);
  font-size: 16px;
}

.note strong {
  color: var(--fg);
}

.note--amber {
  background: var(--amber-soft);
  border-color: var(--amber-line);
}

.summary {
  display: grid;
  gap: 12px;
  margin: 0 0 8px;
  padding: 24px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  list-style: none;
}

.summary li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  margin: 0;
}

.summary li + li {
  margin: 0;
}

.summary svg {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  color: var(--green-ink);
}

/* A two-column list of commands or facts that stacks on a phone. */

.defs {
  display: grid;
  border-top: 1px solid var(--separator);
}

.defs > div {
  display: grid;
  gap: 4px 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--separator);
}

@media (min-width: 640px) {
  .defs > div {
    grid-template-columns: minmax(180px, 38%) 1fr;
  }
}

.defs dt {
  font-weight: 600;
}

.defs dt code {
  font-weight: 500;
}

.defs dd {
  margin: 0;
  color: var(--fg2);
}

.sees {
  display: grid;
  gap: 16px;
  margin: 0 0 16px;
}

@media (min-width: 640px) {
  .sees {
    grid-template-columns: 1fr 1fr;
  }
}

.sees > div {
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--raised);
}

.sees h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 16px;
}

.sees h3 svg {
  width: 18px;
  height: 18px;
}

.sees .no svg {
  color: var(--green-ink);
}

.sees .yes svg {
  color: var(--fg2);
}

.sees ul {
  margin: 0;
  padding-left: 18px;
  color: var(--fg2);
  font-size: 15.5px;
}

.sees li + li {
  margin-top: 6px;
}

.prose a {
  text-decoration-color: var(--fg3);
}

/* ---------- 404 ---------- */

.lost {
  display: grid;
  place-items: center;
  min-height: 60vh;
  padding-block: 96px;
  text-align: center;
}

.lost .mini-term {
  margin: 0 auto 36px;
  text-align: left;
}

.lost h1 {
  font-size: clamp(34px, 5vw, 52px);
}

.lost p {
  max-width: 460px;
  margin: 16px auto 0;
  color: var(--fg2);
}

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

/* ---------- Motion ---------- */

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