/* Iterative Learning Framework — site styles */
:root {
  --bg: #fbfaf6;
  --bg-alt: #f3f1ea;
  --surface: #ffffff;
  --ink: #1b2330;
  --ink-soft: #3a4352;
  --muted: #646d7b;
  --line: #e3dfd4;
  --accent: #2563c9;
  --accent-ink: #ffffff;
  --s1: #3b7dd8;
  --s2: #1a9d8f;
  --s3: #2e9a52;
  --s4: #5b8c2a;
  --iter: #e07b33;
  --ok: #2e9a52;
  --partial: #d99a1e;
  --ko: #d0503c;
  --shadow: 0 1px 2px rgba(27, 35, 48, .05), 0 6px 24px rgba(27, 35, 48, .06);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161d;
    --bg-alt: #171c25;
    --surface: #1c222c;
    --ink: #e8ebf0;
    --ink-soft: #c5cbd5;
    --muted: #949cab;
    --line: #2b3340;
    --accent: #6ea2f2;
    --accent-ink: #0d1520;
    --s1: #5b95e6;
    --s2: #34b8a8;
    --s3: #49b46c;
    --s4: #82b04c;
    --iter: #f0934f;
    --ok: #49b46c;
    --partial: #e5ae3a;
    --ko: #e46a56;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 600; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; margin: 0 0 1em; }
li { margin-bottom: .35em; }
strong { font-weight: 650; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 28px; } }
.narrow { max-width: 46rem; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; letter-spacing: -.01em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand small { display: block; font-weight: 450; color: var(--muted); font-size: .78rem; line-height: 1.1; }
.brand span { line-height: 1.15; font-size: .98rem; }
.nav { display: none; gap: 22px; margin-left: auto; }
.nav a { color: var(--ink-soft); text-decoration: none; font-size: .93rem; }
.nav a:hover { color: var(--accent); }
@media (min-width: 980px) { .nav { display: flex; } }
.lang { margin-left: auto; display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
@media (min-width: 980px) { .lang { margin-left: 8px; } }
.lang a { font-size: .82rem; font-weight: 650; text-decoration: none; color: var(--muted); padding: 4px 11px; border-radius: 999px; letter-spacing: .03em; }
.lang a[aria-current="true"] { background: var(--ink); color: var(--bg); }

/* Language suggestion banner */
.lang-hint { display: none; background: var(--bg-alt); border-bottom: 1px solid var(--line); font-size: .92rem; }
.lang-hint.show { display: block; }
.lang-hint .wrap { display: flex; gap: 12px; align-items: center; justify-content: center; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.lang-hint button { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 2px 6px; }

/* Hero */
.hero { padding: 72px 0 56px; border-bottom: 1px solid var(--line); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--s2); margin-bottom: 18px; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.hero h1 { max-width: 17ch; }
.hero .lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 40rem; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font-weight: 600; text-decoration: none; border: 1px solid transparent; font-size: .98rem; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); }
.facts { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 44px; padding: 0; list-style: none; }
.facts li { margin: 0; }
.facts b { display: block; font-family: var(--serif); font-size: 2rem; line-height: 1; font-weight: 600; }
.facts span { color: var(--muted); font-size: .9rem; }

/* Sections */
section { padding: 72px 0; }
section.alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 46rem; margin-bottom: 36px; }
.section-head p { color: var(--ink-soft); font-size: 1.08rem; }
.kicker { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display: block; }

.grid-3 { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { font-size: 1.15rem; margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card .icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 14px; color: #fff; }
.card .icon svg { width: 22px; height: 22px; }

/* Nested framework diagram */
.nest { display: grid; gap: 28px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .nest { grid-template-columns: 1.1fr 1fr; } }
.nest-box { border-radius: 18px; padding: 18px; color: #fff; }
.nest-box > b { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; display: block; margin-bottom: 12px; }
.nest-l1 { background: #2f5ea8; }
.nest-l1 .row { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .nest-l1 .row { grid-template-columns: 130px 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.chip { background: rgba(255,255,255,.92); color: #1b2330; border-radius: 8px; padding: 6px 10px; font-size: .85rem; font-weight: 550; }
.nest-l1 > .row > .chips { flex-direction: column; }
.nest-l2 { background: #3b72c4; border: 1px solid rgba(255,255,255,.35); }
.nest-l2 .row { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .nest-l2 .row { grid-template-columns: 140px 1fr; } }
.nest-l2 .chips { flex-direction: column; }
.nest-l3 { background: #4a84d6; border: 1px solid rgba(255,255,255,.35); }
.nest-l3 p { background: rgba(255,255,255,.92); color: #1b2330; border-radius: 8px; padding: 10px 12px; font-size: .88rem; margin: 0; }

/* Staircase diagram */
.stairs { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 8px 0 12px; }
.stair { position: relative; border-radius: var(--radius); padding: 18px 18px 16px; color: #fff; box-shadow: var(--shadow); text-decoration: none; display: block; }
.stair:hover { transform: translateY(-2px); transition: transform .15s; }
.stair .n { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.stair .t { display: block; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; line-height: 1.2; margin: 4px 0 6px; }
.stair .d { font-size: .9rem; opacity: .95; line-height: 1.45; display: block; }
.stair.s1 { background: var(--s1); } .stair.s2 { background: var(--s2); } .stair.s3 { background: var(--s3); } .stair.s4 { background: var(--s4); }
.iters { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.iter { background: var(--iter); color: #fff; border-radius: 7px; padding: 3px 9px; font-size: .78rem; font-weight: 650; }
.iter:nth-child(2) { opacity: .82; } .iter:nth-child(3) { opacity: .64; }
@media (min-width: 900px) {
  .stairs { grid-template-columns: repeat(4, 1fr); align-items: end; gap: 16px; }
  .stair.s1 { margin-bottom: 150px; } .stair.s2 { margin-bottom: 100px; } .stair.s3 { margin-bottom: 50px; }
  .stairs { position: relative; }
}
.legend-line { color: var(--muted); font-size: .9rem; display: flex; gap: 18px; flex-wrap: wrap; }
.legend-line i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }

/* Activity detail */
.activity { display: grid; gap: 24px; grid-template-columns: 1fr; padding: 40px 0; border-top: 1px solid var(--line); }
.activity:first-of-type { border-top: 0; }
@media (min-width: 900px) { .activity { grid-template-columns: 220px 1fr; gap: 48px; } }
.activity-tag { position: relative; }
.activity-num { font-family: var(--serif); font-size: 4rem; line-height: 1; font-weight: 600; }
.activity-tag .pill { display: inline-block; margin-top: 10px; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; color: #fff; }
.a1 .activity-num { color: var(--s1); } .a1 .pill { background: var(--s1); }
.a2 .activity-num { color: var(--s2); } .a2 .pill { background: var(--s2); }
.a3 .activity-num { color: var(--s3); } .a3 .pill { background: var(--s3); }
.a4 .activity-num { color: var(--s4); } .a4 .pill { background: var(--s4); }
.pill.iterative { background: var(--iter) !important; margin-left: 4px; }
.activity h3 { font-size: 1.7rem; }
.activity .goal { font-size: 1.1rem; color: var(--ink-soft); border-left: 3px solid var(--line); padding-left: 14px; }
.howto { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-top: 18px; }
.howto h4 { margin: 0 0 10px; font-size: .82rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.howto ol, .howto ul { margin-bottom: 0; }
.done { margin-top: 14px; font-size: .95rem; color: var(--ink-soft); }
.done b { color: var(--ink); }

/* Example map */
.map-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table.map { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .93rem; }
table.map th, table.map td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
table.map thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: var(--bg-alt); }
table.map td.c, table.map th.c { text-align: center; }
table.map tr.parent td:first-child { font-weight: 650; }
table.map tr.child td:first-child { padding-left: 34px; color: var(--ink-soft); }
table.map tfoot td { font-weight: 650; border-bottom: 0; background: var(--bg-alt); }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; }
.dot.ok { background: var(--ok); } .dot.partial { background: var(--partial); } .dot.ko { background: var(--ko); }
.dot.skip { background: transparent; border: 2px dashed var(--muted); opacity: .45; }
.map-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .88rem; color: var(--muted); margin-top: 12px; }
.map-legend span { display: inline-flex; gap: 6px; align-items: center; }
.note { font-size: .88rem; color: var(--muted); }

/* Planner */
.planner { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; }
@media (min-width: 640px) { .planner { padding: 30px; } }
.planner fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.planner legend { font-weight: 650; margin-bottom: 10px; padding: 0; }
.planner label { font-size: .85rem; color: var(--muted); display: block; margin-bottom: 4px; }
.planner input { width: 100%; font: inherit; font-size: .97rem; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); }
.planner input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.p-global { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; max-width: 420px; }
.p-rows { display: grid; gap: 10px; }
.p-row { display: grid; gap: 8px; grid-template-columns: 1fr 1fr 40px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.p-row .p-name { grid-column: 1 / -1; }
@media (min-width: 720px) { .p-row { grid-template-columns: 2fr 1fr 1fr 40px; padding: 0; border: 0; background: none; } .p-row .p-name { grid-column: auto; } .p-row + .p-row label { position: absolute; left: -9999px; } }
.p-del { width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 1.2rem; line-height: 1; }
.p-del:hover { color: var(--ko); border-color: var(--ko); }
.p-add { margin-top: 12px; background: none; border: 1px dashed var(--line); color: var(--accent); border-radius: 9px; padding: 9px 14px; cursor: pointer; font: inherit; font-weight: 600; font-size: .92rem; }
.p-add:hover { border-color: var(--accent); }
.p-result { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 22px; }
.p-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.p-stats div { background: var(--bg-alt); border-radius: 12px; padding: 12px 14px; }
.p-stats b { display: block; font-family: var(--serif); font-size: 1.6rem; line-height: 1.1; font-weight: 600; }
.p-stats span { font-size: .8rem; color: var(--muted); }
.p-bar { height: 14px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; display: flex; }
.p-bar i { display: block; height: 100%; }
.p-msg { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; font-size: .95rem; }
.p-msg.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.p-msg.tight { background: color-mix(in srgb, var(--partial) 18%, transparent); }
.p-msg.ko { background: color-mix(in srgb, var(--ko) 15%, transparent); }
.p-breakdown { list-style: none; padding: 0; margin: 14px 0 0; font-size: .9rem; display: grid; gap: 4px; }
.p-breakdown li { display: flex; align-items: center; gap: 8px; margin: 0; }
.p-breakdown i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.p-breakdown span:last-child { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Foundations table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.fdn { border-collapse: collapse; width: 100%; min-width: 640px; font-size: .93rem; }
table.fdn th, table.fdn td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.fdn thead th { background: var(--bg-alt); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
table.fdn tbody tr:last-child td { border-bottom: 0; }
table.fdn td:first-child { font-weight: 650; white-space: nowrap; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }

.theory { display: grid; gap: 18px; grid-template-columns: 1fr; margin-top: 28px; }
@media (min-width: 760px) { .theory { grid-template-columns: 1fr 1fr; } }
.theory .card h3 { font-size: 1.1rem; }
.theory .card p { font-size: .96rem; color: var(--ink-soft); }
.ref { color: var(--muted); font-size: .85rem; }

/* Audience */
.who { display: grid; gap: 14px; grid-template-columns: 1fr; padding: 0; list-style: none; }
@media (min-width: 760px) { .who { grid-template-columns: 1fr 1fr; } }
.who li { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.who b { display: block; margin-bottom: 2px; }
.who span { color: var(--ink-soft); font-size: .95rem; }

/* Research callout */
.callout { border-left: 4px solid var(--iter); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; padding: 22px 24px; box-shadow: var(--shadow); }
.callout p:last-child { margin-bottom: 0; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-soft); }

/* License */
.license { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .license { grid-template-columns: 1fr 1fr; } }
.cite { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-wrap: anywhere; }

/* References */
.refs { font-size: .9rem; color: var(--ink-soft); padding-left: 0; list-style: none; columns: 1; }
@media (min-width: 860px) { .refs { columns: 2; column-gap: 40px; } }
.refs li { break-inside: avoid; margin-bottom: .7em; padding-left: 1.5em; text-indent: -1.5em; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; gap: 16px 32px; flex-wrap: wrap; justify-content: space-between; }
.site-footer a { color: var(--muted); }
