:root {
  --paper: #f6f7f4; --ink: #14213d; --ink-soft: #46506a; --line: #cdd4d6;
  --polder: #2f6f4e; --polder-soft: #dfeae2; --white: #ffffff;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Archivo", system-ui, sans-serif; font-size: 1.0625rem; line-height: 1.65; }
a { color: var(--polder); text-underline-offset: 3px; }
a:focus-visible { outline: 3px solid var(--polder); outline-offset: 3px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.nav { border-bottom: 1px solid var(--line); background: var(--paper); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 16px; }
.brand img { height: 56px; width: auto; display: block; }
.nav ul { list-style: none; display: flex; gap: 24px; margin: 0; padding: 0; font-size: 0.95rem; }
.nav ul a { color: var(--ink-soft); text-decoration: none; }
.nav ul a:hover, .nav ul a[aria-current] { color: var(--ink); }
@media (max-width: 720px) { .nav ul li:not(:last-child) { display: none; } .brand img { height: 46px; } }
h1, h2, h3 { line-height: 1.15; margin: 0; }
.page-head { padding: 64px 0 32px; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.02em; font-variation-settings: "wdth" 118; margin-bottom: 14px; }
.page-head p { color: var(--ink-soft); max-width: 60ch; margin: 0; font-size: 1.15rem; }
.list { list-style: none; margin: 0 0 96px; padding: 0; border-top: 2px solid var(--ink); }
.list li { border-bottom: 1px solid var(--line); }
.list a { display: grid; grid-template-columns: 140px 1fr; gap: 8px 32px; padding: 26px 0; text-decoration: none; color: var(--ink); }
.list a:hover h2 { color: var(--polder); }
.list .date { color: var(--ink-soft); font-size: 0.92rem; padding-top: 3px; }
.list h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 6px; }
.list p { margin: 0; color: var(--ink-soft); max-width: 68ch; }
@media (max-width: 640px) { .list a { grid-template-columns: 1fr; } }
article.note { max-width: 720px; margin: 0 auto; padding: 56px 24px 96px; }
.note .back { font-size: 0.95rem; }
.note h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -0.02em; font-variation-settings: "wdth" 115; margin: 18px 0 14px; }
.note .meta { color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 32px; }
.note .lead { font-size: 1.2rem; color: var(--ink); }
.note h2 { font-size: 1.45rem; font-weight: 700; margin: 44px 0 12px; }
.note p, .note li { max-width: 68ch; }
.note ul { padding-left: 1.2em; }
.note li { margin-bottom: 6px; }
.note figure { margin: 32px 0; }
.note figure img { width: 100%; height: auto; display: block; }
.note figcaption { color: var(--ink-soft); font-size: 0.9rem; margin-top: 8px; }
.table-wrap { overflow-x: auto; margin: 20px 0; }
.note table { border-collapse: collapse; width: 100%; font-size: 0.95rem; min-width: 520px; }
.note th, .note td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.note thead th { border-bottom: 2px solid var(--ink); }
.note tbody th { font-weight: 700; }
.aside { background: var(--polder-soft); border-left: 4px solid var(--polder); padding: 16px 20px; border-radius: 4px; margin: 32px 0; }
.aside h2 { margin-top: 0; font-size: 1.15rem; }
.aside p:last-child { margin-bottom: 0; }
.source { border-top: 1px solid var(--line); margin-top: 48px; padding-top: 20px; font-size: 0.95rem; color: var(--ink-soft); }
footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 0.9rem; color: var(--ink-soft); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
footer ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.note video { width: 100%; height: auto; display: block; background: var(--white); border: 1px solid var(--line); border-radius: 6px; }
.note figure img.photo { border-radius: 6px; max-height: 460px; object-fit: cover; object-position: 50% 30%; }
.project-block { border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 56px; }
.project-block h2 { margin-top: 12px; }
.facts-line { color: var(--ink-soft); font-size: 0.95rem; margin: -4px 0 16px; }
kbd { font-family: inherit; font-size: 0.9em; background: var(--white); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.viz { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 24px 0 8px; }
.viz canvas, .viz svg { width: 100%; height: auto; display: block; }
.viz-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 10px; font-size: 0.92rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.viz-bar b { color: var(--ink); font-weight: 600; }
.replay { font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 6px; padding: 5px 12px; cursor: pointer; }
.replay:hover { background: var(--polder-soft); }
.replay:focus-visible { outline: 3px solid var(--polder); outline-offset: 2px; }
.key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.88rem; color: var(--ink-soft); margin-top: 8px; }
.key span { display: inline-flex; align-items: center; gap: 6px; }
.key i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.spec { display: inline-block; font-weight: 700; background: var(--polder-soft); color: var(--polder); padding: 1px 8px; border-radius: 4px; font-size: 0.95em; white-space: nowrap; }
.note h3.sub { font-size: 1.2rem; font-weight: 700; margin: 36px 0 10px; }
.aside ul { margin: 0; }
.slider-row { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; font-size: 0.92rem; color: var(--ink-soft); margin-top: 8px; }
.slider-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.slider-row input { width: 100%; accent-color: var(--polder); }
@media (max-width: 560px) { .slider-row { grid-template-columns: 1fr; } }
.formula { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 6px 20px; margin: 20px 0; }
.formula p { margin: 14px 0; font-variant-numeric: tabular-nums; }
.formula span { display: block; font-size: 0.82rem; font-weight: 700; color: var(--polder); margin-bottom: 2px; }
.gates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.gate { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.gate h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; }
.gate h3 span { color: var(--ink-soft); font-weight: 600; font-size: 0.92rem; }
.gate .rule { font-size: 0.9rem; color: var(--ink-soft); margin: 0 0 6px; }
.gate svg { width: 100%; max-width: 260px; height: auto; display: block; margin: 0 auto; }
.ins { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 8px; font-size: 0.92rem; }
.ins button, .bit { font: inherit; font-weight: 700; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); border-radius: 6px; padding: 4px 12px; cursor: pointer; }
.ins button[aria-pressed="true"], .bit.on { background: var(--polder); border-color: var(--polder); color: #fff; }
.ins button:focus-visible, .bit:focus-visible { outline: 3px solid var(--polder); outline-offset: 2px; }
.ins .out { margin-left: auto; color: var(--ink-soft); }
.ins .out b { color: var(--ink); }
.note table.tt { min-width: 0; width: auto; font-size: 0.85rem; margin: 0; }
.note table.tt th, .note table.tt td { padding: 3px 12px; text-align: center; }
.tt tr.now td { background: var(--polder-soft); }
@media (max-width: 640px) { .gates { grid-template-columns: 1fr; } }
.adder { padding: 18px; }
.arow { display: grid; grid-template-columns: 90px auto 1fr; align-items: center; gap: 12px; margin: 6px 0; font-variant-numeric: tabular-nums; }
.alab { font-weight: 700; font-size: 0.92rem; }
.bits { display: grid; grid-template-columns: repeat(5, 38px); gap: 6px; }
.bits .bit { padding: 6px 0; width: 38px; text-align: center; }
.bits.ro span { width: 38px; text-align: center; padding: 6px 0; border-radius: 6px; font-weight: 700; }
.arow.carry .alab, .arow.carry .cb { color: #c0392b; font-size: 0.85rem; }
.arow.carry .cb { padding: 0; }
.arow.sum { border-top: 2px solid var(--ink); padding-top: 8px; }
.sb { background: var(--paper); border: 1px solid var(--line); }
.sb.on { background: var(--polder-soft); border-color: var(--polder); color: var(--polder); }
.dec { font-weight: 700; color: var(--ink-soft); }
.weights { font-size: 0.82rem; color: var(--ink-soft); margin: 10px 0 0; }
@media (max-width: 480px) { .arow { grid-template-columns: 1fr; gap: 4px; } }
.floatform { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; max-width: 420px; margin-bottom: 8px; font-size: 0.95rem; }
.floatform input { font: inherit; padding: 6px 10px; border: 1px solid var(--ink-soft); border-radius: 6px; background: var(--paper); color: var(--ink); font-variant-numeric: tabular-nums; }
.floatform input:focus-visible { outline: 3px solid var(--polder); outline-offset: 1px; }
.replay[disabled] { opacity: 0.45; cursor: default; }
