/* =========================================================
   Polibio.ai — landing page
   Editorial / academic. Warm-neutral. Italia Innovation system.
   ========================================================= */

:root {
  /* Polibio palette (per brief) */
  --bg:        #FAF9F7;
  --surface:   #FFFFFF;
  --ink:       #1A1A1F;
  --secondary: #5C5C66;
  --muted:     #8E8E99;
  --border:    #E8E5DE;
  --rule:      #D9D5CC;
  --dark:      #1A1A1F;
  --dark-2:    #25252B;
  --on-dark-2: #B8B8C0;
  --on-dark-3: #6E6E78;
  --on-dark-border: #2F2F36;

  /* Phase accents */
  --green:  #15803D;   /* A · discovery */
  --amber:  #C2410C;   /* B · interpretation · primary accent */
  --purple: #7C3AED;   /* C · probing */
  --blue:   #1D4ED8;   /* D · design */
  --rose:   #BE123C;
  --teal:   #0F766E;

  --font-sans: 'DM Sans', 'Neue Haas Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, Menlo, Consolas, monospace;
  --font-serif: 'Simoncini Garamond', 'EB Garamond', Georgia, 'Times New Roman', serif;

  --page-max: 1280px;
  --page-pad: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "ss02";
}
a { color: inherit; text-decoration: none; }

::selection { background: var(--amber); color: #fff; }

/* ——— Page wrapper ——— */
.wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--page-pad); }

/* ——— Type primitives ——— */
.meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.meta--inv { color: var(--on-dark-3); }
.prefix::before { content: "_ "; }
.crumb-sep { color: var(--muted); margin: 0 8px; }
.dot {
  display: inline-block; width: 8px; height: 8px;
  vertical-align: middle; margin-right: 8px;
  background: var(--ink);
}
.dot--g { background: var(--green); }
.dot--a { background: var(--amber); }
.dot--p { background: var(--purple); }
.dot--b { background: var(--blue); }

/* ——— Top bar ——— */
.topbar {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid var(--on-dark-border);
  background: var(--dark);
  color: #fff;
}
.topbar .inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--page-pad);
  max-width: var(--page-max); margin: 0 auto;
}
.topbar .wm {
  display: flex; align-items: baseline; gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.04em;
  color: var(--on-dark-2);
}
.topbar .wm img { height: 14px; opacity: 0.9; display: block; }
.topbar .wm .sep { color: var(--on-dark-3); }
.topbar .wm strong { color: #fff; font-weight: 500; font-family: var(--font-sans); letter-spacing: -0.01em; font-size: 14px; }
.topbar nav { display: flex; gap: 26px; }
.topbar nav a {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.04em;
  color: var(--on-dark-2);
  text-transform: lowercase;
}
.topbar nav a:hover { color: #fff; }
.topbar nav a::before { content: "_ "; color: var(--on-dark-3); }

/* =========================================================
   HERO  —  three variants, only one .hero[data-show] is shown
   ========================================================= */
.hero { display: none; background: var(--dark); color: #fff; }
.hero[data-show="A"], .hero[data-show="B"], .hero[data-show="C"] { display: block; }
body[data-hero="A"] .hero[data-show="A"] { display: block; }
body[data-hero="B"] .hero[data-show="A"] { display: none; }
body[data-hero="B"] .hero[data-show="B"] { display: block; }
body[data-hero="C"] .hero[data-show="A"] { display: none; }
body[data-hero="C"] .hero[data-show="C"] { display: block; }
body[data-hero="A"] .hero[data-show="B"], body[data-hero="A"] .hero[data-show="C"] { display: none; }
body[data-hero="B"] .hero[data-show="C"] { display: none; }
body[data-hero="C"] .hero[data-show="B"] { display: none; }

.hero .wrap { padding-top: clamp(56px, 9vw, 120px); padding-bottom: clamp(64px, 9vw, 128px); }
.hero h1 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(40px, 6.4vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 0 32px;
  max-width: 18ch;
  text-wrap: balance;
}
.hero h1 .accent { color: var(--amber); }
.hero .lede {
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.45;
  color: var(--on-dark-2);
  max-width: 56ch;
  margin: 0 0 48px;
  font-weight: 400;
}
.hero .ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.cta {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 22px;
  font-size: 14px; font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid var(--on-dark-border);
  background: transparent; color: #fff;
  transition: background 160ms ease, border-color 160ms ease;
}
.cta:hover { background: #fff; color: var(--dark); border-color: #fff; }
.cta--primary { background: var(--amber); border-color: var(--amber); color: #fff; }
.cta--primary:hover { background: #fff; color: var(--dark); border-color: #fff; }
.cta .arr { font-family: var(--font-mono); font-size: 13px; opacity: 0.7; }
.cta:hover .arr { opacity: 1; }

/* --- Hero A: Editorial --- */
.hero-a .eyebrow {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 56px;
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.06em; color: var(--on-dark-2);
}
.hero-a .eyebrow .pill {
  padding: 4px 10px; border: 1px solid var(--on-dark-border);
  color: var(--on-dark-2);
}
.hero-a .eyebrow .pill .dot { width: 6px; height: 6px; margin-right: 6px; background: var(--amber); }
.hero-a .figure-row {
  display: grid; grid-template-columns: 1fr; gap: 0;
  margin-top: 96px; padding-top: 32px;
  border-top: 1px solid var(--on-dark-border);
}
.hero-a .figure-meta { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hero-a .figure-meta dl { margin: 0; }
.hero-a .figure-meta dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-dark-3); margin-bottom: 6px; }
.hero-a .figure-meta dd { margin: 0; font-size: 14px; color: var(--on-dark-2); }
.hero-a .figure-meta dd strong { color: #fff; font-weight: 500; }

/* --- Hero B: Lifecycle visualization --- */
.hero-b .grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.hero-b h1 { max-width: 14ch; }
.hero-b .lede { max-width: 42ch; }
.hero-b .phases {
  border-left: 1px solid var(--on-dark-border);
  padding: 4px 0 4px 28px;
  display: flex; flex-direction: column; gap: 24px;
  margin-top: 12px;
}
.hero-b .phase {
  display: grid; grid-template-columns: 40px 1fr; gap: 20px;
  padding: 4px 0;
}
.hero-b .phase .letter {
  font-family: var(--font-sans); font-weight: 500;
  font-size: 44px; line-height: 0.9; letter-spacing: -0.04em;
}
.hero-b .phase[data-color="g"] .letter { color: var(--green); }
.hero-b .phase[data-color="a"] .letter { color: var(--amber); }
.hero-b .phase[data-color="p"] .letter { color: var(--purple); }
.hero-b .phase[data-color="b"] .letter { color: var(--blue); }
.hero-b .phase .body { padding-top: 2px; }
.hero-b .phase .body .label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--on-dark-3); margin-bottom: 4px;
}
.hero-b .phase .body .name { font-size: 16px; color: #fff; line-height: 1.35; font-weight: 500; letter-spacing: -0.005em; }
.hero-b .phase .body .name span { color: var(--on-dark-2); font-weight: 400; }
.hero-b .fieldwork {
  display: grid; grid-template-columns: 40px 1fr; gap: 20px;
  padding: 14px 0;
  border-top: 1px dashed var(--on-dark-border);
  border-bottom: 1px dashed var(--on-dark-border);
}
.hero-b .fieldwork .marker {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--on-dark-3); letter-spacing: 0.05em;
}
.hero-b .fieldwork .body .label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--on-dark-3); margin-bottom: 4px;
}
.hero-b .fieldwork .body .name { font-size: 15px; color: #fff; font-style: italic; font-weight: 400; }

/* --- Hero C: Terminal --- */
.hero-c .grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(40px, 5vw, 80px);
  align-items: start;
}
.hero-c h1 { font-size: clamp(36px, 4.8vw, 68px); max-width: 16ch; }
.hero-c .lede { max-width: 44ch; }
.hero-c .terminal {
  background: #0E0E12;
  border: 1px solid var(--on-dark-border);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--on-dark-2);
  min-height: 420px;
  display: flex; flex-direction: column;
}
.hero-c .terminal .titlebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--on-dark-border);
  background: #15151B;
  color: var(--on-dark-3);
  font-size: 11px; letter-spacing: 0.04em;
}
.hero-c .terminal .titlebar .right { display: flex; gap: 10px; align-items: center; }
.hero-c .terminal .titlebar .dot { width: 8px; height: 8px; border-radius: 0; background: var(--on-dark-border); margin: 0; }
.hero-c .terminal .body { padding: 18px 18px; flex: 1; overflow: hidden; white-space: pre-wrap; }
.hero-c .terminal .prompt { color: var(--amber); }
.hero-c .terminal .cmd { color: #fff; }
.hero-c .terminal .out { color: var(--on-dark-2); }
.hero-c .terminal .ok { color: var(--green); }
.hero-c .terminal .warn { color: var(--amber); }
.hero-c .terminal .dim { color: var(--on-dark-3); }
.hero-c .terminal .cursor {
  display: inline-block; width: 8px; height: 14px; background: var(--amber);
  vertical-align: -2px; margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* =========================================================
   Light sections
   ========================================================= */
.section { padding: clamp(64px, 8vw, 112px) 0; border-top: 1px solid var(--border); }
.section:first-of-type { border-top: 0; }
.section-header {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(24px, 5vw, 80px); margin-bottom: clamp(40px, 6vw, 72px);
  align-items: end;
}
.section-header .left .prefix {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.06em; color: var(--muted);
  margin-bottom: 16px;
}
.section-header .left h2 {
  font-size: clamp(32px, 4.2vw, 56px);
  line-height: 1.02; letter-spacing: -0.028em;
  font-weight: 500; margin: 0; max-width: 14ch;
}
.section-header .right .stand {
  font-size: clamp(18px, 1.5vw, 22px); line-height: 1.4;
  color: var(--ink); max-width: 56ch; margin: 0;
  font-weight: 400;
}

/* ——— Why (two cards + inversion line) ——— */
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--ink); }
.why-card { padding: 36px 32px 36px 0; border-bottom: 1px solid var(--ink); }
.why-card:nth-child(1) { padding-right: 48px; border-right: 1px solid var(--ink); padding-left: 0; }
.why-card:nth-child(2) { padding-left: 48px; padding-right: 0; }
.why-card .num {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 14px;
}
.why-card h3 {
  font-size: clamp(22px, 2vw, 28px); line-height: 1.15;
  letter-spacing: -0.015em; font-weight: 500; margin: 0 0 16px;
  max-width: 22ch;
}
.why-card p { font-size: 16px; line-height: 1.55; color: var(--secondary); margin: 0; max-width: 48ch; }
.why-invert {
  padding: 36px 0 0;
  display: flex; justify-content: space-between; align-items: baseline; gap: 32px; flex-wrap: wrap;
}
.why-invert p {
  font-family: var(--font-serif); font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.25; max-width: 22ch; margin: 0; color: var(--ink); font-style: italic;
}
.why-invert p em { font-style: italic; }
.why-invert .key {
  display: flex; gap: 20px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.06em; color: var(--muted);
}

/* ——— Lifecycle diagram ——— */
.lifecycle {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  gap: 0; align-items: stretch;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.lc-step { padding: 28px 24px 28px 0; min-width: 0; }
.lc-step + .lc-step { padding-left: 24px; }
.lc-step .head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 18px;
}
.lc-step .letter {
  font-family: var(--font-sans); font-weight: 500;
  font-size: 48px; line-height: 0.85; letter-spacing: -0.04em;
}
.lc-step[data-color="g"] .letter { color: var(--green); }
.lc-step[data-color="a"] .letter { color: var(--amber); }
.lc-step[data-color="p"] .letter { color: var(--purple); }
.lc-step[data-color="b"] .letter { color: var(--blue); }
.lc-step .label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.lc-step h4 {
  font-size: 17px; line-height: 1.25; font-weight: 500;
  letter-spacing: -0.005em; margin: 0 0 8px; color: var(--ink);
}
.lc-step p { font-size: 13px; line-height: 1.5; color: var(--secondary); margin: 0; max-width: 28ch; }
.lc-arrow {
  display: flex; align-items: center; padding: 0 8px;
  font-family: var(--font-mono); font-size: 14px; color: var(--muted);
}
.lc-fieldwork {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 8px; min-width: 80px;
}
.lc-fieldwork .glyph {
  font-family: var(--font-mono); font-size: 14px; color: var(--muted);
  border-left: 1px dashed var(--rule); height: 36px; margin: 0 auto;
}
.lc-fieldwork .marker {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); text-align: center;
  padding: 6px 0; max-width: 88px;
}
.lc-fieldwork .marker em { font-style: italic; color: var(--secondary); text-transform: none; letter-spacing: 0; font-size: 11px; display: block; }
.lc-foot {
  margin-top: 32px;
  display: flex; gap: 40px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.06em; color: var(--muted);
}
.lc-foot strong { color: var(--ink); font-weight: 500; }

/* ——— What it is (scaffolding) ——— */
.scaff {
  display: grid; grid-template-columns: 1.05fr 1fr;
  gap: clamp(40px, 6vw, 80px); align-items: start;
}
.scaff .text h3 {
  font-size: clamp(24px, 2.4vw, 32px); font-weight: 500;
  letter-spacing: -0.02em; line-height: 1.12; margin: 0 0 18px;
  max-width: 18ch;
}
.scaff .text p { font-size: 16px; line-height: 1.55; color: var(--secondary); max-width: 48ch; margin: 0 0 16px; }
.scaff .text p strong { color: var(--ink); font-weight: 500; }
.scaff .vis {
  border: 1px solid var(--border); background: var(--surface);
  padding: 28px;
}
.scaff .vis .legend {
  display: flex; gap: 28px; margin-bottom: 24px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.06em; color: var(--muted);
}
.scaff .vis .legend .swatch {
  display: inline-block; width: 18px; height: 8px;
  vertical-align: middle; margin-right: 8px; background: var(--ink);
}
.scaff .vis .legend .swatch--dashed {
  background: transparent;
  border-top: 2px dashed var(--ink);
  height: 0;
}
.scaff .layers { display: flex; flex-direction: column; gap: 8px; }
.scaff .layer {
  display: grid; grid-template-columns: 80px 1fr auto;
  gap: 16px; align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--ink);
  background: var(--surface);
}
.scaff .layer.mut {
  border: 1px dashed var(--ink);
  background: transparent;
}
.scaff .layer .id { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--muted); }
.scaff .layer .name { font-size: 15px; font-weight: 500; letter-spacing: -0.005em; color: var(--ink); }
.scaff .layer.mut .name { color: var(--ink); font-style: italic; font-weight: 400; }
.scaff .layer .tag {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

/* ——— Data toolkit ——— */
.toolkit .sources {
  display: flex; flex-wrap: wrap; gap: 4px 28px;
  padding: 28px 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 13px; color: var(--ink);
  align-items: baseline;
}
.toolkit .sources .src { padding: 4px 0; }
.toolkit .sources .src.dim { color: var(--muted); }
.toolkit .sources .sep { color: var(--rule); }
.toolkit .guarantee {
  margin-top: 28px;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 56px; align-items: start;
}
.toolkit .guarantee h4 {
  font-size: 14px; font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 400;
  margin: 0 0 14px;
}
.toolkit .guarantee p { font-size: 15px; line-height: 1.55; color: var(--ink); margin: 0 0 12px; max-width: 50ch; }
.toolkit .guarantee p strong { font-weight: 500; }
.toolkit .guarantee ul {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 10px;
}
.toolkit .guarantee li {
  font-size: 14px; line-height: 1.4; color: var(--secondary);
  padding-left: 18px; position: relative;
}
.toolkit .guarantee li::before {
  content: "—"; color: var(--amber); position: absolute; left: 0;
  font-family: var(--font-mono);
}

/* ——— Adapt to your field (3 cards) ——— */
.adapt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--ink); }
.adapt-card { padding: 32px 28px 32px 0; }
.adapt-card + .adapt-card { padding-left: 32px; border-left: 1px solid var(--rule); }
.adapt-card .num {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 18px;
}
.adapt-card h4 {
  font-size: 19px; font-weight: 500; line-height: 1.2;
  letter-spacing: -0.01em; margin: 0 0 12px;
}
.adapt-card p { font-size: 14px; line-height: 1.55; color: var(--secondary); margin: 0; max-width: 32ch; }

/* ——— Read · try · cite (3 large cards) ——— */
.rtc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.rtc-card { padding: 40px 32px 40px 0; display: flex; flex-direction: column; min-height: 320px; }
.rtc-card + .rtc-card { padding-left: 40px; border-left: 1px solid var(--rule); }
.rtc-card .num { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 18px; }
.rtc-card h3 {
  font-size: clamp(26px, 2.2vw, 32px); font-weight: 500;
  line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 14px;
  max-width: 14ch;
}
.rtc-card p { font-size: 15px; line-height: 1.5; color: var(--secondary); margin: 0 0 22px; max-width: 32ch; }
.rtc-card .meta-block {
  margin-top: auto;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.06em; color: var(--muted);
  display: flex; flex-direction: column; gap: 6px;
}
.rtc-card .meta-block .row { display: flex; gap: 12px; }
.rtc-card .meta-block .row .k { color: var(--muted); min-width: 70px; }
.rtc-card .meta-block .row .v { color: var(--ink); }
.rtc-card .go {
  display: inline-flex; align-items: center; gap: 10px;
  align-self: flex-start;
  padding: 12px 18px; margin-top: 18px;
  border: 1px solid var(--ink); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--ink);
  transition: background 160ms ease, color 160ms ease;
}
.rtc-card .go:hover { background: var(--ink); color: #fff; }
.rtc-card .go .arr { font-family: var(--font-mono); }
.rtc-card[data-color="g"] .num::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--green); margin-right: 8px; vertical-align: middle; }
.rtc-card[data-color="p"] .num::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--purple); margin-right: 8px; vertical-align: middle; }
.rtc-card[data-color="b"] .num::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--blue); margin-right: 8px; vertical-align: middle; }
.rtc-card[data-color="a"] .num::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--amber); margin-right: 8px; vertical-align: middle; }

/* =========================================================
   Footer (dark)
   ========================================================= */
.site-foot { background: var(--dark); color: #fff; padding: clamp(64px, 7vw, 96px) 0 36px; }
.site-foot .wrap { display: flex; flex-direction: column; gap: 48px; }
.site-foot .top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--on-dark-border);
}
.site-foot h5 {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--on-dark-3); margin: 0 0 16px; font-weight: 400;
}
.site-foot .lead {
  font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2;
  letter-spacing: -0.02em; color: #fff; max-width: 22ch;
  margin: 0; font-weight: 500;
}
.site-foot .lead em { font-style: italic; color: var(--on-dark-2); font-weight: 400; }
.site-foot ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.site-foot ul a {
  font-size: 13px; color: var(--on-dark-2);
  display: inline-flex; gap: 8px; align-items: baseline;
}
.site-foot ul a:hover { color: #fff; }
.site-foot ul a::before { content: "_"; color: var(--on-dark-3); font-family: var(--font-mono); }
.site-foot .bottom {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 32px; flex-wrap: wrap;
}
.site-foot .bottom .wmwrap { display: flex; flex-direction: column; gap: 12px; }
.site-foot .bottom .wmwrap img { height: 24px; width: auto; }
.site-foot .bottom .colophon {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.06em; color: var(--on-dark-3);
  text-align: right; line-height: 1.6;
}
.site-foot .bottom .colophon strong { color: var(--on-dark-2); font-weight: 400; }

/* =========================================================
   Tweaks panel
   ========================================================= */
#tweaks-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--ink);
  font-family: var(--font-sans);
  display: none;
}
#tweaks-panel.open { display: block; }
#tweaks-panel .head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--ink); color: #fff;
}
#tweaks-panel .head h6 {
  margin: 0; font-size: 11px; font-family: var(--font-mono);
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 400;
}
#tweaks-panel .head button {
  background: none; border: 0; color: #fff;
  font-family: var(--font-mono); font-size: 12px; cursor: pointer;
  padding: 2px 6px;
}
#tweaks-panel .body { padding: 18px 16px 20px; }
#tweaks-panel .group-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
#tweaks-panel .opts { display: flex; flex-direction: column; gap: 8px; }
#tweaks-panel .opt {
  display: grid; grid-template-columns: 22px 1fr;
  gap: 10px; align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 120ms ease, background 120ms ease;
}
#tweaks-panel .opt:hover { border-color: var(--ink); }
#tweaks-panel .opt.active { border-color: var(--ink); background: var(--bg); }
#tweaks-panel .opt .pip {
  width: 12px; height: 12px; border: 1px solid var(--ink);
  margin-top: 3px; background: var(--surface);
}
#tweaks-panel .opt.active .pip { background: var(--amber); border-color: var(--amber); }
#tweaks-panel .opt .name { font-weight: 500; color: var(--ink); }
#tweaks-panel .opt .desc { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px) {
  .topbar nav { display: none; }
  .hero-b .grid, .hero-c .grid { grid-template-columns: 1fr; }
  .section-header { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .why-card:nth-child(1) { padding-right: 0; border-right: 0; padding-bottom: 28px; }
  .why-card:nth-child(2) { padding-left: 0; padding-top: 28px; }
  .lifecycle {
    grid-template-columns: 1fr;
    border-bottom: 0;
  }
  .lifecycle .lc-arrow, .lifecycle .lc-fieldwork { display: none; }
  .lc-step + .lc-step { padding-left: 0; }
  .lc-step { border-top: 1px solid var(--rule); padding: 24px 0; }
  .lc-step:first-child { border-top: 0; }
  .scaff { grid-template-columns: 1fr; }
  .adapt-grid, .rtc-grid { grid-template-columns: 1fr; }
  .adapt-card + .adapt-card, .rtc-card + .rtc-card { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); padding-top: 28px; }
  .rtc-card { min-height: auto; padding-right: 0; }
  .adapt-card { padding-right: 0; padding-top: 28px; }
  .adapt-grid > :first-child, .rtc-grid > :first-child { padding-top: 0; }
  .site-foot .top { grid-template-columns: 1fr 1fr; }
  .toolkit .guarantee { grid-template-columns: 1fr; gap: 24px; }
  #tweaks-panel { right: 12px; bottom: 12px; width: calc(100vw - 24px); max-width: 320px; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 38px; }
  .site-foot .top { grid-template-columns: 1fr; }
  .hero-a .figure-meta { flex-direction: column; gap: 18px; }
}

/* =========================================================
   What it produces — worked-example output grid
   ========================================================= */
.proof-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; background: var(--rule);
  border: 1px solid var(--rule); border-top: 2px solid var(--ink);
}
.proof { margin: 0; background: var(--bg); padding: 22px 26px 26px; min-width: 0; }
.proof figcaption { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.proof figcaption .t { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
.proof figcaption .s { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.03em; color: var(--muted); }
.proof .chart { position: relative; height: 200px; }
.proof-foot { margin-top: 28px; display: flex; flex-direction: column; gap: 18px; }
.proof-foot .pf-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap;
  border-top: 1px solid var(--rule); padding-top: 20px;
}
.proof-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink);
  border-bottom: 1px solid var(--ink); padding-bottom: 2px;
}
.proof-link:hover { color: var(--amber); border-color: var(--amber); }
.proof-link .arr { opacity: 0.7; }
.diagnosis { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.diagnosis .dx-lead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.diagnosis .dx-lead strong { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
.diagnosis .dx-states { display: flex; gap: 8px; flex-wrap: wrap; }
.diagnosis .dx {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.03em;
  padding: 6px 12px; border: 1px solid var(--rule); color: var(--secondary);
}
.diagnosis .dx--ok { border-color: var(--green); color: var(--green); }
.diagnosis .dx--warn { border-color: var(--amber); color: var(--amber); }
.diagnosis .dx--surprise { border-color: var(--purple); color: var(--purple); }

@media (max-width: 980px) {
  .proof-grid { grid-template-columns: 1fr; }
  .diagnosis { flex-direction: column; align-items: flex-start; }
}
