/* BYTE — byte.gorged.io
 *
 * One stylesheet for the whole site, structurally carried over from GORGE's own
 * (../getgorged/web/style.css, same publisher) — the constraints that shaped it apply
 * here unchanged:
 *
 *   * **No JavaScript, anywhere.** A marketing/legal page has no reason to run script,
 *     and keeping these pages script-free means the CSP the game itself needs
 *     (`script-src 'self' 'wasm-unsafe-eval'`, no `'unsafe-inline'`) never has to be
 *     loosened just to serve this site from the same origin.
 *
 *   * **No external assets.** System fonts, no hosted webfonts, nothing that phones
 *     home to a third party — which is also what lets the privacy page say, truthfully,
 *     that these pages load nothing but themselves.
 *
 *   * **Dark only.** BYTE's own palette (see web/index.html's PALETTES.dark) is a dark
 *     ground with a bright cyan accent — arenaStroke, #22e0ea — chosen there because it
 *     reads against every terrain the game draws. That is the palette this site wears
 *     too, rather than inventing a second brand for the marketing pages.
 */

/* ── Reset ──────────────────────────────────────────────────────────────────── */

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

* {
  margin: 0;
}

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

/* ── Tokens ─────────────────────────────────────────────────────────────────── */

:root {
  /* Ground — the exact PALETTES.dark.bg from the game itself (web/index.html), so the
     site and the arena you land in from its Play button are one continuous look. */
  --bg: #10141d;
  --bg-raised: #171c28;
  --bg-sunk: #0a0d13;

  --line: #262e40;
  --line-soft: #1a2029;

  --ink: #e6edf3;
  --ink-dim: #8d97a8;
  --ink-faint: #5c6577;

  /* The game's own arenaStroke cyan is the primary here — chosen there to contrast with
     every terrain the game draws, which makes it the one colour honestly common to every
     world the Play button leads to. Malachite/ember keep their GORGE-established
     semantic roles (safe/lethal contrast) rather than being reinvented. */
  --accent: #22e0ea;
  --accent-dim: #12777d;
  --malachite: #57b795;
  --ember: #d9573f;

  --radius: 3px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --measure: 34rem;
  --wide: 60rem;
}

/* ── Base ───────────────────────────────────────────────────────────────────── */

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  /* The legal pages carry long unbreakable tokens (an email address, a URL) — breaking
     mid-token is ugly exactly once; a horizontal scrollbar on a phone is ugly always. */
  overflow-wrap: break-word;
  font-size: 17px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(
      ellipse 80% 50% at 50% -10%,
      rgba(34, 224, 234, 0.07),
      transparent 70%
    ),
    linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.4));
  background-attachment: fixed;
}

/* The landing page only (index.html) — the logo repeated down the page, already baked
   to 50% alpha in assets/logo-tile.png rather than layered via opacity, since a
   background-image has no opacity property of its own and a separate element would have
   to be sized and stacked under every section by hand. Laid UNDER the ambient gradients
   above (same background-image list, first layer painted furthest back), and left off
   `fixed` so it repeats down the page as it scrolls rather than staying pinned to the
   viewport — "repeated as you scroll" is the tiling continuing past the fold, not the
   pattern sitting still while the page moves under it.

   `repeat-y`, not `repeat`: a single column down the vertical centre, not a full-width
   grid — the page keeps blank margin on both sides at any width wider than the tile
   itself, rather than the logo wallpapering edge to edge. */
body.landing {
  background-image:
    url("assets/logo-tile.png"),
    radial-gradient(
      ellipse 80% 50% at 50% -10%,
      rgba(34, 224, 234, 0.07),
      transparent 70%
    ),
    linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.4));
  background-repeat: repeat-y, no-repeat, no-repeat;
  background-position: top center, center, center;
  background-attachment: scroll, fixed, fixed;
}

a {
  color: var(--accent);
  text-decoration-color: rgba(34, 224, 234, 0.35);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--accent);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius);
}

::selection {
  background: rgba(34, 224, 234, 0.28);
  color: #fff;
}

/* ── Shell ──────────────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

main {
  flex: 1;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */

.site-head {
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 13, 19, 0.72);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 3.75rem;
  flex-wrap: wrap;
}

.mark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.28em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.mark:hover {
  color: var(--accent);
}

.mark::before {
  content: "";
  width: 3px;
  height: 1.15em;
  background: linear-gradient(180deg, var(--accent) 45%, var(--accent-dim) 45%);
  border-radius: 1px;
}

.site-nav {
  display: flex;
  gap: 1.35rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav a {
  color: var(--ink-dim);
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent-dim);
}

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

.hero {
  padding-block: clamp(3.5rem, 11vw, 7rem) clamp(2.5rem, 7vw, 4.5rem);
  text-align: center;
}

.wordmark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(3.2rem, 15vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: 0.14em;
  margin-inline-start: 0.14em;
  background: linear-gradient(175deg, #f0fdff 8%, var(--accent) 52%, #0f5c61 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  color: var(--ink-dim);
  max-width: 30rem;
  margin: 1.25rem auto 0;
  text-wrap: balance;
  /* The landing page's tiled background sits directly behind this text with nothing
     else between them — a bare `color` alone was unreadable against the tile's own
     bright sky/mountain detail. Layered rather than one heavy shadow: a tight dark ring
     keeps letterforms crisp at any point on the image, and the wider soft glow is what
     actually lifts the text off a busy background rather than just outlining it. */
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 0 14px rgba(0, 0, 0, 0.85),
    0 2px 6px rgba(0, 0, 0, 0.7);
}

.tagline strong {
  color: var(--ink);
  font-weight: 600;
}

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

.actions {
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--bg-raised);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06181a;
  font-weight: 600;
}

.btn-primary:hover {
  background: #5dedf4;
  border-color: #5dedf4;
  color: #06181a;
}

.btn-note {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin: 1rem auto 0;
  max-width: 32rem;
  letter-spacing: 0.04em;
  /* Same reasoning as .tagline's shadow, needed even more here — `--ink-faint` is
     dimmer than `--ink-dim` to begin with. */
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 0 14px rgba(0, 0, 0, 0.85),
    0 2px 6px rgba(0, 0, 0, 0.7);
}

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

.section {
  padding-block: clamp(2.5rem, 7vw, 4.5rem);
  border-top: 1px solid var(--line-soft);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 0.9rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
  font-weight: 650;
  scroll-margin-top: 5rem;
}

.page-title {
  font-size: clamp(2rem, 6vw, 2.9rem);
  letter-spacing: -0.015em;
  margin-bottom: 0.75rem;
}

.lede {
  font-size: 1.1rem;
  color: var(--ink-dim);
  max-width: var(--measure);
}

h2 {
  font-size: clamp(1.35rem, 3.4vw, 1.7rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.05rem;
  letter-spacing: 0;
}

/* ── Prose ──────────────────────────────────────────────────────────────────── */

.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: 1.1rem;
}

.prose > h2 {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
}

.prose > h3 {
  margin-top: 2rem;
  color: var(--ink);
}

.prose ul,
.prose ol {
  padding-left: 1.35rem;
}

.prose li + li {
  margin-top: 0.5rem;
}

.prose li::marker {
  color: var(--accent-dim);
}

.prose strong {
  color: #fff;
  font-weight: 600;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-sunk);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 0.1em 0.4em;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin-block: 2rem;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
}

.card {
  border: 1px solid var(--line-soft);
  background: var(--bg-raised);
  border-radius: var(--radius);
  padding: 1.4rem;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--ink-dim);
  font-size: 0.95rem;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s, background 0.15s;
}

.card-link:hover {
  border-color: var(--accent-dim);
  background: #131826;
}

.card-link h3 {
  color: var(--accent);
}

/* ── Figures ────────────────────────────────────────────────────────────────── */

.figure {
  margin-block: 2rem;
  max-width: var(--wide);
}

.figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: var(--bg-sunk);
}

.figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-style: italic;
}

/* ── Callouts ───────────────────────────────────────────────────────────────── */

.note {
  max-width: var(--measure);
  border-left: 2px solid var(--line);
  background: var(--bg-raised);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  color: var(--ink-dim);
}

.note strong {
  color: var(--ink);
}

.note-warn {
  border-left-color: var(--ember);
}

.note-warn strong {
  color: #f0836d;
}

.note-good {
  border-left-color: var(--malachite);
}

.note-good strong {
  color: #7fd2b3;
}

/* ── Definition rows ────────────────────────────────────────────────────────── */

.rows {
  max-width: var(--measure);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.rows > div {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  padding: 0.9rem 1.15rem;
  font-size: 0.95rem;
}

.rows > div + div {
  border-top: 1px solid var(--line-soft);
}

.rows dt,
.rows .k {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-dim);
  padding-top: 0.15rem;
}

.rows dd,
.rows .v {
  margin: 0;
  color: var(--ink-dim);
}

.rows .v strong {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 34rem) {
  .rows > div {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */

.site-foot {
  border-top: 1px solid var(--line-soft);
  background: var(--bg-sunk);
  padding-block: 2.5rem 3rem;
  margin-top: 4rem;
  font-size: 0.9rem;
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 2rem;
}

.foot-col h2 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.8rem;
}

.foot-col ul {
  list-style: none;
  padding: 0;
}

.foot-col li + li {
  margin-top: 0.45rem;
}

.foot-col a {
  color: var(--ink-dim);
  text-decoration: none;
}

.foot-col a:hover {
  color: var(--accent);
}

.foot-legal {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-faint);
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Motion ─────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
