/* ============================================================
   KidMantis — legal.css
   The premium document surface for the public standalone pages
   (Privacy Notice, Terms of Use, 404). Same brand language as
   app.css, tuned for long-form reading: quiet paper, generous
   measure, numbered section cards, day/night, print.
   Mobile-first from 320px. No external resources.
   ============================================================ */

@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/baloo-2-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 600; font-display: swap; src: url("../assets/fonts/baloo-2-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/baloo-2-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 800; font-display: swap; src: url("../assets/fonts/baloo-2-latin-800-normal.woff2") format("woff2"); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

:root {
  --paper: #f6faf3;
  --paper-2: #eef6ea;
  --card: #ffffff;
  --edge: #dcebd9;
  --edge-soft: #eaf3e6;
  --ink: #1f2c25;
  --ink-soft: #46574d;
  --ink-faint: #6c7d73;
  --accent: #2f9e57;
  --accent-deep: #1d7a40;
  --accent-wash: rgba(47, 158, 87, .09);
  --gold: #d99b18;
  --focus: #7a3cc9;
  --shadow: 0 10px 34px rgba(24, 62, 38, .10);
  --shadow-soft: 0 3px 12px rgba(24, 62, 38, .07);
  --brandbar: rgba(255, 255, 255, .82);
  --measure: 74ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1729;
    --paper-2: #131f38;
    --card: #1a2340;
    --edge: #33416c;
    --edge-soft: #26304f;
    --ink: #eef1ff;
    --ink-soft: #c7cfec;
    --ink-faint: #97a3cb;
    --accent: #4fbe80;
    --accent-deep: #6ed19a;
    --accent-wash: rgba(79, 190, 128, .13);
    --sw-word-a: var(--sw-gold); --sw-word-b: var(--sw-green);   /* dark card: the icon colours pass as they are */
    --gold: #f2c14e;
    --focus: #c7a6ff;
    --shadow: 0 12px 38px rgba(0, 0, 0, .45);
    --shadow-soft: 0 3px 14px rgba(0, 0, 0, .34);
    --brandbar: rgba(14, 23, 41, .86);
  }
}

body {
  margin: 0;
  font-family: "Baloo 2", "Segoe UI Rounded", ui-rounded, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.68;
  color: var(--ink);
  background:
    radial-gradient(1200px 460px at 50% -180px, var(--accent-wash), transparent 70%),
    var(--paper);
  background-attachment: fixed;
  overflow-x: hidden;
}

img { max-width: 100%; }

a { color: var(--accent-deep); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 40;
  background: var(--accent); color: #fff; padding: 10px 16px;
  border-radius: 12px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 12px; }

/* ---------- Brand bar ---------- */
.lg-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px max(14px, env(safe-area-inset-left)) 10px max(14px, env(safe-area-inset-right));
  background: var(--brandbar);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--edge);
}
.lg-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; }
.lg-brand img { display: block; width: 26px; height: 26px; }
.lg-brand b { font-size: 19px; font-weight: 800; letter-spacing: .2px; }
.lg-brand span { color: var(--ink-faint); font-size: 13px; font-weight: 600; }
.lg-bar .lg-spacer { flex: 1 1 auto; }
.lg-back {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 999px;
  background: linear-gradient(180deg, #4cc274, #2f9e57 62%, #268a4a);
  color: #fff; font-weight: 700; font-size: 14px; text-decoration: none;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .10), 0 6px 16px rgba(47, 158, 87, .30);
  transition: transform .16s ease, box-shadow .16s ease;
}
.lg-back:hover { color: #fff; }
.lg-back { white-space: nowrap; }
.lg-back-s { display: none; }
.lg-cta { margin: 20px 0 0; }
@media (hover: hover) {
  .lg-back:hover { transform: translateY(-1px); box-shadow: 0 3px 0 rgba(0, 0, 0, .10), 0 10px 22px rgba(47, 158, 87, .40); }
}

/* ---------- Page frame ---------- */
.lg-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 30px max(16px, env(safe-area-inset-left)) 56px max(16px, env(safe-area-inset-right));
}

/* ---------- Hero ---------- */
.lg-hero {
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 26px;
  padding: 26px 22px 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.lg-hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, #2f9e57, #7bd39a 30%, #e7a824 62%, #ef8bb1);
}
.lg-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--accent-wash);
  border-radius: 999px; padding: 5px 12px;
  margin: 4px 0 12px;
}
.lg-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(27px, 6.4vw, 40px);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -.01em;
}
.lg-lede {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: clamp(16px, 3.6vw, 18.5px);
}
.lg-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 18px 0 0; padding: 16px 0 0;
  border-top: 1px solid var(--edge-soft);
  list-style: none;
}
.lg-meta li {
  display: inline-flex; flex-direction: column; gap: 1px;
  padding: 7px 13px;
  background: var(--paper-2);
  border: 1px solid var(--edge-soft);
  border-radius: 13px;
  min-width: 0;
}
.lg-meta dt, .lg-meta .k {
  font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-faint);
}
.lg-meta .v { font-size: 14.5px; font-weight: 700; color: var(--ink); }

/* ---------- Contents ---------- */
.lg-toc {
  margin: 22px 0 0;
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 22px;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}
.lg-toc h2 {
  margin: 0 0 12px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-faint);
}
.lg-toc ol, .lg-toc ul {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; gap: 8px;
  counter-reset: toc;
}
.lg-toc li { flex: 1 1 220px; min-width: 0; }
.lg-toc a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 13px;
  background: var(--paper-2);
  border: 1px solid var(--edge-soft);
  color: var(--ink); text-decoration: none;
  font-size: 15px; font-weight: 600; line-height: 1.35;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.lg-toc li a::before {
  counter-increment: toc;
  content: counter(toc);
  flex: 0 0 auto;
  width: 23px; height: 23px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--accent-wash); color: var(--accent-deep);
  font-size: 12px; font-weight: 800;
}
.lg-toc.no-count li a::before { content: "›"; font-size: 15px; }
@media (hover: hover) {
  .lg-toc a:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: 0 6px 16px rgba(47, 158, 87, .18); }
}

/* ---------- Kid callout ---------- */
.lg-kid {
  margin: 22px 0 0;
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1.5px solid var(--accent);
  background: linear-gradient(180deg, var(--accent-wash), transparent);
  box-shadow: var(--shadow-soft);
}
.lg-kid .lg-kid-ic {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center; font-size: 22px;
  background: var(--card); border: 1px solid var(--edge);
}
.lg-kid h2 { margin: 2px 0 4px; font-size: 18px; font-weight: 800; }
.lg-kid p { margin: 0; color: var(--ink-soft); }

/* ---------- Sections ---------- */
.lg-doc { margin: 26px 0 0; display: grid; gap: 14px; }
.lg-sec {
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: var(--shadow-soft);
  scroll-margin-top: 76px;
  counter-increment: sec;
}
.lg-sec.no-num { counter-increment: none; }
.lg-doc.numbered .lg-sec.no-num > h2::before { content: none; }
.lg-sec > h2 {
  display: flex; align-items: baseline; gap: 11px;
  margin: 0 0 8px;
  font-size: clamp(18px, 4.4vw, 21px);
  font-weight: 800;
  line-height: 1.3;
}
.lg-doc.numbered { counter-reset: sec; }
.lg-doc.numbered .lg-sec > h2::before {
  content: counter(sec);
  flex: 0 0 auto;
  align-self: center;
  width: 29px; height: 29px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-wash); color: var(--accent-deep);
  font-size: 14px; font-weight: 800;
}
.lg-sec p { margin: 0 0 10px; max-width: var(--measure); color: var(--ink-soft); }
.lg-sec p:last-child { margin-bottom: 0; }
.lg-sec b, .lg-sec strong { color: var(--ink); font-weight: 700; }
.lg-sec ul { margin: 0 0 10px; padding-left: 20px; max-width: var(--measure); color: var(--ink-soft); }
.lg-sec li { margin: 0 0 5px; }

/* ---------- Footer ---------- */
.lg-foot {
  margin: 34px 0 0;
  padding: 20px 22px;
  border-radius: 22px;
  border: 1px solid var(--edge);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.lg-foot .lg-foot-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px;
}
.lg-foot .lg-foot-brand img { width: 20px; height: 20px; display: block; }
.lg-foot .lg-slogan {
  display: block; margin: 6px 0 14px;
  color: var(--ink); font-weight: 900; font-size: 15px;
}
/* rc.65 — the slogan coloured from the Switik mark's tokens, darkened with ink
   on this light card until every word passes 4.5:1 */
:root { --sw-gold: #F4B740; --sw-green: #4FD08A; --sw-word-a: color-mix(in srgb, var(--sw-gold) 52%, #000); --sw-word-b: color-mix(in srgb, var(--sw-green) 52%, #000); }
.sw-slogan { font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.sw-slogan .sw-a { color: var(--sw-word-a); }
.sw-slogan .sw-b { color: var(--sw-word-b); }
.lg-foot nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.lg-foot nav a {
  padding: 8px 15px; border-radius: 999px;
  background: var(--paper-2); border: 1px solid var(--edge-soft);
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px;
  transition: transform .16s ease, border-color .16s ease;
}
@media (hover: hover) { .lg-foot nav a:hover { transform: translateY(-1px); border-color: var(--accent); } }
.lg-foot small { display: block; margin-top: 12px; color: var(--ink-faint); font-size: 12.5px; }

/* ---------- Narrow screens ---------- */
@media (max-width: 400px) {
  body { font-size: 16px; }
  .lg-hero, .lg-sec, .lg-toc, .lg-kid, .lg-foot { border-radius: 18px; padding-left: 16px; padding-right: 16px; }
  .lg-brand span { display: none; }
  .lg-back { padding: 8px 13px; }
  .lg-bar .lg-back-t { display: none; }
  .lg-bar .lg-back-s { display: inline; }
}

/* ---------- Motion / print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
@media print {
  .lg-bar, .lg-toc, .lg-foot nav, .skip-link { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .lg-hero, .lg-sec, .lg-kid, .lg-foot { box-shadow: none; border: 1px solid #bbb; break-inside: avoid; }
  .lg-wrap { max-width: none; padding: 0; }
}
