/* ==========================================================
   Latch Games — homepage
   ========================================================== */

:root {
  font-family: Inter, "Avenir Next", Avenir, Arial, sans-serif;
  color: #1c3038;
  background: #e6edef;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  font-weight: 400;

  --ink: #1c3038;
  --ink-soft: #334950;
  --muted: #56666b;
  --paper: #edf1ee;
  --mist: #dfe8e8;
  --rust: #b9573d;
  --rust-dark: #99432f;
  --lake: #5b7f8e;
  --moss: #6f7f4f;
  --rule: rgba(28, 48, 56, 0.16);

  --gutter: clamp(28px, 7vw, 112px);

  /* Parallax tuning. The scene stays pinned for (track height − 100svh),
     so a shorter track makes every layer move faster per scroll. */
  --track-height: 220svh;
  --layer-scale: 1.3;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
  background: var(--paper);
}

body { margin: 0; min-width: 320px; min-height: 100vh; }
body, a { color: var(--ink); }
a { text-decoration: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 5px;
  border-radius: 2px;
}

img { max-width: 100%; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  width: 100%;
  padding: 25px var(--gutter);
  transition: background-color .25s ease, padding .25s ease, box-shadow .25s ease;
}

/* Soft bar once you leave the hero so the nav stays readable over the new sections */
.site-header.is-scrolled {
  padding-top: 14px;
  padding-bottom: 14px;
  background: rgba(237, 241, 238, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--rule);
}

.wordmark {
  width: max-content;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .24em;
  white-space: nowrap;
}

.site-header nav {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 58px);
  margin-right: clamp(22px, 3vw, 42px);
  font-size: 13px;
}

.site-header nav a,
.site-footer a:last-child { transition: opacity .18s ease; }
.site-header nav a:hover,
.site-footer a:last-child:hover { opacity: .62; }

.header-cta,
.button-link {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 21px;
  border-radius: 999px;
  background: var(--rust);
  color: #fffaf1;
  font-size: 12px;
  transition: background-color .18s ease, transform .18s ease;
}
.header-cta:hover,
.button-link:hover { background: var(--rust-dark); transform: translateY(-2px); }

/* ---------- Shared type ---------- */

main { position: relative; }

.eyebrow {
  margin: 0 0 19px;
  color: #42585e;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .18em;
  line-height: 1.4;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -.045em;
}
h1 { margin-bottom: 17px; font-size: clamp(58px, 6.1vw, 91px); line-height: .98; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  padding: 0 0 6px;
  border-bottom: 1px solid currentColor;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  transition: gap .18s ease, color .18s ease;
}
.text-link:hover { gap: 18px; color: var(--rust); }

.button-link {
  padding: 0 20px;
  border: 0;
  color: #fffaf1;
}
.button-link:hover { color: #fffaf1; }

/* ==========================================================
   Parallax scenes
   ========================================================== */

.scene {
  position: relative;
  z-index: 1;
  isolation: isolate;
  width: 100%;
  height: 100svh;
  min-height: 680px;
  overflow: hidden;
  background: #cbdce2;
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: #e7efed1f;
}

/* Scroll distance: the scene stays pinned for (track height − 100svh). */
.hero-track,
.scene-track--studio {
  position: relative;
  height: var(--track-height);
  background: #cbdce2;
  --scroll-progress: 0;
}
.scene-track--studio { z-index: 2; }

.scene--hero,
.scene--studio {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 680px;
}
.scene--hero { z-index: 1; background: #cbdce2; }
.scene--studio { background: #dbe7e9; }

.hero-plane,
.studio-plane {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform;
}
.hero-plane { object-position: center 52%; }
.studio-plane { object-position: center; }

/* Each layer moves at its own speed: the far mountains barely drift, the
   village rises a little, and the foreground climbs and grows toward you.
   Scales are sized so the translated edges never come into view. */
.hero-plane--mountains,
.studio-plane--mountains {
  z-index: 0;
  transform: translate3d(0, calc(var(--scroll-progress) * 10vh - 4vh), 0) scale(var(--layer-scale));
}
.hero-plane--lake,
.studio-plane--lake {
  z-index: 1;
  transform: translate3d(0, calc(var(--scroll-progress) * -14vh + 2vh), 0)
    scale(calc(var(--layer-scale) + var(--scroll-progress) * .06));
}
.hero-plane--foreground,
.studio-plane--foreground {
  z-index: 2;
  transform: translate3d(0, calc(var(--scroll-progress) * -34vh + 8vh), 0)
    scale(calc(var(--layer-scale) + var(--scroll-progress) * .26));
}

.hero-content,
.chapter-content { position: absolute; z-index: 4; width: min(490px, 41vw); }

.hero-content {
  top: 20%;
  left: 50%;
  width: min(640px, 70vw);
  /* Copy lifts away and fades as you scroll into the scene */
  transform: translate3d(-50%, calc(var(--scroll-progress) * -38vh), 0);
  opacity: calc(1 - var(--scroll-progress) * 2.2);
  text-align: center;
  will-change: transform, opacity;
}

.hero-description,
.chapter-content > p:not(.eyebrow) {
  max-width: 390px;
  margin-bottom: 24px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}
.hero-description { margin-inline: auto; }

.scroll-cue {
  position: absolute;
  z-index: 4;
  right: var(--gutter);
  bottom: 40px;
  display: flex;
  align-items: center;
  gap: 13px;
  color: #38505a;
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: calc(1 - var(--scroll-progress) * 5);
}
.scroll-line {
  width: 46px;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  animation: line-pulse 1.8s ease-in-out infinite alternate;
}

.chapter-content {
  top: 25%;
  left: clamp(38px, 8vw, 126px);
  transform: translate3d(0, calc(14vh - var(--scroll-progress) * 28vh), 0);
  will-change: transform;
}
.chapter-content h2 {
  max-width: 490px;
  margin-bottom: 17px;
  font-size: clamp(46px, 5.2vw, 76px);
  line-height: 1.02;
}
.chapter-content .text-link { margin-top: 2px; }

.scene--studio .chapter-content {
  right: clamp(38px, 8vw, 126px);
  left: auto;
  width: min(440px, 38vw);
}

/* Soft mist behind the studio copy so the body text stays readable over the village */
.scene--studio .chapter-content::before {
  content: "";
  position: absolute;
  inset: -80px -96px;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(226, 236, 236, .9) 0%, rgba(226, 236, 236, .8) 55%, rgba(226, 236, 236, 0) 100%);
  pointer-events: none;
}

.scene--studio .chapter-content > p:not(.eyebrow) {
  color: var(--ink);
  text-shadow: 0 0 12px rgba(226, 236, 236, .9), 0 0 2px rgba(226, 236, 236, .9);
}

.scene-caption {
  position: absolute;
  right: var(--gutter);
  bottom: 39px;
  margin: 0;
  color: #1c3038b8;
  font-size: 8px;
  letter-spacing: .15em;
}

@keyframes line-pulse {
  0% { transform: scaleX(.55); opacity: .55; }
  to { transform: scaleX(1); opacity: 1; }
}

/* ==========================================================
   Content sections
   ========================================================== */

.games,
.team {
  position: relative;
  z-index: 3;
  padding: clamp(96px, 12vw, 168px) var(--gutter);
  background: var(--paper);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  align-items: end;
  gap: 32px 64px;
  margin-bottom: clamp(48px, 6vw, 88px);
}
.section-head h2 {
  margin: 0;
  font-size: clamp(46px, 5.2vw, 76px);
  line-height: 1.02;
}
.section-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}

/* ---------- Games ---------- */

.game-feature {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  margin-bottom: clamp(64px, 8vw, 112px);
}
.game-feature__art {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
}
.game-feature h3 {
  margin-bottom: 16px;
  font-size: clamp(38px, 3.8vw, 56px);
  line-height: 1;
}
.game-feature__body > p:not(.game-status) {
  max-width: 420px;
  margin-bottom: 26px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}

.game-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.game-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.game-status--live { color: var(--rust); }
.game-status--live::before { background: currentColor; }

.game-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  color: var(--ink);
  font-size: 13px;
}
.game-specs li { display: inline-flex; align-items: center; gap: 7px; }
.game-specs svg { width: 17px; height: 17px; color: var(--lake); flex: none; }

.game-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }

.game-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 200px;
  align-items: center;
  gap: 24px clamp(32px, 5vw, 72px);
  padding: 32px 0;
  border-bottom: 1px solid var(--rule);
}
.game-row h3 { margin-bottom: 8px; font-size: clamp(30px, 2.8vw, 40px); line-height: 1.05; }
.game-row__main p:not(.game-status) {
  max-width: 460px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}
.game-row .game-specs { flex-direction: column; gap: 8px; margin: 0; }
.game-row__art {
  display: block;
  width: 200px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
}

/* ---------- Team ---------- */

.team { background: var(--paper); }

.team-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px clamp(28px, 4vw, 64px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.person__portrait {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  margin-bottom: 24px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--mist);
}
.person__portrait svg { width: 38%; height: 38%; }
.person__portrait img { width: 100%; height: 100%; object-fit: cover; }
.person__portrait--rust { color: var(--rust); background: #ecdcd2; }
.person__portrait--lake { color: var(--lake); background: #d7e5e8; }
.person__portrait--moss { color: var(--moss); background: #e1e5d3; }

.person h3 { margin-bottom: 6px; font-size: 30px; line-height: 1.1; }
.person__role { margin-bottom: 14px; color: var(--rust); font-size: 13px; font-weight: 500; }
.person p:last-child { max-width: 340px; margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }

/* ---------- Playtest signup ---------- */

.playtest {
  position: relative;
  z-index: 3;
  padding: clamp(80px, 9vw, 128px) var(--gutter);
  background: var(--mist);
}
.playtest__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  align-items: end;
  gap: 40px 72px;
}
.playtest h2 {
  margin-bottom: 16px;
  font-size: clamp(40px, 4.4vw, 64px);
  line-height: 1.02;
}
.playtest p { max-width: 440px; margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.7; }

.signup { display: flex; flex-wrap: wrap; gap: 12px; }
.signup input {
  flex: 1 1 220px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid rgba(28, 48, 56, .28);
  border-radius: 999px;
  background: #f6f8f5;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
.signup input::placeholder { color: #7b8a8e; }
.signup button { min-height: 46px; cursor: pointer; font: inherit; font-size: 13px; }
.signup__message { flex-basis: 100%; min-height: 1.4em; font-size: 13px; }
.signup__message.is-error { color: var(--rust-dark); }

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 105px;
  padding: 25px var(--gutter);
  background: #eef1eb;
  color: var(--ink);
}
.site-footer p,
.site-footer a:last-child { margin: 0; font-size: 11px; }
.site-footer p { color: var(--muted); }

/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 900px) {
  .scene { min-height: 620px; }
  .hero-content, .chapter-content { width: min(470px, 52vw); }
  .chapter-content h2 { font-size: clamp(44px, 6vw, 64px); }

  .section-head,
  .game-feature,
  .playtest__inner { grid-template-columns: 1fr; }

  .game-row { grid-template-columns: minmax(0, 1fr) 160px; }
  .game-row .game-specs { grid-column: 1; grid-row: 2; flex-direction: row; }
  .game-row__art { grid-column: 2; grid-row: 1 / span 2; width: 160px; }

  .team-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  :root { --track-height: 200svh; --gutter: 24px; }

  .site-header { grid-template-columns: 1fr auto; padding: 21px 23px; }
  .site-header.is-scrolled { padding-top: 14px; padding-bottom: 14px; }
  .wordmark { font-size: 11px; letter-spacing: .2em; }
  .site-header nav { gap: 18px; margin-right: 0; font-size: 11px; }
  .header-cta { display: none; }

  .scene--hero, .scene--studio { height: 100svh; min-height: 100svh; }
  .hero-plane { object-position: 64% center; }
  .studio-plane { object-position: 62% center; }

  .hero-content,
  .chapter-content,
  .scene--studio .chapter-content {
    top: 17%;
    right: auto;
    left: 25px;
    width: min(330px, calc(100% - 50px));
  }
  /* Shorter drift on phones so the copy never slides under the header */
  .chapter-content { transform: translate3d(0, calc(8vh - var(--scroll-progress) * 12vh), 0); }
  .hero-content {
    left: 50%;
    width: min(350px, calc(100% - 42px));
    text-align: center;
  }
  h1 { font-size: clamp(52px, 13vw, 69px); line-height: 1.01; }
  .chapter-content h2 { max-width: 340px; font-size: clamp(45px, 11vw, 59px); }
  .eyebrow { margin-bottom: 14px; font-size: 9px; }
  .hero-description,
  .chapter-content > p:not(.eyebrow) { max-width: 320px; font-size: 13px; line-height: 1.58; }
  .scroll-cue { right: 24px; bottom: 28px; font-size: 8px; }
  .scene-caption { right: 24px; bottom: 27px; max-width: 140px; font-size: 7px; text-align: right; }

  .game-row { grid-template-columns: 1fr; }
  .game-row__art { grid-column: 1; grid-row: 1; width: 100%; }
  .game-row .game-specs { grid-row: auto; flex-wrap: wrap; }

  .team-list { grid-template-columns: 1fr; }
  .person__portrait { aspect-ratio: 16 / 11; }

  .site-footer { flex-wrap: wrap; min-height: 120px; padding: 23px 25px; }
  .site-footer p { width: 100%; order: 1; }
}

@media (prefers-reduced-motion: reduce) {
  /* No pinned scroll: the scenes sit still and the page scrolls normally */
  :root { --track-height: 100svh; }
  .chapter-content { transform: none; }
  html { scroll-behavior: auto; }
  .scroll-line { animation: none; }
  .header-cta, .button-link, .text-link { transition: none; }
}
