/* Letrado static pages: tokens (PLAN 3.1), fonts, chalk grain (3.3) and the FAQ page template (5.6). */
@font-face { font-family: 'Londrina Solid'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/londrina-solid-400.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/atkinson-hyperlegible-400.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/atkinson-hyperlegible-700.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --paper: #e4ded3;
  --tile: #ece7de;
  --line: #4b33a8;
  --ink: #4b33a8;
  --ink-muted: #66579f;
  --sel: #4b33a8;
  --on-sel: #ece7de;
  --pen: #1a7fad;
  --gold: #d98e1f;
  --logo: #2aa7dd;
  --logo-ink: #4b33a8;
  --line-soft: color-mix(in srgb, var(--ink) 28%, transparent);
  --embed-bg: transparent;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n' x='0' y='0' width='100%' height='100%'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  4 0 0 0 -0.55'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #1c1b20;
    --tile: #26252c;
    --line: #45434e;
    --ink: #e8e3f4;
    --ink-muted: #a39fb0;
    --sel: #9a85ff;
    --on-sel: #1c1b20;
    --pen: #4cc3f0;
    --gold: #f0b04a;
    --logo: #4cc3f0;
    --logo-ink: #9a85ff;
    --embed-bg: #ece7de;
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #1c1b20;
  --tile: #26252c;
  --line: #45434e;
  --ink: #e8e3f4;
  --ink-muted: #a39fb0;
  --sel: #9a85ff;
  --on-sel: #1c1b20;
  --pen: #4cc3f0;
  --gold: #f0b04a;
  --logo: #4cc3f0;
  --logo-ink: #9a85ff;
  --embed-bg: #ece7de;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

a { color: var(--ink); text-underline-offset: 3px; }

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.chalk {
  -webkit-mask-image: var(--grain);
  mask-image: var(--grain);
  -webkit-mask-size: 160px;
  mask-size: 160px;
  -webkit-mask-repeat: repeat;
  mask-repeat: repeat;
}

.sp { container-type: inline-size; min-height: 100vh; }
.sp-in { max-width: 1080px; margin-inline: auto; padding: 16px 18px 28px; display: grid; gap: 22px; }

.sp-hd { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--line); }
.sp-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.sp-brand svg { flex: none; }
.sp-brand b { font-family: 'Londrina Solid', cursive; font-weight: 400; font-size: 28px; line-height: 1; letter-spacing: 0.01em; }
.sp-back {
  margin-left: auto; font-weight: 700; font-size: 14px; padding: 8px 14px; border: 2px solid var(--line);
  border-radius: 10px; white-space: nowrap; text-decoration: none; color: var(--ink);
}

.sp-hero { display: grid; gap: 8px; }
.sp-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.sp-hero h1 { margin: 0; font-family: 'Londrina Solid', cursive; font-weight: 400; font-size: clamp(38px, 9cqw, 64px); line-height: 1; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.sp-hero p { font-size: 17px; color: var(--ink-muted); max-width: 52ch; margin: 0; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sp-chips a { font-size: 13px; font-weight: 700; padding: 5px 11px; border-radius: 999px; border: 1.5px solid var(--line); text-decoration: none; }

.sp-body { display: grid; gap: 22px; }
.sp-side { display: grid; gap: 18px; align-content: start; }
.sp-nav { display: none; }

.sp-cta { background: var(--tile); border: 2px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 6px; justify-items: start; }
.sp-cta b { font-size: 18px; }
.sp-cta > span { font-size: 13px; color: var(--ink-muted); }
.sp-cta > span[hidden] { display: none; }
.sp-play { margin-top: 8px; background: var(--sel); color: var(--on-sel); font-weight: 700; font-size: 15px; padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.sp-tiles { display: flex; gap: 5px; margin-bottom: 6px; }
.sp-tiles span {
  width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 7px;
  font-family: 'Londrina Solid', cursive; font-size: 24px; line-height: 1; background: var(--paper);
}

.sp-main { display: grid; gap: 26px; min-width: 0; }
.sp-cat, .sp-sec, .sp-card { scroll-margin-top: 16px; }
.sp-cat { display: grid; gap: 8px; }
.sp-cat h2, .sp-sec h2, .sp-card h2 { margin: 0 0 4px; font-family: 'Londrina Solid', cursive; font-weight: 400; font-size: 28px; line-height: 1.1; letter-spacing: 0.01em; }

.sp-q { background: var(--tile); border: 1.5px solid var(--line-soft); border-radius: 12px; }
.sp-q[open] { border-color: var(--line); }
.sp-q summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 700; font-size: 17px; }
.sp-q summary::-webkit-details-marker { display: none; }
.sp-q summary:focus-visible { border-radius: 10px; }
.sp-q .chev { width: 20px; height: 20px; margin-left: auto; flex: none; color: var(--ink-muted); }
.sp-q[open] .chev { transform: rotate(180deg); }
@media (prefers-reduced-motion: no-preference) {
  .sp-q .chev { transition: transform 160ms ease; }
}
.sp-a { padding: 0 16px 16px; display: grid; gap: 10px; font-size: 17px; line-height: 1.6; max-width: 65ch; }
.sp-a p { margin: 0; }
.sp-tip { border-left: 3px solid var(--pen); padding-left: 12px; color: var(--ink-muted); font-size: 15.5px; }
.sp-links { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }

/* About, contact and legal pages: same two-column shell as the FAQ, prose column capped for reading */
.sp-doc { display: grid; gap: 26px; min-width: 0; max-width: 72ch; }
.sp-sec { display: grid; gap: 10px; min-width: 0; }
.sp-sec h3 { margin: 10px 0 0; font-size: 18px; line-height: 1.3; }
.sp-sec p, .sp-sec ul, .sp-card ul, .sp-doc > p { margin: 0; }
.sp-sec ul, .sp-card ul { padding-left: 1.2em; display: grid; gap: 8px; }
.sp-sec a, .sp-doc a { overflow-wrap: anywhere; }
/* Step buttons inside a page body (/android): the text column's width on a phone, one capped width on wider screens */
.sp-doc .sp-play { display: block; max-width: 420px; margin-top: 0; text-align: center; }
.sp-card { background: var(--tile); border: 1.5px solid var(--line-soft); border-radius: 12px; padding: 16px; display: grid; gap: 10px; }
.sp-card h2 { margin-bottom: 0; }
.sp-card p { margin: 0; }
.sp-note { border-left: 3px solid var(--pen); padding-left: 12px; color: var(--ink-muted); font-size: 15.5px; }
.sp-contact { background: var(--tile); border: 1.5px solid var(--line-soft); border-radius: 12px; padding: 12px; display: grid; gap: 10px; min-width: 0; }
.sp-embed { background: var(--embed-bg); border-radius: 8px; overflow: hidden; }
.sp-embed iframe { display: block; width: 100%; min-height: 520px; border: 0; }
.sp-fallback { font-size: 14px; color: var(--ink-muted); }

.sp-ft { border-top: 2px solid var(--line); padding-top: 16px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.sp-ftl { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 14px; }
.sp-ftl a { padding: 6px 0; }
.sp-theme { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-muted); }
.sp-seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.sp-seg button {
  font: inherit; font-size: 13px; padding: 6px 12px; border: 0; background: transparent; color: var(--ink); cursor: pointer;
}
.sp-seg button[aria-pressed='true'] { background: var(--sel); color: var(--on-sel); }
.sp-seg button:focus-visible { outline-offset: -3px; border-radius: 999px; }
.sp-ft small { font-size: 12px; color: var(--ink-muted); }

@container (min-width: 760px) {
  .sp-in { padding: 22px 36px 36px; gap: 30px; }
  .sp-chips { display: none; }
  .sp-body { grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; }
  .sp-side { position: sticky; top: 16px; }
  .sp-nav { display: grid; gap: 2px; }
  .sp-nav b { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 6px; }
  .sp-nav a { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 8px; font-weight: 700; font-size: 15px; text-decoration: none; }
  .sp-nav a[aria-current] { background: color-mix(in srgb, var(--sel) 16%, transparent); }
  .sp-nav small { color: var(--ink-muted); font-weight: 400; font-size: 13px; }
}
