/* Side by Side companion site.
   Colours come from docs/brand/README.md. Shapes: buttons and chips are pills,
   everything else uses --radius. Light and dark follow the system setting. */

/* DM Sans, self-hosted: one variable file covers weights 400 to 600.
   Licence: assets/fonts/OFL.txt */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("assets/fonts/dm-sans-latin.woff2") format("woff2");
}

:root {
  --paper: #f7f8f5;
  --surface: #eef0ea;
  --ink: #1d211b;
  --muted: #565d52;
  --line: #d9ddd3;
  --sage: #4d6b35;
  --sage-ink: #ffffff;
  --gold: #b78335;
  --coral: #9b4a3c;

  --yes-bg: rgb(77 107 53 / 0.14);
  --yes-fg: #3b5528;
  --some-bg: rgb(183 131 53 / 0.18);
  --some-fg: #6f4c18;
  --part-fg: #7a5520;
  --no-bg: rgb(155 74 60 / 0.13);
  --no-fg: #86392c;

  --radius: 14px;
  --wrap: 1120px;
  --gutter: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141712;
    --surface: #1c2019;
    --ink: #eceee8;
    --muted: #a6ad9f;
    --line: #2f352b;
    --sage: #a9c98a;
    --sage-ink: #141712;
    --gold: #d9b26a;
    --coral: #e59a8b;

    --yes-bg: rgb(169 201 138 / 0.16);
    --yes-fg: #bcd8a0;
    --some-bg: rgb(217 178 106 / 0.18);
    --some-fg: #e6c587;
    --part-fg: #e0bd7c;
    --no-bg: rgb(229 154 139 / 0.16);
    --no-fg: #efb2a5;
  }
}

/* Base */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; font-weight: 600; }
h2 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); }
h3 { font-size: 1.1875rem; letter-spacing: -0.01em; }
p { margin: 0; }

a { color: var(--sage); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 32px; } }

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

.skip {
  position: absolute; left: var(--gutter); top: -100px;
  background: var(--sage); color: var(--sage-ink); padding: 8px 14px; border-radius: 999px;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* The two halves, used in the wordmark and the hero */

.half-a { fill: var(--sage); }
.half-b { fill: var(--gold); }

/* Header */

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }

.wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -0.01em;
}
.wordmark .mark { width: 28px; height: 28px; }

.site-header nav { display: flex; gap: 20px; font-size: 0.9375rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--ink); }
@media (max-width: 479px) { .site-header nav a[href="#made"] { display: none; } }

/* Buttons */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s;
}
.button:active { transform: scale(0.98); }
.button.primary { background: var(--sage); color: var(--sage-ink); }
.button.secondary { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.button.secondary:hover { box-shadow: inset 0 0 0 1.5px var(--muted); }

/* Hero */

.hero {
  display: grid; gap: 32px; align-items: center;
  padding-block: 48px 64px;
}
.hero h1 { font-size: clamp(2.5rem, 1.6rem + 4vw, 4.25rem); letter-spacing: -0.035em; max-width: 12ch; }
.lede { margin-top: 20px; font-size: 1.25rem; color: var(--muted); max-width: 34ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero-visual { display: grid; place-items: center; }
.halves { width: min(100%, 360px); height: auto; overflow: visible; }

@media (min-width: 768px) {
  .hero { grid-template-columns: 1.35fr 1fr; padding-block: 80px 96px; }
}
@media (max-width: 767px) {
  .hero-visual { order: -1; justify-content: start; }
  .halves { width: 120px; margin-left: -18px; }
}

@media (prefers-reduced-motion: no-preference) {
  .halves .half-a { animation: part-a 1.1s var(--ease) 0.2s both; }
  .halves .half-b { animation: part-b 1.1s var(--ease) 0.2s both; }
  @keyframes part-a { from { transform: translateX(3px); } }
  @keyframes part-b { from { transform: translateX(-3px); } }
}

/* The question */

.question { padding-block: 64px; border-top: 1px solid var(--line); }
.intro { margin-top: 12px; color: var(--muted); max-width: 60ch; font-size: 1.125rem; }

.options { display: grid; gap: 16px; margin-top: 32px; }
@media (min-width: 768px) { .options { grid-template-columns: 1fr 1fr; gap: 24px; } }

.option {
  padding: 28px 28px 28px 32px; border-radius: var(--radius);
  background: var(--surface); position: relative; overflow: hidden;
}
.option::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; }
.option-a::before { background: var(--sage); }
.option-b::before { background: var(--gold); }
.option p { margin-top: 8px; color: var(--muted); }

.aside { margin-top: 24px; color: var(--muted); max-width: 60ch; }

/* Statement */

.statement { background: var(--surface); padding-block: 80px; }
.statement h2 { font-size: clamp(2rem, 1.2rem + 3.6vw, 3.5rem); letter-spacing: -0.035em; max-width: 22ch; text-wrap: balance; }
.statement-body { margin-top: 24px; display: grid; gap: 16px; max-width: 58ch; font-size: 1.125rem; }

/* Where the differences are */

.where { padding-block: 80px; }
.where-grid { display: grid; gap: 48px; margin-top: 40px; }
@media (min-width: 900px) { .where-grid { grid-template-columns: 1.2fr 1fr; gap: 64px; } }

.sub { color: var(--muted); margin-top: 4px; }

.feel-list { margin: 24px 0 0; }
.feel-list dt { font-weight: 600; margin-top: 20px; }
.feel-list dt:first-child { margin-top: 0; }
.feel-list dd { margin: 4px 0 0; color: var(--muted); max-width: 56ch; }

.can-do { display: grid; gap: 16px; align-content: start; }
.can-do h3 { margin-bottom: 4px; }
.can-do p { color: var(--muted); }
.pull {
  margin-top: 8px; padding-left: 20px; border-left: 3px solid var(--gold);
  color: var(--ink) !important; font-size: 1.25rem; line-height: 1.45; font-weight: 500;
}

/* Try it */

.try { padding-block: 0 16px; }
.try-inner {
  display: grid; gap: 20px; align-items: center;
  padding-block: 32px; border-block: 1px solid var(--line);
}
.try-inner p { margin-top: 8px; color: var(--muted); max-width: 56ch; }
.soon {
  justify-self: start; padding: 10px 18px; border-radius: 999px;
  background: var(--surface); color: var(--muted) !important; font-weight: 500; white-space: nowrap;
}
@media (min-width: 768px) {
  .try-inner { grid-template-columns: 1fr auto; }
  .soon { justify-self: end; margin-top: 0 !important; }
}

/* Differences */

.differences { padding-block: 64px 80px; }

/* Key: what each status means */
.key {
  display: grid; grid-template-columns: max-content 1fr; gap: 12px 16px; align-items: baseline;
  margin: 28px 0 0; max-width: 720px;
}
.key > div { display: contents; }
.key dt { margin: 0; }
.key dd { margin: 0; color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }

.chip {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: 0.875rem; font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.chip.yes { background: var(--yes-bg); color: var(--yes-fg); }
.chip.native { background: var(--some-bg); color: var(--some-fg); }
.chip.part { box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); }
.chip.no { background: var(--no-bg); color: var(--no-fg); }

/* What "with native code" means */
.explain {
  margin-top: 32px; padding: 28px; border-radius: var(--radius);
  background: var(--surface); max-width: 920px;
  display: grid; gap: 12px;
}
.explain p { color: var(--muted); max-width: 64ch; }
.explain-point { color: var(--ink) !important; font-weight: 500; }

.flow {
  list-style: none; margin: 8px 0; padding: 0;
  display: grid; gap: 28px;
}
.flow li {
  position: relative; display: grid; gap: 4px;
  padding: 14px 16px; border-radius: 10px; background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
}
.flow li span { color: var(--muted); font-size: 0.9375rem; line-height: 1.45; }
.flow li:nth-child(3) { box-shadow: inset 0 0 0 1.5px var(--gold); }
.flow li:not(:last-child)::after {
  content: "\2193"; position: absolute; left: 50%; bottom: -24px; transform: translateX(-50%);
  color: var(--muted); font-size: 1rem; line-height: 20px;
}
@media (min-width: 900px) {
  .flow { grid-template-columns: repeat(4, 1fr); gap: 28px; }
  .flow li:not(:last-child)::after {
    content: "\2192"; left: auto; right: -21px; bottom: auto; top: 50%; transform: translateY(-50%);
  }
}

/* Table controls */
.table-controls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 24px; margin-top: 36px;
}
.table-controls .col-filter { margin-top: 0; }

.switch {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 0.9375rem; font-weight: 500; color: var(--ink);
}
.switch::before {
  content: ""; flex: none; width: 36px; height: 22px; border-radius: 999px;
  background-color: var(--line);
  background-image: radial-gradient(circle at 11px 50%, var(--paper) 7px, transparent 7.5px);
  transition: background-color 0.2s, background-position 0.25s var(--ease);
  background-repeat: no-repeat; background-position: 0 0;
}
.switch[aria-pressed="true"]::before { background-color: var(--sage); background-position: 14px 0; }
@media (prefers-reduced-motion: reduce) { .switch::before { transition: none; } }

.compare tr.first, .compare tr.first > * { border-top: 0 !important; }
.compare tbody[hidden], .compare tr[hidden] { display: none; }

/* Column toggles */
.col-filter {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 36px;
}
.col-filter-label { font-size: 0.9375rem; font-weight: 600; margin-right: 4px; }
.toggle {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px;
  font: inherit; font-size: 0.9375rem; font-weight: 500; cursor: pointer;
  color: var(--muted); background: transparent; box-shadow: inset 0 0 0 1.5px var(--line);
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}
.toggle::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.toggle:hover { color: var(--ink); }
.toggle:active { transform: scale(0.97); }
.toggle[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--muted); }
.toggle-native[aria-pressed="true"]::before { background: var(--sage); box-shadow: none; }
.toggle-wrapper[aria-pressed="true"]::before { background: var(--gold); box-shadow: none; }
.toggle-web[aria-pressed="true"]::before { background: var(--coral); box-shadow: none; }

/* Hidden columns */
.compare.hide-native [data-col="native"],
.compare.hide-wrapper [data-col="wrapper"],
.compare.hide-web [data-col="web"] { display: none; }

.compare[hidden] { display: none; }
.compare-empty { margin-top: 24px; color: var(--muted); padding: 24px; border-radius: var(--radius); background: var(--surface); }

/* Table */
.table-wrap { margin-top: 20px; }
.compare { width: 100%; border-collapse: collapse; }
.compare thead th {
  text-align: left; font-size: 0.875rem; font-weight: 600; color: var(--muted);
  padding: 0 12px 12px; border-bottom: 2px solid var(--line);
  position: sticky; top: 0; background: var(--paper); z-index: 1;
}
.compare thead th:first-child { padding-left: 0; }
.col-name { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.col-name::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; }
.col-native::before { background: var(--sage); }
.col-wrapper::before { background: var(--gold); }
.col-web::before { background: var(--coral); }

.compare th[scope="row"] { text-align: left; font-weight: 500; padding: 12px 12px 12px 0; }
.compare th[scope="row"] small { display: block; font-weight: 400; color: var(--muted); font-size: 0.875rem; }
.compare td { padding: 12px; vertical-align: middle; }
.compare tbody tr:not(.group) + tr:not(.group) > * { border-top: 1px solid var(--line); }

.compare .group th {
  text-align: left; padding: 36px 0 8px; font-size: 1.0625rem; font-weight: 600; color: var(--ink);
}
.compare tbody:first-of-type .group th { padding-top: 20px; }

@media (min-width: 768px) {
  .compare thead th[data-col] { width: 20%; }
}

/* Phones: each row becomes a small block, feature on top, then one line per column */
@media (max-width: 639px) {
  .key { grid-template-columns: 1fr; gap: 4px; }
  .key dd { margin-bottom: 10px; }
  .compare, .compare tbody { display: block; }
  .compare thead { display: none; }
  .compare tr { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0; }
  .compare tbody tr:not(.group) + tr:not(.group) { border-top: 1px solid var(--line); }
  .compare tbody tr:not(.group) + tr:not(.group) > * { border-top: 0; }
  .compare .group { padding: 0; }
  .compare .group th { padding: 28px 0 0; }
  .compare th[scope="row"] { flex: 1 0 100%; padding: 0; }
  .compare td { flex: 1 0 100%; padding: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .compare td::before { content: attr(data-label); font-size: 0.8125rem; color: var(--muted); }
  .compare.hide-native td[data-col="native"],
  .compare.hide-wrapper td[data-col="wrapper"],
  .compare.hide-web td[data-col="web"] { display: none; }
}

.notes { display: grid; gap: 16px; margin-top: 56px; }
@media (min-width: 900px) {
  .notes { grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
}
.note { padding: 24px 28px; border-radius: var(--radius); background: var(--surface); }
.note p { margin-top: 8px; color: var(--muted); }
.notes .note:first-child { box-shadow: inset 0 0 0 1px var(--line); background: transparent; }
.notes .note:first-child h3 { font-size: 1.375rem; }
.notes .note:first-child p { font-size: 1.125rem; }

.sources { margin-top: 40px; color: var(--muted); font-size: 0.9375rem; }
.sources summary { cursor: pointer; font-weight: 600; color: var(--ink); width: fit-content; }
.sources ul { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 6px; }

/* How it was made */

.made { padding-block: 80px 96px; border-top: 1px solid var(--line); }
.made-body { margin-top: 20px; display: grid; gap: 16px; max-width: 58ch; font-size: 1.125rem; }
.made-body .button { justify-self: start; margin-top: 12px; }

/* Footer */

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9375rem; }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding-block: 28px calc(28px + env(safe-area-inset-bottom));
}
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--ink); }

/* Privacy policy and other text pages */

.prose { max-width: calc(68ch + 2 * var(--gutter)); padding-block: 56px 96px; }
.prose h1 { font-size: clamp(2.25rem, 1.6rem + 3vw, 3.25rem); letter-spacing: -0.035em; }
.prose .updated { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; }
.prose .summary { margin-top: 28px; font-size: 1.25rem; line-height: 1.5; }
.prose h2 { font-size: 1.5rem; margin-top: 56px; }
.prose h3 { margin-top: 28px; }
.prose p, .prose ul { margin-top: 12px; }
.prose ul { padding-left: 22px; display: grid; gap: 8px; }
.prose li::marker { color: var(--gold); }
.prose p, .prose li { max-width: 68ch; }
mark.todo { background: var(--some-bg); color: var(--some-fg); padding: 1px 6px; border-radius: 6px; font-weight: 600; }
