/* Page layout and components. Demo animations are in demos.css. */
/* Colours and shapes from the app: THEMES.light in app/src/store/model.ts and
   "Soft shapes" in docs/design-choices.md (rounded, no outlines, depth from
   tone and a soft shadow). Light only. */
:root {
  --bg: #f3f2f2;
  --card: #ffffff;
  --surface: #eae9e9;
  --n200: #eae7e7;
  --rule: #d7d3d3;
  --ink: #000000;
  --sub: #605d5d;
  --amber: #FFD23F;
  --red: #FF6B6B;
  --blue: #74B9FF;
  --green: #88D498;
  --lavender: #B8A9FA;
  --orange: #FFA552;
  --purple: #A388EE;
  --hair: 1px solid var(--n200);
  --shadow: 0 1px 2px rgba(20,10,10,.05), 0 6px 20px rgba(20,10,10,.06);
  /* The darker bottom edge that makes a bright fill read as a key. */
  --press: inset 0 -3px 0 rgba(0,0,0,.1);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 'Archivo', system-ui, sans-serif;
}
.frame { --gut: 32px; max-width: 880px; min-height: 100vh; margin: 0 auto; }
@media (max-width: 600px) { .frame { --gut: 16px; } }
/* Wide screens: render at 125% so the page fills the window like browser
   zoom 125% does. min-height undoes zoom's scaling of 100vh. */
@media (min-width: 1200px) { .frame { zoom: 1.25; min-height: 80vh; } }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
section { padding: 36px var(--gut); }
h2 { font-size: 22px; font-weight: 800; margin-bottom: 16px; }
p { margin: 0; }
.sub { color: var(--sub); }
/* The app's card: white on the ground, hairline, soft shadow. */
.dl, .feat, .group {
  background: var(--card); border: var(--hair); border-radius: 22px; box-shadow: var(--shadow);
}

/* Header */
header { display: flex; align-items: center; justify-content: space-between; padding: 18px var(--gut); }
.logo {
  font-weight: 800; font-size: 20px; text-decoration: none; letter-spacing: -0.02em;
  background: var(--amber); border-radius: 14px; box-shadow: var(--press), 0 4px 14px rgba(255,210,63,.35);
  padding: 6px 14px 8px;
}
nav { display: flex; gap: 6px; font-weight: 600; font-size: 15px; }
nav a { text-decoration: none; padding: 6px 14px; border-radius: 999px; transition: background .15s; }
nav a:hover { background: var(--surface); }

/* Hero */
.hero { padding: 36px var(--gut) 36px; }
.hero h1 { font-size: clamp(32px, 7vw, 48px); font-weight: 800; letter-spacing: -0.02em; }
.hero > p { margin-top: 12px; font-size: 18px; max-width: 560px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pills span { background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 700; }

/* Download card */
.dl { margin-top: 28px; padding: 16px; }
/* The app's segmented control: a white block on a grey track (rounded, not a pill: labels can wrap on phones). */
.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 16px; background: var(--surface); border-radius: 16px; }
.tabs button {
  flex: 1; font: inherit; font-weight: 700; font-size: 15px; padding: 9px 10px;
  background: none; border: 0; border-radius: 12px; cursor: pointer; color: var(--sub); line-height: 1.3;
  transition: background .2s, color .2s, box-shadow .2s;
}
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(20,10,10,.12); }
.dl-body { padding: 0 4px 4px; }
.btn {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px;
  background: var(--green); border-radius: 16px; box-shadow: var(--press);
  padding: 15px 18px 17px; font-weight: 800; font-size: 18px; text-decoration: none;
  transition: translate .08s, filter .15s;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { translate: 0 2px; }
.btn span, .btn small { white-space: nowrap; }
.btn small { font-weight: 600; font-size: 14px; }
.meta { margin-top: 14px; font-size: 14px; }
.meta summary { display: inline; cursor: pointer; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.meta ul { margin: 10px 0 0; padding-left: 20px; color: var(--sub); }
.meta h4 { margin: 12px 0 0; font-size: 14px; color: var(--ink); }
.verify {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding-top: 16px; border-top: var(--hair);
}
.verify > div { flex: 1 1 220px; }
.verify strong { font-size: 15px; }
.verify p { font-size: 14px; margin-top: 2px; }
.copy {
  font: inherit; font-size: 14px; font-weight: 700; background: var(--surface); color: var(--ink);
  border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer; white-space: nowrap;
  transition: translate .08s, background .2s;
}
.copy:active { translate: 0 2px; }
.copy.done { background: var(--green); }
/* Only shown when the browser refuses clipboard access. */
.fallback {
  display: block; margin-top: 12px; padding: 10px 12px; background: var(--surface); border-radius: 14px;
  font: 13px var(--mono); word-break: break-all; user-select: all;
}

/* Features: one animated mini screen per card */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.feat { overflow: hidden; }
/* Two columns from 680px (616px of content). An odd last card sits centred. */
@media (min-width: 680px) {
  .feat:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 8px); }
}
.feat-text { padding: 14px 18px 18px; }
.feat h3 { font-size: 17px; font-weight: 800; }
.feat p { margin-top: 4px; font-size: 15px; color: var(--sub); }

/* Install */
ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 14px; }
ol.steps li { counter-increment: s; display: flex; gap: 14px; align-items: center; }
ol.steps li::before {
  content: counter(s); flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--blue); border-radius: 12px; box-shadow: var(--press); font-weight: 800;
}

/* FAQ and privacy: rows in one rounded card, a hairline between them that
   starts where the text does, like the app's Words list. */
.group { overflow: hidden; }
details.fold { position: relative; }
details.fold + details.fold::before {
  content: ''; position: absolute; top: 0; left: 18px; right: 0; height: 1px; background: var(--n200);
}
details.fold summary {
  cursor: pointer; padding: 15px 18px; font-weight: 700; list-style: none;
  display: flex; justify-content: space-between; gap: 12px; transition: background .25s;
}
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: '+'; font-weight: 800; color: var(--sub); transition: transform .25s; }
/* .closing is set while the close animation runs, so the colour and the
   icon turn back with it rather than after it. */
details.fold[open]:not(.closing) summary::after { transform: rotate(45deg); }
details.fold[open]:not(.closing) { background: color-mix(in srgb, var(--purple) 12%, var(--card)); }
details.fold > p, details.fold > ul { padding: 0 18px 16px; margin: 0; }
details.fold > ul { padding-left: 36px; color: var(--sub); }
details.fold > ul li + li { margin-top: 6px; }

/* Footer */
footer { padding: 20px var(--gut) 40px; font-size: 14px; }
footer .links { display: flex; flex-wrap: wrap; gap: 18px; font-weight: 600; }
footer .legal { margin-top: 16px; }

.error { background: color-mix(in srgb, var(--red) 22%, var(--card)); border-radius: 16px; padding: 12px 16px; margin: 40px var(--gut); font-weight: 700; }
[hidden] { display: none !important; }
