/*
 * QScore landing page.
 *
 * Tokens mirror the game's design system (src/theme): ink chrome, chalk type,
 * one brass accent, the logo's own gold, Oswald for display and Archivo for
 * body copy, and the kit's deliberately tight corner radii.
 */

@font-face { font-family: "Oswald"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/oswald-700.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/oswald-500.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/archivo-400.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/archivo-600.woff2") format("woff2"); }

:root {
  --ink-950: #0A0B0A;
  --ink-900: #0E100F;
  --ink-850: #131614;
  --ink-800: #191C1A;
  --chalk: #EDE9E1;
  --stone: #B4B1A9;
  --steel: #8B928D;
  --brass-400: #DFB65E;
  --brass-500: #C99A3E;
  --brass-600: #A67C2B;
  --on-brass: #1A1305;
  --brand-gold: #CA9731;
  --grass-900: #071A12;
  --grass-850: #0B2A1C;
  --border: rgba(237, 233, 225, 0.10);
  --border-strong: rgba(237, 233, 225, 0.22);

  --r-md: 6px;
  --r-lg: 10px;
  --r-xl: 14px;

  --display: "Oswald", "Arial Narrow", "Helvetica Neue", Impact, sans-serif;
  --body: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: 20px;
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--ink-950);
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  background: var(--ink-950);
  color: var(--chalk);
  font: 400 16px/1.5 var(--body);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--chalk);
  outline-offset: 3px;
  border-radius: var(--r-md);
}

.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 50;
  padding: 12px 16px; border-radius: var(--r-md);
  background: var(--chalk); color: var(--ink-950); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: calc(12px + var(--safe-t)); }

/* ───────────── Hero ───────────── */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(20px + var(--safe-t)) calc(var(--gutter) + var(--safe-r)) 12px calc(var(--gutter) + var(--safe-l));
  /* The game's own home screen: a terrace photograph under a near-black scrim. */
  background:
    linear-gradient(180deg, rgba(10, 11, 10, 0.86) 0%, rgba(10, 11, 10, 0.80) 38%, rgba(10, 11, 10, 0.93) 72%, var(--ink-950) 100%),
    url("img/hero-fans.webp") 50% 22% / cover no-repeat,
    var(--ink-950);
  isolation: isolate;
}

.hero__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(18px, 3.4svh, 36px);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.hero__brand { text-align: center; }

.hero__logo { line-height: 0; }
.hero__logo img {
  width: min(68vw, 300px, 34svh);
  margin: 0 auto;
}

.hero__tagline {
  margin-top: clamp(6px, 1.2svh, 12px);
  color: var(--brass-400);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.06em;
}

.hero__headline {
  margin-top: clamp(12px, 2.6svh, 26px);
  font: 700 clamp(28px, 8.4vw, 44px)/1.04 var(--display);
  letter-spacing: 0.015em;
  text-transform: uppercase;
  text-wrap: balance;
}

.hero__actions { display: grid; gap: 12px; }

.hero__more {
  align-self: center;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px; margin-top: 4px;
  color: var(--stone); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
}

/* ───────────── Buttons ───────────── */

.btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%;
  min-height: 64px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  text-decoration: none; text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color .15s ease, transform .08s ease;
}
.btn--primary {
  background: var(--brass-500);
  color: var(--on-brass);
  box-shadow: 0 10px 30px rgba(201, 154, 62, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn--primary:hover { background: var(--brass-400); }
.btn--primary:active { background: var(--brass-600); transform: translateY(1px); }
.btn__label { font: 700 22px/1.1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.btn__sub { margin-top: 3px; font-size: 13px; font-weight: 600; opacity: 0.86; }
.btn--compact { width: auto; min-height: 48px; padding: 8px 22px; }
.btn--compact .btn__label { font-size: 17px; }

/* The pre-launch stand-in for the Download button. Deliberately NOT button-like:
   outlined, no fill, no shadow, no pointer — it reads as a notice. */
.soon {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%;
  min-height: 64px;
  padding: 10px 20px;
  border: 1px solid var(--brass-600);
  border-radius: var(--r-md);
  background: rgba(201, 154, 62, 0.10);
  color: var(--brass-400);
  text-align: center;
}
.soon__label { font: 700 22px/1.1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; }
.soon__sub { margin-top: 3px; color: var(--stone); font-size: 13px; font-weight: 600; }

/*
 * Availability. The safe state is the default: "Coming soon" shows and every
 * Download button is hidden. They swap only when a store link really has an
 * href — detected by :has() with no JavaScript, and by download.js (which
 * adds .has-store to <html>) for browsers without :has(). Kept as separate
 * rules on purpose: an unsupported selector must not void its neighbour.
 */
.js-download { display: none; }
:root.has-store .js-download { display: flex; }
:root.has-store .soon { display: none; }
body:has(#stores a.store[href]) .js-download { display: flex; }
body:has(#stores a.store[href]) .soon { display: none; }
/* download.js found the hrefs unusable (not a real store URL): stay "coming soon". */
:root.no-store .js-download { display: none; }
:root.no-store .soon { display: flex; }

.stores {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  scroll-margin-top: 45vh;
  border-radius: var(--r-lg);
}
.stores:focus { outline: none; }

/*
 * A store link has two states, chosen by whether it has an href:
 *   no href → "Coming soon to …": a quiet, dashed, non-clickable panel
 *   href    → live: the official store badge, and the whole cell is the link
 */
.store {
  display: flex; align-items: center; justify-content: center;
  min-height: 60px;
  padding: 8px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: rgba(10, 11, 10, 0.55);
  color: var(--stone);
  text-decoration: none;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}
.store__soon { display: flex; flex-direction: column; text-align: center; line-height: 1.15; min-width: 0; }
.store__soon small { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass-400); white-space: nowrap; }
.store__soon strong { margin-top: 2px; font: 600 clamp(15px, 4.4vw, 18px)/1.15 var(--body); color: var(--chalk); white-space: nowrap; }
.store__badge { display: none; width: auto; max-width: 100%; height: clamp(40px, 12.4vw, 52px); }

a.store[href] {
  padding: 4px 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .08s ease, opacity .15s ease;
}
a.store[href] .store__soon { display: none; }
a.store[href] .store__badge { display: block; }
a.store[href]:hover { opacity: 0.88; }
a.store[href]:active { transform: translateY(1px); }

/* Very narrow phones: stack the two stores rather than squeeze them. */
@media (max-width: 339px) {
  .stores { grid-template-columns: 1fr; }
  .store { min-height: 56px; }
  .store__badge { height: 46px; }
}

/* Set by download.js when it cannot tell which store the visitor needs. */
.stores.is-highlighted a.store[href] { animation: store-pulse 1.1s ease-out 2; border-radius: 8px; }
.stores.is-highlighted .store:not([href]) { border-color: var(--brass-400); }
@keyframes store-pulse {
  0% { box-shadow: 0 0 0 0 rgba(223, 182, 94, 0.65); }
  100% { box-shadow: 0 0 0 14px rgba(223, 182, 94, 0); }
}
.stores__hint { min-height: 0; color: var(--brass-400); font-size: 14px; font-weight: 600; text-align: center; }
.stores__hint:empty { display: none; }

/* ───────────── Sections ───────────── */

.section {
  padding: 56px calc(var(--gutter) + var(--safe-r)) 56px calc(var(--gutter) + var(--safe-l));
  text-align: center;
}
.eyebrow {
  color: var(--brass-400);
  font: 500 14px/1 var(--display);
  letter-spacing: 0.2em; text-transform: uppercase;
}
.section__title {
  margin: 12px auto 0;
  max-width: 16ch;
  font: 700 clamp(28px, 7.6vw, 40px)/1.06 var(--display);
  letter-spacing: 0.015em; text-transform: uppercase; text-wrap: balance;
}

/* The pitch: the game's dark striped grass. */
#how {
  background:
    repeating-linear-gradient(180deg, var(--grass-900) 0 84px, var(--grass-850) 84px 168px);
  border-block: 1px solid var(--border);
  padding-inline: 0;
}
#how .eyebrow, #how .section__title { padding-inline: var(--gutter); }

.gallery {
  display: flex;
  gap: 16px;
  margin-top: 28px;
  padding: 4px max(calc(var(--gutter) + var(--safe-l)), calc(50% - 480px)) 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery:focus-visible { outline-offset: -3px; }

.shot {
  flex: 0 0 min(64vw, 250px);
  scroll-snap-align: center;
  text-align: left;
}
.phone {
  padding: 7px;
  border: 1px solid var(--border-strong);
  border-radius: 30px;
  background: #050605;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.phone img {
  width: 100%;
  aspect-ratio: 786 / 1704;
  object-fit: cover;
  border-radius: 23px;
  background: var(--ink-850);
}
.shot figcaption { margin-top: 14px; padding-inline: 4px; color: var(--stone); font-size: 14px; line-height: 1.45; }
.shot figcaption strong {
  display: block; margin-bottom: 2px;
  color: var(--chalk);
  font: 700 17px/1.2 var(--display); letter-spacing: 0.05em; text-transform: uppercase;
}

.modes { display: grid; gap: 12px; max-width: 480px; margin: 28px auto 0; text-align: left; }
.mode {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brass-500);
  border-radius: var(--r-lg);
  background: var(--ink-850);
}
.mode h3 { font: 700 20px/1.2 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.mode p { margin-top: 4px; color: var(--stone); font-size: 15px; }

.cta { padding-top: 24px; }
.cta__logo { width: 150px; margin: 0 auto 20px; }
.cta .btn, .cta .soon, .cta .stores { max-width: 480px; margin-inline: auto; }
.cta .btn, .cta .soon { margin-top: 24px; }
.stores[hidden] { display: none; }
.cta .stores { margin-top: 12px; }

.footer {
  padding: 28px calc(var(--gutter) + var(--safe-r)) calc(28px + var(--safe-b)) calc(var(--gutter) + var(--safe-l));
  border-top: 1px solid var(--border);
  color: var(--steel);
  font-size: 13px; text-align: center;
}
.footer a { color: var(--stone); display: inline-block; padding: 12px 8px; }
.footer__legal { max-width: 60ch; margin: 10px auto 0; font-size: 11px; line-height: 1.5; }
/* Room for the sticky bar so it never covers the last line of the footer. */
.has-sticky .footer { padding-bottom: calc(96px + var(--safe-b)); }

/* ───────────── Sticky download bar ───────────── */

.sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px calc(16px + var(--safe-r)) calc(10px + var(--safe-b)) calc(16px + var(--safe-l));
  border-top: 1px solid var(--border-strong);
  background: rgba(14, 16, 15, 0.94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transform: translateY(110%);
  visibility: hidden;
  transition: transform .25s ease, visibility 0s linear .25s;
}
.sticky[hidden] { display: none; }
.sticky.is-visible { transform: none; visibility: visible; transition: transform .25s ease; }
.sticky__logo { width: 92px; }

/* ───────────── Landscape phones: two columns so the buttons stay above the fold ───────────── */

@media (orientation: landscape) and (max-height: 540px) {
  .hero { padding-top: calc(10px + var(--safe-t)); padding-bottom: 8px; }
  .hero__inner {
    flex-direction: row; align-items: center; gap: 28px;
    max-width: 860px;
  }
  .hero__brand { flex: 0.85 1 0; min-width: 0; }
  .hero__actions { flex: 1 1 0; min-width: 0; }
  .hero__logo img { width: min(190px, 40svh); }
  .hero__tagline { font-size: 13px; margin-top: 4px; }
  .hero__headline { font-size: clamp(20px, 7.4svh, 30px); margin-top: 8px; }
  .hero__actions { gap: 10px; }
  .btn { min-height: 56px; }
  .store { min-height: 54px; padding-inline: 6px; }
  .store__soon strong { font-size: 15px; }
  .store__badge { height: 42px; }
  .soon { min-height: 56px; }
  .hero__more { display: none; }
  .stores { scroll-margin-top: 30vh; }
  .section { padding-block: 40px; }
  .shot { flex-basis: min(30vw, 210px); }
  .sticky { padding-top: 6px; padding-bottom: calc(6px + var(--safe-b)); }
  .btn--compact { min-height: 44px; }
}

/* ───────────── Tablets (iPad): same single column, a little more air ───────────── */

@media (min-width: 700px) and (min-height: 541px) {
  .hero__inner { max-width: 560px; }
  .hero__logo img { width: min(380px, 30svh); }
  .hero__headline { font-size: 52px; }
  .btn { min-height: 72px; }
  .btn__label { font-size: 25px; }
  .store { min-height: 68px; }
  .store__soon small { font-size: 12px; }
  .store__soon strong { font-size: 20px; }
  .store__badge { height: 58px; }
  .soon { min-height: 72px; }
  .soon__label { font-size: 25px; }
  .shot { flex-basis: 260px; }
  .modes { grid-template-columns: 1fr 1fr; max-width: 720px; }
  .section { padding-block: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
