/* In-gen's editor palette: near-black slate, thin borders, cyan actions, the logo's violet as a glow. */
:root {
  --bg: #0d1117;
  --bg-2: #11161d;
  --panel: #161b22;
  --panel-2: #1c222b;
  --line: #262d38;
  --line-soft: rgba(255, 255, 255, 0.06);
  --text: #e6edf3;
  --muted: #9aa4b2;
  --cyan: #22d3ee;
  --cyan-ink: #04161b;
  --violet: #8b5cf6;
  --radius: 14px;
  --wrap: 1180px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(900px 520px at 85% -8%, rgba(139, 92, 246, 0.16), transparent 62%),
    radial-gradient(700px 420px at -5% 10%, rgba(34, 211, 238, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--cyan); }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }

/* Top bar, like the editor's */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(16px, calc((100% - var(--wrap)) / 2 + 16px));
  background: rgba(13, 17, 23, 0.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.brand img { border-radius: 8px; }
.bar nav { display: flex; align-items: center; gap: 22px; }
.bar nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; }
.bar nav a:hover { color: var(--text); }
.bar nav .bar-cta { color: var(--cyan); border: 1px solid rgba(34, 211, 238, 0.5); background: rgba(34, 211, 238, 0.08); padding: 6px 14px; border-radius: 8px; font-weight: 600; }
.bar nav .bar-cta:hover { color: var(--text); background: rgba(34, 211, 238, 0.16); }

main { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* Buttons: the editor's cyan Run button */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border-radius: 10px; border: 1px solid transparent;
  background: var(--cyan); color: var(--cyan-ink);
  font-weight: 600; font-size: 16px; text-decoration: none;
  box-shadow: 0 8px 28px rgba(34, 211, 238, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 12px 34px rgba(34, 211, 238, 0.35); background: #3ddcf2; }
.button svg { width: 20px; height: 20px; }
.button.ghost { background: transparent; color: var(--text); border-color: var(--line); box-shadow: none; }
.button.ghost:hover { border-color: #3a4352; background: var(--panel); }
.eyebrow { margin: 0 0 14px; color: var(--cyan); font-weight: 600; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.meta { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.fine { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.lede { color: var(--muted); font-size: 18px; margin: 20px 0 28px; max-width: 36rem; }

/* Hero */
.nb { white-space: nowrap; }
.hero { display: grid; grid-template-columns: 1fr 1.05fr; align-items: center; gap: 44px; padding: 64px 0 56px; }
h1 { font-size: clamp(36px, 5vw, 58px); font-weight: 700; }
.download { display: flex; flex-wrap: wrap; gap: 12px; }
.download .button { padding: 13px 20px; }

/* The 3D viewport, framed like the editor's scene view */
.viewport { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, #121821, #0b0f15); overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--line-soft) inset; }
.viewport-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel); font-size: 13px; }
.viewport-bar .tab { color: var(--muted); padding: 4px 10px; border-radius: 7px; }
.viewport-bar .tab.active { color: var(--cyan); background: rgba(34, 211, 238, 0.1); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.45); }
.viewport-title { margin-left: auto; color: var(--muted); }
#hero-canvas { display: block; width: 100%; aspect-ratio: 4 / 3; opacity: 0; transition: opacity 0.8s ease; }
.viewport.ready #hero-canvas { opacity: 1; }
.viewport.no-webgl #hero-canvas { opacity: 1; background: center / cover url(/images/shot-scene.jpg); }
.viewport-chip { position: absolute; left: 14px; bottom: 14px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: rgba(22, 27, 34, 0.9); border: 1px solid var(--line); font-size: 13px; color: var(--text); backdrop-filter: blur(6px); }
.spark { color: var(--cyan); }

/* Features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 8px 0 80px; }
.features article { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.features .icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: rgba(34, 211, 238, 0.1); color: var(--cyan); margin-bottom: 14px; font-size: 17px; }
.features h2 { font-size: 18px; margin-bottom: 8px; }
.features p { margin: 0; color: var(--muted); font-size: 15px; }

/* Screens */
.section-title { font-size: clamp(28px, 3.4vw, 38px); margin-bottom: 24px; }
.screens { padding-bottom: 80px; }
.screen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.screen { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.screen.wide { grid-column: 1 / -1; }
.screen img { width: 100%; height: auto; border-bottom: 1px solid var(--line); }
.screen figcaption { padding: 14px 18px; color: var(--muted); font-size: 15px; }
.screen figcaption strong { color: var(--text); }

/* Gen Haven band on the home page */
.haven-band { position: relative; border-radius: calc(var(--radius) + 4px); overflow: hidden; border: 1px solid var(--line); min-height: 380px; display: flex; align-items: center; }
.haven-band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.haven-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 12, 30, 0.92) 0%, rgba(10, 12, 30, 0.6) 45%, transparent 75%); }
.haven-band-text { position: relative; z-index: 1; padding: 40px; max-width: 30rem; }
.haven-band h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 12px; }
.haven-band p:not(.eyebrow) { color: #c8cde0; margin: 0 0 22px; }

footer { max-width: var(--wrap); margin: 64px auto 0; padding: 24px 16px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
footer p { margin: 0; }
footer nav { display: flex; gap: 18px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* ---------- Gen Haven ---------- */
.haven h1, .haven h3, .haven-brand { font-family: Fraunces, Georgia, serif; letter-spacing: -0.01em; }
.haven-mark { color: #ffcf7a; font-size: 18px; }
.haven-hero { position: relative; margin-top: 24px; border-radius: calc(var(--radius) + 4px); overflow: hidden; border: 1px solid var(--line); min-height: 440px; display: flex; align-items: flex-end; }
.haven-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 65% 50%; }
.haven-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 12, 30, 0.85) 0%, rgba(10, 12, 30, 0.35) 50%, transparent 75%), linear-gradient(0deg, rgba(10, 12, 30, 0.6), transparent 45%); }
.haven-hero-text { position: relative; z-index: 1; padding: 44px; max-width: 34rem; }
.haven-hero h1 { font-size: clamp(36px, 5vw, 56px); }
.haven-hero .lede { color: #cfd3e6; margin-bottom: 0; }
.games { padding-top: 40px; }
.game { display: grid; grid-template-columns: 1.3fr 1fr; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.game img { width: 100%; height: 100%; object-fit: cover; min-height: 280px; }
.game-text { padding: 30px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.game h3 { font-size: 30px; margin-bottom: 10px; }
.game-text > p:not(.eyebrow):not(.fine) { color: var(--muted); margin: 0 0 20px; }
.haven .button { background: #ffcf7a; color: #1d1405; box-shadow: 0 8px 28px rgba(255, 207, 122, 0.22); }
.haven .button:hover { background: #ffd98f; box-shadow: 0 12px 34px rgba(255, 207, 122, 0.32); }
.haven .eyebrow { color: #ffcf7a; }
.haven .bar nav .bar-cta { color: var(--cyan); }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; gap: 32px; }
  .features { grid-template-columns: 1fr 1fr; }
  .game { grid-template-columns: 1fr; }
  .game img { min-height: 0; aspect-ratio: 16 / 9; }
}
@media (max-width: 600px) {
  .bar nav { gap: 14px; }
  .bar nav a:not(.bar-cta) { display: none; }
  .features, .screen-grid { grid-template-columns: 1fr; }
  .download .button { width: 100%; }
  .viewport-chip { display: none; }
  .haven-band { min-height: 0; }
  .haven-band::after { background: linear-gradient(0deg, rgba(10, 12, 30, 0.95) 30%, rgba(10, 12, 30, 0.4)); }
  .haven-band-text { padding: 28px 20px; margin-top: 160px; }
  .haven-hero { min-height: 420px; }
  .haven-hero::after { background: linear-gradient(0deg, rgba(10, 12, 30, 0.94) 38%, rgba(10, 12, 30, 0.2) 80%); }
  .haven-hero-text { padding: 24px 20px; }
  .game-text { padding: 22px; }
}
