:root {
  --bg: #0b0d1a;
  --bg-2: #11152a;
  --panel: #161b34;
  --line: #262d52;
  --text: #eef0fa;
  --muted: #a3a9c9;
  --arc: #7fe0ff;
  --warm: #ffb86b;
  --grass: #9be38a;
  --dusk: #c49bff;
  --display: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0; }
h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); max-width: 18ch; }
h3 { font-size: 1.35rem; }
p { margin: 0; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--arc);
  margin-bottom: 14px;
}

/* Hero */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: -40px; z-index: -1; }
.hero-bg img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(28px) saturate(1.25) brightness(0.5);
  transform: scale(1.1);
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero-bg img.shown { opacity: 1; }
.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 60% at 72% 55%, transparent 0%, rgba(11, 13, 26, 0.55) 70%),
    linear-gradient(180deg, rgba(11, 13, 26, 0.5) 0%, rgba(11, 13, 26, 0.2) 40%, var(--bg) 100%);
}

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0;
  gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; text-decoration: none; letter-spacing: 0.01em;
}
.nav-links { display: flex; gap: 26px; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 0.95rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }

.hero-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 48px;
  padding: 24px 0 96px;
}
.hero h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.6rem);
  letter-spacing: -0.01em;
  max-width: 14ch;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}
.hero h1 em {
  font-style: italic;
  background: linear-gradient(90deg, var(--arc), var(--warm));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.lede { margin-top: 24px; font-size: 1.2rem; color: #d3d7ee; max-width: 36ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button {
  display: inline-block;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--text); color: var(--bg);
  font-weight: 600; text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(127, 224, 255, 0.3); }
.button.ghost { background: transparent; color: var(--text); border: 1px solid rgba(238, 240, 250, 0.35); }

/* The doorway */

.doorway {
  position: relative;
  justify-self: center;
  width: min(360px, 80vw);
  perspective: 900px;
}
.door-frame {
  --glow: 0;
  position: relative;
  aspect-ratio: 5 / 9;
  border: 12px solid #2b2238;
  border-bottom-width: 0;
  border-radius: 6px 6px 0 0;
  background: #000;
  box-shadow:
    inset 0 0 0 2px #3d3150,
    0 0 calc(20px + var(--glow) * 70px) calc(var(--glow) * 12px) rgba(127, 224, 255, calc(0.15 + var(--glow) * 0.5)),
    0 40px 80px rgba(0, 0, 0, 0.5);
  transform: rotateY(-8deg);
  transition: box-shadow 0.15s;
}
.door-view { position: absolute; inset: 0; overflow: hidden; }
.door-view img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.25);
  transition: opacity 0.5s ease, transform 3.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.door-view img.shown { opacity: 1; transform: scale(1.02); }
.door-flash {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 60%, #fff, var(--arc) 45%, transparent 75%);
  opacity: 0;
  pointer-events: none;
}
.door-frame.open .door-flash { animation: flash 0.7s ease-out; }
@keyframes flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }
.door-arcs {
  position: absolute;
  inset: -16px -16px -44px;
  width: calc(100% + 32px); height: calc(100% + 60px);
  pointer-events: none;
}
.door-floor {
  height: 60px;
  margin: 0 -40%;
  background: radial-gradient(ellipse 50% 60% at 50% 0%, rgba(255, 184, 107, 0.35), transparent 70%);
  filter: blur(6px);
}

.sync {
  display: flex; align-items: center; gap: 14px;
  margin: 6px auto 0;
  width: max-content;
  padding: 10px 18px 10px 12px;
  border-radius: 999px;
  background: rgba(11, 13, 26, 0.6);
  border: 1px solid rgba(127, 224, 255, 0.25);
  backdrop-filter: blur(10px);
}
.sync-ring { width: 40px; height: 40px; transform: rotate(-90deg); }
.sync-ring circle { fill: none; stroke-width: 3.5; }
.sync-ring .track { stroke: rgba(127, 224, 255, 0.18); }
.sync-ring .fill { stroke: var(--arc); stroke-dasharray: 100; stroke-dashoffset: 100; stroke-linecap: round; }
.sync-state { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--arc); font-variant-numeric: tabular-nums; }
.sync-name { font-weight: 600; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 26px;
  width: 26px; height: 42px;
  border: 2px solid rgba(238, 240, 250, 0.4);
  border-radius: 14px;
  transform: translateX(-50%);
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px;
  width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--text);
  animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* Sections */

.section { padding: 110px 0; }
.section-lede { margin-top: 20px; max-width: 62ch; color: var(--muted); font-size: 1.08rem; }

.steps {
  list-style: none; padding: 0; margin: 56px 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.steps li {
  position: relative;
  padding: 28px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.steps p { margin-top: 10px; color: var(--muted); font-size: 0.98rem; }
.step-n {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; margin-bottom: 18px;
  border-radius: 50%;
  border: 1px solid var(--arc);
  color: var(--arc); font-weight: 600; font-size: 0.9rem;
}

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.mode {
  padding: 32px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(155, 227, 138, 0.14), rgba(155, 227, 138, 0.02));
  border: 1px solid rgba(155, 227, 138, 0.3);
}
.mode.arcade {
  background: linear-gradient(135deg, rgba(255, 184, 107, 0.16), rgba(255, 184, 107, 0.02));
  border-color: rgba(255, 184, 107, 0.35);
}
.mode h3 { font-size: 1.7rem; }
.mode p { margin-top: 12px; color: #cfd3ea; }

/* Worlds */

.worlds-section { background: linear-gradient(180deg, var(--bg), var(--bg-2) 20%, var(--bg-2) 80%, var(--bg)); }
.world-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 28px;
  margin-top: 56px;
}
.world {
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s;
}
.world:hover { transform: translateY(-4px); border-color: rgba(127, 224, 255, 0.4); }
.world-image {
  display: block; padding: 0; border: 0; background: #000;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.world-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.world:hover .world-image img { transform: scale(1.04); }
.world-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.world-body > p:not(.world-meta) { color: var(--muted); font-size: 0.98rem; }
.world-meta { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.kind {
  padding: 2px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid currentColor;
}
.kind-outdoor { color: var(--grass); }
.kind-city { color: var(--dusk); }
.kind-underground { color: var(--warm); }
.world-facts { margin: 8px 0 0; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 0.9rem; }
.world-facts div { display: grid; grid-template-columns: 56px 1fr; gap: 10px; }
.world-facts dt { color: var(--muted); }
.world-facts dd { margin: 0; }
.note { margin-top: 32px; color: var(--muted); font-size: 0.9rem; }

/* Build */

.stack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 56px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.stack article { background: var(--bg); padding: 30px 28px; }
.stack p { margin-top: 10px; color: var(--muted); font-size: 0.98rem; }

/* Status */

.layers { list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 40px; }
.layer {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.layer-id { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.layer-state { font-size: 0.78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.state-done .layer-state { color: var(--grass); }
.state-built .layer-state { color: var(--arc); }
.state-skipped .layer-title, .state-skipped .layer-state { color: #6c7296; }

/* Footer and lightbox */

.footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: 0.92rem; }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer strong { color: var(--text); }

.lightbox {
  width: min(1400px, 100% - 32px);
  padding: 0; border: 0; border-radius: 14px;
  background: #000; color: var(--text);
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(5, 6, 14, 0.85); backdrop-filter: blur(6px); }
.lightbox img { width: 100%; max-height: 82vh; object-fit: contain; }
.lightbox-title { padding: 14px 20px; font-family: var(--display); font-size: 1.2rem; }
.lightbox .close {
  position: absolute; top: 12px; right: 12px;
  padding: 8px 14px; border-radius: 999px; border: 0;
  background: rgba(11, 13, 26, 0.75); color: var(--text); font: 500 0.9rem var(--sans);
  cursor: pointer;
}

/* Small screens */

@media (max-width: 960px) {
  .hero-body { grid-template-columns: 1fr; gap: 56px; padding-bottom: 110px; }
  .doorway { width: min(300px, 70vw); }
  .steps { grid-template-columns: 1fr 1fr; }
  .stack { grid-template-columns: 1fr 1fr; }
  .layers { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .section { padding: 80px 0; }
  .steps, .modes, .stack { grid-template-columns: 1fr; }
  .layer { grid-template-columns: 1fr auto; }
  .layer-id { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
