:root {
  --paper: #f5f0e7;
  --panel: #fffdf8;
  --ink: #17221e;
  --muted: #6c7772;
  --line: #d7d8d0;
  --green: #0ca67c;
  --green-dark: #08755a;
  --green-soft: #def5ed;
  --blue: #3e78f6;
  --blue-dark: #285bc5;
  --blue-soft: #e7eeff;
  --coral: #f16f56;
  --coral-dark: #b94a38;
  --coral-soft: #ffe2d9;
  --yellow: #f2c44f;
  --shadow: 0 22px 60px rgb(37 42 38 / 12%);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --field-min: 88px;
  --field-max: 220px;
}

* {
  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 2% 4%, rgb(12 166 124 / 16%), transparent 25%),
    radial-gradient(circle at 96% 4%, rgb(241 111 86 / 18%), transparent 28%),
    var(--paper);
  font-family: Inter, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 4px solid rgb(62 120 246 / 25%);
  outline-offset: 3px;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(430px, .85fr);
  align-items: end;
  gap: 12px 28px;
  padding: 0 4px 24px;
}

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

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

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

.eyebrow i::before,
.eyebrow i::after {
  position: absolute;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  content: "";
}

.eyebrow i::before {
  top: 4px;
  left: 4px;
  width: 8px;
}

.eyebrow i::after {
  right: 3px;
  bottom: 4px;
  width: 12px;
  background: var(--coral);
}

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

.lead {
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.35vw, 23px);
  font-weight: 800;
  line-height: 1.5;
}

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

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

.support-badge,
.utility-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 13px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.support-badge {
  gap: 8px;
  padding: 0 14px;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid #99d8c5;
}

.support-badge i {
  width: 9px;
  height: 9px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgb(12 166 124 / 13%);
}

.support-badge[data-supported="false"] {
  color: #747b77;
  background: #efeee9;
  border-color: #d6d6ce;
}

.support-badge[data-supported="false"] i {
  background: #9ba19d;
  box-shadow: 0 0 0 4px rgb(110 120 115 / 12%);
}

.utility-button {
  justify-content: center;
  padding: 0 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
}

.utility-button--dark {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.studio {
  display: grid;
  grid-template-columns: minmax(330px, .72fr) minmax(0, 1.6fr);
  align-items: stretch;
  gap: 18px;
}

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

.control-card {
  grid-column: 1;
  grid-row: 1;
}

.preview-card {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.usecase-card {
  grid-column: 1;
  grid-row: 2;
}

.code-card {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  background: #111b17;
  border-color: #111b17;
}

.panel-head {
  display: flex;
  align-items: center;
  min-height: 78px;
  gap: 12px;
  padding: 16px 20px;
  background: rgb(255 253 248 / 97%);
  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.1;
}

.panel-head--compact {
  min-height: 74px;
}

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

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

.same-content {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  gap: 7px;
  margin-left: auto;
  padding: 0 12px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  white-space: nowrap;
}

.same-content i {
  width: 16px;
  height: 8px;
  border: 2px solid var(--blue);
  border-radius: 50%;
}

.control-section {
  padding: 19px 20px 20px;
  border-bottom: 1px solid var(--line);
}

.control-label {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.control-label span,
.rule-note > span,
.measure-row span,
.behavior-strip span,
.field-head span,
.usecase-list em {
  display: block;
  color: var(--green-dark);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .1em;
}

.control-label b {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

.control-label output {
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 900;
}

.mode-switch,
.preview-tabs {
  position: relative;
  display: grid;
  padding: 4px;
  background: #f0efe9;
  border: 1px solid #d7d7cf;
  border-radius: 13px;
}

.mode-switch {
  grid-template-columns: repeat(3, 1fr);
}

.mode-switch button,
.preview-tabs button {
  position: relative;
  z-index: 1;
  min-height: 38px;
  padding: 0 7px;
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.mode-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  background: white;
  border-radius: 9px;
  box-shadow: 0 4px 12px rgb(20 30 25 / 10%);
  transform: translateX(calc(var(--mode-index, 0) * 100%));
  transition: transform .35s var(--ease-out);
}

.sample-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.sample-grid button {
  min-height: 58px;
  padding: 8px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.sample-grid button::before {
  display: block;
  width: var(--sample-width, 50%);
  height: 5px;
  margin: 0 auto 9px;
  background: currentColor;
  border-radius: 5px;
  content: "";
  opacity: .35;
}

.sample-grid button[aria-pressed="true"] {
  color: var(--green-dark);
  background: var(--green-soft);
  border-color: #6dceb0;
  box-shadow: inset 0 0 0 1px #6dceb0;
}

input[type="range"] {
  width: 100%;
  height: 5px;
  margin: 5px 0 8px;
  accent-color: var(--green);
  cursor: pointer;
}

.control-help,
.rule-note p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.55;
}

.rule-note {
  margin: 18px 20px 20px;
  padding: 16px;
  background: var(--green-soft);
  border: 1px solid #a4ddcb;
  border-radius: 16px;
}

.rule-note code {
  display: block;
  margin: 8px 0;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 16px;
  font-weight: 800;
}

.rule-note p code {
  display: inline;
  margin: 0;
  font-size: 10px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 18px;
  background: #f8f7f2;
  border-bottom: 1px solid var(--line);
}

.preview-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.preview-toolbar p span {
  color: var(--blue-dark);
}

.preview-tabs {
  grid-template-columns: repeat(2, 1fr);
  flex: 0 0 184px;
  --preview-index: 1;
}

.preview-tabs button {
  z-index: 1;
  transition: color .25s ease;
}

.preview-tabs button[aria-pressed="true"] {
  color: white;
  background: transparent;
}

.preview-tabs-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / 2);
  background: var(--blue);
  border-radius: 9px;
  box-shadow: 0 4px 12px rgb(62 120 246 / 20%);
  transform: translateX(calc(var(--preview-index) * 100%));
  transition: transform .35s var(--ease-out);
}

@supports (anchor-name: --active-preview-width) {
  .preview-tabs button[aria-pressed="true"] {
    anchor-name: --active-preview-width;
  }

  .preview-tabs-indicator {
    position-anchor: --active-preview-width;
    top: anchor(top);
    bottom: auto;
    left: anchor(left);
    width: anchor-size(width);
    height: anchor-size(height);
    transform: none;
    transition:
      top .35s var(--ease-out),
      left .35s var(--ease-out),
      width .35s var(--ease-out),
      height .35s var(--ease-out);
  }
}

.comparison-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  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;
}

.comparison-stage[data-width="compact"] {
  grid-template-columns: minmax(0, 420px);
  justify-content: center;
}

.field-panel {
  display: flex;
  min-width: 0;
  min-height: 430px;
  flex-direction: column;
  overflow: hidden;
  background: rgb(255 255 255 / 94%);
  border: 1px solid var(--line);
  border-radius: 19px;
}

.field-panel--content {
  background: rgb(235 249 244 / 96%);
  border-color: #8dd9c1;
}

.field-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  min-height: 76px;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.field-head span {
  color: var(--muted);
}

.field-panel--content .field-head span {
  color: var(--green-dark);
}

.field-head h3 {
  margin: 3px 0 0;
  font-size: 20px;
}

.field-head code {
  padding: 7px 9px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.field-panel--content .field-head code {
  color: var(--green-dark);
  border-color: #9fdac8;
}

.field-canvas {
  display: grid;
  min-height: 288px;
  flex: 1;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.demo-field-wrap {
  display: flex;
  width: min(100%, 420px);
  align-items: flex-start;
  flex-direction: column;
  gap: 9px;
}

.demo-field-wrap label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
  font-size: 11px;
  font-weight: 900;
}

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

.demo-field {
  max-width: 100%;
  color: var(--ink);
  background: #fffefb;
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 7px 0 rgb(23 34 30 / 10%);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.demo-field:is(input, textarea) {
  padding: 14px 15px;
}

.demo-field:is(select) {
  min-height: 52px;
  padding: 0 42px 0 15px;
}

textarea.demo-field {
  width: 100%;
  height: var(--field-min);
  min-height: var(--field-min);
  max-height: var(--field-max);
  resize: none;
}

.field-panel--content textarea.demo-field {
  height: auto;
  field-sizing: content;
}

input.demo-field {
  width: min(100%, 330px);
  min-width: min(var(--field-min), 100%);
  max-width: min(var(--field-max), 100%);
}

.field-panel--content input.demo-field {
  width: auto;
  field-sizing: content;
}

select.demo-field {
  width: min(100%, 330px);
  min-width: min(var(--field-min), 100%);
  max-width: min(var(--field-max), 100%);
}

.field-panel--content select.demo-field {
  width: auto;
  field-sizing: content;
}

.field-note {
  width: 100%;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}

.measure-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  gap: 12px;
  padding: 0 16px;
  background: #f7f7f3;
  border-top: 1px solid var(--line);
}

.measure-row span {
  color: var(--muted);
}

.measure-row b {
  font-size: 13px;
}

.field-panel--content .measure-row b {
  color: var(--green-dark);
}

.behavior-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  padding: 0 16px 16px;
  background: #f8f7f1;
}

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

.behavior-strip span {
  color: var(--blue-dark);
}

.behavior-strip b {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usecase-list {
  display: grid;
  gap: 9px;
  padding: 14px 16px 16px;
}

.usecase-list button {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 24px;
  align-items: center;
  min-height: 76px;
  gap: 12px;
  padding: 11px 12px;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease;
}

.usecase-list button:hover {
  border-color: #83d2ba;
  transform: translateY(-2px);
}

.usecase-icon {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  background: var(--green-soft);
  border-radius: 13px;
}

.usecase-icon::before,
.usecase-icon::after {
  position: absolute;
  content: "";
}

.usecase-icon::before {
  inset: 11px 9px;
  border: 2px solid var(--green-dark);
  border-radius: 6px;
}

.usecase-icon::after {
  left: 15px;
  top: 18px;
  width: 18px;
  height: 2px;
  background: var(--coral);
  box-shadow: 0 7px 0 var(--coral);
}

.usecase-icon--input::before {
  inset: 16px 7px;
  border-radius: 9px;
}

.usecase-icon--input::after {
  top: 23px;
  box-shadow: none;
}

.usecase-icon--select::after {
  top: 19px;
  left: 17px;
  width: 10px;
  height: 10px;
  background: transparent;
  border-right: 2px solid var(--coral);
  border-bottom: 2px solid var(--coral);
  box-shadow: none;
  transform: rotate(45deg);
}

.usecase-list span {
  min-width: 0;
}

.usecase-list b,
.usecase-list small {
  display: block;
}

.usecase-list b {
  margin: 3px 0;
  font-size: 13px;
}

.usecase-list small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usecase-list strong {
  color: var(--coral-dark);
  font-size: 18px;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 18px;
  padding: 16px 20px;
  color: white;
  border-bottom: 1px solid rgb(255 255 255 / 12%);
}

.code-head span {
  color: var(--yellow);
}

.code-head button {
  min-height: 42px;
  padding: 0 16px;
  color: white;
  background: var(--coral);
  border: 0;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.code-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 12px 16px 0;
  padding: 4px;
  background: #1f2a25;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 12px;
}

.code-tabs button {
  min-height: 36px;
  color: #aeb8b3;
  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: var(--green-soft);
}

.code-card pre {
  min-height: 205px;
  margin: 0;
  padding: 22px 22px 18px;
  overflow: auto;
  color: #eaf2ee;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.code-card pre .selector { color: #79d9bc; }
.code-card pre .property { color: #f8cb59; }
.code-card pre .value { color: #ff8c75; }
.code-card pre .comment { color: #84918b; }

.code-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: auto;
  padding: 0 16px 16px;
}

.code-notes div {
  padding: 12px;
  background: #1b2722;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 12px;
}

.code-notes span,
.code-notes b {
  display: block;
}

.code-notes span {
  margin-bottom: 5px;
  color: var(--yellow);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

.code-notes b {
  color: #d7dfda;
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-title {
    grid-column: auto;
  }

  .hero-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .studio {
    grid-template-columns: 1fr;
  }

  .control-card,
  .preview-card,
  .usecase-card,
  .code-card {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 20px, 620px);
    padding-top: 18px;
  }

  h1 {
    font-size: clamp(42px, 14vw, 64px);
  }

  .hero {
    padding-bottom: 18px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .support-badge {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .utility-button {
    width: 100%;
  }

  .panel-head {
    padding-inline: 15px;
  }

  .same-content {
    display: none;
  }

  .preview-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-tabs {
    width: 100%;
    flex-basis: auto;
  }

  .comparison-stage,
  .comparison-stage[data-width="compact"] {
    grid-template-columns: 1fr;
  }

  .field-panel {
    min-height: 385px;
  }

  .field-canvas {
    min-height: 240px;
    padding: 18px;
  }

  .behavior-strip,
  .code-notes {
    grid-template-columns: repeat(2, 1fr);
  }

  .code-head {
    align-items: flex-start;
  }

  .code-head h2 {
    font-size: 18px;
  }
}

@media (max-width: 420px) {
  .hero-actions {
    grid-template-columns: 1fr;
  }

  .support-badge {
    grid-column: auto;
  }

  .mode-switch button {
    font-size: 10px;
  }

  .field-head {
    flex-direction: column;
  }

  .behavior-strip,
  .code-notes {
    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;
  }
}
