@import url("https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700;800;900&family=Noto+Sans+JP:wght@500;600;700;800;900&display=swap");

:root {
  --paper: #f3f0e8;
  --surface: #fbfaf5;
  --ink: #17211e;
  --muted: #707b77;
  --line: #d8d7cf;
  --green: #0b9f7a;
  --green-dark: #08745a;
  --green-soft: #def5ed;
  --blue: #3e76f5;
  --blue-soft: #e6edff;
  --orange: #f47752;
  --orange-soft: #ffe4da;
  --yellow: #f3bf43;
  --dark: #10201a;
  --shadow: 0 18px 48px rgb(34 42 38 / 10%);
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 0 0, rgb(190 224 237 / 50%), transparent 29%),
    radial-gradient(circle at 100% 0, rgb(247 205 181 / 47%), transparent 31%),
    var(--paper);
  font-family: Inter, "Noto Sans JP", sans-serif;
}

button,
select { color: inherit; font: inherit; }

button { cursor: pointer; }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px 24px;
  margin-bottom: 20px;
}

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

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 8px;
  color: #45685e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
}

.eyebrow i {
  position: relative;
  width: 25px;
  height: 20px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: white;
}

.eyebrow i::before {
  position: absolute;
  top: 50%;
  left: 5px;
  width: 6px;
  height: 6px;
  content: "";
  background: var(--orange);
  border-radius: 50%;
  translate: 0 -50%;
}

.eyebrow i::after {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 5px;
  height: 5px;
  content: "";
  border-right: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  rotate: 45deg;
  translate: 0 -70%;
}

h1 {
  margin: 0;
  font-size: clamp(50px, 6.4vw, 100px);
  line-height: .9;
  letter-spacing: normal;
  font-weight: 900;
}

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

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

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

.hero-actions span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  color: #276352;
  background: rgb(222 245 237 / 82%);
  border: 1px solid #a8dcca;
  border-radius: 13px;
  font-size: 11px;
  font-weight: 900;
}

.hero-actions span:last-child {
  color: #3d5eaf;
  background: rgb(230 237 255 / 85%);
  border-color: #bdccff;
}

.studio {
  display: grid;
  grid-template-columns: minmax(370px, .72fr) minmax(690px, 1.28fr);
  align-items: stretch;
  gap: 18px;
}

.control-card,
.preview-card {
  overflow: hidden;
  background: rgb(251 250 245 / 96%);
  border: 1px solid #d6d5ce;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

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

.panel-head > div { min-width: 0; }

.panel-head p {
  margin: 0 0 2px;
  color: #2f7763;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}

.panel-head h2 {
  margin: 0;
  font-size: clamp(18px, 1.55vw, 25px);
  line-height: 1.12;
  font-weight: 900;
}

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

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

.preview-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 8px 11px;
  color: #315ab3;
  background: var(--blue-soft);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  white-space: nowrap;
}

.preview-status i {
  width: 8px;
  height: 8px;
  background: var(--blue);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #92adff;
}

.part-picker { padding: 20px 20px 12px; }

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

.control-label span {
  display: block;
  margin-bottom: 3px;
  color: #2f7763;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}

.control-label h3 { margin: 0; font-size: 16px; }

.control-label output {
  color: var(--green-dark);
  font: 800 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.part-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.part-buttons button {
  display: grid;
  place-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 77px;
  padding: 10px 5px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 10px;
  font-weight: 900;
}

.part-buttons button[aria-pressed="true"] {
  color: #185d4b;
  background: var(--green-soft);
  border-color: #64c6a9;
  box-shadow: inset 0 0 0 1px #64c6a9;
}

.part-buttons button:focus-visible,
.code-tabs button:focus-visible,
#copyButton:focus-visible { outline: 3px solid rgb(62 118 245 / 45%); outline-offset: 2px; }

.part-icon {
  position: relative;
  display: block;
  width: 32px;
  height: 27px;
}

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

.part-icon--rich::before {
  inset: 3px 1px;
  background: white;
  border: 2px solid currentColor;
  border-radius: 7px;
}

.part-icon--rich::after {
  top: 10px;
  left: 7px;
  width: 7px;
  height: 7px;
  background: var(--orange);
  border-radius: 50%;
  box-shadow: 10px 0 0 -2px var(--green);
}

.part-icon--selected::before {
  inset: 3px 1px;
  background: white;
  border: 2px solid currentColor;
  border-radius: 7px;
}

.part-icon--selected::after {
  top: 10px;
  left: 7px;
  width: 12px;
  height: 7px;
  background: var(--orange);
  border-radius: 99px;
}

.part-icon--divider::before {
  inset: 3px 2px;
  background: white;
  border: 2px solid currentColor;
  border-radius: 7px;
}

.part-icon--divider::after {
  top: 13px;
  left: 7px;
  width: 18px;
  height: 2px;
  background: var(--orange);
  border-radius: 99px;
}

.part-icon--group::before {
  inset: 2px 3px;
  background: white;
  border: 2px solid currentColor;
  border-radius: 6px;
}

.part-icon--group::after {
  top: 7px;
  left: 8px;
  width: 16px;
  height: 4px;
  border-top: 3px solid var(--blue);
  border-bottom: 3px solid var(--green);
  box-shadow: 0 5px 0 -1px currentColor;
}

.part-detail {
  display: grid;
  gap: 4px;
  min-height: 111px;
  margin-top: 10px;
  padding: 14px 15px;
  background: #f2f7f4;
  border: 1px solid #cce5dc;
  border-radius: 15px;
}

.part-detail > span {
  color: var(--green-dark);
  font: 800 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.part-detail strong { font-size: 13px; line-height: 1.35; }

.part-detail p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
  font-weight: 700;
}

.support-card {
  margin: 0 20px 12px;
  padding: 13px 14px;
  background: #fff7e3;
  border: 1px solid #ecd59d;
  border-radius: 15px;
}

.support-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.support-status > i {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 9px;
}

.support-status > i::before,
.support-status > i::after {
  position: absolute;
  top: 50%;
  content: "";
  translate: 0 -50%;
}

.support-status > i::before { left: 6px; width: 6px; height: 6px; background: var(--yellow); border-radius: 50%; }
.support-status > i::after { right: 5px; width: 5px; height: 5px; border-right: 2px solid var(--green); border-bottom: 2px solid var(--green); rotate: 45deg; translate: 0 -70%; }

.support-status > div { min-width: 0; }
.support-status span { display: block; margin-bottom: 2px; color: #987327; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.support-status strong { display: block; font-size: 12px; }
.support-status b { margin-left: auto; padding: 6px 8px; color: #7d6226; background: white; border-radius: 8px; font-size: 10px; white-space: nowrap; }
.support-card.is-supported .support-status b { color: #17624f; background: #e1f5ed; }
.support-card > p { margin: 8px 0 0 40px; color: #776b4d; font-size: 10px; line-height: 1.45; font-weight: 700; }

.code-card {
  margin: 0 20px 20px;
  overflow: hidden;
  color: #e9f2ee;
  background: var(--dark);
  border: 1px solid #2d3c37;
  border-radius: 17px;
}

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 7px 9px;
  background: #182923;
  border-bottom: 1px solid #314039;
}

.code-tabs {
  display: flex;
  gap: 3px;
  min-width: 0;
  padding: 3px;
  background: #0f1c18;
  border: 1px solid #33463f;
  border-radius: 9px;
}

.code-tabs button {
  min-width: 62px;
  padding: 6px 8px;
  color: #82948e;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
}

.code-tabs button[aria-pressed="true"] { color: #17372e; background: #8ee0c7; }

#copyButton {
  flex: 0 0 auto;
  padding: 8px 10px;
  color: #dff4eb;
  background: #2b4038;
  border: 0;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 900;
}

.code-caption {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  background: #14251f;
  border-bottom: 1px solid #2b3b35;
}

.code-caption > span { flex: 0 0 auto; color: #82cab6; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.code-caption p { margin: 0; color: #a7b7b1; font-size: 10px; line-height: 1.45; font-weight: 700; }
.code-caption code { color: #f5c85f; }

pre {
  height: 170px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #dce7e2;
  font: 700 10px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.comparison-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 18px 18px 12px;
}

.select-case {
  min-width: 0;
  padding: 14px;
  border: 1px solid;
  border-radius: 19px;
}

.select-case--classic { background: #f0f1ed; border-color: #d0d4d0; }
.select-case--custom { background: #eef8f4; border-color: #9ddbc8; }

.select-case > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.select-case > header span { display: block; margin-bottom: 2px; color: #7b8581; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.select-case--custom > header span { color: #28745f; }
.select-case > header h3 { margin: 0; font-size: 21px; }
.select-case > header > b { padding: 6px 7px; color: #65706c; background: white; border-radius: 999px; font-size: 10px; white-space: nowrap; }
.select-case--custom > header > b { color: #1f6d58; }

.select-demo {
  display: grid;
  align-content: center;
  min-height: 264px;
  padding: 22px;
  background:
    linear-gradient(rgb(23 33 30 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(23 33 30 / 5%) 1px, transparent 1px),
    #fdfdfb;
  background-size: 24px 24px;
  border: 1px solid #d9ddd9;
  border-radius: 14px;
}

.select-demo label { margin-bottom: 9px; color: #53615c; font-size: 11px; font-weight: 900; }
.select-demo > p { margin: 11px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; font-weight: 700; }

.select-demo--classic select {
  width: 100%;
  min-height: 58px;
  padding: 0 14px;
  background: white;
  border: 1px solid #aeb7b3;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
}

.select-demo--classic select[hidden] { display: none; }

.custom-select { width: 100%; }
.custom-select[hidden] { display: none; }

@supports (appearance: base-select) {
  .custom-select,
  .custom-select::picker(select) {
    appearance: base-select;
  }

  .custom-select {
    --select-edge: #1c2b26;
    position: relative;
    min-height: 70px;
    padding: 7px 44px 7px 16px;
    color: var(--ink);
    background: white;
    border: 2px solid var(--select-edge);
    border-radius: 14px;
    box-shadow: 0 8px 0 rgb(23 33 30 / 10%);
    transition: border-color .2s ease, box-shadow .2s ease, translate .2s ease;
  }

  .custom-select:not(:has(> button)) {
    padding-block: 20px;
  }

  .custom-select:hover { --select-edge: var(--green); translate: 0 -1px; }
  .custom-select:focus-visible { outline: 4px solid rgb(62 118 245 / 28%); outline-offset: 2px; }

  .custom-select > button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .custom-select selectedcontent { display: contents; }

  .custom-select[data-custom-select="rich"] selectedcontent .option-copy small,
  .custom-select[data-custom-select="rich"] selectedcontent .option-count {
    display: none;
  }

  .custom-select::picker-icon {
    position: absolute;
    top: 50%;
    right: 18px;
    width: 9px;
    height: 9px;
    margin: 0;
    color: transparent;
    border-right: 2px solid var(--select-edge);
    border-bottom: 2px solid var(--select-edge);
    rotate: 45deg;
    translate: 0 -65%;
    transition: rotate .25s ease;
  }

  .custom-select:open::picker-icon { rotate: 225deg; }

  .custom-select::picker(select) {
    margin-block: 8px;
    padding: 7px;
    background: #fbfaf5;
    border: 2px solid #1c2b26;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgb(23 33 30 / 20%);
    opacity: 0;
    translate: 0 -8px;
    transition:
      opacity .2s ease,
      translate .25s cubic-bezier(.2,.8,.2,1),
      display .25s allow-discrete,
      overlay .25s allow-discrete;
  }

  .custom-select:open::picker(select) { opacity: 1; translate: 0 0; }

  @starting-style {
    .custom-select:open::picker(select) { opacity: 0; translate: 0 -8px; }
  }

  .custom-select option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 9px 10px;
    background: transparent;
    border: 0;
    border-radius: 11px;
    font-size: 12px;
    cursor: pointer;
  }

  .custom-select[data-custom-select="rich"] option,
  .custom-select[data-custom-select="selected"] option {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .custom-select option:hover,
  .custom-select option:focus { background: #eef6f2; }

  .custom-select option:checked {
    color: var(--ink);
    background: var(--green-soft);
    font-weight: 700;
  }

  .custom-select option::checkmark {
    order: 4;
    width: 20px;
    height: 20px;
    margin-left: 5px;
    color: white;
    background: var(--green);
    border-radius: 50%;
    content: "✓";
    font-size: 11px;
    line-height: 20px;
    text-align: center;
  }

  .custom-select:not(:open) .option-count { margin-right: 3px; }

  .custom-select hr {
    height: 1px;
    margin: 6px 8px;
    background: #cad3ce;
    border: 0;
  }

  .custom-select optgroup {
    margin: 6px 0;
    padding: 8px;
    background: #f1f6f3;
    border: 1px solid #d1e0da;
    border-radius: 12px;
  }

  .custom-select optgroup legend {
    margin: 0 0 4px 4px;
    padding: 0 5px;
    color: #35725f;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
  }

  .custom-select optgroup option { background: white; }
  .custom-select optgroup option + option { margin-top: 4px; }
}

.option-marker {
  width: 13px;
  height: 13px;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 2px currentColor;
}

.option-marker--gray { color: #89928e; background: #89928e; }
.option-marker--blue { color: var(--blue); background: var(--blue); }
.option-marker--orange { color: var(--orange); background: var(--orange); }
.option-marker--green { color: var(--green); background: var(--green); }

.option-copy { display: grid; min-width: 0; gap: 2px; }
.option-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.option-copy small { overflow: hidden; color: #71807a; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.option-count { min-width: 28px; padding: 4px 6px; color: #376358; background: #e8f2ee; border-radius: 7px; font-size: 10px; font-weight: 900; text-align: center; }

.case-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  background: rgb(255 255 255 / 78%);
  border-radius: 11px;
}

.case-result span { color: #75817d; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.case-result strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.selected-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 18px 12px;
  padding: 15px 16px;
  background: #fff7e7;
  border: 1px solid #ead6a9;
  border-radius: 17px;
}

.selected-preview__copy { min-width: 0; }
.selected-preview__copy > span { display: block; margin-bottom: 3px; color: #9b6e20; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.selected-preview__copy h3 { margin: 0 0 4px; font-size: 14px; }
.selected-preview__copy p { margin: 0; color: #786c53; font-size: 10px; line-height: 1.45; font-weight: 700; }
.selected-preview__copy code { color: var(--green-dark); font-weight: 900; }

.selected-preview__value {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  padding: 10px 13px;
  background: white;
  border: 1px solid #ded8ca;
  border-radius: 13px;
}

.result-marker { width: 17px; height: 17px; border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 2px currentColor; }
.result-marker--gray { color: #89928e; background: #89928e; }
.result-marker--blue { color: var(--blue); background: var(--blue); }
.result-marker--orange { color: var(--orange); background: var(--orange); }
.result-marker--green { color: var(--green); background: var(--green); }
.selected-preview__value > div { min-width: 0; }
.selected-preview__value small { display: block; margin-bottom: 2px; color: #8a918e; font-size: 10px; font-weight: 800; }
.selected-preview__value strong { display: block; max-width: 105px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 18px 18px;
}

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

.metric-grid span { display: block; margin-bottom: 3px; color: #2d8068; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.metric-grid b { display: block; overflow: hidden; font-size: clamp(14px, 1.3vw, 20px); text-overflow: ellipsis; white-space: nowrap; }
.metric-grid small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 700; }

.preview-card[data-recipe="rich"] .custom-select,
.preview-card[data-recipe="divider"] .select-demo--custom,
.preview-card[data-recipe="group"] .select-case--custom,
.preview-card[data-recipe="selected"] .selected-preview {
  animation: focus-pulse .55s ease;
}

@keyframes focus-pulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 5px rgb(62 118 245 / 20%); }
}

@media (max-width: 1120px) {
  .studio { grid-template-columns: 1fr; }
  .part-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
  .control-label { grid-column: 1 / -1; }
  .part-detail { margin-top: 0; }
  .support-card { margin-top: 4px; }
  .code-card { margin-top: 4px; }
}

@media (max-width: 760px) {
  .page { width: min(100% - 24px, 680px); padding: 18px 0 26px; }
  .hero { grid-template-columns: 1fr; }
  .hero-title { grid-column: auto; }
  h1 { font-size: clamp(43px, 13vw, 72px); line-height: .94; }
  .hero-actions { justify-content: flex-start; flex-wrap: wrap; }
  .studio { gap: 12px; }
  .control-card, .preview-card { border-radius: 19px; }
  .panel-head { padding: 13px 14px; }
  .part-picker { display: block; padding: 16px 14px 10px; }
  .part-buttons { grid-template-columns: repeat(2, 1fr); }
  .part-detail { margin-top: 9px; }
  .support-card, .code-card { margin-inline: 14px; }
  .comparison-stage { grid-template-columns: 1fr; padding: 14px 14px 10px; }
  .select-demo { min-height: 220px; padding: 18px; }
  .selected-preview { display: grid; margin-inline: 14px; }
  .selected-preview__value { min-width: 0; width: 100%; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); padding-inline: 14px; }
}

@media (max-width: 440px) {
  .hero-actions span { min-height: 38px; padding-inline: 11px; }
  .preview-status { display: none; }
  .panel-head h2 { font-size: 17px; }
  .section-mark { width: 38px; height: 38px; }
  .control-label { align-items: flex-start; }
  .control-label output { max-width: 48%; text-align: right; }
  .code-toolbar { align-items: stretch; flex-direction: column; }
  .code-tabs { width: 100%; }
  .code-tabs button { flex: 1; min-width: 0; }
  #copyButton { align-self: flex-end; }
  .selected-preview__value { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); }
  .select-case > header { align-items: flex-start; flex-direction: column; }
}

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