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

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

* { 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.16), transparent 28rem),
    radial-gradient(circle at 100% 8%, rgba(255, 111, 87, 0.16), transparent 26rem),
    var(--paper);
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, p, pre { 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: 18px;
  border: 2px solid var(--coral);
  border-radius: 50%;
  box-shadow: 7px -6px 0 -6px var(--blue), -6px 7px 0 -6px var(--lime);
}

h1 {
  font-size: clamp(36px, 6vw, 64px);
  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 { background: var(--ink); color: #fff; border-color: var(--ink); }

.stage-shell,
.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);
}

.stage {
  position: relative;
  overflow: hidden;
  height: min(62vh, 520px);
  border-radius: 25px 25px 0 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(85, 116, 255, 0.22), transparent 18rem),
    radial-gradient(circle at 82% 78%, rgba(255, 111, 87, 0.16), transparent 16rem),
    #151916;
}

.dots,
.dot {
  pointer-events: none;
}

.dot {
  position: absolute;
  border-radius: 50%;
  opacity: 0.86;
  animation: float 3.2s ease-in-out infinite alternate;
}

.supports-random .dot {
  animation-duration: random(--dot-dur, 2.2s, 4.8s);
  animation-delay: random(--dot-delay, -2s, 0s);
}

.word {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin: 0;
  font-size: clamp(48px, 11vw, 120px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff;
}

.letter {
  display: inline-block;
}

.supports-random .letter {
  animation: letter-float 3.2s ease-in-out infinite alternate;
}

@keyframes float {
  to { translate: 0 -10px; }
}

@keyframes letter-float {
  to { filter: brightness(1.18); }
}

.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
}

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

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

.word-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);
}

.stage-bar label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(280px, 100%);
  font-size: 11px;
  font-weight: 900;
}

.stage-bar input { width: 140px; accent-color: var(--blue); }
.stage-bar output { color: var(--blue); min-width: 3.2em; }

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

@media (max-width: 720px) {
  .page { width: calc(100% - 20px); padding-top: 18px; }
  .hero { flex-direction: column; align-items: flex-start; }
  h1 { font-size: 40px; }
  .stage { height: 420px; }
  .word { font-size: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .dot, .letter { animation: none !important; }
}
