/* ==========================================================================
   Home page
   ========================================================================== */

/* The board is the background of the hero. Everything else floats on top of
   it, with a scrim doing the work of keeping the type readable. */

.hero {
  position: relative;
  isolation: isolate;
  min-height: min(calc(100dvh - var(--nav-h)), 840px);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: clamp(40px, 7vw, 80px) 0;
}

.hero-board {
  position: absolute;
  /* Weighted to the right of the hero so the board sits behind the copy
     without swallowing it. */
  inset: -6% -7% -9% 12%;
  z-index: 0;
}

.hero-board canvas {
  width: 100%;
  height: 100%;
}

/* Left-weighted on wide screens so the headline sits on solid ground, and
   top-weighted on phones where the copy stacks above the board. */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      100deg,
      var(--bg) 0%,
      color-mix(in srgb, var(--bg) 92%, transparent) 26%,
      color-mix(in srgb, var(--bg) 55%, transparent) 46%,
      transparent 68%
    ),
    linear-gradient(to bottom, color-mix(in srgb, var(--bg) 70%, transparent), transparent 22%),
    linear-gradient(to top, var(--bg) 2%, transparent 30%);
}

/* On a phone the board sits below the copy rather than behind it. There is
   not enough width for a scrim to keep both readable. */
@media (max-width: 940px) {
  .hero {
    min-height: auto;
    align-items: flex-start;
    padding-bottom: min(64vw, 380px);
  }
  .hero-board {
    inset: auto -8% 0 -8%;
    height: min(70vw, 400px);
  }
  .hero-scrim {
    background: linear-gradient(to top, var(--bg) 1%, transparent 22%);
  }
  .hero-copy {
    max-width: none;
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  /* Clicks in the empty space fall through to the board behind. */
  pointer-events: none;
}

.hero-content a,
.hero-content button {
  pointer-events: auto;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  max-width: 34rem;
}


.hero-reset {
  position: absolute;
  top: 16px;
  right: max(16px, calc((100vw - var(--max-w)) / 2 + var(--gutter)));
  z-index: 3;
  opacity: 0.6;
}
.hero-reset:hover {
  opacity: 1;
}



.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.9rem, 6.4vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.018em;
}

.hero h1 em {
  font-style: italic;
  color: var(--jade);
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.hero-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 0.84rem;
  margin-top: 4px;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stage-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 4;
  background: var(--bg);
  transition: opacity var(--dur-slow) var(--ease);
}
.stage-loading[data-done='true'] {
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding: clamp(52px, 8vw, 104px) 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(26px, 4vw, 44px);
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  margin-top: 10px;
}

.section-head p {
  margin-top: 12px;
  color: var(--text-dim);
}

/* --- mode cards ------------------------------------------------------- */

.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 16px;
}

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--surface-1), var(--bg));
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.mode-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, var(--accent-tint, rgba(61, 220, 151, 0.4)), transparent 55%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}

.mode-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}
.mode-card:hover::after {
  opacity: 1;
}

.mode-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--jade);
  font-size: 1.05rem;
}

.mode-card h3 {
  font-size: 1.12rem;
  font-weight: 620;
}

.mode-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  flex: 1;
}

.mode-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--jade);
  font-weight: 580;
  font-size: 0.88rem;
  margin-top: 4px;
}
.mode-card:hover .mode-link svg {
  translate: 3px 0;
}
.mode-link svg {
  transition: translate var(--dur-fast) var(--ease);
}

.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* --- feature demos ---------------------------------------------------- */

.demos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.demo-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface-1);
}

.demo-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-deep);
}

.demo-card h3 {
  font-size: 1rem;
  font-weight: 620;
}

.demo-card p {
  font-size: 0.86rem;
  color: var(--text-dim);
}

.demo-step {
  font-size: 0.78rem;
  color: var(--jade);
  font-weight: 580;
  min-height: 1.3em;
}

/* --- multiplayer explainer -------------------------------------------- */

.mp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

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

.mp-steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mp-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.mp-step:last-child {
  border-bottom: 0;
}

.mp-step-num {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--jade-soft);
  border: 1px solid color-mix(in srgb, var(--jade) 34%, transparent);
  color: var(--jade);
  font-size: 0.8rem;
  font-weight: 660;
}

.mp-step h4 {
  font-size: 0.98rem;
  font-weight: 600;
}
.mp-step p {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-top: 3px;
}

.room-demo {
  padding: 26px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(150deg, var(--surface-2), var(--bg));
  text-align: center;
}

.room-code {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 6vw, 3.1rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--jade);
  text-shadow: 0 0 40px rgba(61, 220, 151, 0.35);
}

/* --- stats ------------------------------------------------------------ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat {
  padding: 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-1);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 2px;
}

.progress-track {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 10px;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--jade-deep), var(--jade));
  transition: width 1s var(--ease);
}

/* --- closing CTA ------------------------------------------------------ */

.cta-band {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(61, 220, 151, 0.1), transparent 60%), var(--surface-1);
  padding: clamp(32px, 6vw, 64px);
  text-align: center;
}

.cta-band h2 {
  font-family: var(--font-display);
  font-weight: 400;
}

.cta-band p {
  color: var(--text-dim);
  margin: 12px auto 24px;
  max-width: 46ch;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: clamp(40px, 8vw, 96px);
  padding: 34px 0 44px;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.footer-grid {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-links a:hover {
  color: var(--text);
}
