:root {
  --ink: #120d0b;
  --ink-2: #1a1311;
  --ash: #d8cec4;
  --ash-dim: #a89a8e;
  --ash-faint: #6f625a;
  --ember: #e0622a;
  --ember-hot: #ff8a3d;
  --line: rgba(216, 206, 196, 0.16);
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ink);
  color: var(--ash);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.1875rem;
  line-height: 1.55;
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Film grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .4 0 0 0 1.2 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-1%, -2%); }
  100% { transform: translate(0, 0); }
}

a { color: inherit; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  height: max(100svh, 640px);
  overflow: hidden;
  container-type: size;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding-inline: var(--gutter);
  padding-top: env(safe-area-inset-top, 0px);
}

/* The scene box keeps the image's 16:9 shape while covering the hero,
   so firelight stays pinned to the same spots on the map at any size. */
.scene {
  --fx: 0.5;
  --fy: 0.5;
  --w: max(100cqw, 177.78cqh);
  --h: max(100cqh, 56.25cqw);
  position: absolute;
  z-index: -3;
  width: var(--w);
  height: var(--h);
  left: clamp(calc(100cqw - var(--w)), calc(50cqw - var(--w) * var(--fx)), 0px);
  top: clamp(calc(100cqh - var(--h)), calc(50cqh - var(--h) * var(--fy)), 0px);
  background: #1e1613;
}

.scene img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: settle 2.4s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes settle {
  from { opacity: 0; transform: scale(1.04); filter: brightness(.4); }
  to { opacity: 1; transform: none; filter: none; }
}

.fire {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  aspect-ratio: 2.4 / 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 150, 70, 0.55), rgba(255, 90, 30, 0.22) 50%, transparent);
  mix-blend-mode: screen;
  animation: flicker 3.7s infinite ease-in-out;
  animation-delay: var(--d, 0s);
}

.fire--far {
  aspect-ratio: 1 / 1.3;
  translate: -50% -78%;
  background: radial-gradient(closest-side, rgba(255, 120, 50, 0.5), rgba(220, 60, 20, 0.18) 55%, transparent);
  animation-duration: 2.9s;
}

.fire--dim { opacity: 0.6; animation-name: flicker-dim; }

@keyframes flicker {
  0%, 100% { opacity: 0.85; scale: 1; }
  13% { opacity: 1; scale: 1.04; }
  21% { opacity: 0.7; }
  40% { opacity: 0.95; scale: 0.98; }
  57% { opacity: 0.75; }
  71% { opacity: 1; scale: 1.05; }
  86% { opacity: 0.8; }
}

@keyframes flicker-dim {
  0%, 100% { opacity: 0.45; }
  30% { opacity: 0.65; }
  55% { opacity: 0.4; }
  80% { opacity: 0.6; }
}

.horizon-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 16% at 76% 45%, rgba(214, 86, 34, 0.35), transparent 70%),
    radial-gradient(90% 22% at 50% 44%, rgba(120, 44, 22, 0.35), transparent 75%),
    linear-gradient(to bottom, transparent 30%, rgba(60, 26, 16, 0.55) 43%, rgba(40, 22, 16, 0.25) 48%, transparent 58%);
  mix-blend-mode: screen;
}

.smoke {
  position: absolute;
  left: -30%;
  width: 160%;
  height: 22%;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  pointer-events: none;
}

.smoke--a {
  top: 34%;
  background: radial-gradient(closest-side, rgba(70, 56, 50, 0.9), transparent);
  animation: drift 70s linear infinite alternate;
}

.smoke--b {
  top: 18%;
  height: 26%;
  opacity: 0.4;
  background: radial-gradient(closest-side, rgba(52, 40, 36, 0.9), transparent);
  animation: drift 95s linear infinite alternate-reverse;
}

@keyframes drift {
  from { transform: translateX(-8%); }
  to { transform: translateX(8%); }
}

.ash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

.shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(14, 10, 9, 0.75), transparent 22%),
    linear-gradient(100deg, rgba(14, 10, 9, 0.7) 0%, rgba(14, 10, 9, 0.35) 38%, transparent 62%),
    linear-gradient(to top, var(--ink) 0%, rgba(18, 13, 11, 0) 22%);
}

.bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(1.1rem, 3vh, 2rem);
}

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ash);
}

.wordmark span { color: var(--ash-dim); }

.readout {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash-faint);
  white-space: nowrap;
}

.readout .sep { opacity: 0.5; margin-inline: 0.35em; }

.live { color: var(--ash-dim); }

.live::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 0.55em;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 8px var(--ember-hot);
  vertical-align: 1px;
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: 0.35; } }

.intro {
  margin-top: clamp(1.5rem, 9cqh, 7rem);
  max-width: 38rem;
  animation: rise 1.6s 0.3s cubic-bezier(.2, .7, .2, 1) both;
}

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

.kicker {
  margin: 0 0 1.1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember-hot);
}

h1 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(2.6rem, 6.2vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.012em;
  color: #eee5dc;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6);
}

h1 em {
  font-style: italic;
  color: var(--ash-dim);
}

.lede {
  margin: 1.5rem 0 0;
  max-width: 33rem;
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  line-height: 1.5;
  color: #c3b7ac;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.8);
}

/* ---------- Sign-up ---------- */

.signup {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
  max-width: 30rem;
}

.signup input {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.9rem 1rem;
  font: 400 0.9375rem/1.2 var(--mono);
  color: var(--ash);
  background: rgba(14, 10, 9, 0.62);
  border: 1px solid rgba(216, 206, 196, 0.24);
  border-radius: 2px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.2s, background 0.2s;
}

.signup input::placeholder { color: var(--ash-faint); }

.signup input:focus {
  outline: none;
  border-color: var(--ember);
  background: rgba(14, 10, 9, 0.8);
}

.signup button {
  flex: 0 0 auto;
  padding: 0.9rem 1.35rem;
  font: 500 0.75rem/1.2 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1a0d07;
  background: var(--ember);
  border: 1px solid var(--ember);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.3s;
}

.signup button:hover,
.signup button:focus-visible {
  background: var(--ember-hot);
  box-shadow: 0 0 28px rgba(255, 110, 40, 0.35);
  outline: none;
}

.signup button:disabled { opacity: 0.6; cursor: progress; }

.signup__note {
  flex-basis: 100%;
  margin: 0.35rem 0 0;
  min-height: 1.2em;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--ash-faint);
}

.signup[data-state="error"] .signup__note { color: #f08a6a; }
.signup[data-state="done"] .signup__note { color: var(--ash-dim); }
.signup[data-state="done"] input,
.signup[data-state="done"] button { display: none; }

.scroll-cue {
  margin-top: auto;
  align-self: flex-start;
  margin-bottom: calc(1.75rem + env(safe-area-inset-bottom, 0px));
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ash-faint);
  transition: color 0.2s;
}

.scroll-cue::after {
  content: "";
  display: block;
  width: 1px;
  height: 2.2rem;
  margin: 0.7rem 0 0 0.2rem;
  background: linear-gradient(var(--ash-faint), transparent);
}

.scroll-cue:hover { color: var(--ash); }

/* ---------- Below the fold ---------- */

main { position: relative; }

.about,
.lore,
.faq,
.closing {
  padding-inline: var(--gutter);
}

.about {
  padding-block: clamp(4rem, 10vw, 7.5rem) clamp(3rem, 7vw, 5rem);
}

.about__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 4rem);
  max-width: 72rem;
  margin: 0 auto;
}

.about article {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

h2 {
  margin: 0 0 0.75rem;
  font-weight: 500;
  font-size: 1.75rem;
  line-height: 1.15;
  color: #eae0d6;
}

.about p,
.faq dd {
  margin: 0;
  color: var(--ash-dim);
}

.about strong { font-weight: 600; color: var(--ash); }

.lore {
  position: relative;
  padding-block: clamp(4rem, 10vw, 7rem);
  text-align: center;
  background:
    radial-gradient(50% 60% at 50% 50%, rgba(120, 40, 16, 0.18), transparent 70%),
    var(--ink-2);
  border-block: 1px solid rgba(216, 206, 196, 0.07);
  overflow: hidden;
}

/* Faint hex grid, the shape of every arena */
.lore::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0 56 16v32L28 64 0 48V16zM28 64v33M0 48l-28 16M56 48l28 16' fill='none' stroke='%23d8cec4' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 42px 72.75px;
  -webkit-mask-image: radial-gradient(60% 70% at 50% 50%, #000, transparent);
  mask-image: radial-gradient(60% 70% at 50% 50%, #000, transparent);
}

.lore__tag {
  position: relative;
  margin: 0 0 1.5rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ember);
}

.lore blockquote {
  position: relative;
  max-width: 44rem;
  margin: 0 auto;
}

.lore blockquote p {
  margin: 0;
  font-style: italic;
  font-size: clamp(1.4rem, 2.6vw, 1.95rem);
  line-height: 1.4;
  color: #d9cec3;
}

.faq {
  max-width: 52rem;
  margin: 0 auto;
  padding-block: clamp(4rem, 9vw, 6.5rem) 1rem;
  padding-inline: var(--gutter);
  box-sizing: content-box;
}

.faq > h2 {
  margin-bottom: 1.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ash-faint);
}

.faq dl { margin: 0; }

.faq dl > div {
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
}

.faq dt {
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 1.3rem;
  color: #e6dcd2;
}

.closing {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: clamp(3.5rem, 8vw, 6rem);
  text-align: center;
}

.closing__line {
  margin: 0;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  color: #e6dcd2;
}

.signup--compact {
  width: 100%;
  justify-content: center;
}

.signup--compact .signup__note { text-align: center; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--gutter) calc(1.5rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(216, 206, 196, 0.07);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ash-faint);
}

/* ---------- Narrow screens ---------- */

@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; }
}

@media (max-aspect-ratio: 1/1) {
  /* Portrait: crop toward the burning lakes on the right of the map */
  .scene { --fx: 0.74; --fy: 0.5; top: 16cqh; }
  .hero { height: max(100svh, 720px); }
  .shade {
    background:
      linear-gradient(to bottom, rgba(14, 10, 9, 0.88) 0%, rgba(14, 10, 9, 0.7) 50%, rgba(14, 10, 9, 0.35) 68%, transparent 82%),
      linear-gradient(to top, var(--ink) 0%, rgba(18, 13, 11, 0) 18%);
  }
}

@media (max-width: 560px) {
  .readout .hide-sm,
  .readout .sep,
  .readout .cycle { display: none; }
  .readout { font-size: 0.625rem; }
  .wordmark { font-size: 1.1rem; letter-spacing: 0.28em; }
  .signup button { flex: 1 1 100%; }
}

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

@media (max-width: 560px) and (max-aspect-ratio: 1/1) {
  .scroll-cue { display: none; }
}
