/* TileMap Studio — homepage. Same "light table" language as the editor:
   graphite ground, Plex Sans, the pixel wordmark, four-colour viewfinder
   corners around the one lit object (the playable autotile demo). */

:root {
  --ground: #0d0d14;
  --chrome: #13131c;
  --raised: #1a1a26;
  --line: #232333;
  --line-2: #30304a;
  --text: #dde2f3;
  --text-2: #a3a9c6;
  --text-3: #6d7294;
  --blue: #89b4fa;
  --blue-ink: #0f1a33;
  --green: #a6e3a1;
  --yellow: #f9e2af;
  --pink: #f38ba8;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --px: 'Press Start 2P', monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #b7cffc; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; }
strong { font-weight: 600; color: var(--text); }

.wrap { width: min(1160px, 100%); margin: 0 auto; padding-inline: 24px; }

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  font: 600 15px/1.2 var(--sans);
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn svg.i { width: 16px; height: 16px; }
.btn-primary { background: var(--blue); color: var(--blue-ink); }
.btn-primary:hover { background: #a4c5fb; color: var(--blue-ink); }
.btn-primary:hover svg.i { transform: translateX(2px); }
.btn-primary svg.i { transition: transform 0.15s var(--ease); }
.btn-ghost { color: var(--text); border-color: var(--line-2); background: transparent; }
.btn-ghost:hover { border-color: #4a4a6a; background: var(--raised); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn-spritelab { background: var(--yellow); color: #1d1706; }
.btn-spritelab:hover { background: #fcecc7; color: #000; }

/* ── nav ─────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13, 13, 20, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark { display: grid; grid-template-columns: 7px 7px; gap: 2px; }
.brand-mark i { width: 7px; height: 7px; }
.brand-mark i:nth-child(1) { background: var(--blue); }
.brand-mark i:nth-child(2) { background: var(--pink); }
.brand-mark i:nth-child(3) { background: var(--green); }
.brand-mark i:nth-child(4) { background: var(--yellow); }
.brand-name { font: 11px/1 var(--px); padding-top: 2px; white-space: nowrap; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--text-2); text-decoration: none; font-size: 14.5px; }
.nav-links a:hover { color: #fff; }

/* ── hero ────────────────────────────────────────────────────────────── */
.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(rgba(163, 169, 198, 0.07) 1px, transparent 1.2px) 0 0 / 16px 16px;
}
.hero-grid { display: grid; grid-template-columns: 5fr 6fr; gap: 56px; align-items: center; }
.hero h1 {
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: #fff;
  max-width: 14ch;
}
.lede { margin-top: 20px; font-size: 18px; color: var(--text-2); max-width: 46ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { margin-top: 18px; font-size: 13.5px; color: var(--text-3); }

.hero-demo { margin: 0; }
/* the lit object: four-colour viewfinder corners */
.frame { position: relative; padding: 0; line-height: 0; }
.frame {
  --c: 18px;
  /* corner L-brackets painted inside the padding, around the canvas */
  background:
    linear-gradient(var(--blue), var(--blue)) 0 0 / var(--c) 2px no-repeat,
    linear-gradient(var(--blue), var(--blue)) 0 0 / 2px var(--c) no-repeat,
    linear-gradient(var(--pink), var(--pink)) 100% 0 / var(--c) 2px no-repeat,
    linear-gradient(var(--pink), var(--pink)) 100% 0 / 2px var(--c) no-repeat,
    linear-gradient(var(--green), var(--green)) 0 100% / var(--c) 2px no-repeat,
    linear-gradient(var(--green), var(--green)) 0 100% / 2px var(--c) no-repeat,
    linear-gradient(var(--yellow), var(--yellow)) 100% 100% / var(--c) 2px no-repeat,
    linear-gradient(var(--yellow), var(--yellow)) 100% 100% / 2px var(--c) no-repeat;
  padding: 12px;
  margin: -12px;
}
#heroCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 14 / 9;
  image-rendering: pixelated;
  border-radius: 2px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  cursor: crosshair;
  touch-action: none;
  background: #4a3423;
}
.hero-demo figcaption { margin-top: 18px; font-size: 14px; color: var(--text-3); text-align: center; }
.hint-live { display: none; }
#heroHint.live .hint-idle { display: none; }
#heroHint.live .hint-live { display: inline; }
#heroClear { font: inherit; color: var(--blue); background: none; border: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ── screenshot ──────────────────────────────────────────────────────── */
.shot { padding: 24px 0 88px; }
.shot-frame {
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
  background: var(--chrome);
}
.shot-frame img { display: block; width: 100%; height: auto; }

/* ── sections ────────────────────────────────────────────────────────── */
section h2 {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: #fff;
  max-width: 24ch;
}
.section-lede { margin-top: 10px; color: var(--text-2); font-size: 17px; }
.features, .steps, .engines, .faq { padding: 88px 0; border-top: 1px solid var(--line); }

.feature-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px 40px;
  margin-top: 48px;
}
.feature-grid li { border-top: 1px solid var(--line-2); padding-top: 20px; }
.feature-grid h3 { font-size: 17px; font-weight: 600; color: #fff; margin: 14px 0 6px; }
.feature-grid p { color: var(--text-2); font-size: 15px; }
.fi { width: 22px; height: 22px; }
.fi.green { color: var(--green); }
.fi.blue { color: var(--blue); }
.fi.pink { color: var(--pink); }
.fi.yellow { color: var(--yellow); }

.step-list { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 44px; }
.step-list li { counter-increment: step; }
.step-list li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font: 12px/1 var(--px);
  color: var(--ground);
  background: var(--text);
  border-radius: 4px;
  margin-bottom: 18px;
}
.step-list li:nth-child(1)::before { background: var(--blue); }
.step-list li:nth-child(2)::before { background: var(--green); }
.step-list li:nth-child(3)::before { background: var(--yellow); }
.step-list h3 { font-size: 17px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.step-list p { color: var(--text-2); font-size: 15px; }

/* ── SpriteLab ───────────────────────────────────────────────────────── */
.spritelab {
  padding: 96px 0;
  border-top: 1px solid rgba(249, 226, 175, 0.18);
  border-bottom: 1px solid rgba(249, 226, 175, 0.18);
  background: linear-gradient(180deg, rgba(249, 226, 175, 0.045), transparent 70%);
}
.sl-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 64px; align-items: center; }
.sl-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--yellow); margin-bottom: 12px; }
.sl-kicker svg.i { width: 15px; height: 15px; }
.sl-copy > p { margin-top: 14px; color: var(--text-2); font-size: 17px; max-width: 56ch; }
.sl-copy a:not(.btn) { color: var(--yellow); }
.sl-list { list-style: none; margin: 24px 0 30px; display: grid; gap: 14px; max-width: 60ch; }
.sl-list li { position: relative; padding-left: 20px; color: var(--text-2); font-size: 15.5px; }
.sl-list li::before { content: ''; position: absolute; left: 0; top: 10px; width: 8px; height: 8px; border-radius: 2px; background: var(--yellow); }
.sl-atlas { margin: 0; text-align: center; }
.sl-atlas img {
  width: min(100%, 384px);
  height: auto;
  image-rendering: pixelated;
  border-radius: 4px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}
.sl-atlas figcaption { margin-top: 14px; font-size: 13.5px; color: var(--text-3); }

/* ── engines ─────────────────────────────────────────────────────────── */
.engine-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 36px; border-top: 1px solid var(--line-2); }
.engine-list div { padding: 18px 20px 18px 0; border-bottom: 1px solid var(--line); }
.engine-list dt { font-weight: 600; color: #fff; }
.engine-list dd { color: var(--text-2); font-size: 15px; }

/* ── FAQ ─────────────────────────────────────────────────────────────── */
.faq details, .faq h2 { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq h2 { margin-bottom: 24px; }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 32px 18px 0;
  font-size: 17px;
  font-weight: 500;
  color: #fff;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s var(--ease);
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.faq details p { padding: 0 0 20px; color: var(--text-2); max-width: 66ch; }

/* ── final CTA + footer ──────────────────────────────────────────────── */
.final { padding: 96px 0; border-top: 1px solid var(--line); text-align: center; }
.final-inner { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.final h2 { max-width: none; }
.foot { border-top: 1px solid var(--line); padding: 36px 0 44px; background: var(--chrome); }
.foot-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.foot p { margin-top: 10px; font-size: 13.5px; color: var(--text-3); }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.foot nav a { color: var(--text-2); text-decoration: none; font-size: 14px; }
.foot nav a:hover { color: #fff; }

/* ── responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { padding-top: 48px; }
  .hero-grid, .sl-grid { grid-template-columns: 1fr; gap: 44px; }
  .feature-grid, .step-list { grid-template-columns: 1fr 1fr; }
  .engine-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .wrap { padding-inline: 18px; }
  .nav-links { display: none; }
  .nav-inner { justify-content: space-between; }
  .feature-grid, .step-list, .engine-list { grid-template-columns: 1fr; }
  .features, .steps, .engines, .faq, .spritelab, .final { padding: 64px 0; }
  .shot { padding-bottom: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
