/* Shared styles for getpuzzled.io.
 *
 * Palette and spacing mirror packages/puzzle_ui/lib/src/theme/tokens.dart.
 * That consistency is part of the 4.3 story: site and apps should read as one
 * publisher with distinct products, not six interchangeable tiles.
 *
 * The register is adult and editorial on purpose (§1.2). Play can override a
 * 13+ target-audience declaration if the design appeals to children, and the
 * marketing site is evidence in that assessment just as the screenshots are.
 */

:root {
  --ink: #1f1d1a;
  --ink-muted: #5a554d;
  --paper: #f6f3ec;
  --paper-raised: #fffdf8;
  /* Accents are tuned for contrast, not only for hue. These carry the
   * /privacy and /terms links — hard App Store Connect submission
   * requirements — and the uppercase verb labels, which are small text.
   * Both need WCAG AA 4.5:1 against --paper.
   *
   * The earlier values (#6b7f6e, #b08442) measured 3.88:1 and 3.05:1 in
   * light mode, and were never redefined for dark at all. */
  --sage: #536b57;   /* 5.25:1 on --paper */
  --ochre: #8a6220;  /* 4.92:1 on --paper */
  --line: #d9d3c7;
  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ede9e1;
    --ink-muted: #a9a296;
    --paper: #14130f;
    --paper-raised: #1e1c18;
    --line: #3a3630;
    --sage: #85a088;   /* 6.54:1 on dark --paper */
    --ochre: #d6a960;  /* 8.59:1 on dark --paper */
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 ui-serif, Georgia, "Times New Roman", serif;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

header.site {
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
}

header.site a.brand {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

/* Header is a row on anything wider than a small phone and stacks below that.
 * flex-wrap rather than a media query: the breakpoint is wherever the brand and
 * the links stop fitting, which depends on the visitor's text size, not on the
 * viewport width. A fixed breakpoint gets this wrong for anyone using larger
 * text — exactly the people most likely to notice. */
header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
}

nav.site-nav {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.82rem;
}
nav.site-nav a { margin-left: 1.1rem; }
nav.site-nav a:first-child { margin-left: 0; }

/* Footer links wrap into a column on narrow screens rather than overflowing.
 * The separators are gaps rather than middots so that a screen reader does not
 * announce a punctuation mark between every link. */
nav.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
  margin-bottom: 0.9rem;
}

h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 1rem; font-weight: 600; }
h2 { font-size: 1.25rem; margin: 2.5rem 0 0.6rem; font-weight: 600; }
h3 { font-size: 1rem; margin: 1.75rem 0 0.4rem; font-weight: 600; }

p, li { max-width: var(--measure); color: var(--ink-muted); }
p { margin: 0 0 1rem; }
ul { padding-left: 1.1rem; }
li { margin-bottom: 0.4rem; }

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

.lede { font-size: 1.1rem; color: var(--ink); }

/* Each app leads with its verb, never with "beautiful puzzles". A grid of
 * tiles with interchangeable copy is the exact evidence a
 * same-app-different-theme argument would cite (§6). */
.app {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0;
}
.app .verb {
  display: block;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ochre);
  margin-bottom: 0.35rem;
}
.app h2 { margin: 0 0 0.35rem; }
.app .status {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

footer.site {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding-top: 1.25rem;
  font-size: 0.85rem;
}
footer.site p { color: var(--ink-muted); }

.meta {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.callout {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1rem 1.1rem;
  margin: 1.5rem 0;
}
.callout p:last-child { margin-bottom: 0; }
