:root {
  color-scheme: dark;
  --black: #000000;
  --surface: #111113;
  --surface-raised: #1d1d1f;
  --white: #ffffff;
  --gray: #a1a1a6;
  --line: #3a3a3c;
  --blue: #2997ff;
  --blue-strong: #0071e3;
  --font-display: "SF Pro Display", "Inter", "PingFang SC", "Source Han Sans SC", system-ui, sans-serif;
  --font-body: "SF Pro Text", "Inter", "PingFang SC", "Source Han Sans SC", system-ui, sans-serif;
  --page-x: clamp(32px, 6vw, 96px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--black); }
body {
  color: var(--white);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 5px; }
button, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.deck {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
}
.deck > section {
  padding-inline: var(--page-x);
}
.slide {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  scroll-snap-align: start;
  background:
    radial-gradient(circle at 50% 42%, rgba(41, 151, 255, .10), transparent 32%),
    var(--black);
}

.site-header,
.slide__footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  color: var(--gray);
  font-size: 20px;
}
.wordmark {
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -.025em;
  text-decoration: none;
}
.status { display: inline-flex; align-items: center; gap: 10px; }
.status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 0 6px rgba(48, 209, 88, .12);
}

.slide__inner {
  grid-column: 2 / 12;
  align-self: center;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 32px;
  width: 100%;
}
.hero-copy { grid-column: 1 / 7; align-self: center; }
.eyebrow {
  margin: 0 0 20px;
  color: var(--blue);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .16em;
}
h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(48px, 5.4vw, 84px);
  font-weight: 650;
  letter-spacing: -.055em;
  line-height: 1.08;
  text-wrap: balance;
  word-break: keep-all;
}
.subtitle {
  max-width: 620px;
  margin: 28px 0 0;
  color: var(--gray);
  font-size: 22px;
  line-height: 1.5;
  text-wrap: pretty;
  word-break: keep-all;
}

.prompt-panel {
  grid-column: 7 / 13;
  align-self: center;
  padding: clamp(24px, 3vw, 42px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(29, 29, 31, .78);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
  backdrop-filter: blur(24px);
}
.prompt-panel label {
  display: block;
  margin-bottom: 18px;
  color: var(--gray);
  font-size: 20px;
}
.prompt-row { display: grid; gap: 16px; }
textarea {
  width: 100%;
  min-height: 132px;
  resize: none;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: none;
  color: var(--white);
  background: var(--surface);
  font-size: 20px;
  line-height: 1.5;
}
textarea:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(41, 151, 255, .2); }
.primary-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 60px;
  padding: 14px 20px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: var(--blue-strong);
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}
.primary-button:hover { background: var(--blue); transform: translateY(-1px); }
.primary-button:focus-visible,
.rules-button:focus-visible,
.close-button:focus-visible,
.dialog-footer a:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.prompt-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  color: var(--gray);
  font-size: 20px;
}
.rules-button,
.close-button {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
}
.prompt-meta > span { text-align: right; }
.slide__footer {
  min-height: 64px;
  border-top: 1px solid var(--line);
  font-size: 20px;
  letter-spacing: .03em;
}
.slide__footer a { color: var(--blue); text-decoration: none; }

.qt-blur-in {
  opacity: 0;
  filter: blur(14px);
  transform: translateY(10px);
  animation: blur-reveal 700ms cubic-bezier(.2, .8, .2, 1) forwards;
  will-change: transform, opacity, filter;
}
.delay-1 { animation-delay: 80ms; }
.delay-2 { animation-delay: 180ms; }
.delay-3 { animation-delay: 280ms; }
@keyframes blur-reveal { to { opacity: 1; filter: blur(0); transform: none; } }

dialog {
  width: min(980px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 28px;
  color: var(--white);
  background: var(--surface-raised);
  box-shadow: 0 32px 120px rgba(0, 0, 0, .72);
}
dialog::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(12px); }
.dialog-shell { display: grid; grid-template-rows: auto 1fr auto; max-height: calc(100dvh - 48px); }
.dialog-header,
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 30px;
}
.dialog-header { border-bottom: 1px solid var(--line); }
.dialog-header p { margin: 0 0 4px; color: var(--blue); font-size: 20px; letter-spacing: .12em; }
.dialog-header h2 { margin: 0; font-size: 32px; line-height: 1.2; text-wrap: balance; }
.close-button { color: var(--gray); }
.rules-content {
  min-height: 300px;
  overflow: auto;
  padding: 30px;
  color: #e5e5e7;
  background: var(--surface);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", "JetBrains Mono", monospace;
  font-size: 20px;
  line-height: 1.55;
}
.loading-state { margin: 0; color: var(--gray); }
.dialog-footer { border-top: 1px solid var(--line); }
.dialog-footer a { color: var(--blue); text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1280px) {
  :root { --page-x: clamp(32px, 4vw, 56px); }
  .slide__inner { grid-column: 1 / -1; }
  h1 { font-size: clamp(48px, 5.8vw, 72px); }
  .prompt-meta > span { display: none; }
}

@media (max-width: 900px) {
  :root { --page-x: 24px; }
  .slide { gap: 12px; }
  .site-header { min-height: 60px; }
  .status { font-size: 20px; }
  .slide__inner { display: block; align-self: center; }
  .hero-copy { text-align: center; }
  .eyebrow { margin-bottom: 12px; }
  h1 { font-size: clamp(48px, 10vw, 64px); }
  .subtitle { margin: 16px auto 0; font-size: 20px; }
  .prompt-panel { width: min(100%, 660px); margin: 26px auto 0; padding: 20px; border-radius: 22px; }
  .prompt-panel label { margin-bottom: 12px; }
  textarea { min-height: 92px; padding: 14px 16px; }
  .primary-button { min-height: 54px; padding-block: 10px; }
  .prompt-meta { margin-top: 12px; }
  .slide__footer { min-height: 52px; }
  .slide__footer > span { display: none; }
  .slide__footer { justify-content: center; }
}

@media (max-width: 560px) {
  .status { font-size: 0; gap: 0; }
  .status i { display: block; }
  .eyebrow { font-size: 20px; letter-spacing: .10em; }
  h1 { font-size: 48px; }
  .subtitle br { display: none; }
  .prompt-panel { margin-top: 20px; }
  .prompt-panel label { text-align: center; }
  dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 20px; }
  .dialog-shell { max-height: calc(100dvh - 24px); }
  .dialog-header, .dialog-footer { padding: 20px; }
  .dialog-header h2 { font-size: 28px; }
  .rules-content { padding: 20px; }
}

@media (max-height: 760px) {
  .site-header { min-height: 56px; }
  .eyebrow { margin-bottom: 10px; }
  h1 { font-size: 48px; }
  .subtitle { margin-top: 12px; }
  .prompt-panel { margin-top: 16px; padding: 16px 20px; }
  textarea { min-height: 82px; padding-block: 12px; }
  .prompt-panel label, .prompt-meta { margin-bottom: 8px; margin-top: 8px; }
  .slide__footer { min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .qt-blur-in { opacity: 1; filter: none; transform: none; }
}
