/* 2048 Surge — Ember, the production site.
 *
 * Spec: /DESIGN.md. Visual acceptance criterion: docs/apps/2048surge/design/mockups/ember-app.html.
 * Tokens mirror mobile/theme/tokens.ts; that file stays the source of truth.
 *
 * Ember reads as a fire cooling from pale gold through rust to char. There is
 * no cool note anywhere — no blue, purple, pink or teal.
 *
 *   Ink is the action.  Every primary button is #24120A on cream. Nothing
 *                       clickable is orange, so nothing orange has to be
 *                       checked for whether it is clickable.
 *   Orange is heat.     Score, the live dot, costs, and the tile ramp. It marks
 *                       value and temperature — never affordance.
 *
 * Depth comes from the border in front and the heat behind, never a shadow.
 */

/* Latin subsets of the same three faces the app registers. Built from
 * mobile/node_modules/@expo-google-fonts/* with fontTools; see
 * web/production/fonts/README.md for the exact command. */
@font-face { font-family: "Archivo"; src: url("/site/fonts/archivo-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/site/fonts/archivo-800.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/site/fonts/instrument-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/site/fonts/instrument-sans-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/site/fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  /* Ground and ink */
  --ground: #fff8f2;
  --surface: #ffffff;
  --hairline: #eedfce;
  --ink: #24120a;
  --ink-dim: #7a5a46;
  /* Accents — one job each */
  --hot: #e8460c;
  --gold: #ffb300;
  --rare: #ffe9a8;
  /* The board is char; an empty cell is the char that shows through */
  --board: #24120a;
  --empty: #45291b;
  /* Type: three faces, one job each */
  --disp: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --ui: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  /* Shape: tiles 2px, plates 10-18px, buttons 999px */
  --r-tile: 2px;
  --r-plate: 14px;
  --r-pill: 999px;
  /* Rhythm */
  --pad: clamp(1.25rem, 5vw, 5rem);
  --band: clamp(3.5rem, 7vw, 6.5rem);
  --maxw: 76rem;
  /* One content edge for the whole site. Every full-bleed strip pads by this,
   * so the wordmark, the headline and every section heading share a left edge
   * at any width — instead of each band centring its own capped wrapper and
   * drifting away from the header. */
  --gutter: max(var(--pad), calc((100% - var(--maxw)) / 2));
  /* An ink ring reads on cream, on white and outside an ink button alike. */
  --focus: #24120a;
}

.ember {
  min-inline-size: 20rem;
  margin: 0;
  color: var(--ink);
  background: var(--ground);
  color-scheme: only light;
  font-family: var(--ui);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.ember *, .ember *::before, .ember *::after { box-sizing: border-box; }
.ember img, .ember svg { display: block; max-inline-size: 100%; }
/* Zero specificity: a link inherits its colour by default, but any component
 * class on the link — a button, the Discord plate — must still win. */
:where(.ember a) { color: inherit; text-underline-offset: .2em; }
.ember :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.ember h1, .ember h2, .ember h3, .ember p, .ember ul { margin-block-start: 0; }
.ember h1, .ember h2, .ember h3 {
  font-family: var(--disp);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.02;
  text-wrap: balance;
}
.ember [data-concept-root="b"] { overflow: clip; }

/* Every figure that is compared to another figure is tabular. */
.ember [data-figure] { font-variant-numeric: tabular-nums; }

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

/* Data face: uppercase labels, clocks, costs. Never a sentence. */
.eyebrow, .lbl, .clock, .kbd, .proof__cap {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow { margin-block-end: 1.1rem; color: var(--ink-dim); font-size: .7rem; }
.lbl { margin: 0; color: var(--ink-dim); font-size: .62rem; letter-spacing: .11em; }

/* --- action --------------------------------------------------------------- */

.lineup-action {
  display: inline-flex;
  min-block-size: 3rem;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.5rem;
  color: var(--ground);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
  font-family: var(--ui);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 160ms cubic-bezier(.16, 1, .3, 1), color 160ms cubic-bezier(.16, 1, .3, 1);
}
.lineup-action:hover { background: #3a1f12; }
/* Outline buttons are filled, never transparent: a warm ground runs behind
 * them and the label has to stay readable over it. */
.lineup-action--quiet { color: var(--ink); background: var(--surface); }
.lineup-action--quiet:hover { background: var(--rare); }
.lineup-action--small { min-block-size: 2.75rem; padding: .55rem 1.1rem; font-size: .85rem; }

/* --- header --------------------------------------------------------------- */

.lineup-header {
  display: flex;
  min-block-size: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .85rem var(--gutter);
  background: var(--ground);
  border-block-end: 2px solid var(--ink);
}
.lineup-header > a { inline-size: clamp(8rem, 13vw, 11rem); }
.lineup-header img { inline-size: 100%; block-size: auto; mix-blend-mode: multiply; }
.lineup-header nav {
  display: flex;
  align-items: center;
  gap: clamp(.6rem, 1.8vw, 1.6rem);
  font-size: .88rem;
  font-weight: 600;
}
.lineup-header nav > a:not(.lineup-action):not(.discord-action) {
  display: inline-flex;
  min-block-size: 2.75rem;
  align-items: center;
  color: var(--ink-dim);
  text-decoration: none;
}
.lineup-header nav > a:not(.lineup-action):not(.discord-action):hover { color: var(--ink); text-decoration: underline; }

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

.lineup-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 25rem);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(2.75rem, 6vw, 5.5rem) var(--gutter) clamp(3rem, 6vw, 5.5rem);
  border-block-end: 2px solid var(--ink);
  isolation: isolate;
}
/* The heat field: the same ramp the tiles use, run as temperature behind the
 * page. Static — DESIGN.md's animated field belongs to the app, where there is
 * already a canvas; a landing pays for it in bytes and battery. */
.lineup-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(52% 44% at 84% 8%, rgba(255, 179, 0, .34), rgba(255, 179, 0, 0) 72%),
    radial-gradient(44% 40% at 100% 48%, rgba(232, 70, 12, .22), rgba(232, 70, 12, 0) 74%),
    radial-gradient(64% 56% at 2% 96%, rgba(255, 233, 168, .62), rgba(255, 233, 168, 0) 72%),
    radial-gradient(38% 34% at 34% 2%, rgba(255, 122, 0, .14), rgba(255, 122, 0, 0) 74%);
}
/* Tile geometry, enlarged: the grid the product is made of, at the threshold
 * of visibility. */
.lineup-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(36, 18, 10, .05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(36, 18, 10, .05) 1px, transparent 1px);
  background-size: 2.5rem 2.5rem;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .25) 78%, transparent 100%);
}
.lineup-hero__copy { min-inline-size: 0; }
.lineup-hero h1 {
  margin-block-end: 1.25rem;
  font-size: clamp(2.6rem, 6.2vw, 5rem);
  font-weight: 800;
  letter-spacing: -.04em;
}
/* The promise is two lines, and the second one is a line. It never wraps, so
 * it is set from the first line's size rather than given its own clamp. */
.lineup-hero h1 span { display: block; font-size: .78em; white-space: nowrap; }
.lineup-hero__lede {
  max-inline-size: 34rem;
  margin-block-end: 1.75rem;
  color: var(--ink-dim);
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
  line-height: 1.55;
}
.lineup-hero__lede b { color: var(--ink); font-weight: 600; }
.lineup-hero__actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.lineup-hero__note {
  margin: 1.1rem 0 0;
  color: var(--ink-dim);
  font-size: .85rem;
}

/* --- match illustration --------------------------------------------------- */

.lineup-proof { min-inline-size: 0; max-inline-size: 25rem; margin: 0; justify-self: end; }
.proof__cap { margin: 0 0 .6rem; color: var(--ink-dim); font-size: .65rem; }
/* Read at a glance over a heat field, so: opaque surface, real border. */
.proof__frame {
  display: grid;
  gap: .75rem;
  padding: clamp(.9rem, 1.6vw, 1.15rem);
  background: var(--surface);
  border: 3px solid var(--ink);
  border-radius: 18px;
}
.proof__bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.proof__stat { display: grid; gap: .1rem; }
.proof__stat--r { text-align: end; }
.proof__v {
  margin: 0;
  font-family: var(--disp);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
}
/* Gold is your score — but #FFB300 measures 1.9:1 on white, so as *text* it
 * takes the ink the token set already carries for this exact case
 * (colors.statusText.success in mobile/theme/tokens.ts). Gold itself stays a
 * fill: it is the 1024 tile two rows down. */
.proof__v--gold { color: #8a5a00; }
.proof__v--hot { color: var(--hot); }
.clock {
  padding: .25rem .55rem;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 7px;
  font-size: .8rem;
  letter-spacing: .06em;
}
.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--board);
  border-radius: 4px;
}
.board span, .mini span {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--empty);
  border-radius: var(--r-tile);
  color: transparent;
  font-family: var(--disp);
  font-size: clamp(.85rem, 1.9vw, 1.25rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
:is(.board, .mini) span[data-v="2"] { background: #fff0dc; color: #24120a; }
:is(.board, .mini) span[data-v="4"] { background: #ffdfb5; color: #24120a; }
:is(.board, .mini) span[data-v="8"] { background: #ffc24d; color: #24120a; }
:is(.board, .mini) span[data-v="16"] { background: #ff9a1f; color: #24120a; }
:is(.board, .mini) span[data-v="32"] { background: #f26b0a; color: #24120a; }
:is(.board, .mini) span[data-v="64"] { background: #ce4000; color: #fff8f2; }
:is(.board, .mini) span[data-v="128"] { background: #b81d00; color: #fff8f2; }
:is(.board, .mini) span[data-v="256"] { background: #a21700; color: #fff8f2; }
:is(.board, .mini) span[data-v="512"] { background: #8c1000; color: #fff8f2; }
:is(.board, .mini) span[data-v="1024"] { background: #ffb300; color: #24120a; }
:is(.board, .mini) span[data-v="2048"] { background: #ffe9a8; color: #24120a; }
/* Your board dominates. The opponent lives in a rail, and the rail shows the
 * opponent's numbers — it is information, not decoration. */
.proof__rail {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem;
  border: 2px solid var(--hairline);
  border-radius: 10px;
}
.mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  inline-size: 5.5rem;
  flex: none;
  padding: 2px;
  background: var(--board);
  border-radius: 3px;
}
.mini span { border-radius: 1px; font-size: .55rem; }
.proof__opp { min-inline-size: 0; }
.proof__opp p { margin: 0; }
.proof__opp b { font-size: .92rem; font-weight: 600; }
.live { display: flex; align-items: center; gap: .35rem; margin-block-start: .15rem; }
.live i { inline-size: 6px; block-size: 6px; flex: none; background: var(--hot); border-radius: 50%; }
.live span { color: var(--ink-dim); font-family: var(--mono); font-size: .6rem; letter-spacing: .09em; text-transform: uppercase; }
.lineup-proof figcaption {
  margin-block-start: .8rem;
  color: var(--ink-dim);
  font-size: .82rem;
  line-height: 1.45;
}

/* --- bands ---------------------------------------------------------------- */

.rules-row, .mode-lineup, .power-row, .access-row, .controls-row, .lineup-close {
  padding: var(--band) var(--gutter);
  border-block-end: 2px solid var(--ink);
}
.rules-row h2, .mode-lineup h2, .power-row h2, .access-row h2, .controls-row h2, .lineup-close h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
}
.band-lede { max-inline-size: 46rem; color: var(--ink-dim); font-size: 1.05rem; }

.rules-row { background: #fef4e4; }
.rules-row h2 { margin-block-end: 2rem; }
.rules-grid {
  display: grid;
  gap: 1.5rem clamp(1.5rem, 3vw, 2.75rem);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.rules-grid div { border-block-start: 2px solid var(--ink); padding-block-start: .85rem; }
.rules-grid p { margin: 0; color: var(--ink-dim); font-size: .95rem; line-height: 1.55; }
.rules-grid b { display: block; color: var(--ink); font-weight: 600; }

/* --- mode lineup ---------------------------------------------------------- */

.mode-lineup { background: var(--ground); }
.mode-lineup__intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-block-end: 2.25rem;
}
.mode-lineup__intro h2 { margin: 0; }
.mode-lineup__intro p { max-inline-size: 24rem; margin: 0; color: var(--ink-dim); }
.mode-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.mode-stripe {
  display: grid;
  gap: .5rem;
  align-content: start;
  padding: 1.25rem;
  background: var(--surface);
  border: 2px solid var(--hairline);
  border-radius: var(--r-plate);
}
/* The mode marker is a real tile off the ramp, not a decorative numeral. */
.mode-stripe b {
  display: grid;
  place-items: center;
  inline-size: 3rem;
  block-size: 3rem;
  margin-block-end: .35rem;
  border-radius: var(--r-tile);
  font-family: var(--disp);
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.mode-stripe b[data-tile="2"] { background: #fff0dc; color: #24120a; }
.mode-stripe b[data-tile="4"] { background: #ffdfb5; color: #24120a; }
.mode-stripe b[data-tile="8"] { background: #ffc24d; color: #24120a; }
.mode-stripe b[data-tile="16"] { background: #ff9a1f; color: #24120a; }
.mode-stripe h3 { margin: 0; font-size: 1.2rem; }
.mode-stripe p { margin: 0; color: var(--ink-dim); font-size: .95rem; }

/* --- power-ups: the char band --------------------------------------------- */
/* The board is char. One band of it, mid-page, is the fire arriving at its
 * coolest colour — and the only place on the page where cream is the type. */

.power-row { color: var(--ground); background: var(--board); border-block-end-color: var(--board); }
.power-row h2 { margin-block-end: .9rem; }
.power-row > div { display: grid; gap: clamp(1.75rem, 4vw, 3.5rem); grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; }
.power-row p { margin: 0; max-inline-size: 34rem; color: #e5cdb8; font-size: 1.05rem; }
.power-row ul {
  display: grid;
  gap: .6rem;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.power-row li {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-block-size: 3.25rem;
  padding: .75rem .85rem;
  background: var(--empty);
  border: 1.5px solid #5f3a26;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 600;
}
.power-row svg {
  flex: none;
  inline-size: 1.15rem;
  block-size: 1.15rem;
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- access, controls, close ---------------------------------------------- */

.access-row { background: #fef4e4; }
.access-row > div {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
}
.access-row h2 { margin: 0; }
.access-row__copy p { max-inline-size: 34rem; margin-block-end: 1.5rem; color: var(--ink-dim); font-size: 1.05rem; }

.controls-row { background: var(--ground); text-align: center; }
.controls-row h2 { margin-block-end: 1rem; }
.controls-row p { margin-inline: auto; max-inline-size: 44rem; color: var(--ink-dim); font-size: 1.05rem; }
.controls-row ul {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.kbd {
  display: inline-flex;
  align-items: center;
  padding: .4rem .75rem;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-size: .7rem;
}

.lineup-close { background: var(--ground); border-block-end: 0; text-align: center; }
.lineup-close h2 { margin-block-end: 1.5rem; font-size: clamp(2.25rem, 5vw, 4rem); }
.lineup-close__actions { display: flex; align-items: center; justify-content: center; gap: .75rem; flex-wrap: wrap; }

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

.lineup-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem var(--gutter);
  background: var(--board);
  color: var(--ground);
  font-size: .9rem;
}
.lineup-footer > a { font-family: var(--disp); font-weight: 700; letter-spacing: -.02em; text-decoration: none; }
.lineup-footer p { margin: 0; color: #b79582; text-align: center; }
.lineup-footer nav { display: flex; justify-content: flex-end; gap: 1.25rem; }
.lineup-footer nav a { display: inline-flex; min-block-size: 2.75rem; align-items: center; color: #e5cdb8; }
.lineup-footer nav a:hover { color: var(--ground); }
.lineup-footer :focus-visible { outline-color: var(--rare); }

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

@media (max-width: 60rem) {
  .lineup-hero { grid-template-columns: minmax(0, 1fr); }
  .lineup-proof { max-inline-size: 26rem; }
  .power-row > div, .access-row > div { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 45rem) {
  .lineup-header { gap: .75rem; }
  .lineup-header > a { inline-size: 7rem; }
  .lineup-header nav { gap: .5rem; }
  .lineup-header nav > a:not(.lineup-action):not(.discord-action) { display: none; }
  .lineup-hero__actions .lineup-action { flex: 1 1 100%; }
  .mode-lineup__intro { display: grid; }
  .lineup-footer { grid-template-columns: 1fr; gap: .75rem; }
  .lineup-footer p { text-align: start; }
  .lineup-footer nav { justify-content: flex-start; flex-wrap: wrap; }
}

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

@media (forced-colors: active) {
  .lineup-action, .kbd, .clock, .proof__frame { forced-color-adjust: auto; }
}
