@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: #f2f0e8;
  --surface: #fbfaf5;
  --ink: #17211e;
  --muted: #707b77;
  --line: #d8d7cf;
  --orange: #f47752;
  --orange-soft: #ffe4da;
  --blue: #3e76f5;
  --blue-soft: #e7eeff;
  --green: #0b9f7a;
  --green-soft: #dff5ed;
  --dark: #11201b;
  --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(191 222 239 / 45%), transparent 28%),
    radial-gradient(circle at 100% 0, rgb(248 203 185 / 45%), transparent 30%),
    var(--paper);
  font-family: Inter, "Noto Sans JP", sans-serif;
}

button { color: inherit; font: inherit; }

.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: #49635b;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
}

.eyebrow i {
  position: relative;
  width: 23px;
  height: 20px;
}

.eyebrow i::before,
.eyebrow i::after {
  position: absolute;
  inset-block: 1px;
  width: 14px;
  content: "";
  border: 2px solid var(--ink);
  border-radius: 5px;
}

.eyebrow i::before { left: 0; background: var(--orange); }
.eyebrow i::after { right: 0; background: var(--blue); }

h1 {
  margin: 0;
  font-size: clamp(52px, 6.6vw, 104px);
  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(--orange); }
.lead strong { color: var(--blue); }

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

.support-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 900;
}

.support-chip--dialog { color: #9a452f; background: var(--orange-soft); border-color: #ffb39f; }
.support-chip--popover { color: #345ab3; background: var(--blue-soft); border-color: #bdccff; }
.versus { color: #8a918e; font-size: 10px; font-weight: 900; letter-spacing: .12em; }

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

.guide-card,
.preview-card {
  overflow: hidden;
  background: rgb(251 250 245 / 95%);
  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: #9c4d3a; 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--orange { background: var(--orange); }
.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;
}

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

.decision-stack { display: grid; gap: 10px; padding: 18px 20px 10px; }

.decision {
  padding: 16px;
  border: 1px solid;
  border-radius: 17px;
}

.decision--dialog { background: #fff2ed; border-color: #ffc1af; }
.decision--popover { background: #f0f4ff; border-color: #c6d3ff; }
.decision-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.decision-label span { font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.decision-label b { padding: 5px 8px; background: white; border-radius: 999px; font-size: 10px; letter-spacing: .05em; }
.decision--dialog .decision-label { color: #ad4d35; }
.decision--popover .decision-label { color: #3f63ba; }
.decision h3 { margin: 0 0 5px; font-size: clamp(18px, 1.65vw, 25px); line-height: 1.12; }
.decision p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; font-weight: 700; }
.case-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.case-list span { padding: 5px 7px; color: #5f6965; background: rgb(255 255 255 / 75%); border: 1px solid rgb(112 123 119 / 15%); border-radius: 6px; font-size: 10px; font-weight: 800; }

.code-card { margin: 10px 20px 18px; 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: 10px; min-height: 48px; padding: 7px 10px; background: #182923; border-bottom: 1px solid #314039; }
.code-toolbar > button { flex: 0 0 auto; padding: 8px 10px; color: #dff4eb; background: #2b4038; border: 0; border-radius: 8px; font-size: 10px; font-weight: 900; cursor: pointer; }
.code-tabs { display: flex; gap: 3px; padding: 3px; background: #0f1c18; border: 1px solid #33463f; border-radius: 9px; }
.code-tabs button { min-width: 72px; padding: 6px 9px; color: #82948e; background: transparent; border: 0; border-radius: 6px; font-size: 10px; font-weight: 900; cursor: pointer; }
.code-tabs button[aria-pressed="true"] { color: #17372e; background: #8ee0c7; }
.code-caption { display: flex; align-items: baseline; gap: 10px; padding: 11px 15px; 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: #9fb0aa; font-size: 10px; line-height: 1.45; font-weight: 700; }
.code-caption code { color: #f5c85f; }
pre { height: 124px; margin: 0; padding: 15px; overflow: auto; color: #dce7e2; font: 700 10px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.token-tag { color: #86d5bd; }
.token-attr { color: #f2c45c; }
.token-value { color: #ef9078; }

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

.comparison { min-width: 0; padding: 13px; border: 1px solid; border-radius: 18px; }
.comparison--dialog { background: #fff1ec; border-color: #ffb8a4; }
.comparison--popover { background: #eef3ff; border-color: #bfd0ff; }
.comparison-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.comparison-head > div > span { display: block; margin-bottom: 2px; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.comparison--dialog .comparison-head > div > span { color: #b24e35; }
.comparison--popover .comparison-head > div > span { color: #4166bf; }
.comparison-head h3 { margin: 0; font-size: 22px; }
.behavior-badge { padding: 6px 7px; color: #5d6965; background: white; border-radius: 999px; font-size: 10px; font-weight: 900; white-space: nowrap; }

.mini-browser { position: relative; height: 220px; overflow: hidden; background: #fcfcfa; border: 1px solid #d8d9d5; border-radius: 13px; }
.mini-toolbar { display: flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; background: #edeee9; border-bottom: 1px solid #d9dad5; }
.mini-toolbar i { width: 6px; height: 6px; background: #f1785a; border-radius: 50%; }
.mini-toolbar i:nth-child(2) { background: #e8bb4e; }
.mini-toolbar i:nth-child(3) { background: #55b791; }
.mini-toolbar b { width: 42%; height: 8px; margin: 0 auto; background: white; border-radius: 999px; }
.mini-content { display: grid; grid-template-columns: 1.1fr .9fr; gap: 10px; padding: 28px 18px; }
.mini-content span { display: block; height: 10px; background: #d8dcd9; border-radius: 99px; }
.mini-content span:nth-child(1) { grid-column: 1 / -1; width: 52%; height: 15px; background: #b9c2be; }
.mini-content span:nth-child(2) { width: 90%; }
.mini-content span:nth-child(3) { width: 64%; }
.mini-content button { grid-column: 1 / -1; justify-self: start; margin-top: 36px; padding: 9px 11px; color: #5d6965; background: #eff0ec; border: 1px solid #d5d8d5; border-radius: 8px; font-size: 10px; font-weight: 900; }
.mini-overlay { position: absolute; inset: 26px 0 0; display: grid; place-items: center; background: rgb(18 28 25 / 58%); }
.mini-overlay > div,
.mini-popover { display: grid; gap: 4px; min-width: 132px; padding: 16px; background: white; border: 1px solid #d8d9d5; border-radius: 12px; box-shadow: 0 12px 28px rgb(20 31 27 / 20%); }
.mini-overlay b,
.mini-popover b { font-size: 12px; }
.mini-overlay span,
.mini-popover span { color: var(--muted); font-size: 10px; font-weight: 700; }
.mini-popover { position: absolute; top: 62px; right: 18px; border-color: #aebfff; box-shadow: 0 12px 28px rgb(47 76 148 / 16%); }

.open-button { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 10px; padding: 11px 13px; color: white; border: 0; border-radius: 11px; font-size: 11px; font-weight: 900; cursor: pointer; }
.open-button i { font-style: normal; font-size: 16px; }
.open-button--dialog { background: #bd5137; }
.open-button--popover { background: #4269c6; }

.background-test { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 18px 12px; padding: 14px 16px; background: #eef7f3; border: 1px solid #c6e5d9; border-radius: 16px; }
.background-test > div { min-width: 0; }
.background-test > div > span { display: block; margin-bottom: 4px; color: #257660; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.background-test strong { display: block; font-size: 13px; }
.background-test p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; font-weight: 700; }
.background-test > button { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; min-height: 48px; padding: 8px 9px 8px 14px; color: white; background: var(--green); border: 0; border-radius: 12px; cursor: pointer; }
.background-test > button span { font-size: 10px; font-weight: 900; }
.background-test > button b { display: flex; align-items: baseline; justify-content: center; gap: 2px; min-width: 43px; min-height: 32px; padding: 6px; color: #17624f; background: white; border-radius: 8px; font-size: 10px; white-space: nowrap; }
.background-test output { font-size: 16px; }
.background-test.is-pulsing { animation: test-pulse .45s ease; }

.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: #4269c5; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.metric-grid b { display: block; font-size: clamp(15px, 1.3vw, 20px); }
.metric-grid small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 700; }

.demo-panel {
  width: min(440px, calc(100% - 28px));
  max-width: none;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  opacity: 0;
  scale: .94;
  translate: 0 12px;
  transition:
    opacity .25s ease,
    scale .3s cubic-bezier(.2,.8,.2,1),
    translate .3s cubic-bezier(.2,.8,.2,1),
    display .3s allow-discrete,
    overlay .3s allow-discrete;
}

.demo-dialog { margin: auto; }
.demo-popover { inset: 0; margin: auto; overflow: visible; background: transparent; border: 0; box-shadow: none; }
.demo-panel[open],
.demo-panel:popover-open { opacity: 1; scale: 1; translate: 0 0; }

.demo-dialog::backdrop {
  background: rgb(11 19 16 / 0%);
  backdrop-filter: blur(0);
  transition:
    background .3s ease,
    backdrop-filter .3s ease,
    display .3s allow-discrete,
    overlay .3s allow-discrete;
}

.demo-dialog[open]::backdrop { background: rgb(11 19 16 / 66%); backdrop-filter: blur(5px); }

@starting-style {
  .demo-panel[open],
  .demo-panel:popover-open { opacity: 0; scale: .94; translate: 0 12px; }
  .demo-dialog[open]::backdrop { background: rgb(11 19 16 / 0%); backdrop-filter: blur(0); }
}

.top-layer-card { overflow: hidden; background: #fbfaf5; border: 1px solid #d7d7cf; border-radius: 22px; box-shadow: 0 28px 80px rgb(7 14 11 / 28%); }
.demo-popover .top-layer-card { box-shadow: 0 18px 44px rgb(7 14 11 / 18%); }
.top-layer-card > header { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--line); }
.top-layer-card > header > span { color: #497066; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.top-layer-card > header button { position: relative; width: 40px; height: 40px; background: #edf0ed; border: 0; border-radius: 50%; cursor: pointer; }
.top-layer-card > header button i::before,
.top-layer-card > header button i::after { position: absolute; top: 50%; left: 50%; width: 15px; height: 2px; content: ""; background: var(--ink); border-radius: 99px; }
.top-layer-card > header button i::before { rotate: 45deg; translate: -50% -50%; }
.top-layer-card > header button i::after { rotate: -45deg; translate: -50% -50%; }
.top-layer-card h2 { margin: 12px 24px 8px; font-size: 30px; line-height: 1.08; }
.top-layer-card p { margin: 0 24px 22px; color: var(--muted); font-size: 12px; line-height: 1.65; font-weight: 700; }
.top-layer-card p code { color: var(--green); font-weight: 900; }
.panel-action { width: calc(100% - 48px); margin: 0 24px 24px; padding: 13px; color: white; background: var(--orange); border: 0; border-radius: 11px; font-size: 12px; font-weight: 900; cursor: pointer; }

.top-layer-icon { position: relative; width: 76px; height: 60px; margin: 22px 24px 0; }
.top-layer-icon i { position: absolute; width: 54px; height: 46px; border: 3px solid var(--ink); border-radius: 10px; }
.top-layer-icon i:first-child { top: 0; left: 0; background: var(--orange-soft); }
.top-layer-icon i:last-child { right: 0; bottom: 0; background: var(--blue-soft); }
.top-layer-icon--dialog i:first-child { z-index: 2; background: var(--orange); box-shadow: 0 0 0 9px rgb(23 33 30 / 14%); }
.top-layer-icon--popover i:last-child { z-index: 2; background: var(--blue); box-shadow: 0 8px 18px rgb(62 118 245 / 25%); }

@keyframes test-pulse {
  50% { background: #cdf0e3; box-shadow: 0 0 0 5px rgb(11 159 122 / 10%); }
}

@media (max-width: 1050px) {
  .studio { grid-template-columns: 1fr; }
  .guide-card { display: grid; grid-template-columns: .9fr 1.1fr; }
  .guide-card > .panel-head { grid-column: 1 / -1; }
  .code-card { align-self: stretch; }
}

@media (max-width: 720px) {
  .page { width: min(100% - 24px, 620px); padding-top: 18px; }
  .hero { grid-template-columns: 1fr; align-items: start; gap: 10px; }
  .hero-title { grid-column: auto; }
  h1 { font-size: clamp(48px, 14.5vw, 72px); }
  .hero-actions { justify-content: flex-start; }
  .studio { grid-template-columns: minmax(0, 1fr); }
  .guide-card { display: block; }
  .comparison-stage { grid-template-columns: 1fr; }
  .mini-browser { height: 200px; }
  .background-test { align-items: stretch; flex-direction: column; }
  .background-test > button { justify-content: space-between; width: 100%; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 430px) {
  .lead { font-size: 15px; }
  .support-chip { min-height: 40px; padding-inline: 12px; font-size: 11px; }
  .panel-head { padding-inline: 14px; }
  .decision-stack { padding-inline: 14px; }
  .code-card { margin-inline: 14px; }
  .comparison-stage { padding-inline: 12px; }
  .background-test { margin-inline: 12px; }
  .metric-grid { padding-inline: 12px; }
  .decision-label { align-items: flex-start; flex-direction: column; gap: 5px; }
  .comparison-head { align-items: flex-start; flex-direction: column; }
}

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