:root {
  --paper: #f3efe6;
  --paper-cool: #eaf2f2;
  --panel: #fffdf8;
  --ink: #17221e;
  --muted: #6f7a75;
  --line: #d7d7ce;
  --coral: #ef6b57;
  --coral-dark: #b94738;
  --coral-soft: #ffe2da;
  --blue: #3e76f5;
  --blue-soft: #e6edff;
  --green: #0da77c;
  --green-dark: #08765a;
  --green-soft: #dff6ee;
  --yellow: #f4c44e;
  --shadow: 0 22px 55px rgb(31 41 36 / 12%);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 4%, rgb(82 169 196 / 16%), transparent 25%),
    radial-gradient(circle at 94% 4%, rgb(239 107 87 / 18%), transparent 27%),
    var(--paper);
  font-family: Inter, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

button,
input { font: inherit; }

button { color: inherit; }

button:focus-visible,
input:focus-visible {
  outline: 4px solid rgb(62 118 245 / 28%);
  outline-offset: 3px;
}

.page {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 34px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, .8fr);
  align-items: end;
  gap: 10px 28px;
  padding: 0 4px 24px;
}

.hero-title { grid-column: 1 / -1; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 8px;
  color: var(--coral-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
}

.eyebrow i {
  position: relative;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.eyebrow i::before,
.eyebrow i::after {
  position: absolute;
  content: "";
}

.eyebrow i::before {
  top: 6px;
  left: 3px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.eyebrow i::after {
  right: -5px;
  bottom: -5px;
  width: 8px;
  height: 8px;
  background: var(--paper);
  border: 2px solid var(--green);
  border-radius: 50%;
}

h1 {
  margin: 0;
  font-family: "Arial Black", Inter, sans-serif;
  font-size: clamp(56px, 7.3vw, 118px);
  line-height: .91;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.45vw, 24px);
  font-weight: 800;
}

.lead span { color: var(--coral-dark); }

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.hero-actions span,
.hero-actions button {
  min-height: 44px;
  padding: 0 17px;
  border-radius: 13px;
  font-size: 11px;
  font-weight: 900;
}

.hero-actions span {
  display: inline-flex;
  align-items: center;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid #9fdcca;
}

.hero-actions button {
  color: white;
  background: var(--ink);
  border: 0;
  cursor: pointer;
  transition: translate .2s ease, background .2s ease;
}

.hero-actions button:hover { background: #26342f; translate: 0 -2px; }

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(340px, .72fr);
  gap: 18px;
}

.comparison-card,
.guide-card,
.code-card {
  overflow: hidden;
  background: rgb(255 253 248 / 94%);
  border: 1px solid var(--line);
  border-radius: 25px;
  box-shadow: var(--shadow);
}

.comparison-card { grid-row: span 2; }

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head > div { min-width: 0; }
.panel-head p,
.code-head span {
  margin: 0 0 3px;
  color: var(--coral-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
}

.panel-head h2,
.code-head h2 { margin: 0; font-size: 21px; line-height: 1.08; }

.section-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 45px;
  height: 45px;
  color: white;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 900;
}

.section-mark--coral { background: var(--coral); }
.section-mark--blue { background: var(--blue); }

.same-value {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 8px 10px;
  background: #f4f2ec;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.same-value span { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.same-value code { color: var(--coral-dark); font-size: 12px; font-weight: 900; }

.comparison-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  background:
    linear-gradient(rgb(23 34 30 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(23 34 30 / 5%) 1px, transparent 1px),
    #f8f7f1;
  background-size: 22px 22px;
}

.form-case {
  min-width: 0;
  padding: 18px;
  background: white;
  border: 2px solid var(--line);
  border-radius: 20px;
  transition: border-color .25s ease, background .25s ease, translate .25s ease;
}

.form-case--instant { border-color: #ef9d90; background: #fff8f5; }
.form-case--timed { border-color: #a9c4ff; background: #f8faff; }
.form-case--timed:has(.timed-input:user-invalid) { border-color: var(--coral); background: #fff8f5; }
.form-case--timed:has(.timed-input:user-valid) { border-color: var(--green); background: #f4fcf8; }

.case-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.case-head span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.case-head h3 { margin: 0; font-size: 19px; }
.case-head code { flex: 0 0 auto; padding: 7px 9px; color: var(--coral-dark); background: var(--coral-soft); border-radius: 9px; font-size: 11px; font-weight: 900; }
.form-case--timed .case-head code { color: #2f5ec9; background: var(--blue-soft); }

.field {
  padding: 14px;
  background: white;
  border: 1px solid #d4d9d6;
  border-radius: 15px;
  transition: background .2s ease, border-color .2s ease;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.field-label label { font-size: 12px; font-weight: 900; }
.field-label span { color: var(--muted); font-size: 10px; font-weight: 800; }

.input-shell { position: relative; }

.input-shell input {
  width: 100%;
  min-height: 57px;
  padding: 0 50px 0 15px;
  color: var(--ink);
  background: #fdfdfa;
  border: 2px solid #89948f;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 750;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.input-shell > i {
  position: absolute;
  top: 50%;
  right: 15px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #9da6a2;
  border-radius: 50%;
  translate: 0 -50%;
}

.input-shell > i::before { color: #808b86; content: "•"; font-style: normal; font-size: 17px; line-height: 1; }

.field-message {
  min-height: 18px;
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.45;
}

.instant-input:invalid,
.timed-input:user-invalid {
  background: #fff8f6;
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgb(239 107 87 / 12%);
}

.field--instant:has(.instant-input:invalid),
.field--timed:has(.timed-input:user-invalid) {
  background: var(--coral-soft);
  border-color: #f1aa9e;
}

.instant-input:invalid + i,
.timed-input:user-invalid + i {
  color: white;
  background: var(--coral);
  border-color: var(--coral);
}

.instant-input:invalid + i::before,
.timed-input:user-invalid + i::before { color: white; content: "!"; font-size: 12px; font-weight: 900; }

.field--instant:has(.instant-input:invalid) .field-message,
.field--timed:has(.timed-input:user-invalid) .field-message { color: var(--coral-dark); }

.timed-input:user-valid {
  background: #f7fffb;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgb(13 167 124 / 11%);
}

.field--timed:has(.timed-input:user-valid) {
  background: var(--green-soft);
  border-color: #86d4bd;
}

.timed-input:user-valid + i { color: white; background: var(--green); border-color: var(--green); }
.timed-input:user-valid + i::before { color: white; content: "✓"; font-size: 12px; font-weight: 900; }
.field--timed:has(.timed-input:user-valid) .field-message { color: var(--green-dark); }

.check-button {
  width: 100%;
  min-height: 43px;
  margin-top: 11px;
  color: var(--ink);
  background: white;
  border: 2px solid var(--ink);
  border-radius: 11px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  transition: translate .2s ease, box-shadow .2s ease;
}

.check-button:hover { box-shadow: 0 5px 0 rgb(23 34 30 / 12%); translate: 0 -2px; }
.check-button--accent { color: white; background: var(--blue); border-color: var(--blue); }

.case-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  padding: 10px 11px;
  background: #f4f3ee;
  border-radius: 12px;
}

.case-status > span { display: flex; align-items: center; gap: 7px; }
.case-status i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 900; }
.case-status b { font-size: 11px; letter-spacing: .08em; }
.case-status p { margin: 0; color: var(--muted); font-size: 10px; font-weight: 800; }
.case-status[data-state="error"] { color: var(--coral-dark); background: var(--coral-soft); }
.case-status[data-state="error"] i { color: white; background: var(--coral); }
.case-status[data-state="wait"] { color: #46627b; background: #eaf1f6; }
.case-status[data-state="wait"] i { color: white; background: #6c8ca5; }
.case-status[data-state="valid"] { color: var(--green-dark); background: var(--green-soft); }
.case-status[data-state="valid"] i { color: white; background: var(--green); }

.state-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 0 18px 18px;
}

.state-flow > div {
  min-width: 0;
  padding: 11px 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.state-flow > i { color: #9da5a1; font-style: normal; font-size: 17px; font-weight: 900; }
.state-flow span { display: block; margin-bottom: 3px; color: var(--coral-dark); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.state-flow b { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.state-flow small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 700; }
.state-flow code { color: inherit; }

.panel-head--compact { min-height: 72px; padding: 13px 15px; }
.panel-head--compact h2 { font-size: 18px; }
.panel-head--compact .section-mark { width: 41px; height: 41px; }

.guide-list { display: grid; gap: 8px; padding: 14px; }

.guide-list button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 65px;
  padding: 9px 11px;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, translate .2s ease;
}

.guide-list button:hover { translate: 3px 0; }
.guide-list button[aria-pressed="true"] { background: var(--blue-soft); border-color: #a8bdf7; }
.guide-list button > span { display: grid; place-items: center; width: 30px; height: 30px; color: white; background: var(--blue); border-radius: 9px; font-size: 10px; font-weight: 900; }
.guide-list button div { min-width: 0; }
.guide-list button code { display: block; margin-bottom: 3px; color: #315fc4; font-size: 11px; font-weight: 900; }
.guide-list button b { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.guide-list button > i { color: #7f8b86; font-style: normal; font-weight: 900; }

.guide-detail {
  margin: 0 14px 12px;
  padding: 14px;
  color: white;
  background: var(--ink);
  border-radius: 15px;
}

.guide-detail span { display: inline-block; margin-bottom: 8px; padding: 5px 7px; color: #c8f7e9; background: rgb(255 255 255 / 9%); border-radius: 7px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; font-weight: 900; }
.guide-detail h3 { margin: 0 0 5px; font-size: 15px; }
.guide-detail p { margin: 0; color: #b9c4bf; font-size: 10px; line-height: 1.55; font-weight: 700; }

.decision-note {
  display: flex;
  gap: 10px;
  margin: 0 14px 14px;
  padding: 11px 12px;
  background: #fff4cf;
  border: 1px solid #ead48c;
  border-radius: 13px;
}

.decision-note span { color: #956f10; font-size: 10px; font-weight: 900; letter-spacing: .09em; }
.decision-note p { margin: 0; color: #776523; font-size: 10px; line-height: 1.5; font-weight: 750; }
.decision-note strong { color: var(--ink); }

.code-card { min-width: 0; color: white; background: #101915; border-color: #101915; }

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 11px;
}

.code-head span { color: #f7cc5e; }
.code-head h2 { font-size: 18px; }
.code-head button { min-height: 38px; padding: 0 13px; color: white; background: var(--coral); border: 0; border-radius: 11px; font-size: 10px; font-weight: 900; cursor: pointer; }

.code-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 0 16px;
  padding: 4px;
  background: #1e2924;
  border: 1px solid #33423c;
  border-radius: 12px;
}

.code-tabs button { min-width: 0; min-height: 34px; color: #9eaba5; background: transparent; border: 0; border-radius: 8px; font-size: 10px; font-weight: 900; cursor: pointer; }
.code-tabs button[aria-pressed="true"] { color: var(--ink); background: white; }

.code-body {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(160px, .55fr);
  min-height: 160px;
  margin-top: 10px;
  border-top: 1px solid #33423c;
}

pre {
  min-width: 0;
  margin: 0;
  padding: 15px 16px;
  overflow: auto;
  color: #dce6e1;
  background: #09100d;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.code-note { padding: 15px; background: #171c2d; }
.code-note span { display: block; margin-bottom: 9px; color: #9eb5ff; font-size: 10px; font-weight: 900; letter-spacing: .09em; }
.code-note strong { display: block; margin-bottom: 5px; font-size: 13px; }
.code-note p { margin: 0; color: #aeb8d4; font-size: 10px; line-height: 1.5; font-weight: 700; }

@media (max-width: 1120px) {
  .studio { grid-template-columns: 1fr; }
  .comparison-card { grid-row: auto; }
  .guide-card { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr); }
  .guide-card > .panel-head { grid-column: 1 / -1; }
  .guide-detail { align-self: stretch; margin: 14px 14px 8px 0; }
  .decision-note { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .page { width: min(100% - 24px, 680px); padding: 18px 0 26px; }
  .hero { grid-template-columns: 1fr; padding-bottom: 18px; }
  .hero-title { grid-column: auto; }
  h1 { font-size: clamp(43px, 13vw, 72px); line-height: .95; }
  .hero-actions { justify-content: flex-start; flex-wrap: wrap; }
  .studio { gap: 12px; }
  .comparison-card, .guide-card, .code-card { border-radius: 19px; }
  .panel-head { padding: 13px 14px; }
  .same-value { align-items: flex-start; flex-direction: column; gap: 2px; }
  .comparison-stage { grid-template-columns: 1fr; padding: 13px; }
  .form-case { padding: 14px; }
  .state-flow { grid-template-columns: 1fr; margin: 0 13px 13px; }
  .state-flow > i { rotate: 90deg; justify-self: center; }
  .guide-card { display: block; }
  .guide-detail { margin: 0 14px 12px; }
  .code-body { grid-template-columns: 1fr; }
  .code-note { border-top: 1px solid #33423c; }
}

@media (max-width: 440px) {
  .lead { font-size: 15px; }
  .panel-head { align-items: flex-start; flex-wrap: wrap; }
  .panel-head h2 { font-size: 18px; }
  .same-value { width: 100%; margin-left: 0; }
  .case-head { align-items: flex-start; flex-direction: column; }
  .case-status { align-items: flex-start; flex-direction: column; }
  .guide-list button { grid-template-columns: auto minmax(0, 1fr); }
  .guide-list button > i { display: none; }
  .code-head { align-items: flex-start; flex-direction: column; }
  .code-head button { align-self: flex-end; }
  .code-tabs { grid-template-columns: 1fr; }
}

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