/* AnkoKids - Drawing Tutor. Site styles.
   The palette is lifted straight from lib/theme.dart so the site and the app
   never drift apart. */

:root {
  --bg: #fff8f0;
  --ink: #2b2b2b;
  --teal: #2a9d8f;
  --orange: #f4a261;
  --yellow: #f1c40f;
  --blue: #457b9d;
  --pink: #f4a6c1;
  --soft: #e9e4dc;

  --surface: #ffffff;
  --muted: #6b6862;
  --line: #ece6dd;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.07);
  --radius: 22px;
  --wrap: 1080px;
  --font: "Baloo 2", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: #17181a;
  --ink: #f2efe9;
  --surface: #212327;
  --muted: #a7a49d;
  --line: #32353a;
  --soft: #32353a;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; font-weight: 800; margin: 0 0 12px; }
h1 { font-size: clamp(32px, 5vw, 46px); }
h2 { font-size: clamp(24px, 3.4vw, 32px); margin-top: 8px; }
h3 { font-size: 20px; }
p { margin: 0 0 14px; }

/* ------------------------------------------------------------------ header */
header.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.bar { display: flex; align-items: center; gap: 14px; height: 68px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

nav.links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
nav.links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
}
nav.links a:hover { background: var(--soft); text-decoration: none; }
nav.links a[aria-current="page"] { background: var(--teal); color: #fff; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
}
.icon-btn:hover { border-color: var(--teal); }

.menu-btn { display: none; }

@media (max-width: 800px) {
  .menu-btn { display: grid; }
  nav.links {
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 16px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  nav.links[hidden] { display: none; }
  nav.links a { padding: 12px 14px; border-radius: 14px; }
}

/* -------------------------------------------------------------------- hero */
.hero { padding: 56px 0 24px; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 34px; } }

.eyebrow {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.lead { font-size: 19px; color: var(--muted); max-width: 46ch; }

.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 800;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: #23867a; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--teal); text-decoration: none; }

/* ------------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.grid { display: grid; gap: 18px; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .g3, .g2 { grid-template-columns: 1fr; } }

section { padding: 40px 0; }
section > .wrap > h2 { margin-bottom: 6px; }
.section-lead { color: var(--muted); margin-bottom: 22px; max-width: 62ch; }

/* -------------------------------------------------------------- draw demo */
.demo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.demo svg { width: 100%; height: auto; display: block; border-radius: 16px; background: #fff; }
[data-theme="dark"] .demo svg { background: #f7f4ef; }
.demo-bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.demo-step { font-weight: 800; font-size: 15px; }
.demo-hint { color: var(--muted); font-size: 15px; flex: 1 1 200px; }

.stroke { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; }
.stroke.ghost { stroke: #d8d3cb; }

/* ------------------------------------------------------------------ swatch */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.swatch {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  padding: 0;
  color: inherit;
}
.swatch:hover { border-color: var(--teal); }
.swatch .chip { height: 74px; }
.swatch .meta { padding: 10px 12px 12px; }
.swatch .name { font-weight: 800; font-size: 15px; }
.swatch .hex { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; color: var(--muted); }

.copied { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 15px; z-index: 90; }
.copied[hidden] { display: none; }

/* --------------------------------------------------------------- do / dont */
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .rules { grid-template-columns: 1fr; } }
.rule { border-radius: 18px; padding: 18px 20px; border: 1px solid var(--line); background: var(--surface); }
.rule h3 { display: flex; align-items: center; gap: 8px; }
.rule.do h3 { color: var(--teal); }
.rule.dont h3 { color: #d1495b; }
.rule ul { margin: 0; padding-left: 20px; }
.rule li { margin-bottom: 8px; }

/* ----------------------------------------------------------- legal layout */
.legal { display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: start; padding: 34px 0 60px; }
@media (max-width: 900px) { .legal { grid-template-columns: 1fr; gap: 20px; } }

.toc { position: sticky; top: 92px; }
@media (max-width: 900px) { .toc { position: static; } }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a {
  display: block;
  padding: 7px 12px;
  border-left: 3px solid transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}
.toc a::before { content: counter(t) ". "; opacity: 0.6; }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.active { color: var(--teal); border-left-color: var(--teal); background: color-mix(in srgb, var(--teal) 8%, transparent); }

.legal article h2 { scroll-margin-top: 96px; margin-top: 34px; }
.legal article h2:first-of-type { margin-top: 0; }
.legal article ul { padding-left: 22px; }
.legal article li { margin-bottom: 8px; }

.stamp { display: inline-flex; gap: 10px; align-items: center; background: var(--soft); color: var(--ink); padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; }

/* --------------------------------------------------------------- accordion */
.faq { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }
.faq + .faq { margin-top: 10px; }
.faq summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 800;
  font-size: 17px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; font-size: 22px; color: var(--teal); }
.faq[open] summary::after { content: "\2212"; }
.faq .body { padding: 0 20px 18px; color: var(--muted); }

/* ------------------------------------------------------------------ tables */
table { width: 100%; border-collapse: collapse; margin: 8px 0 18px; font-size: 16px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 800; }
.table-wrap { overflow-x: auto; }

/* ------------------------------------------------------------------ footer */
footer.bottom { border-top: 1px solid var(--line); padding: 34px 0; margin-top: 40px; color: var(--muted); font-size: 15px; }
footer.bottom .cols { display: flex; gap: 30px; flex-wrap: wrap; justify-content: space-between; }
footer.bottom a { color: var(--muted); font-weight: 600; }
footer.bottom a:hover { color: var(--teal); }
footer.bottom nav { display: flex; gap: 18px; flex-wrap: wrap; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.pill { background: var(--soft); border-radius: 999px; padding: 5px 13px; font-size: 14px; font-weight: 700; }

.fact { display: flex; gap: 14px; align-items: baseline; }
.fact b { font-size: 30px; color: var(--teal); font-weight: 800; }

.note { border-left: 4px solid var(--yellow); background: color-mix(in srgb, var(--yellow) 12%, transparent); padding: 14px 18px; border-radius: 0 14px 14px 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
