:root {
  --paper: #f2eee5;
  --surface: #fffdf7;
  --ink: #171914;
  --muted: #6d736c;
  --line: #c8cdc5;
  --green: #008b72;
  --lime: #b5ff2d;
  --coral: #ff6855;
  --blue: #6d73f5;
  --yellow: #ffd86d;
  --soft: #e4e8e0;
  --panel: #20231e;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 6% 5%, rgba(109,115,245,.09), transparent 28rem),
    radial-gradient(circle at 94% 4%, rgba(181,255,45,.09), transparent 28rem),
    var(--paper);
  font-family: "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
}
button, input, a { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 4px solid #1c5dff;
  outline-offset: 4px;
}
code, pre { font-family: var(--mono); }

.page {
  width: min(1660px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 80px;
}

.hero {
  display: flex;
  min-height: 250px;
  padding: 12px 18px 28px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}
.hero-copy { min-width: 0; }
.eyebrow,
.section-heading p,
.panel-intro > p,
.inspector-heading p,
.inspector-label p {
  margin: 0;
  color: var(--green);
  font: 900 12px/1.2 var(--mono);
  letter-spacing: .13em;
}
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.eyebrow i {
  position: relative;
  width: 19px;
  height: 19px;
  border: 2px solid var(--blue);
  border-radius: 6px;
}
.eyebrow i::after {
  position: absolute;
  inset: 5px -7px -7px 5px;
  z-index: -1;
  border-radius: 6px;
  background: var(--lime);
  content: "";
}
h1 {
  margin: 0;
  font-size: min(6.15vw, 96px);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}
.lead {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 25px);
  font-weight: 750;
}
.lead strong { color: var(--ink); }
.hero-actions { display: flex; flex: 0 0 auto; align-items: stretch; gap: 10px; }
.hero-actions > button {
  min-height: 54px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.hero-actions > button.dark { border-color: var(--ink); background: var(--ink); color: white; }
.series-link {
  display: grid;
  min-width: 218px;
  padding: 9px 14px 9px 54px;
  position: relative;
  border: 1px solid #afd8cc;
  border-radius: 14px;
  background: #e6fff7;
  color: var(--ink);
  text-decoration: none;
}
.series-link > span {
  display: grid;
  position: absolute;
  inset: 9px auto 9px 9px;
  width: 36px;
  place-items: center;
  border-radius: 10px;
  background: var(--green);
  color: white;
  font: 900 11px/1 var(--mono);
}
.series-link b { align-self: end; font-size: 12px; }
.series-link small { color: var(--green); font: 800 10px/1.4 var(--mono); }

.lab,
.guide {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 18px 55px rgba(23,25,20,.07);
}
.section-heading {
  display: flex;
  min-height: 104px;
  padding: 18px 28px;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.section-heading.compact { min-height: 94px; }
.section-number {
  display: grid;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  background: var(--coral);
  color: white;
  font: 900 13px/1 var(--mono);
}
.section-number.blue { background: var(--blue); }
.section-heading h2 { margin: 4px 0 0; font-size: clamp(24px,2.2vw,34px); line-height: 1.05; letter-spacing: 0; }
.heading-status { display: flex; margin-left: auto; gap: 8px; }
.heading-status span,
.heading-status b {
  padding: 10px 12px;
  border-radius: 999px;
  background: #edf0ea;
  font: 900 10px/1 var(--mono);
}
.heading-status span { color: var(--blue); }
.heading-status b { background: var(--coral); color: white; }
.heading-status b.is-good { background: var(--lime); color: var(--ink); }
.heading-status b.is-warning { background: var(--yellow); color: var(--ink); }

.lab-grid { display: grid; grid-template-columns: 292px minmax(530px,1fr) 350px; min-height: 760px; }
.case-panel { border-right: 1px solid var(--line); background: #f8f5ed; }
.panel-intro { padding: 24px 23px 15px; }
.panel-intro h3 { margin: 7px 0 0; font-size: 19px; }
.case-list { display: grid; gap: 7px; padding: 0 18px 22px; }
.case-button {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  min-height: 66px;
  padding: 8px 11px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}
.case-button[aria-current="true"] { border-color: var(--ink); background: var(--ink); color: white; }
.case-button > span:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: #e7ebe5;
  color: var(--ink);
  font: 900 10px/1 var(--mono);
}
.case-button[aria-current="true"] > span:first-child { background: var(--lime); }
.case-button > span:nth-child(2) { min-width: 0; }
.case-button b { display: block; font-size: 13px; }
.case-button small { display: block; margin-top: 3px; color: var(--muted); font: 800 10px/1 var(--mono); }
.case-button[aria-current="true"] small { color: #aeb5ad; }
.case-button > i { color: var(--muted); font-style: normal; font-size: 16px; }
.case-button[aria-current="true"] > i { color: var(--lime); }
.panel-note {
  display: flex;
  margin: 0 18px;
  padding: 16px;
  gap: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.panel-note > span { display: grid; flex: 0 0 auto; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: var(--blue); color: white; font: 900 12px/1 var(--mono); }
.panel-note p { margin: 0; font-size: 11px; line-height: 1.65; }
.panel-note strong { display: block; color: var(--ink); }

.preview-panel { display: grid; min-width: 0; grid-template-rows: 58px 1fr 58px; background: #e4e8e1; }
.browser-bar {
  display: flex;
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #b9beb7;
  background: #d7dbd4;
}
.browser-bar > p { margin: 0; color: #697069; font: 800 10px/1 var(--mono); }
.browser-bar > p i { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; background: var(--coral); }
.browser-bar > p i:nth-child(2) { background: var(--yellow); }
.browser-bar > p i:nth-child(3) { margin-right: 9px; background: #57cfa3; }
.mode-switch { display: flex; padding: 4px; border: 1px solid #afb5ad; border-radius: 11px; background: #eff1ed; }
.mode-switch button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font-size: 10px; font-weight: 900; cursor: pointer; }
.mode-switch button[aria-pressed="true"] { background: var(--ink); color: white; }
.mode-switch button[data-mode="after"][aria-pressed="true"] { background: var(--lime); color: var(--ink); }
.preview-canvas {
  display: grid;
  min-height: 644px;
  padding: 48px clamp(24px,4vw,70px);
  place-items: center;
  overflow: hidden;
  background-color: #faf8f1;
  background-image: linear-gradient(#e9e6de 1px,transparent 1px),linear-gradient(90deg,#e9e6de 1px,transparent 1px);
  background-size: 26px 26px;
}
.demo-window {
  width: min(100%,720px);
  min-height: 460px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 12px 14px 0 rgba(23,25,20,.12);
}
.demo-header { display: flex; min-height: 64px; padding: 0 22px; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--ink); }
.demo-brand { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 900; }
.demo-brand i { width: 22px; height: 22px; border-radius: 7px; background: var(--lime); border: 2px solid var(--ink); }
.demo-header nav { display: flex; gap: 18px; font-size: 10px; font-weight: 800; }
.demo-content { display: grid; min-height: 394px; padding: 46px; align-content: center; }
.demo-kicker { margin: 0 0 10px; color: var(--green); font: 900 10px/1 var(--mono); letter-spacing: .12em; }
.demo-content h3 { max-width: 580px; margin: 0 0 13px; font-size: clamp(27px,3vw,43px); line-height: .98; letter-spacing: 0; }
.demo-copy { max-width: 550px; margin: 0 0 30px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.target-wrap { display: flex; min-height: 96px; align-items: center; justify-content: center; padding: 20px; border: 1px dashed #bdc2bb; border-radius: 18px; background: #f0f2ed; }
.inspect-target { position: relative; outline: 4px solid var(--lime); outline-offset: 6px; }
.icon-search,
.cart-button,
.plan-button,
.sound-button {
  display: inline-flex;
  min-height: 54px;
  padding: 0 19px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--lime);
  font-weight: 900;
  cursor: pointer;
}
.icon-search { width: 58px; padding: 0; background: var(--blue); color: white; }
.icon-search svg { width: 25px; height: 25px; }
.cart-button { background: var(--coral); }
.plan-button { background: var(--yellow); }
.sound-button { min-width: 154px; background: var(--surface); }
.sound-button[aria-pressed="true"] { background: var(--blue); color: white; }
.field-demo { display: grid; width: min(100%,420px); gap: 8px; }
.field-demo > span,
.field-demo label { font-size: 12px; font-weight: 900; }
.field-demo input { width: 100%; min-height: 52px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 12px; background: white; font-size: 16px; }
.plan-row { display: flex; align-items: center; gap: 18px; }
.plan-card { min-width: 160px; padding: 16px; border: 2px solid var(--ink); border-radius: 14px; background: white; }
.plan-card small { display: block; color: var(--green); font: 900 10px/1 var(--mono); }
.plan-card strong { display: block; margin-top: 5px; font-size: 22px; }
.artwork {
  display: block;
  width: 190px;
  aspect-ratio: 1.28;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--blue);
}
.artwork svg { display: block; width: 100%; height: 100%; }
.ignored-note { margin-left: 20px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.preview-footer { display: flex; padding: 0 18px; align-items: center; justify-content: space-between; border-top: 1px solid #b9beb7; background: #d7dbd4; }
.preview-footer p { margin: 0; color: #656c65; font-size: 10px; font-weight: 750; }
.target-dot { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 2px; background: var(--lime); border: 1px solid var(--ink); }
.preview-footer button { min-height: 34px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 9px; background: var(--surface); font-size: 10px; font-weight: 900; cursor: pointer; }

.inspector { min-width: 0; background: var(--panel); color: #f5f7f2; }
.inspector-heading { display: flex; min-height: 92px; padding: 20px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #3a3e38; }
.inspector-heading p { margin-bottom: 7px; color: #949b92; font-size: 10px; }
.inspector-heading code { font-size: 13px; font-weight: 800; }
.inspector-heading > span { padding: 9px 10px; border-radius: 999px; background: var(--coral); color: white; font: 900 10px/1 var(--mono); }
.inspector-heading > span.is-good { background: var(--lime); color: var(--ink); }
.inspector-heading > span.is-warning { background: var(--yellow); color: var(--ink); }
.a11y-summary { display: grid; grid-template-columns: 1.25fr 1fr 1fr; margin: 0; border-bottom: 1px solid #3a3e38; }
.a11y-summary > div { min-width: 0; padding: 16px 13px; border-right: 1px solid #3a3e38; }
.a11y-summary > div:last-child { border-right: 0; }
.a11y-summary dt { color: #8d958b; font: 900 10px/1 var(--mono); letter-spacing: .1em; }
.a11y-summary dd { margin: 8px 0 0; overflow-wrap: anywhere; color: var(--lime); font: 900 14px/1.2 var(--mono); }
.speech-block { padding: 21px 20px; border-bottom: 1px solid #3a3e38; }
.speech-block > p { margin: 0; color: #90988e; font: 900 10px/1 var(--mono); letter-spacing: .12em; }
.speech-block blockquote { margin: 13px 0 8px; color: white; font-size: 22px; font-weight: 800; line-height: 1.25; }
.speech-block small { color: #8f968d; font-size: 10px; }
.source-block,
.code-block { padding: 19px 20px; border-bottom: 1px solid #3a3e38; }
.inspector-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inspector-label p { color: #91998f; font-size: 10px; }
.inspector-label span { color: var(--lime); font: 900 10px/1 var(--mono); }
.source-block ol { display: grid; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.source-block li { display: flex; min-height: 34px; padding: 0 9px; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #3e433c; border-radius: 8px; color: #939b91; font: 800 10px/1.2 var(--mono); }
.source-block li::before { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 5px; background: #343832; color: #aab1a8; content: attr(data-step); font-size: 10px; }
.source-block li b { margin-left: auto; color: #71796f; font-size: 10px; }
.source-block li.is-source { border-color: var(--lime); background: rgba(181,255,45,.08); color: white; }
.source-block li.is-source::before { background: var(--lime); color: var(--ink); }
.source-block li.is-source b { color: var(--lime); }
.source-block li.is-skipped { text-decoration: line-through; opacity: .55; }
.inspector-label button { padding: 6px 8px; border: 1px solid #51564f; border-radius: 7px; background: transparent; color: white; font-size: 10px; font-weight: 900; cursor: pointer; }
.code-block pre { min-height: 120px; max-height: 174px; margin: 12px 0 0; padding: 13px; overflow: auto; border: 1px solid #3d423b; border-radius: 10px; background: #151713; color: #f2f4ee; font-size: 10px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.code-block .token-attr { color: var(--lime); }

.guide { margin-top: 22px; }
.guide-note { margin-left: auto; color: var(--muted); font: 800 10px/1.3 var(--mono); }
.priority-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; padding: 28px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: #f8f5ed; }
.priority-flow article { min-height: 112px; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.priority-flow article > span { display: block; margin-bottom: 10px; color: var(--blue); font: 900 10px/1 var(--mono); }
.priority-flow article > code,
.priority-flow article > b { font-size: 14px; }
.priority-flow article p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.priority-flow > i { color: var(--blue); font-style: normal; font-weight: 900; }
.rule-grid { display: grid; grid-template-columns: repeat(3,1fr); }
.rule-grid article { min-height: 150px; padding: 25px 28px; border-right: 1px solid var(--line); }
.rule-grid article:last-child { border-right: 0; }
.rule-grid span { color: var(--green); font: 900 10px/1 var(--mono); }
.rule-grid h3 { margin: 12px 0 8px; font-size: 19px; }
.rule-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.guide-footer { display: grid; grid-template-columns: minmax(300px,520px) 1fr; gap: 26px; padding: 24px 28px; align-items: center; border-top: 1px solid var(--line); background: #f8f5ed; }
.starter-cta { display: grid; padding: 17px 19px; border: 2px solid var(--ink); border-radius: 15px; background: var(--lime); color: var(--ink); text-decoration: none; }
.starter-cta span { font: 900 10px/1 var(--mono); letter-spacing: .1em; }
.starter-cta strong { margin-top: 5px; font-size: 18px; }
.starter-cta b { margin-top: 7px; font-size: 11px; }
.guide-footer > div > p { margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.guide-footer > div > a { margin-right: 15px; color: var(--ink); font: 900 10px/1 var(--mono); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; padding: 12px 16px; translate: -50% 18px; border-radius: 10px; background: var(--ink); color: white; opacity: 0; pointer-events: none; transition: .18s ease; font-size: 12px; font-weight: 800; }
.toast.is-visible { translate: -50% 0; opacity: 1; }

@media (max-width: 1280px) {
  .hero { display: block; min-height: 0; padding-top: 30px; }
  .hero-actions { margin-top: 25px; }
  .lab-grid { grid-template-columns: 260px minmax(480px,1fr); }
  .inspector { grid-column: 1 / -1; display: grid; grid-template-columns: 280px 1fr 1fr; }
  .inspector-heading { grid-column: 1; }
  .a11y-summary { grid-column: 1; grid-template-columns: 1fr; border-bottom: 0; }
  .a11y-summary > div { border-right: 0; border-bottom: 1px solid #3a3e38; }
  .speech-block { grid-column: 1; }
  .source-block { grid-column: 2; grid-row: 1 / span 3; border-left: 1px solid #3a3e38; }
  .code-block { grid-column: 3; grid-row: 1 / span 3; border-left: 1px solid #3a3e38; }
  .code-block pre { max-height: 310px; }
}

@media (max-width: 900px) {
  .page { width: min(100% - 24px, 760px); padding-top: 18px; }
  h1 { font-size: clamp(42px,9vw,70px); white-space: normal; }
  .hero-actions { flex-wrap: wrap; }
  .series-link { order: 3; width: 100%; }
  .section-heading { padding-inline: 18px; }
  .heading-status { display: none; }
  .lab-grid { display: block; }
  .case-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .case-list { grid-template-columns: repeat(2,1fr); }
  .panel-note { margin-bottom: 18px; }
  .preview-canvas { min-height: 560px; padding: 30px 18px; }
  .inspector { display: block; }
  .inspector-heading, .a11y-summary, .speech-block, .source-block, .code-block { grid-column: auto; grid-row: auto; }
  .a11y-summary { grid-template-columns: repeat(3,1fr); border-bottom: 1px solid #3a3e38; }
  .a11y-summary > div { border-right: 1px solid #3a3e38; border-bottom: 0; }
  .priority-flow { grid-template-columns: 1fr; }
  .priority-flow > i { rotate: 90deg; justify-self: center; }
  .rule-grid { grid-template-columns: 1fr; }
  .rule-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .guide-footer { grid-template-columns: 1fr; }
  .guide-note { display: none; }
}

@media (max-width: 560px) {
  .page { width: 100%; padding: 0 0 50px; }
  .hero { padding: 28px 16px 24px; }
  .eyebrow { font-size: 10px; }
  h1 { font-size: 45px; }
  .lead { margin-top: 16px; font-size: 16px; line-height: 1.45; }
  .hero-actions > button { flex: 1; }
  .lab, .guide { border-inline: 0; border-radius: 0; }
  .section-heading { min-height: 86px; padding: 15px 14px; }
  .section-number { width: 44px; height: 44px; border-radius: 13px; }
  .section-heading h2 { font-size: 21px; }
  .case-list { grid-template-columns: 1fr; }
  .browser-bar { padding-inline: 10px; gap: 8px; }
  .browser-bar > p { max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mode-switch button { padding-inline: 9px; }
  .preview-canvas { min-height: 490px; padding: 20px 12px; }
  .demo-window { min-height: 400px; border-radius: 16px; }
  .demo-header { padding-inline: 14px; }
  .demo-header nav { gap: 9px; }
  .demo-content { min-height: 336px; padding: 30px 20px; }
  .demo-content h3 { font-size: 29px; }
  .target-wrap { padding: 15px 8px; }
  .plan-row { flex-direction: column; }
  .ignored-note { margin: 12px 0 0; }
  .preview-footer p { display: none; }
  .preview-footer { justify-content: flex-end; }
  .a11y-summary dd { font-size: 12px; }
  .priority-flow, .rule-grid article, .guide-footer { padding-inline: 16px; }
}

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

.series-nav {
  display: grid;
  grid-template-columns: auto repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.74);
}

.series-nav > p {
  display: flex;
  margin: 0;
  padding: 0 12px;
  align-items: center;
  color: var(--green);
  font: 900 10px/1.2 var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.series-nav a {
  display: grid;
  min-height: 48px;
  padding: 7px 12px 7px 46px;
  position: relative;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.series-nav a > span {
  display: grid;
  position: absolute;
  inset: 7px auto 7px 7px;
  width: 32px;
  place-items: center;
  border-radius: 9px;
  background: var(--soft);
  color: var(--green);
  font: 900 10px/1 var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
}

.series-nav a b { font-size: 12px; line-height: 1.2; }
.series-nav a small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.2; }
.series-nav a[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: white; }
.series-nav a[aria-current="page"] > span { background: var(--lime); color: var(--ink); }
.series-nav a[aria-current="page"] small { color: #c9cec7; }

@media (max-width: 700px) {
  .series-nav {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .series-nav > p {
    grid-column: 1 / -1;
    min-height: 22px;
    padding-inline: 4px;
  }
}
