/* Haven's website: Haven's own look (DESIGN.md). Calm colours, big readable text, no motion, no
   outside requests (the font is hosted here, OFL: fonts/OFL.txt). */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/AtkinsonHyperlegible-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/AtkinsonHyperlegible-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f4efe6;
  --surface: #ffffff;
  --tint: #ebe4d8;
  --ink: #2b2620;
  --muted: #5f574e;
  --line: #ddd3c4;
  --night: #22384f;
  --gold: #d9a54e;
  --gold-ink: #7a5414;
  --link: #22384f;
  --focus: #22384f;                 /* 10.5:1 on the background: easy to see where the keyboard is */
  --radius: 20px;
  color-scheme: light;
}
/* Dark: Haven's own Calm Dark (DESIGN.md 1), so the site looks like the computer. Gold stays for the
   "in testing" badge and the logo. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1b19; --surface: #2a2724; --tint: #24211f; --ink: #f1ebe2; --muted: #bdb4a8; --line: #3d3833;
    --night: #7fa6cf; --gold: #e2b567; --gold-ink: #e2b567; --link: #7fa6cf; --focus: #7fa6cf; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1d1b19; --surface: #2a2724; --tint: #24211f; --ink: #f1ebe2; --muted: #bdb4a8; --line: #3d3833;
  --night: #7fa6cf; --gold: #e2b567; --gold-ink: #e2b567; --link: #7fa6cf; --focus: #7fa6cf; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 20px/1.6 "Atkinson Hyperlegible", system-ui, sans-serif;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 12px 18px; min-height: 44px; border-radius: 10px; }

/* Header */
.top { border-bottom: 1px solid var(--line); background: var(--bg); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 26px; }
.top nav { display: flex; gap: 6px 20px; flex-wrap: wrap; }
.top nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; text-decoration: none; color: var(--muted); font-size: 17px; }
.top nav a:hover { color: var(--ink); text-decoration: underline; }

/* Hero */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1fr 220px; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(42px, 7vw, 68px); line-height: 1.05; margin: 14px 0 18px; color: var(--night); letter-spacing: -0.5px; }
.lead { font-size: clamp(21px, 2.6vw, 26px); max-width: 30ch; margin: 0 0 18px; }
.tagline { color: var(--muted); margin: 0; } /* no italics: harder to read (DESIGN.md 2) */
.badge { display: inline-block; margin: 0; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--gold); color: var(--gold-ink); font-weight: 700; font-size: 16px; }
.hero-mark { width: 220px; }

/* Sections */
.block { padding: 64px 24px; }
.tint { background: var(--tint); }
h2 { font-size: clamp(30px, 4vw, 40px); line-height: 1.15; margin: 0 0 12px; color: var(--night); }
h3 { font-size: 21px; margin: 0 0 6px; line-height: 1.3; }
.intro { font-size: 21px; max-width: 62ch; margin: 0 0 28px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.cards article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.cards.four { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.cards article p { margin: 0; color: var(--muted); }
.note { max-width: 70ch; margin: 22px 0 0; }
.more { max-width: 70ch; margin: 28px 0 0; color: var(--muted); }

.shot { margin: 34px 0 0; }
.shot img, .gallery img { border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
figcaption { margin-top: 10px; color: var(--muted); font-size: 17px; }
.page-head { padding-bottom: 8px; }
.page-head h1 { font-size: clamp(36px, 5vw, 52px); line-height: 1.1; color: var(--night); margin: 0 0 16px; }
.feature { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 36px; align-items: start; }
.feature > .shot { margin: 0; }
.feature h2 { margin-top: 0; }
.feature p { max-width: 52ch; }
.feature .shot img { width: 100%; height: auto; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; gap: 20px; } }
.download { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 8px; }
.download .small { margin: 0; }
ol.plain { padding-left: 1.3em; margin: 0 0 18px; max-width: 62ch; }
ol.plain li { margin: 6px 0; }
.check { margin-top: 28px; max-width: 72ch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px; }
.check summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; overflow-wrap: anywhere; }
.keys { overflow-x: auto; margin: 8px 0 16px; max-width: 760px; }
.keys table { border-collapse: collapse; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.keys th, .keys td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.keys thead th { color: var(--muted); font-size: 16px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 28px; margin-top: 32px; }
.gallery figure, .shot { margin-left: 0; margin-right: 0; }

.spectrum { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.spectrum li { background: var(--surface); padding: 18px 20px; border-left: 1px solid var(--line); }
.spectrum li:first-child { border-left: 0; }
.spectrum b { display: block; color: var(--night); font-size: 20px; }
.spectrum span { color: var(--muted); font-size: 17px; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 48px; }
.two p { margin: 0; color: var(--muted); }

.steps { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; max-width: 760px; counter-reset: step; }
.steps li { position: relative; padding: 14px 18px 14px 64px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; color: var(--muted); }
.steps li b { color: var(--ink); }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 16px; top: 13px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; border: 2px solid var(--line); color: var(--muted); }
.steps li.done::before { content: "✓"; background: var(--night); border-color: var(--night); color: var(--bg); }
.steps li.now { border: 2px solid var(--gold); }
.steps li.now::before { border-color: var(--gold); color: var(--gold-ink); }

.foot { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: 16px; }
.foot .tagline { font-size: 18px; margin-bottom: 8px; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-mark { display: none; } /* the header already shows it */
  .hero { padding-top: 40px; }
  .spectrum { grid-template-columns: 1fr 1fr; }
  .spectrum li:nth-child(3) { border-left: 0; }
  .spectrum li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .two { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .block { padding: 48px 16px; }
  .spectrum { grid-template-columns: 1fr; }
  .spectrum li { border-left: 0; border-top: 1px solid var(--line); }
  .spectrum li:first-child { border-top: 0; }
  .top nav { gap: 4px 14px; }
}

/* ---------- "What would help you?" (tell-us/) and the results page ---------- */
.ask { max-width: 900px; padding-top: 36px; padding-bottom: 64px; }
.ask h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.2; color: var(--night); margin: 8px 0 18px; }
.ask h1:focus { outline: none; }
.ask .lead { max-width: 52ch; }
.small { color: var(--muted); font-size: 17px; max-width: 62ch; }
.facts { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; }
.facts li { display: flex; gap: 14px; align-items: center; }
.facts svg, .what svg, .btn svg, .choice svg { width: 28px; height: 28px; flex: none; fill: currentColor; }
.facts svg { color: var(--night); }
.progress { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 16px; margin: 0; }
.progress .meter { flex: 0 0 180px; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress .meter i { display: block; height: 100%; background: var(--night); }
.nav { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 19px; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--night); border-color: var(--night); color: var(--bg); font-weight: 700; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.btn.read { margin-top: 18px; }
.btn:disabled { opacity: .55; cursor: default; }
.choices-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.choices-grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.choice { position: relative; display: flex; align-items: center; gap: 14px; text-align: left; min-height: 72px; padding: 14px 52px 14px 16px;
  border-radius: 18px; border: 3px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 19px; line-height: 1.3; cursor: pointer; }
.choice svg { width: 36px; height: 36px; color: var(--night); }
.choice::after { content: ""; position: absolute; right: 14px; top: 50%; translate: 0 -50%; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); }
.choice[aria-pressed="true"] { border-color: var(--night); background: color-mix(in srgb, var(--night) 9%, var(--surface)); font-weight: 700; }
.choice[aria-pressed="true"]::after { content: "✓"; display: grid; place-items: center; background: var(--night); border-color: var(--night); color: var(--bg); font-size: 16px; font-weight: 700; }
.rate { display: grid; gap: 10px; }
.rate-row { display: grid; grid-template-columns: 1fr auto; gap: 10px 18px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.what { display: flex; gap: 12px; align-items: center; }
.what svg { color: var(--night); }
.rate-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 17px; cursor: pointer; }
.pick[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: var(--bg); font-weight: 700; }
.free { width: 100%; font: inherit; font-size: 19px; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
textarea.free { resize: vertical; }
.how { display: grid; gap: 8px; margin-top: 18px; max-width: 560px; }
.how label { font-weight: 700; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; }
.code { font-size: 24px; }
.code b { font-size: 30px; letter-spacing: 2px; color: var(--night); }
.err { min-height: 1.6em; }
.cta { display: inline-flex; margin-top: 22px; }
@media (max-width: 640px) {
  .rate-row { grid-template-columns: 1fr; }
  .progress .meter { flex-basis: 100px; }
}
