/* The public pages for Questify (roadmap 7.1).
 *
 * **No web fonts, no analytics, no third-party anything.** A privacy policy
 * that fetches a typeface from another company's CDN sends every reader's IP
 * address to that company in the act of telling them we do not do that. The
 * system font stack costs nothing, renders instantly and is nobody's business
 * but the reader's. (The app's DM Sans is fetched at run time, not bundled, so
 * there is no copy of ours to serve.)
 *
 * **The app's own palette** (16 Oct 2026, the user's ask): the tokens are
 * `AppColors.dark` and `AppColors.light` in `app/lib/core/theme/app_colors.dart`,
 * value for value — change them there and here together. Dark by default, light
 * when the reader's system asks for it, the same way round as the app. No toggle:
 * these pages run no script (`public_pages.test.js`). */

:root {
  color-scheme: dark;

  --bg: #0c0c0a;
  --surface: #141310;
  --raised: #1b1a16;
  --action: #c8ff3d;
  --on-action: #0c0c0a;
  --error: #ff6b5a;
  --text: #f0eee6;
  --muted: #98958a;
  --border: #2c2a24;
  --action-soft: rgba(200, 255, 61, 0.08);
  --error-soft: rgba(255, 107, 90, 0.1);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;

    --bg: #faf9f5;
    --surface: #ffffff;
    --raised: #ffffff;
    --action: #4f7000;
    --on-action: #ffffff;
    --error: #b3261e;
    --text: #1f1e1a;
    --muted: #6b675e;
    --border: #e3dfd5;
    --action-soft: rgba(79, 112, 0, 0.08);
    --error-soft: rgba(179, 38, 30, 0.07);
  }
}

/* The header's switch, as the app's own: Device, Light, Dark (16 Oct 2026, the
 * user's ask). Radio buttons and `:has()`, no script — so the choice lasts only
 * while the page is open; Device, the default, is the system's setting. These
 * two blocks repeat the tokens above on purpose: one is conditional on a media
 * query and the other is not, and CSS cannot share a block between them. */
:root:has(#theme-light:checked) {
  color-scheme: light;

  --bg: #faf9f5;
  --surface: #ffffff;
  --raised: #ffffff;
  --action: #4f7000;
  --on-action: #ffffff;
  --error: #b3261e;
  --text: #1f1e1a;
  --muted: #6b675e;
  --border: #e3dfd5;
  --action-soft: rgba(79, 112, 0, 0.08);
  --error-soft: rgba(179, 38, 30, 0.07);
}

:root:has(#theme-dark:checked) {
  color-scheme: dark;

  --bg: #0c0c0a;
  --surface: #141310;
  --raised: #1b1a16;
  --action: #c8ff3d;
  --on-action: #0c0c0a;
  --error: #ff6b5a;
  --text: #f0eee6;
  --muted: #98958a;
  --border: #2c2a24;
  --action-soft: rgba(200, 255, 61, 0.08);
  --error-soft: rgba(255, 107, 90, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 16px 64px;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 680px;
  margin: 0 auto;
}

/* The app's mark of a heading is a short lime bar, not a coloured title:
 * colour reinforces, it never carries meaning alone (specs.md §5). */
header {
  padding: 48px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

/* The Q and the switch, on one line above the title. */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 24px;
}

/* The wordmark, one link home: the user's logo (16 Oct 2026), its source in
 * `design/wordmark/questify-wordmark.png` and here cropped to the letters as
 * `questify-wordmark.png`. Only its shape is used — a mask — painted in the
 * theme's action colour, as the app paints its Q (`QMark`): lime in dark,
 * olive in light. The ratio is the image's, 1157 × 360. */
.brand {
  display: block;
  line-height: 0;
}

.wordmark {
  display: block;
  height: 40px;
  aspect-ratio: 1157 / 360;
  background: var(--action);
  -webkit-mask: url("questify-wordmark.png") center / contain no-repeat;
  mask: url("questify-wordmark.png") center / contain no-repeat;
}

.theme-switch {
  display: none;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

/* Without `:has()` (Firefox before 121) the radios would change nothing, so
 * the switch shows only where it works. */
@supports selector(:has(a)) {
  .theme-switch {
    display: inline-flex;
  }
}

.theme-switch legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.theme-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.theme-switch label {
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--muted);
}

.theme-switch label:hover {
  color: var(--text);
}

/* The one filled element, as in the app: the chosen segment is the pill. */
.theme-switch input:checked + label {
  background: var(--action);
  color: var(--on-action);
}

.theme-switch input:focus-visible + label {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 44px 0 8px;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 24px 0 4px;
}

strong {
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

a {
  color: var(--action);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
  border-radius: 4px;
}

ul {
  padding-left: 22px;
}

li {
  margin-bottom: 6px;
}

li::marker {
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
}

/* A card, as the app draws one: surface, hairline border, 8px corners
 * (`Radii.card`). */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
}

/* The policy's second layer (7.1, 16 Oct 2026): a section's exact list,
 * folded. Built into HTML, so it opens with no script; a chevron in the app's
 * lime says it can. */
details {
  margin: 12px 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 8px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "▸";
  display: inline-block;
  width: 1.2em;
  color: var(--action);
  transition: transform 0.15s;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details[open] summary {
  color: var(--text);
}

summary:hover {
  color: var(--text);
}

summary:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

details > :not(summary) {
  margin-left: 16px;
  margin-right: 16px;
}

details > :last-child {
  margin-bottom: 14px;
}

.panel p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  summary::before {
    transition: none;
  }
}

/* The unfinished marker. Loud on purpose: these pages carry placeholders that
 * must be filled before anyone but the author reads them, and a quiet note is
 * one somebody publishes past. */
.draft {
  background: var(--error-soft);
  color: var(--text);
  border: 1px solid var(--error);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
}

.draft code {
  background: var(--raised);
  padding: 1px 5px;
  border-radius: 4px;
}

footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Narrow phones: the three-column diagnostics table would otherwise squeeze
 * its middle column to a word per line. */
@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  table {
    font-size: 0.9rem;
  }

  .theme-switch label {
    padding: 6px 11px;
  }
}
