/* THE BOARD. One printed two colour sheet: black ground, fluorescent orange plates with black type,
   every block a rounded rectangle with a gutter around it. Built to art/ref/poster.jpg.
   Orange plates carry black text, the black ground carries orange text: that inversion is the system. */

@font-face { font-family: Nippo; src: url("/fonts/Nippo-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Nippo; src: url("/fonts/Nippo-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Nippo; src: url("/fonts/Nippo-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Sligoil; src: url("/fonts/Sligoil-Micro.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --ink: #f88000;
  --ground: #000000;
  --sunk: #0d0d0d;
  --on-plate: #000000;
  --dim: rgba(0, 0, 0, 0.62);
  --dim-ink: rgba(248, 128, 0, 0.58);
  --r: 26px;
  --r-in: 18px;
  --gap: 20px;
  --pad: 32px;
  --inset: 32px;
  --line: 3px;
  --cols: 12;
}

* { box-sizing: border-box; }
html { background: var(--ground); }
body {
  margin: 0;
  padding: var(--pad);
  background: var(--ground);
  color: var(--ink);
  font-family: Nippo, system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

/* ---------------------------------------------------------------- the grid */

.sheet { max-width: 1856px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--gap); }
.row { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; } .col-12 { grid-column: span 12; }

/* ---------------------------------------------------------------- the plates */

.plate {
  background: var(--ink);
  color: var(--on-plate);
  border-radius: var(--r);
  padding: var(--inset);
  min-width: 0;
}
.plate--cut { background: var(--ground); color: var(--ink); border: var(--line) solid var(--ink); }
.plate--sunk { background: var(--sunk); color: var(--ink); border: var(--line) solid var(--ink); }
.inset {
  border: var(--line) solid currentColor;
  border-radius: var(--r-in);
  padding: 22px 30px;
  min-width: 0;
}

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

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 36px; line-height: 1.05; }
h3 { font-size: 24px; line-height: 1.1; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

.label {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
}
.lede { font-size: 22px; line-height: 1.3; }
.note { font-size: 16px; line-height: 1.4; }
.num { font-family: Sligoil, ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.big { font-family: Sligoil, ui-monospace, monospace; font-size: clamp(28px, 2.4vw, 46px); line-height: 1; letter-spacing: -0.02em; }
.huge { font-weight: 700; font-size: clamp(40px, 3.6vw, 70px); line-height: 0.95; letter-spacing: -0.02em; }
.dim { color: var(--dim); }
.plate--cut .dim, .plate--sunk .dim, .on-black .dim, .dim.on-black { color: var(--dim-ink); }

/* ---------------------------------------------------------------- the masthead and the selector */

.mast { display: flex; align-items: center; gap: 28px; padding: 16px var(--inset); flex-wrap: wrap; }
.mast__right { gap: 24px; }
.mast__name { font-weight: 700; font-size: 34px; line-height: 1; letter-spacing: -0.02em; white-space: nowrap; }
.mast__say { font-size: 16px; line-height: 1.3; max-width: 34ch; }
.mast__right { margin-left: auto; display: flex; align-items: center; gap: 20px; }

.selector { display: flex; align-items: center; gap: 4px; background: rgba(0, 0, 0, 0.1); border-radius: 999px; padding: 5px; }
.selector a {
  display: block;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--on-plate);
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease;
}
.selector a:hover { background: rgba(0, 0, 0, 0.14); }
.selector a[aria-current="page"] { background: var(--ground); color: var(--ink); }

/* the ring badge: a generated star on its disc, with real text set letter by letter around it */
/* The badge: two flat pictures at whole pixel sizes, never scaled up, so nothing is resampled. The ring
   was set with a real textPath and rasterised at 3x (tools/ring.mjs); only it turns, the star is still. */
.badge { position: relative; width: 176px; height: 176px; flex: 0 0 176px; margin: 0; align-self: center; }
.badge__ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 176px;
  height: 176px;
  animation: turn 18s linear infinite;
  transform-origin: 88px 88px;
  will-change: transform;
  backface-visibility: hidden;
}
.badge__star { position: absolute; left: 46px; top: 46px; width: 84px; height: 84px; border-radius: 50%; }
@keyframes turn { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- the tapes (generated tiles) */

.tape { height: 34px; border-radius: 6px; background-repeat: repeat-x; background-size: auto 100%; }
.tape--checker { background-image: url("/img/tape-checker.png"); }
.tape--hazard { background-image: url("/img/tape-hazard.png"); }
.tape--run { animation: run 24s linear infinite; }
@keyframes run { to { background-position-x: -480px; } }

/* ---------------------------------------------------------------- keys */

.keys { display: flex; flex-wrap: wrap; gap: 12px; }
.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  padding: 13px 28px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ground);
  font-family: Nippo, sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 90ms ease, filter 140ms ease;
}
.plate .key { background: var(--ground); color: var(--ink); }
.key:hover { filter: brightness(1.12); }
.key:active { transform: translateY(2px); }
.key[disabled], .key[aria-disabled="true"] { opacity: 0.58; cursor: not-allowed; pointer-events: none; }
.key--big { min-height: 64px; font-size: 20px; padding: 15px 34px; }
.key--ghost { background: transparent; color: var(--ink); border: var(--line) solid var(--ink); }
.plate .key--ghost { background: transparent; color: var(--on-plate); border-color: var(--on-plate); }
.plate--cut .key--ghost, .plate--sunk .key--ghost { color: var(--ink); border-color: var(--ink); }
.plate--cut .key, .plate--sunk .key { background: var(--ink); color: var(--ground); }
.key__mark { width: 22px; height: 22px; flex: 0 0 22px; object-fit: contain; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.plate :focus-visible { outline-color: var(--ground); }

/* ---------------------------------------------------------------- fields */

.field { display: block; margin-bottom: 18px; }
.field > span { display: block; margin-bottom: 8px; }
input, select, textarea {
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border: var(--line) solid var(--on-plate);
  border-radius: var(--r-in);
  background: transparent;
  color: var(--on-plate);
  font-family: Nippo, sans-serif;
  font-size: 18px;
}
textarea { min-height: 112px; resize: vertical; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: rgba(0, 0, 0, 0.42); }
.plate--cut input, .plate--cut textarea, .plate--sunk input, .plate--sunk textarea {
  border-color: var(--ink); color: var(--ink);
}
.plate--cut input::placeholder, .plate--sunk input::placeholder { color: var(--dim-ink); }

/* ---------------------------------------------------------------- the word stack (the week) */

.week { display: flex; flex-direction: column; gap: 4px; }
.week b {
  font-weight: 700;
  font-size: clamp(22px, 1.75vw, 30px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
  white-space: nowrap;
}
.week b.on { color: var(--ink); -webkit-text-stroke-width: 0; }
.week b.gone { -webkit-text-stroke-color: rgba(248, 128, 0, 0.34); }

/* ---------------------------------------------------------------- the board table */

.board { padding: 0; overflow: hidden; }
.board__head, .board__row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 150px 118px 128px 132px;
  align-items: center;
  gap: 18px;
  padding: 0 var(--inset);
}
.board__head { height: 52px; border-bottom: var(--line) solid var(--on-plate); }
.board__head span { font-weight: 700; font-size: 16px; letter-spacing: 0.14em; text-transform: uppercase; }
.board__row { min-height: 88px; padding-top: 14px; padding-bottom: 14px; border-bottom: 2px solid rgba(0, 0, 0, 0.18); text-decoration: none; color: inherit; }
.board__row:last-child { border-bottom: 0; }
.board__row:hover { background: rgba(0, 0, 0, 0.08); }
.board__rank { font-family: Sligoil, monospace; font-size: 38px; line-height: 1; }
.board__name { font-weight: 700; font-size: 21px; line-height: 1.15; overflow-wrap: anywhere; }
.board__sub { font-size: 16px; line-height: 1.25; color: var(--dim); }
.board__bars { width: 150px; height: 46px; display: block; }
.board__n { font-family: Sligoil, monospace; font-size: 22px; text-align: right; }
.right { text-align: right; }

/* ---------------------------------------------------------------- the ticker plate */

.ticker { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 40px var(--inset) 44px; }
.ticker__word { width: min(860px, 78%); }
.ca {
  width: min(1100px, 100%);
  font-family: Sligoil, monospace;
  font-size: 20px;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
  padding: 18px 24px;
  border-radius: var(--r-in);
  background: var(--sunk);
  border: var(--line) solid var(--ink);
  color: var(--ink);
  user-select: all;
}
.ca[data-empty="1"] { color: var(--dim-ink); }

/* ---------------------------------------------------------------- bits */

.pic { border-radius: var(--r); border: var(--line) solid var(--ink); overflow: hidden; background: var(--sunk); }
.pic img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.22); }
.plate .pic { border-color: var(--on-plate); }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.between { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.rows { display: flex; flex-direction: column; margin: 0 -18px; }
.rows > div { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 13px 18px; }
.rows > div + div { border-top: 2px solid rgba(0, 0, 0, 0.2); }
.plate--cut .rows > div + div, .plate--sunk .rows > div + div { border-top-color: rgba(248, 128, 0, 0.28); }
.say { font-size: 18px; line-height: 1.45; max-width: 62ch; }
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 24px; border-radius: 999px;
  background: var(--ground); color: var(--ink); font-weight: 700; font-size: 16px; letter-spacing: 0.1em;
  text-transform: uppercase;
}
.plate--cut .chip, .plate--sunk .chip { background: var(--ink); color: var(--ground); }
.msg { margin-top: 18px; font-size: 17px; line-height: 1.45; }
.msg--bad { font-weight: 700; }
.hide { display: none !important; }

/* ---- between a laptop and a desktop: the masthead keeps one row and the board keeps its name column */
@media (max-width: 1500px) {
  .mast__say { display: none; }
  .board__head, .board__row { grid-template-columns: 64px minmax(0, 1fr) 118px 92px 92px; gap: 16px; }
  .board__bars { width: 118px; }
  .board__n--mcap { display: none; }
}

/* ---------------------------------------------------------------- phone */

@media (max-width: 1100px) {
  :root { --cols: 6; --pad: 16px; --gap: 14px; --inset: 32px; --r: 22px; }
  .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-12 { grid-column: span 6; }
  .board__head { display: none; }
  .board__row { grid-template-columns: 54px minmax(0, 1fr) 96px; grid-auto-rows: min-content; padding: 18px var(--inset); }
  .board__bars { width: 96px; height: 38px; }
  .board__n--mcap { display: none; }
  /* the phone masthead: the name and a small badge on one row, the selector as a full width grid of
     cells wide enough to keep 16 px of air round every word */
  .mast { gap: 16px; flex-wrap: wrap; align-items: center; padding: 22px var(--inset); }
  .mast__say { display: none; }
  .mast__name { flex: 1 1 150px; white-space: normal; font-size: 30px; line-height: 1.04; }
  .mast__right { display: contents; }
  /* under a laptop the ring is too small for its letters to read, so the badge is the star alone */
  .badge { order: 2; width: 84px; height: 84px; flex: 0 0 84px; }
  .badge__star { left: 0; top: 0; width: 84px; height: 84px; }
  .badge__ring { display: none; }
  /* the words keep their own width and wrap centred, so a short last row reads as a row and not as a bar */
  .selector { order: 3; width: 100%; flex-wrap: wrap; justify-content: center; border-radius: 24px; gap: 4px; }
  .selector a { text-align: center; padding: 14px 18px; }


  h2 { font-size: 28px; }
}
@media (max-width: 420px) {
  :root { --inset: 32px; }
  .selector a { padding: 12px 18px; font-size: 16px; }
  .mast__name { font-size: 26px; flex-basis: 120px; }
  .badge { width: 62px; height: 62px; flex: 0 0 62px; }
  .badge__star { left: 0; top: 0; width: 62px; height: 62px; }
}

@media (prefers-reduced-motion: reduce) {
  .badge__ring, .tape--run { animation: none; }
  * { transition-duration: 1ms !important; }
}

/* the board before its first coin: the grammar of a row, held empty */
.board__row--sample { opacity: 0.44; pointer-events: none; }
.board__row--sample .board__bars { border-bottom: 2px solid currentColor; }

/* the two fee splits side by side, with the arrows between them */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 200px minmax(0, 1fr); gap: 26px; align-items: center; }
.split > img { width: 200px; height: auto; }
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .split > img { justify-self: center; }
}

/* the pot band: the display slot of his poster, filled by the one number the festival plays for */
.pot { padding-top: 0; overflow: hidden; }
.pot__tape { height: 30px; margin: 0 calc(var(--inset) * -1) 26px; border-radius: 0; }
.pot__row { display: grid; grid-template-columns: minmax(0, 1fr) auto 180px; gap: 32px; align-items: center; }
.pot__n { font-family: Sligoil, monospace; font-size: clamp(50px, 6.2vw, 118px); line-height: 0.92; letter-spacing: -0.03em; }
.pot__places { display: flex; flex-direction: column; gap: 10px; }
.pot__globe { width: 180px; height: auto; }
@media (max-width: 1100px) {
  .pot__row { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .pot__places { flex-direction: row; flex-wrap: wrap; }
  .pot__globe { display: none; }
}

/* the day numeral: the biggest thing on the first screen, set the size his "25" is set at */
.daynum {
  font-weight: 700;
  font-size: clamp(76px, 6.6vw, 132px);
  line-height: 0.86;
  letter-spacing: -0.04em;
  margin: 6px 0 0;
  text-align: center;
}
