/* Blurt site - one committed dark "game night" theme, palette lifted verbatim
 * from src/ui/theme.ts (darkPalette). Served as /styles.css by every page. */

:root {
  color-scheme: dark;
  --bg: #141036;
  --bg-deep: #0e0b26;
  --bg-elevated: #1d1750;
  --surface: #241c63;
  --surface-muted: #2e2578;
  --border: #4a3fa8;
  --border-soft: rgba(74, 63, 168, 0.45);
  --text: #ffffff;
  --text-muted: #bfb6f5;
  --primary: #ff3d81;
  --accent: #37e2d5;
  --surprise: #ffd400;
  --correct: #2bd97c;
  --skip: #ffa023;
  --font: "Heebo", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  background-image:
    radial-gradient(56rem 30rem at 85% -8%, rgba(255, 61, 129, 0.14), transparent 60%),
    radial-gradient(46rem 28rem at -10% 30%, rgba(55, 226, 213, 0.1), transparent 60%),
    linear-gradient(var(--bg), var(--bg-deep));
  background-attachment: fixed;
  color: var(--text);
  font: 400 1.0625rem/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #7fefe5; }

::selection { background: var(--primary); color: #fff; }

:focus-visible {
  outline: 3px solid var(--surprise);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--surprise);
  color: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: 0 0 10px 0;
  font-weight: 700;
  z-index: 10;
}
.skip-link:focus { left: 0; }

/* ---------- chrome ---------- */

.site-header {
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 900;
  font-size: 1.35rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark img { width: 30px; height: 30px; }

.site-nav {
  margin-inline-start: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a { color: var(--text-muted); text-decoration: none; }
.site-nav a:hover { color: var(--text); }

main { display: block; }

/* ---------- hero ---------- */

.hero {
  max-width: 68rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 4.5rem;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 3rem;
  align-items: center;
}

.hero-copy > * {
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero-copy > *:nth-child(2) { animation-delay: 0.08s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.16s; }
.hero-copy > *:nth-child(4) { animation-delay: 0.24s; }
.hero-copy > *:nth-child(5) { animation-delay: 0.32s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.hero-kicker {
  display: inline-block;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--surprise);
  margin: 0 0 1rem;
}

.hero h1 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(3.2rem, 8vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.hero h1 .bang { color: var(--primary); }

.hero .hebrew {
  display: block;
  text-align: left;
  margin-top: 0.35rem;
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--text-muted);
}

.hero-tagline {
  margin: 1.4rem 0 0;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.5;
  color: var(--text);
  max-width: 30ch;
  font-weight: 500;
}
.hero-tagline strong { color: var(--primary); font-weight: 900; }

.hero-sub {
  margin: 1rem 0 0;
  color: var(--text-muted);
  max-width: 44ch;
}

.hero-ctas {
  margin: 1.8rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.7rem 1.35rem;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
}
.pill-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 61, 129, 0.35);
}
.pill-primary:hover { background: #ff5c94; color: #fff; }
.pill-ghost {
  border: 2px solid var(--border);
  color: var(--text);
}
.pill-ghost:hover { border-color: var(--accent); color: var(--accent); }
.store-note {
  flex-basis: 100%;
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* the hero's little nod to the in-game clock */
.timer {
  margin-top: 2.2rem;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-elevated);
  overflow: hidden;
  max-width: 22rem;
}
.timer::before {
  content: "";
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--correct), var(--surprise), var(--primary));
  animation: countdown 8s linear infinite;
}
@keyframes countdown {
  from { width: 100%; }
  to { width: 0; }
}

/* ---------- floating word cards ---------- */

.card-stack {
  position: relative;
  min-height: 24rem;
  display: grid;
  place-items: center;
}

.word-card {
  position: absolute;
  width: min(15rem, 70%);
  padding: 2rem 1.6rem 1.7rem;
  border-radius: 24px;
  background: var(--bg-elevated);
  border: 2px solid var(--border-soft);
  box-shadow: 0 24px 48px rgba(6, 4, 26, 0.55);
  text-align: center;
  animation: floaty 7s ease-in-out infinite;
}
.word-card .deck {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.word-card .word {
  font-weight: 900;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.word-card.is-front {
  rotate: -6deg;
  translate: -26% -48%;
  z-index: 3;
  border-color: var(--primary);
}
.word-card.is-front .word { color: var(--primary); }

.word-card.is-mid {
  rotate: 5deg;
  translate: 34% -2%;
  z-index: 2;
  border-color: var(--accent);
  animation-delay: 1.4s;
}
.word-card.is-mid .word { color: var(--accent); }

.word-card.is-back {
  rotate: -3deg;
  translate: -14% 54%;
  z-index: 1;
  border-color: var(--surprise);
  animation-delay: 2.6s;
}
.word-card.is-back .word { color: var(--surprise); }

@keyframes floaty {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -14px; }
}

/* confetti dust behind the stack */
.card-stack::before,
.card-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 32px;
  background-image:
    radial-gradient(5px 5px at 12% 18%, var(--primary) 99%, transparent),
    radial-gradient(4px 4px at 82% 10%, var(--accent) 99%, transparent),
    radial-gradient(4px 4px at 90% 55%, var(--surprise) 99%, transparent),
    radial-gradient(5px 5px at 8% 78%, var(--accent) 99%, transparent),
    radial-gradient(4px 4px at 70% 88%, var(--primary) 99%, transparent),
    radial-gradient(3px 3px at 40% 6%, var(--surprise) 99%, transparent);
  opacity: 0.5;
  pointer-events: none;
}
.card-stack::after {
  transform: rotate(28deg) scale(1.15);
  opacity: 0.25;
}

/* ---------- sections ---------- */

.section {
  max-width: 68rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem;
}

.section-kicker {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.section h2 {
  margin: 0 0 1rem;
  font-weight: 900;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.section-intro {
  margin: 0 0 2rem;
  color: var(--text-muted);
  max-width: 56ch;
}

/* how a turn works */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 1.6rem 1.4rem;
}
.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  margin-bottom: 0.9rem;
}
.steps li:nth-child(2)::before { background: var(--accent); color: var(--bg); }
.steps li:nth-child(3)::before { background: var(--surprise); color: var(--bg); }
.steps h3 { margin: 0 0 0.4rem; font-size: 1.15rem; font-weight: 700; }
.steps p { margin: 0; color: var(--text-muted); font-size: 0.97rem; }

/* features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.features li {
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 1.5rem 1.4rem;
  background: linear-gradient(160deg, rgba(36, 28, 99, 0.55), rgba(20, 16, 54, 0.2));
}
.features .emoji { font-size: 1.6rem; display: block; margin-bottom: 0.7rem; }
.features h3 { margin: 0 0 0.35rem; font-size: 1.08rem; font-weight: 700; }
.features p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* FAQ */
.faq { max-width: 46rem; }
.faq details {
  border-bottom: 1px solid var(--border-soft);
  padding: 0.35rem 0;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.85rem 0;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  font-weight: 900;
  color: var(--primary);
  font-size: 1.2rem;
  line-height: 1;
  flex: none;
  transition: rotate 0.2s ease;
}
.faq details[open] summary::before { rotate: 45deg; }
.faq summary h3 {
  display: inline;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.faq .answer { margin: 0 0 1.1rem 1.95rem; color: var(--text-muted); }

/* ---------- prose pages (legal, support, delete) ---------- */

.doc {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.doc-header { margin-bottom: 2.25rem; }

.doc h1 {
  margin: 0 0 0.75rem;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.doc-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--bg);
  background: var(--surprise);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
}

.doc-note { margin: 0.9rem 0 0; color: var(--text-muted); font-size: 0.95rem; }

.doc h2 {
  margin: 2.4rem 0 0.6rem;
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.3;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-soft);
}
.doc h2::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  border-radius: 3px;
  background: var(--primary);
  margin-inline-end: 0.5em;
}
.doc h2:nth-of-type(3n + 2)::before { background: var(--accent); }
.doc h2:nth-of-type(3n)::before { background: var(--surprise); }

.doc p { margin: 0 0 1.05rem; color: var(--text-muted); }
.doc strong { color: var(--text); }
.doc ol { color: var(--text-muted); padding-inline-start: 1.4rem; }
.doc li { margin-bottom: 0.5rem; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 3rem;
  background: rgba(14, 11, 38, 0.6);
}
.footer-grid {
  max-width: 68rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
.footer-grid h2 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}
.footer-blurb { color: var(--text-muted); font-size: 0.95rem; margin: 0.5rem 0 0; max-width: 34ch; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.5rem; }
.footer-grid a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; }
.footer-grid a:hover { color: var(--text); text-decoration: underline; }
.footer-bottom {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- 404 ---------- */

.lost {
  max-width: 44rem;
  margin: 0 auto;
  padding: 5rem 1.25rem;
  text-align: center;
}
.lost .word-card {
  position: static;
  display: inline-block;
  rotate: -5deg;
  animation: none;
  margin-bottom: 2rem;
}

/* ---------- responsive & motion ---------- */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-bottom: 3rem; }
  .card-stack { min-height: 21rem; order: 2; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .word-card .word { font-size: 1.6rem; }
  .word-card.is-front { translate: -22% -48%; }
  .word-card.is-mid { translate: 26% -2%; }
  .word-card.is-back { translate: -10% 54%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy > *, .word-card, .timer::before { animation: none; }
}
