/* ============================================================
   The IEP Toolkit — shared styles
   Design intent: calm authority. Elegant, warm, unhurried.
   A stressed parent should feel this site is careful and safe.
   No JS. No webfonts. All motion respects prefers-reduced-motion.
   ============================================================ */

:root {
  --teal:        #1a6b63;
  --teal-deep:   #0f4540;
  --teal-mid:    #257e75;
  --teal-wash:   #eef5f3;
  --cream:       #f8f5ee;
  --cream-deep:  #f1ebdd;
  --gold:        #b08d3f;
  --gold-soft:   #d9c48a;
  --ink:         #1c211e;
  --ink-soft:    #414a45;
  --muted:       #6b736d;
  --rule:        #ddd7ca;
  --shadow-sm:   0 1px 2px rgba(28,33,30,.05), 0 2px 8px rgba(28,33,30,.04);
  --shadow-md:   0 2px 6px rgba(28,33,30,.06), 0 8px 24px rgba(28,33,30,.07);
  --shadow-lift: 0 4px 10px rgba(26,107,99,.10), 0 14px 34px rgba(26,107,99,.13);
  --ease:        cubic-bezier(.22,.61,.36,1);
  --serif:       'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --sans:        system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 18.5px;
  line-height: 1.68;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 730px; margin: 0 auto; padding: 0 22px; }

/* ---------- Motion primitives ---------- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes drawRule {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Header ---------- */
header {
  background: linear-gradient(160deg, var(--teal-mid) 0%, var(--teal) 45%, var(--teal-deep) 100%);
  padding: 20px 0 21px;
  border-bottom: 3px solid var(--gold-soft);
  position: relative;
  overflow: hidden;
}
/* soft light bloom, purely decorative */
header::after {
  content: "";
  position: absolute;
  top: -60%; right: -10%;
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(255,255,255,.10) 0%, transparent 68%);
  pointer-events: none;
}
header .wrap {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  position: relative; z-index: 1;
}
header a.brand {
  color: #fff; font-weight: 600; font-size: 21px;
  text-decoration: none; letter-spacing: .2px;
  transition: opacity .25s var(--ease);
}
header a.brand:hover { opacity: .82; }
header nav {
  display: inline-flex;
  gap: 18px;
  align-items: baseline;
  flex-wrap: wrap;
}
header nav a {
  color: #bfdcd7; text-decoration: none; font-size: 14.5px;
  font-family: var(--sans); letter-spacing: .2px;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .25s var(--ease), border-color .25s var(--ease);
  white-space: nowrap;
}
.navsep { color: rgba(255,255,255,.35); font-size: 13px; }
/* thin divider between nav items */
header nav a + a { position: relative; }
header nav a + a::before {
  content: "";
  position: absolute; left: -10px; top: 2px; bottom: 2px;
  width: 1px; background: rgba(255,255,255,.22);
}
header nav a:hover { color: #fff; border-bottom-color: var(--gold-soft); }

/* ---------- Typography ---------- */
h1 {
  font-size: 35px; line-height: 1.22; margin: 40px 0 10px;
  letter-spacing: -.2px; font-weight: 600;
}
h2 {
  font-size: 24px; margin: 44px 0 12px; font-weight: 600;
  letter-spacing: -.1px; position: relative; padding-bottom: 9px;
}
/* animated gold underline that draws in on scroll */
h2::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 62px; height: 2px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-soft) 100%);
  transform-origin: left center;
}
h3 { font-size: 19.5px; margin: 30px 0 7px; font-weight: 600; }

.standfirst {
  font-size: 20.5px; color: var(--ink-soft); margin: 0 0 10px;
  line-height: 1.55; font-style: italic;
}
p { margin: 0 0 17px; }

a { color: var(--teal-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--teal-mid); }

/* ---------- The answer box: the thing they came for ---------- */
.answer {
  background: linear-gradient(168deg, var(--cream) 0%, var(--cream-deep) 100%);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--teal);
  padding: 24px 26px;
  margin: 30px 0;
  border-radius: 3px 10px 10px 3px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.answer::before {
  content: "";
  position: absolute; top: -40px; right: -40px;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(26,107,99,.06) 0%, transparent 70%);
  pointer-events: none;
}
.answer .big {
  font-size: 33px; font-weight: 700; color: var(--teal-deep);
  display: block; line-height: 1.18; margin-bottom: 8px;
  letter-spacing: -.5px;
}
.answer dl { margin: 16px 0 0; }
.answer dt {
  font-family: var(--sans);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); margin-top: 14px; font-weight: 600;
}
.answer dd {
  margin: 3px 0 0; font-size: 17.5px; color: var(--ink);
  padding-left: 11px; border-left: 2px solid var(--gold-soft);
}

/* ---------- Callout ---------- */
.note {
  background: #fdfaf1;
  border: 1px solid #e9dcb9;
  border-left: 4px solid var(--gold);
  padding: 17px 20px;
  border-radius: 3px 8px 8px 3px;
  margin: 26px 0;
  font-size: 17.5px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.note:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.note strong { color: #7d6320; }

ul, ol { margin: 0 0 17px; padding-left: 25px; }
li { margin-bottom: 9px; }
ol li::marker { color: var(--teal); font-weight: 700; }
ul li::marker { color: var(--gold); }

/* ---------- CTA ---------- */
.cta {
  background: linear-gradient(155deg, var(--teal-mid) 0%, var(--teal) 50%, var(--teal-deep) 100%);
  color: #fff;
  padding: 32px 28px;
  border-radius: 12px;
  margin: 44px 0;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute; top: -50%; left: -20%;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(255,255,255,.09) 0%, transparent 66%);
  pointer-events: none;
}
.cta > * { position: relative; z-index: 1; }
.cta h2 {
  color: #fff; border: none; margin: 0 0 10px; padding: 0; font-size: 23px;
}
.cta h2::after { display: none; }
.cta p { color: #cfe6e2; margin: 0 0 20px; font-size: 17px; }
.cta a.btn {
  display: inline-block;
  background: #fff; color: var(--teal-deep);
  padding: 14px 30px; border-radius: 7px;
  font-weight: 700; text-decoration: none;
  font-family: var(--sans); font-size: 16px;
  letter-spacing: .2px;
  box-shadow: 0 2px 5px rgba(0,0,0,.13);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), background .28s var(--ease);
}
.cta a.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 20px rgba(0,0,0,.22);
  background: var(--cream);
}
.cta a.btn:active { transform: translateY(0); }
.cta .small { font-size: 14.5px; margin: 16px 0 0; color: #b9d6d1; }
.cta .small a { color: #e2f0ed; }

/* ---------- Sources ---------- */
.sources {
  font-size: 15px; color: var(--ink-soft);
  background: #fbfaf7; border: 1px solid var(--rule);
  padding: 18px 20px; border-radius: 9px; margin: 34px 0;
}
.sources h3 {
  margin-top: 0; font-size: 13px; color: var(--muted);
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 1px;
}
.sources ul { margin-bottom: 0; padding-left: 20px; }
.sources li { margin-bottom: 7px; word-break: break-word; }

/* ---------- State grid ---------- */
.states {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 12px;
}
.states li { margin: 0; }
.states a {
  display: block; padding: 15px 17px;
  border: 1px solid var(--rule); border-radius: 9px;
  text-decoration: none; color: var(--ink);
  font-family: var(--sans); font-size: 16.5px; font-weight: 600;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease),
              border-color .3s var(--ease), background .3s var(--ease);
  position: relative;
  overflow: hidden;
}
/* gold sweep that slides in on hover */
.states a::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--gold);
  transform: scaleY(0); transform-origin: top;
  transition: transform .32s var(--ease);
}
.states a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--teal-mid);
  background: var(--teal-wash);
}
.states a:hover::before { transform: scaleY(1); }
.states a span {
  display: block; font-size: 13.5px; color: var(--muted);
  font-weight: 400; margin-top: 3px;
}

/* ---------- Footer ---------- */
footer {
  margin-top: 58px;
  padding: 30px 0 60px;
  font-size: 14px; color: var(--muted);
  font-family: var(--sans);
  border-top: 1px solid var(--rule);
  position: relative;
}
footer::before {
  content: "";
  position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
footer .disclaimer {
  background: #fbfaf7; border: 1px solid var(--rule);
  padding: 16px 18px; border-radius: 9px; margin-bottom: 18px;
  line-height: 1.6;
}
footer a { color: var(--ink-soft); }

/* ============================================================
   MOTION — entrance + scroll reveal.
   Content is visible by default; motion only enhances.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {

  /* staggered entrance for the top of the page */
  main > h1        { animation: riseIn .6s var(--ease) both; }
  main > .standfirst { animation: riseIn .6s .07s var(--ease) both; }
  main > .answer   { animation: countUp .65s .14s var(--ease) both; }
  header .wrap     { animation: fadeIn .5s var(--ease) both; }

  .answer .big     { animation: countUp .6s .26s var(--ease) both; }
  .answer dl       { animation: fadeIn .6s .38s var(--ease) both; }

  /* scroll-linked reveals, only where the browser supports it */
  @supports (animation-timeline: view()) {
    main > h2,
    main > p,
    main > ul,
    main > ol,
    main > .note,
    main > .sources,
    main > .cta,
    .states li {
      animation: riseIn .7s var(--ease) both;
      animation-timeline: view();
      animation-range: entry 0% entry 42%;
    }
    /* the gold underline draws itself as the heading arrives */
    h2::after {
      animation: drawRule .7s var(--ease) both;
      animation-timeline: view();
      animation-range: entry 0% entry 46%;
    }
    /* gentle stagger across the state grid */
    .states li:nth-child(3n+2) { animation-delay: .04s; }
    .states li:nth-child(3n+3) { animation-delay: .08s; }
  }
}

/* Honour reduced motion completely — no transitions, no animations */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Keyboard focus — visible, on-brand, never removed */
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 17.5px; }
  h1 { font-size: 27px; margin-top: 30px; }
  h2 { font-size: 21.5px; margin-top: 36px; }
  .standfirst { font-size: 18.5px; }
  .answer { padding: 20px 20px; }
  .answer .big { font-size: 27px; }
  .cta { padding: 26px 20px; }
  .states { grid-template-columns: 1fr; }
}

/* ---------- Print: parents WILL print these ---------- */
@media print {
  header, .cta { background: none !important; color: #000; }
  header { border-bottom: 2px solid #000; }
  header a.brand, header nav a { color: #000 !important; }
  .cta, .states a { box-shadow: none; }
  .answer { box-shadow: none; border: 1px solid #000; }
  a { text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 11px; word-break: break-all; }
  footer { page-break-inside: avoid; }
}
