:root {
  --paper: #f2efe7;
  --panel: #fffdf8;
  --ink: #17211e;
  --muted: #68736e;
  --line: #d4d8cf;
  --soft-line: #e8e8e0;
  --coral: #f26e55;
  --coral-dark: #b74634;
  --coral-soft: #ffe3dc;
  --blue: #4271ef;
  --blue-dark: #2853b5;
  --blue-soft: #e6edff;
  --green: #08a77c;
  --green-dark: #087157;
  --green-soft: #dbf5eb;
  --yellow: #f3c54d;
  --yellow-soft: #fff0bc;
  --purple: #8357ef;
  --shadow: 0 24px 65px rgb(29 40 35 / 12%);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { 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 0 3%, rgb(66 113 239 / 14%), transparent 27%),
    radial-gradient(circle at 100% 5%, rgb(242 110 85 / 16%), transparent 30%),
    var(--paper);
  font-family: Inter, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}
button { color: inherit; font: inherit; }
button:focus-visible, input:focus-visible, .carousel:focus-visible {
  outline: 4px solid rgb(66 113 239 / 27%);
  outline-offset: 3px;
}
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.page { width: min(1560px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 44px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(480px, .8fr);
  align-items: end;
  gap: 12px 28px;
  padding: 0 4px 24px;
}
.hero-title { grid-column: 1 / -1; min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 9px; color: var(--blue-dark); font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.eyebrow i { position: relative; width: 31px; height: 18px; border: 2px solid currentColor; border-radius: 999px; }
.eyebrow i::before, .eyebrow i::after { position: absolute; top: 50%; width: 6px; height: 6px; background: currentColor; border-radius: 50%; translate: 0 -50%; content: ""; }
.eyebrow i::before { left: 4px; }
.eyebrow i::after { right: 4px; }
h1 { margin: 0; font-family: "Arial Black", Inter, sans-serif; font-size: clamp(50px, 6vw, 90px); line-height: .95; letter-spacing: normal; }
h1 span { color: var(--coral-dark); }
.lead { margin: 0; color: var(--muted); font-size: clamp(16px, 1.35vw, 23px); font-weight: 800; line-height: 1.5; }
.lead strong { color: var(--ink); }
.hero-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.support-badge, .utility-button { display: inline-flex; min-height: 44px; align-items: center; 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 #98dac5; }
.support-badge i { width: 9px; height: 9px; background: currentColor; border-radius: 50%; box-shadow: 0 0 0 4px rgb(8 167 124 / 13%); }
.support-badge[data-support="partial"] { color: #855f0c; background: var(--yellow-soft); border-color: #dfc267; }
.utility-button { justify-content: center; padding: 0 15px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; }
.utility-button--dark { color: #fff; background: var(--ink); border-color: var(--ink); }

.studio { display: grid; grid-template-columns: minmax(360px, .62fr) minmax(0, 1.38fr); gap: 18px; align-items: stretch; }
.controls-panel, .preview-panel, .enhancement-panel, .code-panel { min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 25px; box-shadow: var(--shadow); }
.panel-head { display: flex; min-height: 78px; align-items: center; gap: 12px; 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: .11em; }
.panel-head h2, .code-head h2 { margin: 0; font-size: clamp(18px, 1.45vw, 25px); line-height: 1.15; }
.section-mark { display: grid; flex: 0 0 47px; width: 47px; height: 47px; place-items: center; color: #fff; border-radius: 15px; font-size: 11px; font-weight: 900; }
.section-mark--coral { background: var(--coral); }
.section-mark--blue { background: var(--blue); }
.section-mark--green { background: var(--green); }
.panel-head--preview p { color: var(--blue-dark); }
.same-markup-badge { margin-left: auto; padding: 8px 11px; color: var(--blue-dark); background: var(--blue-soft); border-radius: 999px; font-size: 10px; font-weight: 900; white-space: nowrap; }

.control-group { padding: 19px 20px; border-bottom: 1px solid var(--line); }
.control-label { display: flex; justify-content: space-between; gap: 12px; }
.control-label span { color: var(--green-dark); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.control-label b { color: var(--blue-dark); font-size: 10px; }
.control-group h3 { margin: 7px 0 11px; font-size: 14px; }
.control-group > p { margin: 9px 0 0; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.5; }
.control-group code { color: var(--coral-dark); font-weight: 900; }
.segmented { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); min-height: 45px; padding: 4px; background: #f0f1ec; border: 1px solid var(--line); border-radius: 12px; }
.segmented--two { grid-template-columns: repeat(2, 1fr); }
.segmented button { position: relative; z-index: 2; padding: 0 8px; background: transparent; border: 0; cursor: pointer; font-size: 10px; font-weight: 900; }
.segmented button[aria-pressed="true"] { color: var(--ink); }
.segmented i { position: absolute; z-index: 1; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); background: #fff; border-radius: 9px; box-shadow: 0 3px 8px rgb(23 33 30 / 11%); transition: left .35s var(--ease), width .35s var(--ease); }
.segmented--two i { width: calc((100% - 8px) / 2); }
.segmented:has(button:nth-child(2)[aria-pressed="true"]) i { left: calc(4px + (100% - 8px) / 3); }
.segmented:has(button:nth-child(3)[aria-pressed="true"]) i { left: calc(4px + (100% - 8px) * 2 / 3); }
.segmented--two:has(button:nth-child(2)[aria-pressed="true"]) i { left: calc(4px + (100% - 8px) / 2); }
@supports (anchor-name: --segmented-active) {
  .segmented[data-control="layout"] button[aria-pressed="true"] { anchor-name: --layout-active; }
  .segmented[data-control="layout"] i { position-anchor: --layout-active; top: anchor(top); left: anchor(left); width: anchor-size(width); height: anchor-size(height); }
  .segmented[data-control="snap"] button[aria-pressed="true"] { anchor-name: --snap-active; }
  .segmented[data-control="snap"] i { position-anchor: --snap-active; top: anchor(top); left: anchor(left); width: anchor-size(width); height: anchor-size(height); }
  .segmented[data-control="marker"] button[aria-pressed="true"] { anchor-name: --marker-active; }
  .segmented[data-control="marker"] i { position-anchor: --marker-active; top: anchor(top); left: anchor(left); width: anchor-size(width); height: anchor-size(height); }
}
.switch-row { display: flex; min-height: 77px; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.switch-row > span { display: grid; gap: 4px; }
.switch-row b { font-size: 11px; }
.switch-row small { color: var(--muted); font-size: 10px; font-weight: 700; }
.switch { cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: relative; display: block; width: 48px; height: 28px; background: #c9ccc6; border: 1px solid #b8bbb5; border-radius: 999px; transition: background .25s; }
.switch i::before { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; box-shadow: 0 2px 7px rgb(23 33 30 / 18%); transition: translate .3s var(--ease); content: ""; }
.switch input:checked + i { background: var(--green); border-color: var(--green); }
.switch input:checked + i::before { translate: 20px 0; }
.switch:has(input:focus-visible) { outline: 4px solid rgb(66 113 239 / 27%); outline-offset: 4px; border-radius: 999px; }
.fallback-note { margin: 16px 20px 20px; padding: 13px; color: #655529; background: var(--yellow-soft); border: 1px solid #dfc263; border-radius: 13px; }
.fallback-note span { font-size: 10px; font-weight: 900; }
.fallback-note p { margin: 5px 0 0; font-size: 10px; font-weight: 700; line-height: 1.55; }

.comparison-stage { --card-basis: 78%; --snap-mode: mandatory; display: grid; gap: 12px; padding: 16px; background-image: linear-gradient(var(--soft-line) 1px, transparent 1px), linear-gradient(90deg, var(--soft-line) 1px, transparent 1px); background-size: 24px 24px; }
.comparison-stage[data-layout="single"] { --card-basis: 100%; }
.comparison-stage[data-layout="multi"] { --card-basis: 45%; }
.comparison-stage[data-snap="proximity"] { --snap-mode: proximity; }
.carousel-case { min-width: 0; padding: 12px; background: rgb(255 253 248 / 95%); border: 1px solid var(--line); border-radius: 18px; }
.carousel-case--native { background: rgb(238 244 255 / 96%); border-color: #b8c8f3; }
.case-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.case-head span { color: var(--muted); font-size: 10px; font-weight: 900; }
.case-head h3 { margin: 2px 0 0; font-size: 17px; }
.case-tags { display: flex; gap: 5px; }
.case-tags span { padding: 6px 8px; background: #eff0eb; border-radius: 999px; }
.case-tags--native span { color: var(--blue-dark); background: var(--blue-soft); }
.carousel-viewport { min-width: 0; border-radius: 15px; }
.carousel-viewport--base { padding: 10px; background: #eef0eb; }
.carousel-viewport--native { padding: 10px 54px 42px; background: #dfe8ff; transition: padding .28s var(--ease); }
.comparison-stage[data-marker="before"] .carousel-viewport--native { padding-top: 42px; padding-bottom: 10px; }
.carousel { display: flex; width: 100%; gap: 12px; margin: 0; padding: 0; overflow-x: auto; overscroll-behavior-inline: contain; scroll-behavior: smooth; scroll-snap-type: inline var(--snap-mode); scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel-card { position: relative; display: grid; flex: 0 0 var(--card-basis); grid-template-columns: minmax(130px, .8fr) minmax(150px, 1.2fr); min-height: 165px; overflow: hidden; background: #fff; border: 2px solid var(--ink); border-radius: 15px; scroll-snap-align: center; }
.card-art { position: relative; min-height: 100%; overflow: hidden; background: var(--card-color, var(--coral)); }
.card-art::before { position: absolute; top: 18%; left: 16%; width: 64%; height: 54%; background: var(--card-accent, var(--yellow)); border: 3px solid var(--ink); border-radius: 50%; content: ""; }
.card-art::after { position: absolute; right: -14%; bottom: -20%; width: 67%; aspect-ratio: 1; background: var(--panel); border: 3px solid var(--ink); rotate: 16deg; content: ""; }
.card-art span { position: absolute; z-index: 2; top: 12px; left: 12px; padding: 6px 8px; color: #fff; background: var(--ink); border-radius: 999px; font-size: 10px; font-weight: 900; }
.card-art i { position: absolute; z-index: 2; right: 15%; top: 14%; width: 17%; aspect-ratio: 1; background: #fff; border: 3px solid var(--ink); border-radius: 50%; }
.card-art b { position: absolute; z-index: 3; right: 14%; bottom: 13%; width: 33%; height: 14%; background: var(--purple); border: 3px solid var(--ink); border-radius: 999px; rotate: -22deg; }
.carousel-card:nth-child(2) .card-art::before { border-radius: 18% 82% 61% 39%; rotate: 25deg; }
.carousel-card:nth-child(3) .card-art::after { border-radius: 50%; }
.carousel-card:nth-child(4) .card-art::before { width: 47%; border-radius: 4px; rotate: 45deg; }
.carousel-card:nth-child(5) .card-art b { width: 47%; height: 18%; rotate: 12deg; }
.card-copy { display: grid; align-content: center; gap: 7px; padding: 18px; }
.card-copy > span { color: var(--blue-dark); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.card-copy h3 { margin: 0; font-size: clamp(18px, 1.6vw, 26px); line-height: 1.05; }
.card-copy p { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.45; }
.case-caption { display: flex; justify-content: space-between; gap: 12px; margin: 10px 1px 0; }
.case-caption b, .case-caption span { font-size: 10px; }
.case-caption span { color: var(--muted); font-weight: 700; text-align: right; }

.carousel--native { anchor-name: --native-carousel; scroll-marker-group: after; }
.carousel--native::scroll-button(left),
.carousel--native::scroll-button(right) {
  position: absolute;
  position-anchor: --native-carousel;
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgb(23 33 30 / 18%);
}
.carousel--native::scroll-button(left) { position-area: left center; margin-right: 9px; content: "‹" / "前のカード"; }
.carousel--native::scroll-button(right) { position-area: right center; margin-left: 9px; content: "›" / "次のカード"; }
.carousel--native::scroll-button(left):disabled,
.carousel--native::scroll-button(right):disabled { cursor: not-allowed; opacity: .28; }
.carousel--native::scroll-marker-group {
  position: absolute;
  position-anchor: --native-carousel;
  position-area: bottom center;
  display: flex;
  gap: 7px;
  margin-top: 12px;
  padding: 7px 9px;
  background: rgb(255 255 255 / 82%);
  border: 1px solid #b9c7ed;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.comparison-stage[data-marker="before"] .carousel--native::scroll-marker-group {
  position-area: top center;
  translate: 0 -11px;
}
.carousel--native > .carousel-card::scroll-marker {
  width: 9px;
  height: 9px;
  padding: 0;
  background: #a8b5d8;
  border: 0;
  border-radius: 50%;
  content: "" / attr(data-label);
  transition: width .28s var(--ease), background .28s;
}
.carousel--native > .carousel-card::scroll-marker:target-current { width: 24px; background: var(--blue); border-radius: 999px; }
.comparison-stage[data-native="off"] .carousel--native { scroll-marker-group: none; }
.comparison-stage[data-native="off"] .carousel--native::scroll-button(*) { content: none; }
.comparison-stage[data-native="off"] .case-tags--native { opacity: .35; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; padding: 0 16px 16px; }
.metrics > div { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 8px; min-height: 62px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.metrics span { color: var(--blue-dark); font-size: 10px; font-weight: 900; }
.metrics b { grid-row: span 2; font-size: 20px; }
.metrics small { color: var(--muted); font-size: 10px; font-weight: 700; }

.learning-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(500px, 1.1fr); gap: 18px; margin-top: 18px; }
.panel-head--compact { min-height: 76px; }
.panel-head--compact p { color: var(--green-dark); }
.enhancement-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 10px; padding: 18px; background-image: linear-gradient(var(--soft-line) 1px, transparent 1px), linear-gradient(90deg, var(--soft-line) 1px, transparent 1px); background-size: 24px 24px; }
.enhancement-flow article { position: relative; display: grid; min-height: 150px; align-content: center; justify-items: center; gap: 7px; padding: 15px 10px; text-align: center; background: rgb(255 253 248 / 96%); border: 1px solid var(--line); border-radius: 15px; }
.enhancement-flow article > span { position: absolute; top: 9px; left: 9px; color: var(--blue-dark); font-size: 10px; font-weight: 900; }
.enhancement-flow article.is-enhanced { background: var(--blue-soft); border-color: #aebff0; }
.enhancement-flow > b { font-size: 23px; }
.enhancement-flow h3 { margin: 0; font-size: 13px; }
.enhancement-flow p { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.4; }
.flow-icon { position: relative; width: 51px; height: 42px; color: var(--green); }
.flow-icon--list::before, .flow-icon--list::after { position: absolute; left: 4px; width: 43px; height: 10px; background: var(--green-soft); border: 2px solid currentColor; border-radius: 5px; content: ""; }
.flow-icon--list::before { top: 6px; }
.flow-icon--list::after { bottom: 6px; }
.flow-icon--snap::before { position: absolute; top: 5px; left: 7px; width: 30px; height: 30px; background: var(--coral-soft); border: 2px solid var(--coral); border-radius: 8px; box-shadow: 9px 4px 0 -2px #fff, 9px 4px 0 0 var(--coral); content: ""; }
.flow-icon--control::before, .flow-icon--control::after { position: absolute; top: 10px; width: 24px; height: 24px; background: var(--blue); border-radius: 50%; content: ""; }
.flow-icon--control::before { left: 0; }
.flow-icon--control::after { right: 0; }
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding: 0 18px 18px; }
.why-grid > div { min-height: 116px; padding: 13px; background: #f3f4ef; border: 1px solid var(--line); border-radius: 13px; }
.why-grid span { color: var(--green-dark); font-size: 10px; font-weight: 900; }
.why-grid b { display: block; margin: 7px 0 5px; font-size: 11px; }
.why-grid p { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.45; }

.code-panel { color: #f7fbf8; background: #101a16; border-color: #101a16; }
.code-head { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 19px; border-bottom: 1px solid rgb(255 255 255 / 13%); }
.code-head span { color: var(--yellow); }
.code-head button { min-height: 41px; padding: 0 14px; color: #fff; background: var(--coral); border: 0; border-radius: 11px; cursor: pointer; font-size: 10px; font-weight: 900; }
.code-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 14px 14px 0; padding: 4px; background: #202b26; border: 1px solid #33413b; border-radius: 12px; }
.code-tabs button { min-height: 38px; color: #aebbb4; background: transparent; border: 0; border-radius: 8px; cursor: pointer; font-size: 10px; font-weight: 900; }
.code-tabs button[aria-selected="true"] { color: var(--ink); background: #fff; }
.code-tabs i { display: none; }
.code-content { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(230px, .65fr); gap: 12px; padding: 12px 14px 14px; }
.code-content pre { min-height: 305px; max-height: 390px; margin: 0; padding: 16px; overflow: auto; color: #e7eee9; background: #08100d; border: 1px solid #2d3934; border-radius: 13px; font-size: 11px; font-weight: 700; line-height: 1.65; white-space: pre-wrap; }
.code-content aside { padding: 16px; color: #e3e9ff; background: #1c2439; border: 1px solid #35415f; border-radius: 13px; }
.code-content aside > span { color: #9db0ff; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.code-content aside h3 { margin: 9px 0; color: #fff; font-size: 20px; line-height: 1.15; }
.code-content aside p { margin: 0; color: #c0c8dc; font-size: 10px; font-weight: 700; line-height: 1.55; }
.support-list { display: grid; gap: 7px; margin-top: 16px; }
.support-list span { display: flex; align-items: center; gap: 8px; min-height: 35px; padding: 0 10px; color: #fff; background: rgb(255 255 255 / 6%); border: 1px solid rgb(255 255 255 / 11%); border-radius: 9px; font-size: 10px; font-weight: 900; }
.support-list i { width: 8px; height: 8px; background: #72d7b5; border-radius: 50%; }
.toast { position: fixed; z-index: 20; right: 22px; bottom: 22px; padding: 12px 15px; color: #fff; background: var(--ink); border-radius: 11px; box-shadow: 0 12px 30px rgb(23 33 30 / 23%); font-size: 11px; font-weight: 900; opacity: 0; translate: 0 12px; pointer-events: none; transition: opacity .25s, translate .25s var(--ease); }
.toast.is-visible { opacity: 1; translate: 0; }

@media (max-width: 1120px) {
  .hero { grid-template-columns: 1fr; }
  .hero-actions { justify-content: flex-start; }
  .studio, .learning-grid { grid-template-columns: 1fr; }
  .controls-panel { display: grid; grid-template-columns: repeat(2, 1fr); }
  .controls-panel .panel-head, .controls-panel .fallback-note { grid-column: 1 / -1; }
  .control-group:nth-of-type(2) { border-right: 1px solid var(--line); }
  .switch-row { border-right: 1px solid var(--line); }
}

@media (max-width: 720px) {
  .page { width: min(100% - 20px, 620px); padding-top: 18px; }
  .hero { gap: 10px; padding-bottom: 18px; }
  h1 { font-size: clamp(42px, 14vw, 65px); }
  .hero-actions { flex-wrap: wrap; }
  .support-badge { width: 100%; justify-content: center; }
  .controls-panel { display: block; }
  .control-group:nth-of-type(2), .switch-row { border-right: 0; }
  .panel-head { padding: 14px; }
  .same-markup-badge { display: none; }
  .comparison-stage { padding: 10px; }
  .carousel-case { padding: 10px; }
  .case-head { align-items: flex-start; }
  .case-tags { display: none; }
  .carousel-viewport--native { padding-inline: 46px; }
  .carousel-card { grid-template-columns: 1fr; min-height: 275px; }
  .card-art { min-height: 135px; }
  .card-copy { padding: 13px; }
  .case-caption { display: grid; }
  .case-caption span { text-align: left; }
  .metrics { grid-template-columns: repeat(2, 1fr); padding: 0 10px 10px; }
  .enhancement-flow { grid-template-columns: 1fr; }
  .enhancement-flow > b { rotate: 90deg; text-align: center; }
  .why-grid { grid-template-columns: 1fr; }
  .code-content { grid-template-columns: 1fr; }
  .code-content pre { min-height: 280px; }
}

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