/*
 * The public face of Aben To Go.
 *
 * Palette lifted from the app (src/theme/colors.ts) rather than invented, so
 * someone who has used the app recognises the site as the same thing. Ochre
 * is the brand colour; rust is reserved for the one destructive action, the
 * same rule the app follows.
 *
 * No web fonts and no external stylesheets. Partly speed, mostly principle:
 * a page whose job is to explain what happens to your data should not open a
 * connection to a third party to render itself.
 */

:root {
  --ink: #23190f;
  --paper: #e9ebe4;
  --surface: #f6f6f1;
  --surface-2: #ffffff;
  --line: #d8d9ce;
  --muted: #6b6455;
  --ochre: #a9691a;
  --ochre-soft: #f1e3cc;
  --rust: #9a3d28;
  --forest: #365b41;

  --measure: 34rem;

  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino,
    "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

header.site {
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

header.site .wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

header.site svg { display: block; }

header.site .name {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

header.site nav {
  margin-left: auto;
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
}

header.site nav a { color: var(--muted); text-decoration: none; }
header.site nav a:hover { color: var(--ochre); }

/* --- Type -------------------------------------------------------------- */

main { padding: 3.5rem 0 4.5rem; }

h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}

h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 2.75rem 0 0.75rem;
  text-wrap: balance;
}

h3 {
  font-size: 1rem;
  margin: 1.75rem 0 0.4rem;
}

p, li { max-width: var(--measure); }

.lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: var(--measure);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.9rem;
}

a { color: var(--ochre); }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--ochre-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* --- Blocks ------------------------------------------------------------ */

.card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  margin: 1.5rem 0;
}

.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

/* Used where a page has to be blunt: what is erased, what is kept. */
.card.warn { border-color: color-mix(in srgb, var(--rust) 35%, var(--line)); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.9rem 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

th {
  width: 34%;
  font-weight: 600;
  color: var(--ink);
}

td { color: var(--muted); }

.contents {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.2rem 1.5rem;
  margin: 2rem 0 2.5rem;
}

.contents ol {
  margin: 0;
  padding-left: 1.2rem;
  columns: 2;
  column-gap: 2rem;
  font-size: 0.95rem;
}

.contents li { margin: 0.2rem 0; break-inside: avoid; }

.btn {
  display: inline-block;
  background: var(--ochre);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
}

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

footer.site {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  padding: 2.25rem 0;
  font-size: 0.88rem;
  color: var(--muted);
}

footer.site a { color: var(--muted); }
footer.site nav { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 0.9rem; }

/* A value still carrying a placeholder is marked so it cannot be published
   by accident — see build.mjs, which also refuses to build with any left. */
.todo {
  background: #ffe9c7;
  border-bottom: 2px solid var(--ochre);
  padding: 0 0.2em;
}

@media (max-width: 34rem) {
  .contents ol { columns: 1; }
  th { width: auto; display: block; padding-bottom: 0.15rem; border: 0; }
  td { display: block; padding-top: 0; }
}
