:root {
        color-scheme: light;
        --bg: #f7f5ef;
        --surface: #ffffff;
        --surface-soft: #f2efe7;
        --text: #1d2520;
        --muted: #647067;
        --line: #e0dccd;
        --accent: #2f7d5b;
        --accent-dark: #215c43;
        --warm: #b86f3c;
        --shadow: 0 18px 50px rgba(28, 42, 34, 0.10);
        /* data series — validated categorical slots (CVD-safe as a trio) */
        --bs-a: #2a78d6;
        --bs-b: #eb6834;
        --bs-c: #1baf7a;
        --ink: #1d2520;
        --grid: #e5e2d6;
      }

      * { box-sizing: border-box; }
      html { scroll-behavior: smooth; }

      body {
        margin: 0;
        min-height: 100vh;
        background:
          linear-gradient(135deg, rgba(255, 250, 240, 0.98), rgba(235, 244, 235, 0.94) 52%, rgba(232, 239, 244, 0.98)),
          repeating-linear-gradient(90deg, rgba(47, 125, 91, 0.035) 0 1px, transparent 1px 54px),
          repeating-linear-gradient(0deg, rgba(184, 111, 60, 0.035) 0 1px, transparent 1px 54px);
        color: var(--text);
        font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        line-height: 1.55;
        -webkit-font-smoothing: antialiased;
      }

      a { color: inherit; }
      img { display: block; max-width: 100%; }

      .site-header {
        position: sticky;
        top: 0;
        z-index: 20;
        border-bottom: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.88);
        backdrop-filter: blur(8px);
      }
      .header-inner {
        margin: 0 auto;
        max-width: min(1160px, calc(100% - 32px));
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 0;
      }
      .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; text-decoration: none; }
      .brand-mark {
        width: 30px; height: 30px; border-radius: 9px;
        display: grid; place-items: center;
        background: var(--accent); color: #fff; font-size: 15px;
      }
      .top-nav a { text-decoration: none; color: var(--muted); font-size: 14px; padding: 6px 10px; border-radius: 8px; }
      .top-nav a:hover { color: var(--text); background: var(--surface-soft); }

      main { margin: 0 auto; max-width: min(1160px, calc(100% - 32px)); padding: 34px 0 70px; }

      .hero { max-width: 860px; }
      .kicker {
        display: inline-block; font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase;
        color: var(--accent-dark); font-weight: 650; margin-bottom: 10px;
      }
      h1 { font-size: clamp(28px, 4.4vw, 42px); line-height: 1.12; margin: 0 0 14px; letter-spacing: -0.015em; }
      .lede { font-size: 17px; color: var(--muted); margin: 0 0 18px; }
      .lede strong { color: var(--text); }
      .hero-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
      .pill-link {
        text-decoration: none; font-size: 13.5px; font-weight: 600;
        border: 1px solid var(--line); background: var(--surface);
        padding: 7px 13px; border-radius: 999px; color: var(--text);
      }
      .pill-link:hover { border-color: var(--accent); color: var(--accent-dark); }

      section { margin-top: 54px; }
      h2 { font-size: clamp(21px, 2.8vw, 27px); margin: 0 0 6px; letter-spacing: -0.01em; }
      .section-sub { color: var(--muted); margin: 0 0 20px; max-width: 780px; }
      h3 { font-size: 16px; margin: 0 0 8px; }
      p { max-width: 780px; }
      code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }

      .card-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
      .idea-card {
        background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
        padding: 18px 18px 16px; box-shadow: 0 8px 26px rgba(28, 42, 34, 0.05);
      }
      .idea-card h3 { display: flex; align-items: center; gap: 8px; }
      .idea-card p { font-size: 14.5px; color: var(--muted); margin: 6px 0 0; }
      .idea-tag { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
      .tag-bad { background: #f6e3dc; color: #8d4425; }
      .tag-mid { background: #ece9dd; color: #6b6349; }
      .tag-good { background: #ddeee4; color: var(--accent-dark); }

      .panel {
        background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
        box-shadow: var(--shadow); padding: 18px;
      }

      /* ---- toy example layout ---- */
      .toy-controls {
        display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center;
        padding: 10px 12px; margin-bottom: 12px;
        background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px;
      }
      .toy-controls .grow { flex: 1 1 160px; display: flex; align-items: center; gap: 8px; }
      button {
        font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text);
        background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
        padding: 7px 12px; cursor: pointer;
      }
      button:hover { border-color: var(--accent); color: var(--accent-dark); }
      button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
      button.primary:hover { background: var(--accent-dark); color: #fff; }
      input[type="range"] { width: 100%; accent-color: var(--accent); }
      .radio-row { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
      .radio-row label {
        font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 8px; cursor: pointer;
        color: var(--muted); white-space: nowrap;
      }
      .radio-row input { position: absolute; opacity: 0; pointer-events: none; }
      .radio-row label:has(input:checked) { background: var(--accent); color: #fff; }
      .radio-row label:hover { color: var(--text); }
      .radio-row label:has(input:checked):hover { color: #fff; }
      .radio-row label:has(input:focus-visible) { outline: 2px solid var(--accent-dark); outline-offset: 2px; }

      .toy-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
      .toy-scene svg { width: 100%; height: auto; display: block; }

      .side-block { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: var(--surface); }
      .side-block h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
      .owner-chip { display: flex; align-items: center; gap: 10px; }
      .owner-chip .label { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 21px; font-weight: 700; }
      .owner-chip .who { font-size: 13px; color: var(--muted); }
      .swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
      .shadow-chips { display: flex; gap: 8px; flex-wrap: wrap; min-height: 26px; }
      .shadow-chips .chip {
        display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
        border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
      }
      .shadow-chips .none { color: var(--muted); font-size: 13px; }
      .meter-row { display: grid; grid-template-columns: 64px 1fr 44px; gap: 8px; align-items: center; margin: 7px 0; font-size: 13px; }
      .meter-row .name { color: var(--muted); font-weight: 600; white-space: nowrap; }
      .meter-track { position: relative; height: 10px; border-radius: 6px; background: var(--surface-soft); overflow: visible; }
      .meter-fill { position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: 6px; transition: width 80ms linear; }
      .meter-th { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: 0.55; }
      .meter-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
      .meter-row.fired .val { color: var(--accent-dark); font-weight: 700; }

      .stat-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
      .stat-tile { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
      .stat-tile .lab { font-size: 11.5px; color: var(--muted); }
      .stat-tile .num { font-size: 17px; font-weight: 700; }
      .stat-tile.wide { grid-column: 1 / -1; }
      .stat-tile.wide .num { font-size: 20px; }

      .event-log { list-style: none; margin: 0; padding: 0; }
      .event-log li {
        display: flex; gap: 10px; padding: 7px 8px; border-radius: 9px; font-size: 13.5px;
        color: var(--muted); cursor: pointer; border: 1px solid transparent;
      }
      .event-log li:hover { background: var(--surface-soft); }
      .event-log li:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 1px; }
      .event-log li .n {
        flex: none; width: 21px; height: 21px; border-radius: 50%; border: 1.5px solid currentColor;
        display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
      }
      .event-log li.reached { color: var(--text); }
      .event-log li.current { border-color: var(--accent); background: #eef6f0; color: var(--text); }

      .scene-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 13px; color: var(--muted); }
      .scene-legend .item { display: inline-flex; align-items: center; gap: 7px; }
      .scene-legend svg { flex: none; }

      details.table-view { margin-top: 14px; max-width: 100%; overflow-x: auto; }
      details.table-view summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--accent-dark); }
      table { border-collapse: collapse; margin-top: 10px; font-size: 13.5px; width: 100%; max-width: 720px; }
      th, td { text-align: left; padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
      th { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
      td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

      .formula {
        font-family: Charter, Georgia, "Times New Roman", serif; font-size: 19px;
        background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px;
        padding: 14px 18px; margin: 14px 0; overflow-x: auto; white-space: nowrap;
      }
      .formula i { font-style: italic; }
      .fnote { font-size: 13.5px; color: var(--muted); max-width: 780px; }

      .widget-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
      .score-readout .row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
      .score-readout .row b { font-variant-numeric: tabular-nums; }
      .score-verdict { margin-top: 12px; font-weight: 700; font-size: 15px; padding: 9px 12px; border-radius: 10px; text-align: center; }
      .score-verdict.no { background: var(--surface-soft); color: var(--muted); }
      .score-verdict.yes { background: #ddeee4; color: var(--accent-dark); }
      .slider-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; font-size: 13.5px; color: var(--muted); margin-top: 10px; }

      .chart-figure { margin: 0; }
      .chart-figure figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
      .chart-wrap { position: relative; }
      .chart-tip {
        position: absolute; pointer-events: none; background: var(--surface);
        border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow);
        padding: 7px 10px; font-size: 12.5px; display: none; z-index: 5; min-width: 130px;
      }
      .chart-tip .t-val { font-weight: 700; font-size: 14px; }
      .chart-tip .t-key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

      .site-footer { border-top: 1px solid var(--line); margin-top: 70px; padding: 22px 0 34px; }
      .footer-inner { margin: 0 auto; max-width: min(1160px, calc(100% - 32px)); color: var(--muted); font-size: 13.5px; }
      .footer-inner p { margin: 4px 0; }

      @media (max-width: 900px) {
        .toy-grid, .widget-grid { grid-template-columns: 1fr; }
        .toy-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
        .side-block { margin-bottom: 0; }
      }
      @media (max-width: 560px) {
        .toy-controls .radio-row { width: 100%; justify-content: space-between; }
        .radio-row label { font-size: 12px; padding: 5px 7px; }
      }
      @media (prefers-reduced-motion: reduce) {
        html { scroll-behavior: auto; }
        .flow-ants { animation: none !important; }
      }
      @keyframes ants { to { stroke-dashoffset: -26; } }
      .flow-ants { animation: ants 0.9s linear infinite; }
