:root {
  color-scheme: light;
  --blue-1200: #000060;
  --blue-1000: #0017c1;
  --blue-900: #0031d8;
  --blue-100: #e8f1fe;
  --cyan: #00c7e6;
  --ink: #1a1a1c;
  --subtle: #626264;
  --line: #d8d8db;
  --surface: #f7f7f8;
  --white: #ffffff;
  --focus: #ffd43b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--white); line-height: 1.7; }
button, textarea, input { font: inherit; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--focus);
}

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 50; padding: 10px 16px; background: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.site-header {
  height: 72px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1160px) / 2)); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; color: #fff; background: var(--blue-1000); font: 800 20px/1 Georgia, serif; }
.site-header nav { display: flex; gap: 28px; }
.site-header nav a { color: #333; font-size: 14px; font-weight: 650; text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; text-underline-offset: 5px; }

.hero { min-height: 650px; padding: 104px max(24px, calc((100vw - 1160px) / 2)) 96px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 72px; align-items: center; background: linear-gradient(135deg, #fff 64%, var(--blue-100) 64%); }
.eyebrow, .section-number, .card-kicker { margin: 0 0 14px; color: var(--blue-900); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 24px; font-size: clamp(44px, 6.3vw, 76px); line-height: 1.16; letter-spacing: -.055em; }
h1 span { color: var(--blue-1000); }
.lead { max-width: 630px; margin-bottom: 34px; font-size: 18px; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button { min-height: 48px; padding: 12px 22px; border: 2px solid var(--blue-1000); display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; font-weight: 750; text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s; }
.button-primary { color: #fff; background: var(--blue-1000); }
.button-primary:hover { background: var(--blue-1200); border-color: var(--blue-1200); }
.button-secondary { color: var(--blue-1000); background: #fff; }
.button-secondary:hover { background: var(--blue-100); }

.hero-demo { padding: 28px; border: 1px solid #9cafe8; border-radius: 8px; background: rgba(255,255,255,.9); box-shadow: 12px 12px 0 rgba(0,23,193,.10); }
.demo-label { display: flex; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--subtle); font-size: 12px; font-weight: 700; }
.hero-demo > p { margin: 20px 0 14px; font-weight: 650; line-height: 1.8; }
.flow-arrow { color: var(--blue-1000); text-align: center; font-size: 22px; }
.answer-chip { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.answer-chip span { color: var(--blue-900); font: 700 11px/1 monospace; }
.answer-chip strong { font-size: 14px; }
.answer-chip b { color: var(--blue-1000); font: 800 18px/1 monospace; }

.section { max-width: 1160px; margin: 0 auto; padding: 112px 24px; }
.section-heading { max-width: 760px; margin-bottom: 48px; }
h2 { margin-bottom: 18px; font-size: clamp(32px, 4.5vw, 50px); line-height: 1.3; letter-spacing: -.035em; }
.section-heading > p:last-child { color: var(--subtle); font-size: 17px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.compare-card { min-height: 270px; padding: 32px; border-radius: 8px; }
.compare-card h3 { font-size: 25px; }
.compare-card code { display: block; margin-top: 28px; padding: 14px; border-radius: 4px; background: rgba(255,255,255,.78); font-size: 13px; overflow-x: auto; }
.muted-card { background: var(--surface); border: 1px solid var(--line); }
.accent-card { background: var(--blue-100); border: 1px solid #9cafe8; }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 52px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.principles > div { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 26px 20px; }
.principles > div + div { border-left: 1px solid var(--line); }
.principles b { color: var(--blue-1000); font: 800 32px/1 monospace; }
.principles span, .principles strong { display: block; }
.principles span { color: var(--subtle); font-size: 14px; }
.principles strong { margin-bottom: 4px; color: var(--ink); font-size: 16px; }

.primitives-section { max-width: none; padding-inline: max(24px, calc((100vw - 1160px) / 2)); background: var(--surface); }
.primitive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.primitive-card { min-height: 410px; padding: 28px; border: 1px solid var(--line); border-top-width: 5px; border-radius: 5px; background: #fff; }
.choice-card { border-top-color: #0017c1; }
.score-card { border-top-color: #0085a1; }
.noul-card { border-top-color: #8843e1; }
.primitive-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 26px; border-radius: 50%; color: #fff; background: var(--blue-1000); font: 800 16px/1 monospace; }
.score-card .primitive-icon { background: #0085a1; }
.noul-card .primitive-icon { background: #8843e1; }
.primitive-card h3 { font-size: 22px; }
.primitive-card > p:not(.card-kicker) { min-height: 78px; color: var(--subtle); font-size: 14px; }
.mini-bars span { display: grid; grid-template-columns: 1fr 78px; gap: 10px; align-items: center; margin: 10px 0; }
.mini-bars i { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--blue-1000) var(--value), var(--blue-100) var(--value)); }
.mini-bars b { color: var(--subtle); font-size: 12px; }
.score-scale { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 32px; font: 700 12px/1 monospace; }
.score-scale i { position: relative; height: 8px; border-radius: 8px; background: #cbeaf0; }
.score-scale b { position: absolute; top: 50%; width: 18px; height: 18px; border: 4px solid #fff; border-radius: 50%; background: #0085a1; transform: translate(-50%, -50%); box-shadow: 0 0 0 1px #0085a1; }
.score-example { display: block; margin-top: 14px; color: var(--subtle); text-align: center; font: 700 13px/1 monospace; }
.noul-gauge { height: 10px; margin-top: 36px; border-radius: 6px; background: #eadff9; overflow: hidden; }
.noul-gauge span { display: block; width: var(--value); height: 100%; background: #8843e1; }

.confidence-section { padding: 96px max(24px, calc((100vw - 1160px) / 2)); display: grid; grid-template-columns: 1fr 1fr; gap: 80px; color: #fff; background: var(--blue-1200); }
.section-number.light { color: #91ddff; }
.confidence-section p:last-child { color: #d9ddff; }
.confidence-paths { display: grid; }
.confidence-paths > div { display: grid; grid-template-columns: 110px 1fr; align-items: center; padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,.25); }
.confidence-paths span { color: #91ddff; font: 700 12px/1 monospace; }
.confidence-paths strong { font-size: 18px; }
.confidence-paths small { grid-column: 2; color: #b8bce0; }

.lab-section { padding: 112px max(24px, calc((100vw - 1160px) / 2)); background: linear-gradient(#fff, #f1f4ff); }
.lab-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; border: 1px solid #aab6dd; border-radius: 8px; background: #fff; box-shadow: 0 20px 50px rgba(0,23,100,.10); overflow: hidden; }
.lab-panel { min-width: 0; padding: 32px; }
.input-panel { border-right: 1px solid var(--line); }
fieldset { margin: 0 0 28px; padding: 0; border: 0; }
legend, .textarea-label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 800; }
.textarea-label span { margin-left: 6px; color: var(--subtle); font-weight: 500; }
.lesson-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.lesson-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.lesson-tabs span { min-height: 44px; display: grid; place-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 5px; color: #444; font-size: 13px; font-weight: 650; cursor: pointer; }
.lesson-tabs input:checked + span { color: var(--blue-1000); border: 2px solid var(--blue-1000); background: var(--blue-100); }
.lesson-tabs input:focus-visible + span { outline: 3px solid #000; outline-offset: 2px; box-shadow: 0 0 0 5px var(--focus); }
textarea { width: 100%; min-height: 210px; padding: 15px; resize: vertical; border: 1px solid #777; border-radius: 4px; color: var(--ink); background: #fff; line-height: 1.75; }
textarea:focus { border-color: var(--blue-1000); }
.input-meta { display: flex; justify-content: space-between; gap: 16px; margin: 8px 0 20px; color: var(--subtle); font-size: 11px; }
.run-button { width: 100%; border: 0; }
.button-loading { display: none; }
.is-loading .button-idle { display: none; }
.is-loading .button-loading { display: inline; }
.run-button:disabled { cursor: wait; opacity: .72; }
.privacy-note { margin: 12px 0 0; color: var(--subtle); font-size: 11px; line-height: 1.6; }
.result-panel { display: flex; flex-direction: column; background: #fafbff; }
.result-header { display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.result-header h3 { margin-bottom: 20px; font-size: 24px; }
.model-badge { padding: 4px 8px; border: 1px solid #aab6dd; border-radius: 3px; color: var(--blue-1000); background: var(--blue-100); font: 700 11px/1.4 monospace; }
.empty-result { flex: 1; display: grid; place-content: center; justify-items: center; padding: 50px 20px; color: var(--subtle); text-align: center; }
.empty-result div { margin-bottom: 16px; color: #aab6dd; font: 800 54px/1 monospace; }
.empty-result p { max-width: 350px; font-size: 14px; }
.result-content { padding-top: 22px; }
.answer-result { padding: 18px 0; border-bottom: 1px solid var(--line); }
.answer-result:first-child { padding-top: 0; }
.answer-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.answer-top h4 { margin: 0; font-size: 14px; }
.type-label { margin-right: 8px; color: var(--blue-900); font: 800 10px/1 monospace; text-transform: uppercase; }
.answer-value { color: var(--blue-1000); font: 800 22px/1 monospace; }
.confidence-label { display: block; margin: 8px 0 10px; color: var(--subtle); font-size: 11px; text-align: right; }
.probability-list { margin-top: 14px; display: grid; gap: 7px; }
.probability-row { display: grid; grid-template-columns: minmax(74px, auto) 1fr 42px; gap: 8px; align-items: center; font-size: 11px; }
.probability-track { height: 6px; border-radius: 4px; background: #e1e4ef; overflow: hidden; }
.probability-track i { display: block; width: var(--value); height: 100%; background: var(--blue-900); }
.probability-row b { text-align: right; font: 700 11px/1 monospace; }
.usage-box { margin-top: auto; padding-top: 18px; color: var(--subtle); font: 11px/1.5 monospace; }
.error-box { margin-top: 22px; padding: 14px; border-left: 4px solid #ec0000; color: #680000; background: #fff0f0; font-size: 14px; }

.next-section { padding-bottom: 80px; }
.do-dont-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.do-dont-grid article { padding: 28px 32px; border: 1px solid var(--line); border-radius: 6px; }
.do-dont-grid h3 { font-size: 20px; }
.do-dont-grid h3 span { color: var(--blue-1000); margin-right: 7px; }
.do-dont-grid ul { margin: 0; padding-left: 20px; }
.do-dont-grid li { margin: 8px 0; }
.source-note { margin: 42px 0 12px; color: var(--subtle); font-size: 12px; }
.source-links { display: flex; flex-wrap: wrap; gap: 16px; }
.source-links a { color: var(--blue-1000); font-size: 13px; font-weight: 650; text-underline-offset: 4px; }
footer { min-height: 86px; padding: 24px max(24px, calc((100vw - 1160px) / 2)); display: flex; align-items: center; justify-content: space-between; color: #ddd; background: #1a1a1c; font-size: 12px; }

@media (max-width: 850px) {
  .site-header nav { display: none; }
  .hero { min-height: auto; padding-top: 72px; grid-template-columns: 1fr; gap: 48px; background: linear-gradient(165deg, #fff 70%, var(--blue-100) 70%); }
  .hero-demo { max-width: 560px; }
  .primitive-grid { grid-template-columns: 1fr; }
  .primitive-card { min-height: 0; }
  .primitive-card > p:not(.card-kicker) { min-height: 0; }
  .confidence-section { grid-template-columns: 1fr; gap: 34px; }
  .lab-grid { grid-template-columns: 1fr; }
  .input-panel { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .site-header { height: 64px; }
  h1 { font-size: 42px; }
  .hero, .section, .primitives-section, .lab-section { padding-top: 72px; padding-bottom: 72px; }
  .compare-grid, .principles, .do-dont-grid { grid-template-columns: 1fr; }
  .principles > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .confidence-section { padding-top: 72px; padding-bottom: 72px; }
  .lesson-tabs { grid-template-columns: 1fr; }
  .lab-panel { padding: 22px; }
  .answer-chip { grid-template-columns: 58px 1fr auto; padding-inline: 10px; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; }
}

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