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

:root {
  --ink: #151916;
  --paper: #f4f1e8;
  --line: #cdd1c8;
  --muted: #717a73;
  --blue: #5574ff;
  --coral: #ff6f57;
  --lime: #b9ff3d;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, "Noto Sans JP", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  background:
    radial-gradient(circle at 8% 0, rgba(85, 116, 255, 0.14), transparent 26rem),
    radial-gradient(circle at 100% 10%, rgba(255, 111, 87, 0.12), transparent 24rem),
    var(--paper);
}

button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, p { margin: 0; }

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.eyebrow i {
  width: 18px;
  height: 14px;
  border: 2px solid var(--coral);
  box-shadow: inset 0 4px 0 var(--blue), inset 0 -4px 0 var(--lime);
}

h1 {
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.96;
  font-weight: 900;
  letter-spacing: 0;
}

.lead {
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.lead strong { color: var(--ink); }

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

.support-chip,
.hero-actions button {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  font-size: 11px;
  font-weight: 900;
}

.support-chip[data-state="ok"] { color: #1d6b4f; background: #e8f8d8; border-color: #b9ff3d; }
.support-chip[data-state="fallback"] { color: #8a3b1f; background: #ffe5dc; border-color: var(--coral); }
.hero-actions button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.figma-ref {
  margin: 16px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: #2c2c2c;
  box-shadow: 0 22px 48px rgba(21, 25, 22, 0.1);
}

.figma-ref figcaption {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 14px 18px 12px;
  color: #ececec;
  font-size: 13px;
  font-weight: 800;
}

.figma-ref figcaption span {
  color: #a8a8a8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.figma-ref figcaption strong { color: #fff; font-weight: 900; }

.figma-ref img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.studio,
.code-shell {
  border: 1px solid var(--line);
  border-radius: 25px;
  background: rgba(255, 253, 246, 0.92);
  box-shadow: 0 22px 48px rgba(21, 25, 22, 0.1);
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
}

.panel {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 22px;
  padding: 36px 32px 32px;
}

.panel + .panel { border-left: 1px solid var(--line); background: #fffdf8; }

.panel-kicker {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.panel--trim .panel-kicker { color: #1d6b4f; }

.measure { display: inline-block; }

.display {
  position: relative;
  display: inline-block;
  padding: 0;
  background: #151916;
  color: #fff;
  font-size: clamp(56px, 8vw, 96px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0;
}

.guide {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--coral);
  pointer-events: none;
}

.guide.cap { top: 0; }
.guide.base { bottom: 0; background: var(--blue); }

body:not(.show-guides) .guide { display: none; }

.ui-button {
  min-height: 0;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.note {
  max-width: 36ch;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 700;
}

.panel--trim[data-edge="cap alphabetic"] .display,
.panel--trim[data-edge="cap alphabetic"] .ui-button {
  text-box: trim-both cap alphabetic;
}

.panel--trim[data-edge="ex alphabetic"] .display,
.panel--trim[data-edge="ex alphabetic"] .ui-button {
  text-box: trim-both ex alphabetic;
}

.panel--trim[data-edge="text"] .display,
.panel--trim[data-edge="text"] .ui-button {
  text-box: trim-both text;
}

.stage-bar {
  display: flex;
  justify-content: center;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.edge-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  isolation: isolate;
  width: min(520px, 100%);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #eff1ec;
}

.edge-switch button {
  position: relative;
  z-index: 2;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 900;
}

.edge-switch i {
  position: absolute;
  z-index: 1;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(21, 25, 22, 0.1);
  transition: translate 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.code-shell { margin-top: 16px; padding: 18px 20px 20px; }
.code-shell p { margin-bottom: 10px; font-size: 13px; font-weight: 800; }
.code-shell pre {
  overflow: auto;
  margin: 0;
  padding: 16px;
  border-radius: 15px;
  background: var(--ink);
  color: #e7ece8;
  font: 600 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre;
}

@media (max-width: 780px) {
  .page { width: calc(100% - 20px); padding-top: 18px; }
  .hero { flex-direction: column; align-items: flex-start; }
  h1 { font-size: 42px; }
  .compare { grid-template-columns: 1fr; }
  .panel + .panel { border-left: 0; border-top: 1px solid var(--line); }
  .display { font-size: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .edge-switch i { transition: none; }
}
