/* The public site.
 *
 * Hand-written rather than built, because a marketing page that needs a
 * toolchain is a marketing page nobody edits. It is copied into dist-web/ by
 * `npm run build:site` and served from the root by the Worker.
 *
 * The palette is the app's own `linen` theme, read from DEFAULT_THEMES in
 * src/App.jsx. The site and the product should not look like two companies.
 *
 * No web fonts. The shipped Content-Security-Policy allows no remote origin at
 * all, and keeping it that way is worth more than a typeface: the same policy
 * protects the editor, and one exception here is an exception everywhere.
 */

/* The palette is the app's `linen` theme with two colours darkened, and the
 * reason is measured rather than aesthetic. At the app's own values, against
 * this paper:
 *
 *   accent #c95f3d on paper      3.89:1   every link on the site
 *   white on accent              4.05:1   the primary button
 *   muted #766f64 on the box     4.39:1   the status panel's body copy
 *
 * WCAG AA wants 4.5:1 for body text, so all three failed. The values below give
 * 4.82, 5.01 and 4.87, which is headroom rather than sitting on the line where
 * a rounding difference puts it back under.
 *
 * The app's own themes have the same failure, because this accent came from
 * them. That is a product decision rather than a site one and is recorded in
 * docs/HANDOFF.md rather than changed here.
 */
:root {
  --paper: #fffaf1;
  --ink: #2c2924;
  --muted: #6f685e;
  --accent: #b15436;
  --soft: #f2e8d9;
  --rule: color-mix(in srgb, var(--muted) 22%, transparent);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --measure: 34rem;
  --wide: 68rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.shell { max-width: var(--wide); margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Header */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0 10px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.masthead nav {
  display: flex;
  gap: 22px;
  font-family: var(--sans);
  font-size: 14px;
}

.masthead nav a { color: var(--muted); text-decoration: none; }
.masthead nav a:hover { color: var(--ink); }

/* Hero */

.hero { padding: 56px 0 24px; }

h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  max-width: 22ch;
}

.standfirst {
  font-size: 1.22rem;
  color: var(--muted);
  max-width: var(--measure);
  margin: 0 0 30px;
}

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 8px;
  text-decoration: none;
}

.button:hover { filter: brightness(0.94); }

/* The default focus ring on a coloured block against a warm ground is hard to
 * see, and this is the one control on the page. Keyboard only, so a pointer
 * click does not leave a ring behind it. */
:where(a, button):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 3px;
}

.button:focus-visible { outline-color: var(--ink); border-radius: 8px; }

/* It sat beside a button and was a caption. The button is gone until there is
   something to open, so it is the only thing under the standfirst now and gets
   a line length that reads as a sentence rather than a label. */
.aside {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--muted);
  max-width: 46ch;
}

/* The screenshot */

figure { margin: 44px 0 0; }

figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--rule);
  box-shadow: 0 24px 60px -30px rgb(44 41 36 / 45%);
}

figcaption {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
}

/* Sections */

section { padding: 60px 0; border-top: 1px solid var(--rule); margin-top: 60px; }

h2 {
  font-size: 1.9rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  max-width: 24ch;
}

h3 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.005em;
  margin: 0 0 6px;
}

section > p { max-width: var(--measure); color: var(--muted); margin: 0 0 12px; }
section > p strong { color: var(--ink); font-weight: 600; }

.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 30px 36px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.points p { margin: 0; font-size: 0.94rem; color: var(--muted); }

/* The honest list */

.plain { margin: 26px 0 0; padding: 0; list-style: none; max-width: var(--measure); }

.plain li {
  padding: 11px 0;
  border-top: 1px solid var(--rule);
  font-size: 0.96rem;
  color: var(--muted);
}

.plain li:last-child { border-bottom: 1px solid var(--rule); }
.plain b { color: var(--ink); font-weight: 600; }

/* Status */

.status {
  background: color-mix(in srgb, var(--soft) 55%, transparent);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 26px 28px;
  max-width: var(--measure);
}

.status h2 { font-size: 1.35rem; margin-bottom: 10px; }
.status p { color: var(--muted); font-size: 0.96rem; margin: 0 0 10px; }
.status p:last-child { margin-bottom: 0; }

footer {
  border-top: 1px solid var(--rule);
  margin-top: 60px;
  padding: 30px 0 60px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  justify-content: space-between;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: color-mix(in srgb, var(--soft) 70%, transparent);
  border-radius: 4px;
  padding: 0.1em 0.34em;
}

/* The privacy and terms pages: one column of prose, not a landing page. */

.prose { max-width: var(--measure); padding: 40px 0 0; }
.prose .standfirst { font-size: 1.06rem; margin-bottom: 40px; }
.prose h2 {
  font-size: 1.35rem;
  margin: 44px 0 12px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  /* The base heading rule caps h2 at 24ch for the landing page, which here
     stopped the border mid-column and read as a half-drawn line. */
  max-width: none;
}
.prose h2:first-of-type { border-top: 0; padding-top: 0; }
.prose p { color: var(--muted); margin: 0 0 14px; }
.prose p strong { color: var(--ink); font-weight: 600; }

/* A postal address is read a line at a time, so it keeps its line breaks and
   sits apart from the paragraph that introduces it. */
.prose p.address {
  font-style: normal;
  line-height: 1.7;
  margin: 18px 0 22px;
  padding-left: 16px;
  border-left: 2px solid var(--rule);
}
.prose .plain { margin-bottom: 18px; }

.page-title {
  font-size: clamp(2rem, 5vw, 2.7rem);
  margin-bottom: 14px;
}

footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }

@media (max-width: 640px) {
  body { font-size: 18px; }
  .hero { padding: 34px 0 12px; }
  section { padding: 44px 0; margin-top: 44px; }

  /* Four links wrapping into two ragged rows above the headline is worse than
     no nav on a page this short, and the hero already links to the one section
     somebody arriving cold actually needs. */
  .masthead nav { display: none; }
  .masthead { padding-bottom: 4px; }
}
