/* GameRange design system.
   One light look, deliberately: no prefers-color-scheme variant, and
   color-scheme: light so browser chrome follows. The game's own interface is
   dark neon, so every screenshot is framed as an object on quiet ground
   rather than bled across the page. */

:root {
  --paper: #eeefec;
  --card: #ffffff;
  --ink: #16181c;
  --muted: #6c7178;
  --line: #dcded9;
  --wash: rgba(22, 24, 28, 0.04);
  --accent: #1f42cc;
  /* the aubergine the wordmark was actually drawn on, sampled from the
     original artwork — the pairing the logo was designed as */
  --masthead: #3a0a3e;
  /* the peach of "Range", sampled from the wordmark, so the bar is one palette */
  --masthead-ink: #fbd5bc;

  color-scheme: light;

  --display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --page: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 94px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--body);
  font-synthesis-weight: none;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip { position: absolute; left: -9999px; }

.skip:focus {
  left: var(--gutter);
  top: 8px;
  z-index: 10;
  background: var(--card);
  padding: 8px 14px;
  border: 1px solid var(--ink);
}

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--masthead);  /* fallback for browsers without color-mix */
  background: color-mix(in srgb, var(--masthead) 92%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.masthead-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 76px;
  display: flex;
  align-items: center;
  gap: 28px;
}

/* The wordmark keeps its drawn colours; the dark bar is the ground it needs. */
.wordmark {
  margin-right: auto;
  flex-shrink: 0;        /* flex would squeeze the wordmark out of proportion */
  display: flex;
  align-items: center;
  line-height: 0;
}

.wordmark img {
  height: 40px;
  width: auto;
  max-width: none;       /* overrides the global img rule, which also squeezes */
}

.masthead-nav {
  display: flex;
  gap: 22px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.masthead-nav a {
  text-decoration: none;
  color: var(--masthead-ink);
  padding: 4px 0;
  white-space: nowrap;
}

.masthead-nav a:hover {
  color: #fff;
  box-shadow: inset 0 -1px 0 #fff;
}

/* the language switch is a control, not another nav destination */
.masthead-nav .lang {
  border: 1px solid color-mix(in srgb, var(--masthead-ink) 40%, transparent);
  padding: 4px 9px;
  margin-left: 4px;
  color: var(--masthead-ink);
}

.masthead-nav .lang:hover {
  border-color: var(--masthead-ink);
  background: color-mix(in srgb, var(--masthead-ink) 12%, transparent);
  box-shadow: none;
}

/* ---------- shared type ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

.display {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 0.97;
  letter-spacing: -0.035em;
  margin: 0;
}

.lede {
  max-width: 46ch;
  font-size: 1.06rem;
  color: var(--muted);
  margin: 20px 0 0;
}

.meta {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 30px;
}

.section-head h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  letter-spacing: -0.025em;
  margin: 0;
}

.prose { max-width: 62ch; font-size: 1.02rem; }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }
.prose a { text-underline-offset: 3px; }

.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); max-width: 64ch; }

.block { margin-top: clamp(48px, 6vw, 80px); }
.pad-bottom { padding-bottom: clamp(56px, 7vw, 96px); }

/* The frame: these screenshots are dark neon, so they need separating from the
   light page. A shadow does that without drawing a line around the picture.
   It is weighted downwards, not even on all four sides: the hero clip opens
   with the near-white titlebar of a macOS window and ends on the game's almost
   black board, so an even shadow reads strongly along the top and disappears
   into the picture's own bottom edge. isolation forces a stacking context:
   without one Safari has a habit of painting video past its own border-radius
   while it plays. */
.frame {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(22, 24, 28, 0.12),
    0 1px 3px rgba(22, 24, 28, 0.30),
    0 4px 10px rgba(22, 24, 28, 0.42);
}

.frame img,
.frame video { width: 100%; height: auto; display: block; }

/* ---------- hero ---------- */

.hero {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(36px, 5vw, 72px) var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.hero-icon {
  width: clamp(64px, 7vw, 88px);
  height: auto;
  border-radius: 22%;
  margin-bottom: 22px;
}

.hero-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 4.6vw, 3.9rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
  margin: 0;
}

.hero-title span {
  display: block;
  color: var(--accent);
}

.hero-tagline {
  margin: 20px 0 0;
  max-width: 38ch;
  font-size: 1.06rem;
  color: var(--muted);
}

/* four facts in two fixed columns: auto-fit would leave an orphan cell that
   shows the lattice background through */
.facts {
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.facts div {
  background: var(--card);
  padding: 12px 14px;
}

.facts dt {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd {
  margin: 4px 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.hero-status {
  margin: 24px 0 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}

/* ---------- how to play ---------- */

/* Column counts divide the item count exactly at every breakpoint. auto-fit
   would strand a card and show the lattice background through the gap. */
.rules {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.rule {
  background: var(--card);
  padding: 24px 26px 28px;
}

.rule h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.rule p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- scoring ---------- */

.scoring-band {
  margin-top: clamp(48px, 6vw, 80px);
  background: var(--card);
  border-block: 1px solid var(--line);
}

.scoring-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(40px, 5vw, 64px) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.scoring-note {
  margin: 0;
  max-width: 40ch;
  color: var(--muted);
}

.scoring {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.scoring th,
.scoring td {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
  text-align: left;
}

.scoring th { color: var(--muted); width: 8ch; }

.scoring td { position: relative; padding-left: 14px; }

/* the bar makes the acceleration visible: nine balls pay four times five */
.scoring .bar {
  display: inline-block;
  height: 10px;
  background: var(--accent);
  vertical-align: 1px;
  margin-right: 12px;
  min-width: 2px;
}

/* ---------- screenshots ---------- */

/* Same treatment as .frame: the gallery used to be a hairline lattice, which
   read as a different kind of object from the hero on the same page. */
.shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2vw, 24px);
}

.shot {
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
  cursor: zoom-in;
  display: block;
  box-shadow:
    0 0 0 1px rgba(22, 24, 28, 0.12),
    0 1px 3px rgba(22, 24, 28, 0.30),
    0 4px 10px rgba(22, 24, 28, 0.42);
}

.shot img { width: 100%; height: auto; }

.shot:hover img { opacity: 0.88; }

.lightbox {
  border: 0;
  padding: 0;
  background: none;
  max-width: 92vw;
  max-height: 92vh;
}

.lightbox::backdrop { background: rgba(10, 11, 13, 0.86); }

.lightbox img { max-height: 88vh; width: auto; cursor: zoom-out; }

/* ---------- controls, platforms ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.rows { margin: 0; }

.rows div {
  display: grid;
  grid-template-columns: minmax(140px, 0.35fr) minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.rows dt {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
}

.rows dd { margin: 0; color: var(--muted); }

.phone-frame { max-width: 260px; margin-inline: auto; }

.fineprint {
  margin-top: 22px;
  font-size: 0.86rem;
  color: var(--muted);
  max-width: 60ch;
}

/* ---------- text pages ---------- */

.page-head { padding-block: clamp(40px, 7vw, 84px) 0; }

/* Правовые страницы читают подряд, поэтому они идут одной колонкой. Ширину
   ограничивают сами блоки: у секции она задана .wrap, и её нельзя сужать —
   иначе поля от margin: auto уводят колонку к середине. */
.stack {
  display: grid;
  gap: clamp(22px, 3vw, 34px);
  padding-block: 40px 80px;
}

.stack > * { max-width: 62ch; }

.stamp { font-size: 0.92rem; opacity: 0.7; }

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(24px, 4vw, 56px);
  padding-block: 40px 80px;
}

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

.colophon {
  border-top: 1px solid var(--line);
  padding: 34px 0 56px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.colophon-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  align-items: baseline;
}

.colophon a { text-decoration: none; }
.colophon a:hover { color: var(--ink); }
.colophon p { margin: 0 0 0 auto; }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .rules { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .scoring-inner { grid-template-columns: 1fr; gap: 24px; }
  .split { grid-template-columns: 1fr; }
  .phone-frame { max-width: 220px; }
  .colophon p { margin-left: 0; }
}

@media (max-width: 620px) {
  .masthead-inner { gap: 14px; }
  .masthead-nav { gap: 13px; font-size: 0.68rem; }
  .wordmark img { height: 30px; }
  /* the wordmark needs the width, and both anchors are in the footer anyway */
  .masthead-nav .jump { display: none; }
  .rows div { grid-template-columns: 1fr; gap: 4px; }
  .rules { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
