@import url('marketing-atmosphere.css');

/* landing.css — full-bleed marketing page */

body.landing-page {
  background: var(--bg-deep);
}

body.landing-page .site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 30;
  border-bottom: none;
  background: linear-gradient(180deg, rgba(9, 8, 7, 0.82) 0%, transparent 100%);
}

body.landing-page .site-main {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  scroll-snap-type: y proximity;
}

/* ---------- Scroll presentation ---------- */

.landing-slide {
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

/* ---------- Scroll reveals ---------- */

.landing-reveal {
  --reveal-delay: calc(var(--reveal-i, 0) * 0.1s);
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s var(--ease-out) var(--reveal-delay),
    transform 0.7s var(--ease-out) var(--reveal-delay);
}

.landing-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.landing-reveal--left {
  transform: translateX(-36px) translateY(12px);
}

.landing-reveal--left.is-visible {
  transform: translateX(0) translateY(0);
}

.landing-reveal--right {
  transform: translateX(36px) translateY(12px);
}

.landing-reveal--right.is-visible {
  transform: translateX(0) translateY(0);
}

.landing-reveal--scale {
  transform: translateY(24px) scale(0.94);
}

.landing-reveal--scale.is-visible {
  transform: translateY(0) scale(1);
}

[data-reveal-stagger].landing-reveal {
  --reveal-delay: calc(var(--reveal-i, 0) * 0.14s);
}

[data-reveal-stagger] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.65s var(--ease-out),
    transform 0.65s var(--ease-out);
  transition-delay: calc(var(--reveal-i, 0) * 0.12s);
}

[data-reveal-stagger].is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

.landing-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: center;
  overflow: visible;
}

.landing-hero__copy {
  position: relative;
  z-index: 2;
  padding:
    clamp(96px, 14vh, 128px)
    clamp(24px, 5vw, 64px)
    clamp(48px, 8vh, 72px)
    clamp(24px, 7vw, 96px);
}

.landing-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: var(--s-4);
}

.landing-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6.5vw, 5.2rem);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.025em;
  max-width: 12ch;
}

.landing-hero h1 em {
  font-style: italic;
  color: var(--violet-hot);
  text-shadow: 0 0 48px var(--violet-glow);
}

.landing-lead {
  margin-top: var(--s-6);
  max-width: 38ch;
  font-size: clamp(15px, 1.55vw, 17px);
  line-height: 1.65;
  color: var(--ink-dim);
}

.landing-lead strong {
  font-weight: 500;
  color: var(--violet);
}

.landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  margin-top: var(--s-8);
}

.landing-cta-row .primary {
  padding: 14px 24px;
  font-size: 14px;
  min-height: 44px;
}

.landing-cta-row .text-cta {
  color: var(--ink-dim);
  font-size: 14px;
}

.landing-cta-row .text-cta a {
  color: var(--amber);
  text-underline-offset: 3px;
}

.landing-hero__demo {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
  padding:
    clamp(96px, 14vh, 128px)
    clamp(24px, 5vw, 64px)
    clamp(48px, 8vh, 72px)
    clamp(24px, 5vw, 48px);
  border-left: 1px solid var(--line);
}

.landing-hero__demo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(520px 360px at 50% 20%, rgba(169, 142, 247, 0.08), transparent 70%);
  pointer-events: none;
}

#demo-prompt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet-hot);
  margin-bottom: var(--s-4);
  text-align: center;
}

/* ---------- Demo board (scoped game.css) ---------- */

.landing-demo {
  width: auto;
  max-width: 100%;
  overflow: visible;
}

.landing-demo__flip {
  position: relative;
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}

.landing-demo__flip.is-switching {
  opacity: 0.15;
  transform: scale(0.97);
}

.landing-demo .board-zone {
  width: auto;
  display: flex;
  justify-content: center;
}

.landing-demo .board-frame {
  padding: 18px;
  padding-top: 28px;
  width: auto;
  display: inline-block;
  overflow: visible;
}

body.landing-page .landing-demo .oppview-banner {
  top: 4px;
  z-index: 12;
}

/* Force a true square — overrides game.css min() width rules */
body.landing-page .landing-demo .board {
  --demo-board-size: clamp(280px, 34vw, 400px);
  width: var(--demo-board-size);
  height: var(--demo-board-size);
  max-width: calc(100vw - 80px);
  max-height: calc(100vw - 80px);
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
}

.landing-demo .coord-rail.files { left: 18px; right: 18px; bottom: 4px; }
.landing-demo .coord-rail.ranks { top: 18px; bottom: 18px; left: 4px; }

.landing-demo .square.demo-shake {
  animation: demo-shake 0.35s var(--ease);
}

@keyframes demo-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.landing-demo__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  padding: var(--s-6);
  background: rgba(9, 8, 7, 0.78);
  backdrop-filter: blur(4px);
  border-radius: var(--r-3);
  text-align: center;
  z-index: 10;
}

.landing-demo__overlay p {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 1.75rem);
  font-style: italic;
  color: var(--ink);
  max-width: 22ch;
}

.landing-demo__overlay .primary {
  min-height: 44px;
  padding: 12px 22px;
}

.landing-demo-wrap {
  position: relative;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  overflow: visible;
  padding-top: 8px;
}

.landing-demo__overlay[hidden] {
  display: none !important;
}

/* ---------- Sections ---------- */

.landing-section {
  position: relative;
  padding: clamp(64px, 10vh, 112px) clamp(24px, 6vw, 96px);
  border-top: 1px solid var(--line);
  min-height: 85vh;
  min-height: 85dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.landing-section__inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.landing-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: var(--s-3);
}

.landing-section h2 em {
  font-style: italic;
  color: var(--violet-hot);
}

.landing-section__intro {
  color: var(--ink-dim);
  max-width: 52ch;
  margin-bottom: var(--s-10);
  font-size: 15px;
  line-height: 1.6;
}

/* How it works */

.landing-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(var(--s-6), 4vw, var(--s-10));
}

.landing-step {
  padding-top: var(--s-5);
  border-top: 1px solid var(--line-2);
}

.landing-step h3 {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: var(--s-2);
  color: var(--ink);
}

.landing-step p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-dim);
}

/* Gallery */

.landing-gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 8vh, 96px);
}

.landing-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(var(--s-6), 5vw, var(--s-12));
  align-items: start;
}

@media (min-width: 1024px) {
  .landing-panel {
    align-items: stretch;
  }

  .landing-panel__copy {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .landing-panel__copy-sticky {
    position: sticky;
    top: calc(50dvh - var(--sticky-copy-half, 5rem));
    z-index: 1;
    align-self: flex-start;
    width: 100%;
  }
}

.landing-panel--reverse {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.landing-panel--reverse .landing-panel__copy {
  order: 2;
}

.landing-panel--reverse .landing-panel__media {
  order: 1;
}

.landing-panel__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: var(--s-3);
}

.landing-panel__copy-inner {
  width: 100%;
}

.landing-panel__copy h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  line-height: 1.12;
  margin-bottom: var(--s-3);
}

.landing-panel__copy p {
  color: var(--ink-dim);
  font-size: 14.5px;
  line-height: 1.65;
  max-width: 42ch;
}

.landing-shot-frame {
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-2);
  background: linear-gradient(180deg, var(--surface-3), var(--board-rim));
  box-shadow:
    0 0 0 1px rgba(169, 142, 247, 0.18),
    0 0 48px rgba(169, 142, 247, 0.12),
    var(--sh-2);
  overflow: hidden;
}

.landing-shot-reveal {
  width: 100%;
  height: 100%;
}

.landing-shot {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Rules strip */

.landing-rules {
  background:
    linear-gradient(180deg, rgba(226, 177, 102, 0.03) 0%, transparent 100%);
  min-height: 70vh;
  min-height: 70dvh;
}

.landing-rules__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-6);
  list-style: none;
  margin: 0;
  padding: 0;
}

.landing-rules__list li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-dim);
  padding-left: var(--s-4);
  border-left: 2px solid var(--amber-deep);
}

.landing-rules__list strong {
  display: block;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 4px;
}

/* Final CTA */

.landing-final {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.landing-final__inner {
  position: relative;
  z-index: 2;
  padding: clamp(80px, 12vh, 120px) var(--s-6);
}

.landing-final h2 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-style: italic;
  line-height: 1;
  margin-bottom: var(--s-6);
}

.landing-final .landing-cta-row {
  justify-content: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
  body.landing-page .site-main {
    scroll-snap-type: none;
  }

  .landing-section {
    min-height: auto;
    display: block;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .landing-hero__copy {
    padding-bottom: var(--s-6);
  }

  .landing-hero h1 {
    max-width: none;
  }

  .landing-hero__demo {
    border-left: none;
    border-top: 1px solid var(--line);
    padding-top: var(--s-8);
  }

  .landing-steps {
    grid-template-columns: 1fr;
    gap: var(--s-8);
  }

  .landing-panel,
  .landing-panel--reverse {
    grid-template-columns: 1fr;
  }

  .landing-panel--reverse .landing-panel__copy,
  .landing-panel--reverse .landing-panel__media {
    order: unset;
  }

  .landing-rules__list {
    grid-template-columns: 1fr;
    gap: var(--s-5);
  }
}

@media (max-width: 520px) {
  body.landing-page .site-header {
    padding-inline: var(--s-4);
  }

  body.landing-page .landing-demo .board {
    --demo-board-size: min(300px, calc(100vw - 56px));
  }

  .landing-cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .landing-cta-row .primary {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.landing-page .site-main {
    scroll-snap-type: none;
  }

  .landing-reveal,
  .landing-reveal--left,
  .landing-reveal--right,
  .landing-reveal--scale,
  [data-reveal-stagger] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .landing-demo__flip {
    transition: opacity 0.2s var(--ease);
  }

  .landing-demo__flip.is-switching {
    transform: none;
  }

  .landing-demo .square.demo-shake {
    animation: none;
  }
}
