/* Stonebridge Games landing. Mobile first.
   Tokens: navy base, night for the sign-up band, cream text,
   gate blue and gate red from the game, yellow for the one call to action. */

/* "SB Display" is a web subset of Lilita One (SIL OFL 1.1, see /assets/LilitaOne-OFL.txt).
   The licence reserves the name "Lilita" for unmodified copies, so the subset has its own name. */
@font-face {
  font-family: "SB Display";
  src: url("/assets/sb-display.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #14203F;
  --night: #0D1630;
  --cream: #F8F4E8;
  --cream-soft: #D9D6CF;
  --blue: #54B0FF;
  --blue-edge: #A9DBFF;
  --yellow: #FFD233;
  --yellow-edge: #C79A00;
  --red: #FF5A6E;
  --red-text: #FF8A98;

  --display: "SB Display", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --pad: 20px;
  --measure: 34rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--navy);
  color: var(--cream);
  font: 400 1.0625rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}

img, video, svg { display: block; max-width: 100%; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: var(--blue-edge); }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

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

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

.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 5;
  padding: 14px var(--pad);
  background: linear-gradient(rgba(13, 22, 48, 0.72), rgba(13, 22, 48, 0));
}
.site-header { pointer-events: none; } /* lets taps reach the video button under it */
.site-header .brand { display: inline-block; pointer-events: auto; }
.site-header .brand img { width: 148px; height: auto; }

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

.hero { position: relative; }

.hero-media { position: relative; }

.phone {
  position: relative;
  height: min(56svh, 560px);
  min-height: 300px;
  overflow: hidden;
  background: var(--night);
}

.loop {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
}

/* Fade the bottom of the video into the page so the headline can sit on it. */
.phone::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 38%;
  background: linear-gradient(rgba(20, 32, 63, 0), var(--navy) 92%);
  pointer-events: none;
}

.video-toggle {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(13, 22, 48, 0.62);
  color: var(--cream);
  cursor: pointer;
}
.video-toggle svg { width: 16px; height: 16px; }
.video-toggle .icon-play { display: none; }
.video-toggle[data-state="paused"] .icon-play { display: block; }
.video-toggle[data-state="paused"] .icon-pause { display: none; }

.hero-copy {
  position: relative;
  z-index: 1;
  margin-top: -76px;
  padding: 0 var(--pad) 40px;
}

.badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 10px 3px;
  border-radius: 8px;
  background: var(--blue);
  color: var(--night);
  font: 400 0.9375rem/1.2 var(--display);
  letter-spacing: 0.04em;
}

h1 {
  margin: 0;
  max-width: 13ch;
  font: 400 clamp(2.25rem, 9.6vw, 3.25rem)/1.02 var(--display);
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.lede {
  margin: 14px 0 22px;
  max-width: var(--measure);
  color: var(--cream-soft);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 12px 28px 10px;
  border: 0;
  border-radius: 14px;
  font: 400 1.3125rem/1 var(--display);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-cta {
  width: 100%;
  max-width: 420px;
  background: var(--yellow);
  color: var(--night);
  box-shadow: 0 5px 0 var(--yellow-edge);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}
.btn-cta:hover { color: var(--night); background: #FFDA52; }
.btn-cta:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--yellow-edge); }
.btn-cta[aria-busy="true"] { opacity: 0.7; cursor: progress; }
@media (prefers-reduced-motion: reduce) { .btn-cta { transition: none; } }

/* ---------- Features: the game's gate panels ---------- */

.features {
  padding: 8px var(--pad) 48px;
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 30px;
}

.feature {
  display: grid;
  grid-template-columns: 128px 1fr;
  column-gap: 18px;
  align-items: start;
}

.feature h3 {
  margin: 2px 0 6px;
  font: 400 1.375rem/1.1 var(--display);
}
.feature p { margin: 0; color: var(--cream-soft); font-size: 1rem; }

.feature-art {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  grid-row: span 2;
}

.gate {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  height: 64px;
  padding: 4px 10px 0;
  border: 3px solid var(--blue-edge);
  border-radius: 6px;
  background: linear-gradient(rgba(84, 176, 255, 0.42), rgba(84, 176, 255, 0.16));
  box-shadow:
    0 0 0 1px rgba(84, 176, 255, 0.7),
    0 0 20px rgba(84, 176, 255, 0.55),
    inset 0 0 16px rgba(84, 176, 255, 0.5);
  color: #fff;
  font: 400 1.75rem/1 var(--display);
  text-shadow: 0 2px 0 rgba(13, 22, 48, 0.55);
}
.gate-wide { min-width: 108px; height: 76px; font-size: 2.25rem; }
.gate-bad {
  border-color: #FFB3BC;
  background: linear-gradient(rgba(255, 90, 110, 0.5), rgba(255, 90, 110, 0.2));
  box-shadow:
    0 0 0 1px rgba(255, 90, 110, 0.75),
    0 0 20px rgba(255, 90, 110, 0.55),
    inset 0 0 16px rgba(255, 90, 110, 0.5);
}

.boss-hp { width: 116px; text-align: center; }
.boss-hp-value {
  display: block;
  color: #FF4E4E;
  font: 400 1.75rem/1 var(--display);
  -webkit-text-stroke: 1.5px var(--night);
  paint-order: stroke fill;
}
.boss-hp-bar {
  display: block;
  height: 10px;
  margin-top: 6px;
  border: 2px solid var(--night);
  border-radius: 3px;
  background: linear-gradient(90deg, #E8243A 0 64%, rgba(255, 255, 255, 0.18) 64%);
}

/* ---------- Sign-up ---------- */

.signup {
  padding: 44px var(--pad) 56px;
  background: var(--night);
  scroll-margin-top: 0;
}

.signup-inner { max-width: 30rem; }

.status {
  margin: 0 0 24px;
  font-size: 1.1875rem;
  line-height: 1.45;
}

.field { margin-bottom: 18px; }

.field-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.input {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--cream);
  color: var(--night);
  font: 400 1.125rem/1.2 var(--body);
}
.input::placeholder { color: #6F6C66; }
.input:focus-visible { outline-offset: 2px; }
.input[aria-invalid="true"] { border-color: var(--red); }

.check {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  cursor: pointer;
}
.check input {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  margin: 0;
  border: 2px solid var(--cream);
  border-radius: 7px;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.check input::after {
  content: "";
  width: 8px;
  height: 14px;
  margin-top: -3px;
  border: solid var(--night);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) scale(0);
}
.check input:checked { background: var(--yellow); border-color: var(--yellow); }
.check input:checked::after { transform: rotate(45deg) scale(1); }
.check input[aria-invalid="true"] { border-color: var(--red); }
.check span { font-size: 1rem; }

.field-error, .form-error {
  margin: 8px 0 0;
  color: var(--red-text);
  font-size: 0.9375rem;
  font-weight: 600;
}
.form-error { margin: 14px 0 0; }

.signup .btn-cta { margin-top: 8px; }

.fineprint {
  margin: 16px 0 0;
  color: var(--cream-soft);
  font-size: 0.9375rem;
}

/* Bots fill every field; people never see this one. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.success {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  outline: none;
}
.success[hidden] { display: none; }
.success p { margin: 0; font-size: 1.1875rem; line-height: 1.4; }

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

.site-footer {
  padding: 24px var(--pad) 32px;
  background: var(--night);
  border-top: 1px solid rgba(248, 244, 232, 0.12);
  color: var(--cream-soft);
  font-size: 0.875rem;
}
.site-footer p { margin: 0; line-height: 2; }
.site-footer .item { white-space: nowrap; }
.site-footer a, .link-button { color: var(--cream-soft); }
.link-button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.link-button:hover, .site-footer a:hover { color: var(--cream); }
.sep { padding: 0 0.1em; }

/* ---------- Cookie banner ---------- */

.consent {
  position: fixed;
  z-index: 50;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px var(--pad) calc(16px + env(safe-area-inset-bottom));
  background: var(--cream);
  color: var(--night);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.35);
}
.consent[hidden] { display: none; }
.consent p { margin: 0 0 12px; font-size: 0.9375rem; line-height: 1.45; }
.consent a { color: #1B5FA8; font-weight: 600; }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.consent-actions button {
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--navy);
  color: var(--cream);
  font: 600 1rem/1 var(--body);
  cursor: pointer;
}
.consent-actions button:hover { background: #22325C; }

/* ---------- Privacy page and other text pages ---------- */

.page-header {
  padding: 16px var(--pad);
  background: var(--night);
}
.page-header img { width: 148px; height: auto; }

.prose {
  max-width: 44rem;
  padding: 32px var(--pad) 56px;
}
.prose h1 { max-width: none; font-size: clamp(2rem, 7vw, 2.75rem); }
.prose h2 { margin: 2em 0 0.4em; font: 400 1.375rem/1.2 var(--display); }
.prose p, .prose li { color: var(--cream-soft); }
.prose strong { color: var(--cream); }
.prose a { overflow-wrap: anywhere; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 0.3em 0; }
.prose .updated { margin-top: 8px; }
.table-wrap { overflow-x: auto; margin: 0.8em 0; }
.prose table { border-collapse: collapse; min-width: 34rem; font-size: 0.9375rem; }
.prose th, .prose td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(248, 244, 232, 0.16);
  text-align: left;
  vertical-align: top;
}
.prose th { color: var(--cream); font-weight: 600; }
.prose td { color: var(--cream-soft); }
.prose [id] { scroll-margin-top: 16px; }

/* Text Tare still has to fill in before going live. */
mark.todo { background: var(--yellow); color: var(--night); padding: 0 4px; border-radius: 3px; }

/* ---------- Wider screens ---------- */

@media (min-width: 600px) {
  :root { --pad: 32px; }
  .phone { height: min(60svh, 620px); }
  .site-header .brand img, .page-header img { width: 172px; }
  .feature-list { max-width: 40rem; }
}

@media (min-width: 960px) {
  :root { --pad: 48px; }
  body { font-size: 1.125rem; }

  .site-header {
    position: static;
    background: none;
    padding: 26px var(--pad) 0;
    max-width: 1200px;
    margin: 0 auto;
  }
  .site-header .brand img { width: 196px; }

  .hero {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "copy media";
    align-items: center;
    gap: 64px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px var(--pad) 72px;
  }
  .hero-copy { grid-area: copy; margin: 0; padding: 0; }
  .hero-media { grid-area: media; }

  .phone {
    width: min(360px, 34vw);
    height: auto;
    min-height: 0;
    aspect-ratio: 9 / 16;
    border: 10px solid #0A1126;
    border-radius: 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(248, 244, 232, 0.08);
  }
  .phone::after { display: none; }
  .loop { object-position: 50% 50%; }

  h1 { max-width: 12ch; font-size: clamp(3.5rem, 5.6vw, 4.75rem); }
  .badge { font-size: 1rem; }
  .lede { margin: 20px 0 30px; font-size: 1.25rem; }
  .btn-cta { width: auto; min-width: 280px; }

  .features { max-width: 1200px; margin: 0 auto; padding: 24px var(--pad) 88px; }
  .feature-list { max-width: none; grid-template-columns: repeat(3, 1fr); gap: 48px; }
  .feature { grid-template-columns: 1fr; }
  .feature-art { justify-content: flex-start; height: 104px; margin-bottom: 14px; grid-row: auto; }
  .feature h3 { font-size: 1.625rem; }
  .feature p { font-size: 1.0625rem; max-width: 22rem; }

  .signup { padding: 80px var(--pad) 96px; }
  .signup-inner {
    max-width: calc(1200px - 2 * var(--pad));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr minmax(0, 30rem);
    gap: 64px;
    align-items: start;
  }
  .status { margin: 0; max-width: 24ch; font: 400 2rem/1.15 var(--display); }
  .signup .btn-cta { width: 100%; max-width: none; }

  .site-footer { padding: 28px var(--pad) 36px; }
  .site-footer p { max-width: calc(1200px - 2 * var(--pad)); margin: 0 auto; }

  .consent {
    left: auto;
    right: 24px;
    bottom: 24px;
    max-width: 440px;
    border-radius: 16px;
    padding: 20px;
  }

  .page-header { padding: 22px calc((100% - 44rem) / 2 + var(--pad)); }
  .prose { margin: 0 auto; padding-top: 48px; }
}
