/* Tokens from docs/design-system.md §2. Components use tokens only. */
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #faf6f0;
  --surface: #fffdf9;
  --text: #3d352e;
  --text-muted: #6e6259;
  --primary: #d97b66;
  --primary-strong: #c04a30;
  --secondary: #8aa899;
  --secondary-strong: #597768;
  --accent: #d8c3a5;
  --border: #af874c;
  --on-strong: #ffffff;
  --shadow: rgb(61 53 46 / 8%);
  --shadow-lg: rgb(61 53 46 / 22%);
  --frame: #3d352e;
  --veil: rgb(250 246 240 / 80%);
  --photo-dim: 1;
  --gap: 16px;
  --section: 64px;
  --display: "Fraunces", Georgia, serif;
  --sans: "Plus Jakarta Sans", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2a241f;
    --surface: #352e28;
    --text: #faf6f0;
    --text-muted: #c9bbaa;
    --primary: #e8907b;
    --primary-strong: #e8907b;
    --secondary: #9dbbac;
    --secondary-strong: #9dbbac;
    --accent: #5a4d40;
    --border: #9c8770;
    --on-strong: #2a241f;
    --shadow: rgb(0 0 0 / 25%);
    --shadow-lg: rgb(0 0 0 / 55%);
    --frame: #120f0d;
    --veil: rgb(42 36 31 / 86%);
    --photo-dim: 0.8;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.5 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--primary-strong); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--border); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 16px; }

h1, h2 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.25rem, 1.4rem + 4vw, 3.5rem); line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.375rem); margin-top: 1.6em; text-wrap: balance; }
h3 { font-size: 1.0625rem; margin: 1.4em 0 0.3em; }
p, li { max-width: 38rem; }
.lead { font-size: 1.1875rem; line-height: 1.55; color: var(--text-muted); }

/* Header */
.site-head { padding: 20px 0; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 1.3125rem var(--display); color: var(--text); text-decoration: none;
}
.brand img { width: 36px; height: 36px; border-radius: 10px; }

/* Two-wave motif: the one memorable element (design-system §1) */
.waves { width: 180px; height: auto; margin: 4px 0 20px; }
.waves path { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.waves .w1 { stroke: var(--primary); }
.waves .w2 { stroke: var(--secondary); }

/* Buttons: pill radius, primary = primary-strong (design-system §4) */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px; border-radius: 999px;
  font: 700 1rem var(--sans); text-decoration: none;
}
.btn-primary { background: var(--primary-strong); color: var(--on-strong); }
.btn-secondary { border: 2px solid var(--border); color: var(--text); }
.note { font-size: 0.875rem; color: var(--text-muted); }

/* Landing hero: linen photo from the app, real screenshot in a phone frame */
.hero { display: grid; gap: 40px; padding-block: 8px 56px; align-items: center; }
.hero-visual { position: relative; padding-bottom: 32px; }
.hero-photo { border-radius: 28px; overflow: hidden; box-shadow: 0 12px 32px var(--shadow); aspect-ratio: 1 / 1; background: var(--accent); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; filter: brightness(var(--photo-dim)); }
.phone { margin: 0; border: 6px solid var(--frame); border-radius: 32px; background: var(--frame); overflow: hidden; box-shadow: 0 20px 44px var(--shadow-lg); }
.phone img { width: 100%; height: auto; border-radius: 26px; }
.hero-phone { position: absolute; right: 16px; bottom: 0; width: 40%; max-width: 190px; }
@media (min-width: 52rem) {
  .hero { grid-template-columns: 1.05fr 0.95fr; gap: 72px; padding-block: 32px 96px; }
  .hero-phone { right: auto; left: -9%; bottom: 0; width: 42%; max-width: 220px; }
}

/* Sections share one rhythm: 64px on phones, 96px from tablet up */
.how, .showcase, .features, .faq, .download { padding-block: var(--section); }
.showcase { max-width: none; padding-inline: 0; background: linear-gradient(var(--veil), var(--veil)), url("/img/linen-900.webp") center / cover; }
.showcase > .inner { max-width: 68rem; margin: 0 auto; padding: 0 16px; }
.showcase h2, .how h2, .features h2, .faq h2, .download h2 { margin-top: 0; }
.shots { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 32px; }
.shots li { max-width: none; display: grid; grid-template-columns: 44% 1fr; gap: 20px; align-items: center; }
.shots .phone { max-width: 220px; }
.shots figcaption { color: var(--text); }
.shots strong { display: block; font: 600 1.3125rem/1.2 var(--display); margin-bottom: 4px; }
.shots span { color: var(--text-muted); }
@media (min-width: 52rem) {
  .shots { grid-template-columns: repeat(3, 1fr); gap: 56px; margin-top: 56px; }
  .shots li { grid-template-columns: 1fr; gap: 24px; justify-items: start; }
  .shots li:nth-child(2) { margin-top: 48px; }
  .shots .phone { width: 100%; max-width: 250px; }
}

.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 28px; }
.steps li { display: grid; grid-template-columns: 2.75rem 1fr; gap: 12px; align-items: start; max-width: none; }
.steps .n { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--primary-strong); color: var(--on-strong); font: 600 1.375rem/1 var(--display); }
.steps p { margin: 0; }
.steps strong { display: block; font: 600 1.3125rem/1.25 var(--display); margin-bottom: 4px; }
.steps span { color: var(--text-muted); }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(3, 1fr); gap: 40px; } }

/* Join page */
.join { padding-block: 16px 56px; max-width: 34rem; }
.code-card {
  background: var(--surface); border-radius: 28px; box-shadow: 0 12px 32px var(--shadow);
  padding: 24px 20px; margin: 20px 0 8px;
}
.code-card p { margin: 0; color: var(--text-muted); }
.code-card .code {
  color: var(--text);
  font: 600 clamp(2.5rem, 13vw, 3.5rem)/1.1 var(--display);
  letter-spacing: 0.12em; margin: 8px 0 0; word-break: break-all;
}
[hidden] { display: none !important; }

/* Legal pages */
.legal { padding-block: 8px 56px; }
.legal ul { padding-left: 1.2em; }
.draft {
  border: 2px solid var(--primary-strong); border-radius: 12px; padding: 12px 16px;
  margin: 0 0 24px; max-width: 38rem; font-weight: 700;
}
.draft span { display: block; font-weight: 400; color: var(--text-muted); }

/* Footer */
.site-foot { border-top: 1px solid var(--accent); padding: 12px 0 20px; font-size: 0.9375rem; }
.site-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 24px; }
.site-foot a { color: var(--text); display: inline-flex; align-items: center; min-height: 44px; }

/* Landing page */
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary-strong); color: var(--on-strong); padding: 12px 20px; border-radius: 999px; z-index: 10; }
.skip:focus { left: 16px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 0 24px; flex-wrap: wrap; }
.site-head { padding: 12px 0; }
.brand { min-height: 44px; }
.topnav { display: flex; flex-wrap: wrap; gap: 0 20px; font-size: 0.9375rem; }
.topnav a { color: var(--text); text-decoration: none; padding: 12px 2px; min-height: 44px; display: inline-flex; align-items: center; }
.topnav a:hover { text-decoration: underline; }
section[id] { scroll-margin-top: 8px; }
.answer { padding-block: var(--section) 0; }
.answer h2 { margin-top: 0; }
.answer p { font-size: 1.1875rem; line-height: 1.6; max-width: 42rem; }
.sub { margin: -0.2em 0 0; color: var(--text-muted); font-size: 1.1875rem; }

/* Features: ruled rows instead of a grid of identical cards */
.features-list { margin-top: 32px; border-bottom: 1px solid var(--accent); }
.feat { display: grid; gap: 8px; padding: 24px 0; border-top: 1px solid var(--accent); }
.feat h3 { font: 600 1.3125rem/1.25 var(--display); margin: 0; }
.feat p { margin: 0; color: var(--text-muted); max-width: 40rem; }
@media (min-width: 52rem) { .feat { grid-template-columns: 1fr 1.6fr; gap: 48px; padding: 32px 0; } }

.privacy { background: var(--surface); border-radius: 28px; padding: 8px 24px 24px; margin-block: 0; border: 1px solid var(--secondary-strong); box-shadow: 0 12px 32px var(--shadow); }
.privacy h2 { margin-top: 0.8em; }
.privacy p { color: var(--text-muted); }
.faq details { border-bottom: 1px solid var(--accent); max-width: 44rem; }
.faq summary { cursor: pointer; min-height: 44px; padding: 14px 32px 14px 0; font-weight: 700; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font: 400 1.5rem/1 var(--sans); color: var(--primary-strong); }
.faq details[open] summary::after { content: "2"; }
.faq summary:hover { color: var(--primary-strong); }
.faq details p { margin: 0 0 16px; color: var(--text-muted); }
.download { text-align: center; }
.download .waves { display: block; margin: 0 auto 16px; }
.download p { max-width: 42ch; margin-inline: auto; }
.download .actions { justify-content: center; }
.btn { transition: filter 0.15s; }
.btn:hover { filter: brightness(1.08); }
.btn-primary:active { filter: brightness(0.94); }
@media (min-width: 52rem) { :root { --section: 96px; } }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* Shared by the landing teaser and the name pages (names.css) */
.chips { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { max-width: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 14px;
  justify-content: center; border: 2px solid var(--accent); border-radius: 999px; background: var(--surface);
  color: var(--text); font: 700 1rem var(--sans); text-decoration: none;
}
.chip small { font: 400 0.75rem var(--sans); color: var(--text-muted); }
.chip:hover { border-color: var(--border); }
.chip[aria-current="page"] { background: var(--primary-strong); border-color: var(--primary-strong); color: var(--on-strong); }
.chip[aria-current="page"] small { color: inherit; }
.teaser { padding-block: var(--section) 0; }
.teaser h2 { margin-top: 0; }
.teaser p { font-size: 1.1875rem; line-height: 1.6; max-width: 42rem; }

/* Name teaser: linked cards with a real meaning snippet */
.namepick { padding-block: 0 var(--section); }
.namepick h2 { margin-top: 0; }
.namecards { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 12px; }
.namecards li { max-width: none; }
.namecard {
  display: block; height: 100%; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; color: var(--text); text-decoration: none;
}
.namecard strong { display: block; font: 600 1.5rem/1.2 var(--display); }
.namecard span { display: block; margin-top: 4px; color: var(--text-muted); }
.namecard:hover { border-color: var(--primary-strong); }
.namecard:hover strong { color: var(--primary-strong); }
@media (min-width: 40rem) { .namecards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .namecards { grid-template-columns: repeat(5, 1fr); } }

/* Friends download page (/dl/<token>/): install guide screenshots */
.install-steps { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 1.5rem; }
.install-steps li { display: grid; gap: .75rem; }
.install-steps img { width: 100%; max-width: 320px; height: auto; border-radius: 24px; border: 1px solid var(--line, #d9cfc2); }
@media (min-width: 52rem) { .install-steps { grid-template-columns: repeat(3, 1fr); } }

/* Landing: swipe screenshots row, "soon" and "planned" markers */
.shots-h { margin: 64px 0 0; font: 600 1.5rem/1.2 var(--display); }
.shots-more { margin-top: 24px; }
.tag { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 12px; border: 2px solid var(--secondary-strong); border-radius: 999px; color: var(--secondary-strong); font: 700 0.875rem/1.5 var(--sans); }
.soon { padding-block: var(--section) 0; }
.pricing { padding-block: var(--section) 32px; }
.soon h2 { margin-top: 0; }
.soon p { font-size: 1.1875rem; line-height: 1.6; max-width: 42rem; }
.soon-list { font-size: 1.1875rem; margin: 0 0 16px; padding-left: 1.25rem; max-width: 42rem; line-height: 1.6; }
.soon-list li { margin-bottom: 4px; max-width: none; }
