/*
  Shared styling for heedhome.app. Same structure as RecipeGo's legal.css,
  in HeedHome's palette (mobile/src/ui/theme.ts).

  System fonts on purpose: a legal page that waits on a font CDN renders
  unstyled on slow connections, and nothing here needs a display face.
*/

:root {
  --ground: #f7f5ef;
  --surface: #ffffff;
  --surface-alt: #efede6;
  --border: #e4e2da;
  --border-soft: #efede6;
  --ink: #1f2a40;
  --body: #4a5366;
  --muted: #5a6273;
  --accent: #2d3c59;
  --link: #2d4f8c;
  --sage-soft: #e4ead9;
  --sage-ink: #4a5a33;
  --warn-soft: #fbf1d3;
  --warn-ink: #5c4407;
  --measure: 70ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ground: #12161f;
    --surface: #1a1f2b;
    --surface-alt: #232a38;
    --border: #2e3647;
    --border-soft: #232a38;
    --ink: #f2f3f6;
    --body: #c9cdd6;
    --muted: #9aa1ae;
    --accent: #c9d4ea;
    --link: #9fb7e6;
    --sage-soft: #1f2a1a;
    --sage-ink: #bccb9f;
    --warn-soft: #2e2510;
    --warn-ink: #ecd38c;
  }
}

:root[data-theme='dark'] {
  --ground: #12161f;
  --surface: #1a1f2b;
  --surface-alt: #232a38;
  --border: #2e3647;
  --border-soft: #232a38;
  --ink: #f2f3f6;
  --body: #c9cdd6;
  --muted: #9aa1ae;
  --accent: #c9d4ea;
  --link: #9fb7e6;
  --sage-soft: #1f2a1a;
  --sage-ink: #bccb9f;
  --warn-soft: #2e2510;
  --warn-ink: #ecd38c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--body);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 16px 96px; }

/* ── Masthead ─────────────────────────────────────────────────────────── */

header.masthead {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 40px;
}

.masthead .wrap { padding-top: 18px; padding-bottom: 18px; display: flex; align-items: center; gap: 12px; }

.masthead .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }

/* The icon carries its own white tile, so it reads on dark pages too. */
.masthead img { width: 40px; height: 40px; border-radius: 10px; display: block; border: 1px solid var(--border); }

.masthead .name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--accent);
}

.masthead nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }

.masthead nav a { font-size: 14px; color: var(--muted); text-decoration: none; }
.masthead nav a:hover, .masthead nav a:focus-visible { color: var(--ink); text-decoration: underline; }
.masthead nav a[aria-current='page'] { color: var(--ink); font-weight: 600; }

/*
  On a phone the links fold behind a ☰ button below 640px. A checkbox and its
  label do the toggling, which keeps these pages free of JavaScript.
*/
.menu-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.menu-button { display: none; }

@media (max-width: 640px) {
  .masthead .wrap { flex-wrap: wrap; }
  .menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--ink);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
  }
  .menu-toggle:focus-visible + .menu-button { outline: 2px solid var(--link); outline-offset: 2px; }
  .menu-toggle:checked + .menu-button { background: var(--surface-alt); }
  .masthead nav { display: none; flex-basis: 100%; flex-direction: column; gap: 0; margin: 10px 0 0; }
  .menu-toggle:checked ~ nav { display: flex; }
  .masthead nav a { font-size: 16px; padding: 12px 2px; border-top: 1px solid var(--border-soft); }
}

/* ── Type ─────────────────────────────────────────────────────────────── */

h1 {
  font-size: clamp(30px, 5vw, 40px);
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 6px;
  text-wrap: balance;
}

.updated { color: var(--muted); font-size: 15px; margin: 0 0 34px; }

h2 {
  font-size: 22px;
  line-height: 1.3;
  color: var(--ink);
  margin: 42px 0 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  scroll-margin-top: 20px;
  text-wrap: balance;
}

h3 { font-size: 17px; color: var(--ink); margin: 26px 0 8px; }

p, li { margin: 0 0 14px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 8px; }

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

strong { color: var(--ink); }

/* ── Components ───────────────────────────────────────────────────────── */

.lede { font-size: 19px; line-height: 1.6; color: var(--body); }

.toc {
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 12px;
}
.toc p { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 10px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 5px; }

.callout {
  background: var(--sage-soft);
  border-left: 3px solid var(--sage-ink);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin: 22px 0;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

.callout.warn { background: var(--warn-soft); border-left-color: var(--warn-ink); }

.table-scroll { overflow-x: auto; margin: 20px 0; }

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 15px;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
}

th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

tbody tr:last-child td { border-bottom: none; }

td.yes { color: var(--ink); font-weight: 600; }
td.no { color: var(--muted); }

footer.page {
  border-top: 1px solid var(--border);
  margin-top: 56px;
  padding-top: 22px;
  font-size: 15px;
  color: var(--muted);
}
footer.page a { color: var(--muted); }

/* ── Home page ────────────────────────────────────────────────────────── */

.hero { text-align: center; padding: 24px 0 8px; }
.hero img { width: 112px; height: 112px; border-radius: 26px; border: 1px solid var(--border); box-shadow: 0 6px 24px rgba(31, 42, 64, 0.12); }
.hero h1 { margin-top: 22px; }
.hero .tagline { font-size: 20px; color: var(--body); margin: 8px auto 0; max-width: 34ch; text-wrap: balance; }
.hero .soon { display: inline-block; margin-top: 22px; padding: 8px 16px; border-radius: 999px; background: var(--surface-alt); color: var(--muted); font-size: 15px; }

.points { list-style: none; padding: 0; display: grid; gap: 14px; margin-top: 40px; }
.points li { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin: 0; }
.points strong { display: block; margin-bottom: 2px; }

:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
