:root {
  --ink: #0b1e2d;
  --ink-soft: #29404f;
  --paper: #f5f0e4;
  --paper-deep: #e9e1d2;
  --white: #fffdf7;
  --coral: #f06445;
  --coral-dark: #c83e26;
  --mint: #97dbc9;
  --yellow: #f2ca67;
  --line: #b9b09f;
  --ok: #2e8b70;
  --bad: #d84935;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(11,30,45,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,30,45,.045) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: var(--sans);
  line-height: 1.75;
}
a { color: inherit; }
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 20; background: var(--ink); color: white; padding: 10px 16px; }
.skip-link:focus { left: 8px; }

.site-header {
  position: relative;
  z-index: 5;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 5vw, 76px);
  border-bottom: 1px solid var(--ink);
  background: rgba(245,240,228,.94);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; line-height: 1.05; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; background: var(--coral); color: var(--white); border: 1px solid var(--ink); border-radius: 50%; font-family: var(--serif); font-size: 1.35rem; box-shadow: 3px 3px 0 var(--ink); }
.brand b, .brand small { display: block; }
.brand b { font-size: .95rem; letter-spacing: .08em; }
.brand small { margin-top: 5px; font-size: .69rem; letter-spacing: .16em; }
nav { display: flex; align-items: center; gap: clamp(12px, 2.2vw, 30px); font-size: .84rem; font-weight: 700; }
nav a { text-underline-offset: 5px; text-decoration-thickness: 1px; }
.privacy-pill { padding: 5px 11px; border: 1px solid var(--ink); border-radius: 999px; background: var(--mint); white-space: nowrap; }

.hero {
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: center;
  padding: clamp(60px, 9vw, 130px) clamp(20px, 8vw, 130px) clamp(70px, 10vw, 140px);
  overflow: hidden;
}
.kicker, .section-index { font-family: var(--mono); font-size: .76rem; font-weight: 800; letter-spacing: .18em; }
.kicker { color: #8b2b1c; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 760px;
  margin-bottom: 28px;
  font-family: var(--serif);
  font-size: clamp(3rem, 6.6vw, 6.8rem);
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: 1.04;
}
h1 em { position: relative; z-index: 0; font-style: normal; white-space: nowrap; }
h1 em::after { content: ""; position: absolute; z-index: -1; left: -.04em; right: -.04em; bottom: .07em; height: .22em; background: var(--yellow); transform: rotate(-1.1deg); }
.hero-lead { max-width: 650px; font-size: clamp(1rem, 1.4vw, 1.23rem); color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 34px 0 38px; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 16px; padding: 11px 20px; border: 1px solid var(--ink); border-radius: 0; text-decoration: none; font-weight: 800; cursor: pointer; box-shadow: 4px 4px 0 var(--ink); transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translate(2px,2px); box-shadow: 2px 2px 0 var(--ink); }
.button:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; box-shadow: 0 0 0 5px var(--ink); }
.button-primary { background: var(--ink); color: var(--white); }
.button-primary:hover { background: #183a50; }
.button-ghost { background: var(--white); }
.button-dark { width: 100%; background: var(--ink); color: var(--white); box-shadow: 4px 4px 0 var(--coral); }
.button-wide { width: 100%; }
.trust-strip { display: flex; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.trust-strip li { display: flex; align-items: baseline; gap: 7px; padding: 10px 20px 10px 0; margin-right: 20px; }
.trust-strip strong { font-family: var(--mono); font-size: 1.35rem; }
.trust-strip span { color: var(--ink-soft); font-size: .73rem; }

.hero-instrument { position: relative; min-height: 520px; display: grid; place-items: center; }
.hero-instrument::before { content: ""; position: absolute; width: min(430px, 90%); aspect-ratio: 1; border: 1px solid var(--ink); border-radius: 50%; background: var(--mint); box-shadow: 17px 18px 0 rgba(11,30,45,.12); }
.specimen-card { position: relative; z-index: 2; width: min(340px, 82%); min-height: 410px; padding: 26px 28px 32px; background: var(--white); border: 1px solid var(--ink); box-shadow: 11px 12px 0 var(--ink); transform: rotate(2deg); font-family: var(--mono); font-size: .78rem; line-height: 1.85; overflow: hidden; }
.specimen-head { display: flex; justify-content: space-between; padding-bottom: 10px; border-bottom: 2px solid var(--ink); color: var(--coral-dark); letter-spacing: .12em; }
.receipt-vendor { margin-top: 20px; font-family: var(--serif); font-size: 1.55rem; font-weight: 700; }
.receipt-focus { padding: 3px 6px; background: var(--yellow); }
.receipt-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; }
.receipt-total strong { font-size: 1.35rem; }
.text-cursor { position: absolute; right: 26px; bottom: 28px; width: 42px; height: 5px; background: var(--coral); box-shadow: 0 0 14px rgba(240,100,69,.65); }
.measure-rail { position: absolute; z-index: 3; right: -2px; top: 74px; bottom: 74px; width: 40px; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; font-family: var(--mono); font-size: .62rem; }
.measure-rail::before { content: ""; position: absolute; right: 0; top: 18px; bottom: 18px; width: 2px; background: var(--ink); }
.measure-rail i { position: relative; width: 18px; height: 1px; background: var(--ink); }
.instrument-note { position: absolute; z-index: 3; left: 8px; bottom: 40px; display: grid; gap: 5px; font-family: var(--mono); font-size: .67rem; }
.instrument-note span { width: max-content; padding: 4px 8px; background: var(--ink); color: var(--white); }
.hero-boundary { max-width: 650px; padding: 14px 16px; border-left: 5px solid var(--coral); background: rgba(255,253,247,.72); font-size: .92rem; }

.positioning { display: grid; grid-template-columns: .35fr 1.2fr .8fr; gap: clamp(24px, 5vw, 72px); padding: 72px clamp(20px, 8vw, 130px); background: var(--ink); color: var(--white); }
.section-index { color: #8b2b1c; }
.positioning .section-index { color: #ff9279; }
h2 { font-family: var(--serif); font-size: clamp(2rem, 4.1vw, 4.25rem); letter-spacing: -.045em; line-height: 1.13; }
.positioning h2 { font-size: clamp(2rem, 3.7vw, 3.6rem); }
.positioning p { color: #d9e0e3; }
.boundary-card { align-self: start; padding: 24px; border: 1px solid var(--white); background: rgba(255,255,255,.045); box-shadow: 7px 7px 0 var(--coral); }
.boundary-card b { display: block; color: var(--mint); }
.boundary-card .muted-title { margin-top: 18px; color: var(--yellow); }
.boundary-card p { margin-bottom: 0; font-size: .87rem; }

.lab-section { padding: clamp(76px, 9vw, 130px) clamp(20px, 5vw, 76px); background: var(--paper-deep); border-bottom: 1px solid var(--ink); }
.section-heading { max-width: 800px; margin: 0 auto 48px; text-align: center; }
.section-heading h2 { margin-bottom: 12px; }
.section-heading p:last-child { color: var(--ink-soft); }
.case-picker { max-width: 720px; margin: 0 auto 28px; padding: 20px 22px; display: grid; grid-template-columns: 170px minmax(0,1fr); gap: 7px 18px; align-items: center; border: 1px solid var(--ink); background: var(--white); box-shadow: 6px 6px 0 var(--coral); }
.case-picker label { margin: 0; }
.case-picker select { width: 100%; min-height: 48px; padding: 9px 42px 9px 12px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); font: 700 .92rem var(--sans); }
.case-picker p { grid-column: 2; margin: 0; color: var(--ink-soft); font-size: .78rem; }
.lab-grid { max-width: 1450px; margin: auto; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); border: 1px solid var(--ink); box-shadow: 12px 12px 0 var(--ink); }
.lab-step { min-width: 0; padding: clamp(22px, 3vw, 38px); background: var(--white); }
.lab-step + .lab-step { border-left: 1px solid var(--ink); }
.step-label { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.step-label span { padding: 3px 7px; background: var(--ink); color: white; font-family: var(--mono); font-size: .65rem; letter-spacing: .1em; }
.step-label b { font-size: .95rem; }
.sample-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.sample-meta span { padding: 2px 7px; border: 1px solid var(--line); font-family: var(--mono); font-size: .6rem; }
pre { height: 285px; margin: 0 0 16px; padding: 18px; overflow: auto; border: 1px solid var(--ink); background: var(--paper); font-family: var(--mono); font-size: .78rem; line-height: 1.65; white-space: pre-wrap; }
label { display: block; margin-bottom: 7px; font-size: .82rem; font-weight: 800; }
input, select, textarea { border-radius: 0; }
#candidate-name { width: 100%; min-height: 46px; margin-bottom: 16px; padding: 9px 12px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); }
textarea { width: 100%; height: 250px; resize: vertical; padding: 16px; border: 1px solid var(--ink); background: #f8faf7; color: var(--ink); font-family: var(--mono); font-size: .78rem; line-height: 1.55; }
textarea[aria-invalid="true"] { border: 3px solid var(--bad); }
.manual-prompt { height: 180px; margin-top: 12px; background: var(--white); }
.sample-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
.sample-buttons button { min-height: 44px; padding: 8px 11px; border: 1px solid var(--ink); background: var(--paper); cursor: pointer; font-size: .75rem; font-weight: 700; }
.sample-buttons button:hover { background: var(--yellow); }
.microcopy { margin: 12px 0 0; color: var(--ink-soft); font-size: .76rem; }
.input-error { margin: 8px 0; padding: 10px 12px; border-left: 5px solid var(--bad); background: #fff0eb; color: #7d1f13; font-size: .8rem; font-weight: 700; }
.input-error[hidden] { display: none; }
.third-party-warning { margin: 0 0 16px; padding: 13px 14px; border: 1px solid var(--ink); background: #fff6d8; }
.third-party-warning b { font-size: .8rem; }
.third-party-warning p { margin: 4px 0 0; color: var(--ink-soft); font-size: .76rem; line-height: 1.6; }
.result-step { background: #f3f7f2; }
.score-orbit { position: relative; width: 178px; margin: 12px auto 18px; }
.score-orbit svg { display: block; transform: rotate(-90deg); }
.orbit-base, .orbit-value { fill: none; stroke-width: 7; }
.orbit-base { stroke: #d9ded7; }
.orbit-value { stroke: var(--coral); stroke-linecap: square; stroke-dasharray: 358.14; stroke-dashoffset: 358.14; transition: stroke-dashoffset .5s ease; }
.score-orbit > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.score-orbit strong { font-family: var(--mono); font-size: 2.8rem; }
.score-orbit span { margin-top: 6px; color: var(--ink-soft); font-family: var(--mono); font-size: .65rem; }
.result-summary { min-height: 52px; text-align: center; font-size: .82rem; }
.field-map { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; margin: 20px 0; }
.field-map i { height: 34px; background: #d9ded7; border: 1px solid rgba(11,30,45,.15); }
.field-map i.pass { background: var(--mint); }
.field-map i.fail { background: var(--coral); }
.field-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: -10px 0 16px; color: var(--ink-soft); font-size: .76rem; }
.field-legend span { display: inline-flex; align-items: center; gap: 6px; }
.field-legend i { width: 14px; height: 14px; border: 1px solid var(--ink); }
.field-legend i.pass { background: var(--mint); }
.field-legend i.fail { background: var(--coral); }
details { border-top: 1px solid var(--line); padding-top: 12px; font-size: .76rem; }
summary { cursor: pointer; font-weight: 800; }
#failure-list { max-height: 190px; overflow: auto; padding-left: 22px; font-family: var(--sans); font-size: .76rem; }
.comparison-wrap { margin-top: 24px; padding-top: 18px; border-top: 2px solid var(--ink); }
.comparison-wrap h3 { margin-bottom: 8px; font-family: var(--serif); font-size: 1.35rem; }
.comparison-wrap > p { color: var(--ink-soft); font-size: .76rem; }
.comparison-list { display: grid; gap: 8px; }
.comparison-list article { padding: 11px 12px; border: 1px solid var(--ink); background: var(--white); }
.comparison-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.comparison-heading b { font-family: var(--mono); color: var(--coral-dark); }
.comparison-list p { margin: 5px 0 0; color: var(--ink-soft); font-size: .72rem; line-height: 1.55; }
.comparison-next { margin-top: 18px; padding: 16px; border: 1px solid var(--ink); background: var(--paper); }
.comparison-next p { margin-bottom: 10px; }

.outcome-section { padding: clamp(78px, 10vw, 150px) clamp(20px, 8vw, 130px); }
.outcome-title-wrap { display: grid; grid-template-columns: 1fr .9fr; gap: 9vw; align-items: end; }
.outcome-title-wrap p { color: var(--ink-soft); font-size: 1.05rem; }
.decision-cards { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 54px; border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.decision-cards article { min-height: 220px; padding: 28px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: rgba(255,253,247,.72); }
.decision-cards span { font-family: var(--mono); font-size: .73rem; color: var(--coral-dark); }
.decision-cards h3 { margin: 15px 0 8px; font-family: var(--serif); font-size: 1.55rem; }
.decision-cards p { color: var(--ink-soft); font-size: .84rem; }
.interpretation-note { max-width: 920px; margin: 28px 0 0 auto; padding-left: 18px; border-left: 5px solid var(--yellow); font-size: .85rem; }

.evidence-section { display: grid; grid-template-columns: .7fr 1.3fr; gap: 8vw; padding: clamp(74px, 9vw, 130px) clamp(20px, 8vw, 130px); background: var(--mint); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.evidence-list { margin: 0; }
.evidence-list div { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 18px 0; border-top: 1px solid var(--ink); }
.evidence-list div:last-child { border-bottom: 1px solid var(--ink); }
.evidence-list dt { font-weight: 900; }
.evidence-list dd { margin: 0; color: var(--ink-soft); }
.text-link { display: inline-block; margin-top: 22px; font-weight: 900; text-underline-offset: 5px; }
.provenance-link { margin-left: 24px; }

footer { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 24px; align-items: center; padding: 34px clamp(20px, 5vw, 76px); background: var(--ink); color: var(--white); font-size: .7rem; }
.footer-brand .brand-mark { width: 34px; height: 34px; font-size: 1rem; box-shadow: 2px 2px 0 var(--white); }
footer p { margin: 0; color: #c9d2d7; }

.method-main { max-width: 1120px; margin: auto; padding: 70px 24px 120px; }
.method-hero { padding: 36px 0 56px; border-bottom: 2px solid var(--ink); }
.method-hero h1 { max-width: 960px; font-size: clamp(2.6rem, 5.8vw, 5.6rem); }
.method-hero p { max-width: 720px; color: var(--ink-soft); }
.method-grid { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 54px; padding-top: 62px; }
.method-nav { position: sticky; top: 28px; align-self: start; display: grid; gap: 9px; font-size: .78rem; }
.method-nav a { text-underline-offset: 4px; }
.method-content section { padding: 0 0 60px; }
.method-content h2 { font-size: clamp(1.8rem,3vw,3rem); }
.method-content h3 { margin-top: 28px; }
.method-content table { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--white); font-size: .82rem; }
.method-content th, .method-content td { padding: 11px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.method-content code { padding: 2px 5px; background: var(--paper-deep); font-family: var(--mono); }
.method-content td code { overflow-wrap: anywhere; word-break: break-all; white-space: normal; }
.method-callout { padding: 20px; border: 1px solid var(--ink); background: var(--yellow); box-shadow: 6px 6px 0 var(--ink); }
.warning-callout { background: #fff1c7; }

@media (max-width: 1060px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { max-width: 820px; }
  .hero-instrument { min-height: 500px; max-width: 620px; width: 100%; margin: auto; }
  .positioning { grid-template-columns: .35fr 1fr; }
  .boundary-card { grid-column: 2; }
  .lab-grid { grid-template-columns: 1fr 1fr; }
  .result-step { grid-column: 1 / -1; border-left: 0 !important; border-top: 1px solid var(--ink); }
  .outcome-title-wrap, .evidence-section { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-header { min-height: 68px; padding: 11px 16px; }
  .brand-mark { width: 36px; height: 36px; box-shadow: 2px 2px 0 var(--ink); }
  .brand b { font-size: .82rem; }
  .brand small { font-size: .58rem; }
  nav { gap: 8px; }
  .site-header > nav a { display: none; }
  .site-header > nav a:last-of-type { display: inline-flex; min-height: 44px; align-items: center; font-size: .7rem; }
  .privacy-pill { font-size: .7rem; }
  .hero { min-height: auto; padding: 62px 18px 84px; }
  h1 { font-size: clamp(2.55rem, 13vw, 4.1rem); line-height: 1.09; }
  h1 > span, h1 em { white-space: normal; }
  h1 em { white-space: normal; }
  .hero-instrument { min-height: 430px; }
  .specimen-card { min-height: 350px; padding: 20px; }
  .measure-rail { display: none; }
  .positioning { grid-template-columns: 1fr; padding: 60px 18px; }
  .boundary-card { grid-column: auto; }
  .lab-section { padding: 70px 14px; }
  .case-picker { grid-template-columns: 1fr; padding: 16px; }
  .case-picker p { grid-column: 1; font-size: .82rem; }
  .lab-grid { grid-template-columns: 1fr; box-shadow: 7px 7px 0 var(--ink); }
  .lab-step + .lab-step { border-left: 0; border-top: 1px solid var(--ink); }
  .result-step { grid-column: auto; }
  .outcome-section, .evidence-section { padding: 76px 18px; }
  .decision-cards { grid-template-columns: 1fr; }
  .decision-cards article { min-height: auto; }
  .evidence-list div { grid-template-columns: 90px 1fr; gap: 12px; }
  .provenance-link { display: block; margin-left: 0; }
  footer { grid-template-columns: 1fr; }
  .method-main { padding: 48px 18px 90px; }
  .method-grid { grid-template-columns: 1fr; gap: 30px; }
  .method-nav { position: static; padding: 16px; border: 1px solid var(--ink); background: var(--white); }
  .method-nav a { display: flex; min-height: 44px; align-items: center; }
  .method-content table, .method-content tbody, .method-content tr, .method-content th, .method-content td { display: block; width: 100%; }
  .method-content tr { margin-bottom: 12px; }
  pre, textarea { font-size: .82rem; }
  .microcopy, .third-party-warning p, .comparison-list p, #failure-list, .field-legend { font-size: .82rem; }
  .sample-buttons { display: grid; grid-template-columns: 1fr; }
  .sample-buttons button { width: 100%; min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
