/* ==========================================================================
   Lottura — home page
   Editorial stage · conversion billboard · guarantee band · draw machine
   · era strip · prizes · pillars · partners · charity · signup
   ========================================================================== */

:root {
  --bg: #070918;
  --ink: #f0f2ff;
  --dim: #a2aacd;
  --faint: #7d86b5;
  --cyan: #11C3ED;
  --blue: #2E3CEC;
  --purple: #8B16E0;
  --grad: linear-gradient(100deg, #11C3ED 0%, #2E3CEC 52%, #8B16E0 100%);
  --grad-ink: linear-gradient(100deg, #35D2FF 0%, #7B8CFF 52%, #C179FF 100%);
  --grad-btn: linear-gradient(100deg, #2E3CEC 0%, #8B16E0 100%);
  --rule: rgba(148,160,255,.16);
  --rule-soft: rgba(148,160,255,.09);
  --steel: rgba(170,190,215,.22);
  --steel-ink: #C7D6E6;
  --steel-rule: rgba(170,190,215,.14);
  --rule-strong: rgba(148,160,255,.35);
  --paper-dim: #565179;
  --paper-rule: #c9c4b4;
  --error: #ff8fa8;
  --paper: #f2efe6;
  --paper-ink: #16142e;
  --fd: 'Montserrat', system-ui, sans-serif;
  --fb: 'Inter', system-ui, sans-serif;
  --fa: 'Fraunces', Georgia, serif;
  --fm: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --hh: 72px;
  --stamp-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 0.1'/%3E%3C/filter%3E%3Crect width='120' height='120' fill='%23fff' filter='url(%23r)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--hh) + 1.2rem); }

[hidden] { display: none !important; }
html, body { overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.65 var(--fb);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
::selection { background: rgba(139,22,224,.45); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.wrap { width: min(1240px, 100% - 3rem); margin-inline: auto; }
.mono { font-family: var(--fm); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fine { font-size: .6875rem; letter-spacing: .08em; color: var(--faint); margin-top: 1.2rem; }
.soon { cursor: default; pointer-events: none; opacity: .55; }
.dim { color: var(--faint); }

.accent {
  font-family: var(--fa);
  font-style: italic;
  font-weight: 500;
  background: var(--grad-ink);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-inline-end: .06em;
}

/* ---------- Stage ---------- */

.stage-light {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 44% at 50% -8%, rgba(46,60,236,.22), transparent 70%),
    radial-gradient(ellipse 42% 34% at 82% 22%, rgba(139,22,224,.14), transparent 70%),
    radial-gradient(ellipse 36% 30% at 12% 80%, rgba(17,195,237,.08), transparent 70%);
}

.grain {
  position: fixed; inset: -100px; z-index: 90;
  pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Header ---------- */

.hdr { position: fixed; inset: 0 0 auto; z-index: 50; transition: background .35s; }
.hdr::after {
  content: ""; position: absolute; inset: auto 0 0; height: 1px;
  background: var(--rule);
  opacity: 0; transition: opacity .35s;
}
.hdr.scrolled { background: rgba(7,9,24,.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.hdr.scrolled::after { opacity: 1; }
.hdr__in { display: flex; align-items: center; gap: 1.1rem; height: var(--hh); }
.logo { margin-inline-end: auto; }

.logo { display: inline-flex; align-items: baseline; gap: .7rem; }
.logo__img { height: 30px; width: auto; display: block; }
.logo__tag { font-size: .625rem; letter-spacing: .3em; color: var(--faint); }

.nav { display: flex; align-items: center; gap: 1.7rem; }
.nav > a:not(.cta) {
  font-size: .875rem; font-weight: 500; color: var(--dim);
  transition: color .25s;
}
.nav > a:not(.cta):hover { color: var(--ink); }
.nav > a { white-space: nowrap; }
.cta {
  font-size: .75rem; font-weight: 700; letter-spacing: .1em;
  padding: .8em 1.5em;
  color: #fff;
  background: var(--grad-btn);
  border-radius: 4px;
  box-shadow: 0 8px 28px -10px rgba(46,60,236,.8);
  transition: transform .3s var(--ease), box-shadow .3s;
}
@media (hover: hover) {
  .cta:hover { transform: translateY(-2px); box-shadow: 0 14px 36px -10px rgba(46,60,236,1); }
}
.cta:active { transform: translateY(0); box-shadow: 0 6px 20px -10px rgba(46,60,236,.9); }

.burger { display: none; width: 44px; height: 44px; flex-direction: column; align-items: center; justify-content: center; gap: 7px; }
.burger span { width: 22px; height: 2px; background: var(--ink); transition: transform .3s var(--ease); }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--hh) + 2.4rem) 0 3rem;
  position: relative;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2.2rem 2.5rem;
  align-items: center;
}

.js [data-intro] {
  opacity: 0; transform: translateY(26px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: calc(var(--i, 0) * .09s);
}
.js .loaded [data-intro] { opacity: 1; transform: none; }
[data-i="1"] { --i: 1; } [data-i="2"] { --i: 2; } [data-i="3"] { --i: 3; } [data-i="4"] { --i: 4; }
[data-i="5"] { --i: 5; } [data-i="6"] { --i: 6; } [data-i="7"] { --i: 7; }

.stampline {
  display: inline-flex; align-items: center; gap: .7em;
  font-size: .66rem; letter-spacing: .22em;
  color: var(--dim);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: .6em 1em;
  margin-bottom: 1.7rem;
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: pulse 2.2s ease-in-out infinite;
  flex: none;
}
@keyframes pulse { 50% { opacity: .35; } }

.mega {
  font: 900 clamp(2.3rem, 5.2vw, 4.4rem)/1.02 var(--fd);
  letter-spacing: -.04em;
}
.mega__row { display: block; }
.mega__ghost {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(162,170,205,.55);
}

.hero__lede {
  max-width: 31rem;
  color: var(--dim);
  font-size: 1.0625rem;
  margin-top: 1.4rem;
}

.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem; margin-top: 1.8rem; }

.bigbtn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  font: 700 1rem var(--fd);
  color: #fff;
  padding: 1em 2em;
  background: var(--grad-btn);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 12px 38px -12px rgba(46,60,236,.9);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.bigbtn span { transition: transform .3s var(--ease); }
.bigbtn::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 50%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.4), transparent);
  transform: translateX(-170%) skewX(-20deg);
  transition: transform .6s var(--ease);
}
@media (hover: hover) {
  .bigbtn:hover { transform: translateY(-2px); box-shadow: 0 18px 48px -12px rgba(46,60,236,1); }
  .bigbtn:hover span { transform: translateX(4px); }
  .bigbtn:hover::after { transform: translateX(270%) skewX(-20deg); }
}
.bigbtn:active { transform: translateY(0); box-shadow: 0 6px 20px -10px rgba(46,60,236,.9); }

/* Play buttons ([data-play]) without an href (LOTTURA_CONFIG.playUrl unset): visibly off, not interactive.
   Keyed on the data attribute, never on .bigbtn/.cta alone: the Subscribe <button class="bigbtn"> has no href either. */
[data-play]:not([href]) { opacity: .45; cursor: default; pointer-events: none; box-shadow: none; filter: saturate(.6); }
[data-play]:not([href])::after { display: none; }
.hero__note { flex-basis: 100%; font-size: .7rem; letter-spacing: .14em; color: var(--faint); }
.hero__note a { color: var(--dim); border-bottom: 1px solid var(--rule-strong); padding-bottom: .15em; transition: color .3s, border-color .3s; }
@media (hover: hover) { .hero__note a:hover { color: var(--cyan); border-color: var(--cyan); } }

.linebtn {
  display: inline-block;
  font-weight: 600; font-size: .9375rem;
  padding-bottom: .25em;
  border-bottom: 1px solid var(--rule);
  transition: border-color .3s;
}
.linebtn:hover { border-color: var(--cyan); }
.charity__copy .linebtn { margin-top: 1.6rem; }

.hero__audit {
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .7rem;
  font-size: .66rem; letter-spacing: .14em; color: var(--faint);
  margin-top: 1.8rem;
}
.auditchip {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .5em .85em;
  border: 1px solid var(--rule); border-radius: 3px;
  color: var(--dim);
  background: rgba(11,15,38,.45);
  white-space: nowrap;
}
.auditchip span { color: var(--cyan); }
.hero__audit a { color: var(--dim); border-bottom: 1px solid var(--rule); transition: color .25s, border-color .25s; }
.hero__audit a:hover { color: var(--ink); border-color: var(--cyan); }

/* ---------- Conversion billboard ---------- */

.board {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  --board-pad: 2.2rem; --board-gap: 4.4rem;
  gap: 1.5rem var(--board-gap);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.5rem var(--board-pad) 1.6rem;
  background:
    radial-gradient(ellipse 55% 100% at 15% 50%, rgba(17,195,237,.09), transparent 70%),
    radial-gradient(ellipse 50% 100% at 88% 50%, rgba(139,22,224,.09), transparent 70%),
    rgba(11,15,38,.45);
  position: relative;
}
.board::before {
  content: ""; position: absolute; top: 16%; bottom: 16%; width: 1px;
  /* left padding + column 1 (1.15 of 2.15 tracks) + half the gap */
  inset-inline-start: calc(var(--board-pad) + (100% - 2 * var(--board-pad) - var(--board-gap)) * .5349 + var(--board-gap) / 2);
  background: var(--rule);
}
.board__label {
  display: flex; align-items: center; gap: .7em;
  font-size: .625rem; letter-spacing: .24em; color: var(--faint);
  margin-bottom: .55rem;
}
/* the figure cell is a size container so a long figure can scale itself to the cell (cqi) */
.board, .board__cell--pot { min-width: 0; }
.board__cell--pot { container-type: inline-size; }
.board__pot {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .3em;
  --pot-size: clamp(2.7rem, 5.6vw, 4.6rem);
  font-size: var(--pot-size);
  font-weight: 700; line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  background: var(--grad-ink);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* main.js sets --pot-chars to the length of the live figure, so the unit never moves during the roll-up */
.board__pot b { font-weight: 700; min-width: calc(var(--pot-chars, 1) * (1ch - .02em)); text-align: end; }
/* Inside @supports on purpose: a declaration with var() is never dropped at parse time, so without this guard an engine
   that lacks cqi (Safari 15) would compute the size as invalid and fall back to 16px instead of to --pot-size.
   Digits are .58em wide here and the unit label adds about 1.25em: shrink only when the figure would not fit. */
@supports (width: 1cqi) {
  .board__pot { font-size: min(var(--pot-size), calc(100cqi / (var(--pot-chars, 1) * .58 + 1.25))); }
}
.board__pot i { font-style: normal; font-size: .3em; letter-spacing: .12em; }
/* no draw scheduled (nextDrawAt is null, or the endpoint is unreachable): the countdown cell is [hidden] and the jackpot takes the row */
.board--nocd { grid-template-columns: 1fr; }
.board--nocd::before { display: none; }
.board__cd { display: flex; align-items: flex-start; gap: clamp(.5rem, 1.4vw, 1rem); }
.seg { display: flex; flex-direction: column; align-items: center; }
.seg b {
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  font-weight: 700; line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.seg i {
  font-style: normal;
  font-size: .625rem; letter-spacing: .18em;
  color: var(--faint);
  margin-top: .5rem;
}
.board__sales { display: block; margin-top: .9rem; }
.board__colon {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1;
  color: var(--cyan);
  padding-top: .25em;
  animation: pulse 2s ease-in-out infinite;
}

/* ---------- Ticket ---------- */

.hero__right { display: flex; justify-content: center; }

.tickettilt { transform: rotate(-4deg); perspective: 1200px; }

.ticket {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 30%;
  --ticket-px: 1.9rem;
  position: relative;
  width: min(410px, 88vw);
  padding: 1.8rem var(--ticket-px) 1.3rem;
  border-radius: 14px;
  color: var(--ink);
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(148,160,255,.14), transparent 55%),
    linear-gradient(155deg, #151a3a, #0c1029 60%, #12102e);
  border: 1px solid var(--rule-strong);
  box-shadow:
    0 40px 90px -30px rgba(0,0,0,.8),
    0 0 60px -20px rgba(46,60,236,.5),
    inset 0 0 40px rgba(46,60,236,.08);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: box-shadow .4s, transform .6s var(--ease);
  will-change: transform;
}
.tickettilt:hover .ticket { transition: box-shadow .4s, transform .12s linear; }

.ticket__sheen {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 60% 45% at var(--mx) var(--my), rgba(255,255,255,.1), transparent 65%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.ticket__head { display: flex; align-items: baseline; justify-content: space-between; }
.ticket__brandimg { height: 22px; width: auto; display: block; }
.ticket__no { font-size: .6875rem; color: var(--dim); letter-spacing: .12em; }

.ticket__sub {
  font-size: .625rem; letter-spacing: .14em; color: var(--faint);
  text-wrap: balance;
  margin-top: .4rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--rule-soft);
}

.ticket__numbers {
  display: flex; justify-content: space-between; gap: .5rem;
  padding: 1.4rem 0 1.2rem;
}
.hole {
  display: grid; place-items: center;
  flex: 1 1 0;
  width: auto; height: auto;
  aspect-ratio: 1 / 1;
  max-width: 48px;
  border-radius: 50%;
  font-size: .875rem; font-weight: 700;
  color: #fff;
  border: 1px dashed rgba(148,160,255,.5);
  background: rgba(7,9,24,.65);
  box-shadow: inset 0 3px 10px rgba(0,0,0,.55), 0 0 16px rgba(17,195,237,.14);
}

.ticket__jack {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: .2rem .8rem; /* a long live figure drops under its label as one piece instead of breaking */
  padding-bottom: 1.3rem;
}
.ticket__jacklabel { font-size: .625rem; letter-spacing: .24em; color: var(--faint); white-space: nowrap; }
.ticket__jackval { font-size: 1.375rem; font-weight: 700; white-space: nowrap; }
.ticket__jackval b { font-weight: 700; font-variant-numeric: tabular-nums; }

.ticket__perf {
  position: relative;
  height: 0;
  border-top: 2px dashed rgba(148,160,255,.3);
  margin: 0 calc(-1 * var(--ticket-px));
}
.ticket__perf::before, .ticket__perf::after {
  content: "";
  position: absolute; top: -11px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--rule-strong);
}
.ticket__perf::before { left: -13px; border-left-color: transparent; }
.ticket__perf::after { right: -13px; border-right-color: transparent; }

.ticket__stub {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding-top: 1.2rem;
}
.ticket__cdlabel { display: block; font-size: .625rem; letter-spacing: .24em; color: var(--faint); margin-bottom: .3rem; }
.ticket__cdval { font-size: .9375rem; color: var(--ink); }
.ticket__cdval b { font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.ticket__cdval i { font-style: normal; }
.ticket__barcode { width: 96px; height: 30px; color: rgba(240,242,255,.75); flex: none; margin-inline-start: auto; }

/* ---------- Ticker ---------- */

.ticker {
  border-block: 1px solid var(--rule);
  overflow: hidden;
  padding: .85rem 0;
  background: rgba(11,15,38,.4);
}
.ticker__belt {
  display: inline-flex; align-items: center; gap: 2.2rem;
  padding-inline-end: 2.2rem; /* must equal gap so translateX(-25%) is exactly one of the four copies main.js makes */
  white-space: nowrap;
  font-size: .6875rem; letter-spacing: .18em;
  color: var(--dim);
  animation: belt 36s linear infinite;
  will-change: transform;
}
.ticker__belt i {
  font-style: normal; font-size: .5rem;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@keyframes belt { to { transform: translateX(-25%); } }
.ticker { position: relative; }
.ticker__pause {
  position: absolute; top: 50%; inset-inline-end: .8rem; transform: translateY(-50%);
  min-width: 2rem; height: 2rem; padding: 0 .55rem;
  font-size: .625rem; letter-spacing: 0; line-height: 1;
  color: var(--dim);
  background: rgba(11,15,38,.9);
  border: 1px solid var(--rule); border-radius: 999px;
  transition: color .25s, border-color .25s;
  z-index: 1;
}
.ticker__pause:hover, .ticker__pause:focus-visible { color: #fff; border-color: var(--dim); }
.ticker__pause:active { transform: translateY(calc(-50% + 1px)); }
.ticker::after {
  content: ""; position: absolute; top: 0; inset-inline-end: 0; bottom: 0; width: 6rem;
  background: linear-gradient(90deg, rgba(9,11,30,0), #090b1e 45%);
  pointer-events: none;
}
.ticker--paused .ticker__belt { animation-play-state: paused; }
@media (hover: hover) and (pointer: fine) {
  .ticker__belt:hover { animation-play-state: paused; }
}

/* ---------- Guarantee band ---------- */

.cant {
  position: relative;
  padding: clamp(4.5rem, 9vw, 8rem) 0;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.cant__wrap { position: relative; }
.cant__eyebrow {
  font-size: .6875rem; letter-spacing: .24em; color: var(--dim);
  margin-bottom: 1.8rem;
}
.cant__mega {
  font: 900 clamp(2.1rem, 4.9vw, 4rem)/1.12 var(--fd);
  letter-spacing: -.035em;
  max-width: 56rem;
}
.cant__line { display: block; }
.cant__kicker { color: var(--dim); margin-top: 1.5rem; max-width: 33rem; }
.cant__more {
  margin-top: 2.1rem;
  font-size: .6875rem; letter-spacing: .12em; line-height: 1.8;
  text-wrap: balance;
  color: var(--faint);
  max-width: 46rem;
}
.cant__how { display: inline-block; margin-top: 1.4rem; font-size: .75rem; letter-spacing: .14em; color: var(--dim); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: .3em; transition: color .25s; }
.cant__how:hover { color: var(--ink); }
.cant__stamp {
  position: absolute; inset-inline-end: 1rem; top: 46%;
  transform: translateY(-50%) rotate(-9deg);
  font-size: .875rem; font-weight: 700; letter-spacing: .2em;
  text-align: center; line-height: 1.6;
  color: var(--cyan);
  border: 2px solid var(--cyan);
  border-radius: 8px;
  padding: .8em 1.1em;
  opacity: .75;
  -webkit-mask-image: var(--stamp-mask);
  mask-image: var(--stamp-mask);
}

/* ---------- Sections ---------- */

.sec { padding: clamp(4.5rem, 9vw, 8rem) 0; }

.sec__head { margin-bottom: clamp(2.4rem, 5vw, 3.8rem); }
.sec__index {
  display: block;
  font-size: .6875rem; letter-spacing: .3em;
  color: var(--faint);
  margin-bottom: 1rem;
}
.sec__title {
  font: 800 clamp(1.8rem, 3.8vw, 2.9rem)/1.15 var(--fd);
  letter-spacing: -.025em;
}
.sec__title .dim { font-weight: 700; }
.sec__note { margin-top: 1rem; color: var(--dim); max-width: 42rem; }
.sec__note b { color: var(--ink); }

/* Wrap control: no one-word last lines (progressive enhancement) */
.sec__title, .cant__mega, .signup__title, .era__cap, .prow__body h3 { text-wrap: balance; }
.hero__lede, .sec__note, .cant__kicker, .prow__body p, .charity__lede, .step p, .era__sub, .signup__lede, .ftr__tag, .ftr__legal { text-wrap: pretty; }

.js [data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].in { opacity: 1; transform: none; }
[data-d="1"] { --d: .07s; } [data-d="2"] { --d: .14s; } [data-d="3"] { --d: .21s; } [data-d="4"] { --d: .28s; }

/* ---------- Steps ---------- */

.steps__row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}
.step {
  padding-block: 1.8rem 0; padding-inline: 1.2rem 1.4rem;
  border-inline-start: 1px solid var(--rule-soft);
  position: relative;
}
.step:first-child { border-inline-start: 0; padding-inline-start: 0; }
.step::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0;
  height: 1px; background: var(--grad);
  transform: scaleX(.4); transform-origin: left center;
  opacity: 0; transition: opacity .5s, transform .6s var(--ease);
}
.step:hover::before { opacity: 1; transform: scaleX(1); }
.step__n {
  display: block;
  font-size: 2.4rem; font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px rgba(148,160,255,.6);
  margin-bottom: 1rem;
  transition: color .4s, -webkit-text-stroke-color .4s;
}
.step:hover .step__n { color: var(--cyan); -webkit-text-stroke-color: var(--cyan); }
.step h3 { font: 700 1.125rem var(--fd); margin-bottom: .5rem; }
.step p { font-size: .875rem; color: var(--dim); }
.steps__note { margin-top: 1.7rem; padding-top: 1.1rem; border-top: 1px solid var(--rule-soft); font-size: .9rem; color: var(--dim); max-width: 64ch; }
.steps__note .privy { color: var(--ink); font-weight: 600; }
.steps__note .privy[href] { border-bottom: 1px solid var(--rule-strong); padding-bottom: .1em; transition: color .3s, border-color .3s; }
@media (hover: hover) { .steps__note .privy[href]:hover { color: var(--cyan); border-color: var(--cyan); } }

/* ---------- The machine (engineered) ---------- */

.draw { padding-top: 0; }

.machine { max-width: 960px; margin-inline: auto; }
.machine__frame {
  position: relative;
  border-radius: 14px;
  background: linear-gradient(180deg, #10141f, #0a0d16);
  border: 1px solid var(--steel);
  box-shadow:
    inset 0 1px 0 rgba(220,235,255,.09),
    inset 0 -1px 0 rgba(0,0,0,.6),
    0 34px 90px -30px rgba(0,0,0,.85);
  overflow: hidden;
}
/* brushed-metal sweep */
.machine__frame::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(115deg, transparent 0 38%, rgba(200,225,255,.035) 46%, transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 2px, transparent 2px 4px);
  pointer-events: none;
}
.machine__screws i {
  position: absolute; z-index: 2;
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #cfdae8, #5c6b7d 60%, #26313e);
  box-shadow: inset 0 -1px 2px rgba(0,0,0,.7);
}
.machine__screws i::after {
  content: ""; position: absolute; left: 1.5px; right: 1.5px; top: 50%;
  height: 1px; background: rgba(10,14,20,.75);
  transform: rotate(38deg);
}
.machine__screws i:nth-child(1) { top: 9px; left: 10px; }
.machine__screws i:nth-child(2) { top: 9px; right: 10px; }
.machine__screws i:nth-child(3) { bottom: 9px; left: 10px; }
.machine__screws i:nth-child(4) { bottom: 9px; right: 10px; }

.machine__head {
  display: flex; align-items: center; gap: .9rem;
  padding: 1rem 1.9rem;
  font-size: .6875rem; letter-spacing: .18em;
  color: var(--steel-ink);
  border-bottom: 1px solid var(--steel-rule);
}
.machine__headright { margin-inline-start: auto; color: var(--faint); }
.machine__led {
  width: 8px; height: 8px; border-radius: 50%;
  background: #37E6C3;
  box-shadow: 0 0 10px rgba(55,230,195,.9);
  animation: led 2.6s ease-in-out infinite;
  flex: none;
}
@keyframes led { 50% { opacity: .3; } }

.machine__stage { position: relative; height: clamp(320px, 44vw, 440px); }
#machine-canvas { width: 100%; height: 100%; }

.callout {
  position: absolute;
  display: flex; align-items: center; gap: .7em;
  font-size: .625rem; letter-spacing: .2em;
  color: rgba(165,185,210,.85);
}
.callout::before {
  content: ""; width: 36px; height: 1px;
  background: rgba(165,185,210,.4);
  flex: none;
}
.callout--dome { top: 9%; inset-inline-start: 2.5%; flex-direction: row-reverse; }
.callout--jet { bottom: 7%; inset-inline-start: 2.5%; flex-direction: row-reverse; }
.callout--port { top: 16%; inset-inline-end: 2.5%; }

.machine__out {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem;
  padding: 1.1rem 1.9rem;
  border-top: 1px solid var(--steel-rule);
}
.drawbtn {
  font-size: .72rem; font-weight: 700; letter-spacing: .2em;
  padding: .85em 1.7em;
  color: #DCE8F5;
  background: linear-gradient(180deg, #1b2231, #12161f);
  border: 1px solid rgba(170,190,215,.32);
  border-radius: 5px;
  box-shadow: inset 0 1px 0 rgba(220,235,255,.1), 0 4px 14px -6px rgba(0,0,0,.8);
  transition: border-color .3s, box-shadow .3s, color .3s;
}
.drawbtn:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: rgba(95,220,255,.6);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(220,235,255,.1), 0 0 22px -6px rgba(17,195,237,.55);
}
.drawbtn:disabled, .drawbtn[aria-disabled="true"] { opacity: .55; cursor: default; }
.drawbtn--ghost { background: none; box-shadow: none; border-color: var(--steel); color: var(--dim); }
.machine__btns { display: flex; flex-wrap: wrap; gap: .6rem; }
.drawbtn { white-space: nowrap; }
.drawbtn:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(1px); }
#draw-btn { min-width: 10.8em; }       /* reserves RUN AGAIN */
#machine-pause { min-width: 14em; }    /* reserves RESUME MOTION */
.machine__head > span { text-wrap: balance; }

.rack { display: flex; gap: .6rem; }
.rack li {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 8px;
  font-size: 1.0625rem; font-weight: 700;
  color: #EAF6FF;
  background: linear-gradient(180deg, #0a0e18, #10151f);
  border: 1px solid rgba(170,190,215,.18);
  box-shadow: inset 0 3px 9px rgba(0,0,0,.65);
  transition: border-color .35s, box-shadow .35s;
}
.rack li.filled {
  border-color: rgba(95,220,255,.5);
  box-shadow: inset 0 3px 9px rgba(0,0,0,.5), 0 0 18px -4px rgba(17,195,237,.5);
  text-shadow: 0 0 12px rgba(95,220,255,.8);
  animation: racked .45s var(--ease);
}
@keyframes racked { from { transform: scale(.7); } }

/* ---------- Latest results (real, from the results endpoint) ---------- */
.results { max-width: 960px; margin: 2.4rem auto 0; animation: results-in .7s var(--ease) both; }
@keyframes results-in { from { opacity: 0; transform: translateY(14px); } }
.results__title { font-size: .6875rem; font-weight: 500; letter-spacing: .24em; color: var(--steel-ink); padding: 0 .6rem 1rem; }
.results__list { border-top: 1px solid var(--rule); }
.results__all { display: inline-block; margin: 1.1rem .6rem 0; font-size: .75rem; letter-spacing: .12em; color: var(--steel-ink); transition: color .25s; }
.results__all:hover { color: var(--ink); }
.rrow {
  display: grid; grid-template-columns: 7.5rem 10rem minmax(0, 1fr);
  align-items: center; gap: 1.5rem;
  padding: 1rem .6rem;
  border-bottom: 1px solid var(--rule-soft);
}
.rrow--head { font-size: .625rem; letter-spacing: .24em; color: var(--faint); padding: 0 .6rem .7rem; border-bottom: 0; }
.rrow--head span:last-child { text-align: end; margin-inline-end: -.24em; }
.rrow__no { font-size: .9375rem; font-weight: 700; color: var(--ink); }
.rrow__date { font-size: .875rem; color: var(--dim); }
.rrow__nums { display: flex; justify-content: flex-end; }
.rrow__chips { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.rrow__chips b {
  display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  font-size: .8125rem; font-weight: 700; font-variant-numeric: tabular-nums;
  color: #EAF6FF;
  background: radial-gradient(circle at 35% 30%, #1b2346, #0a0e20);
  border: 1px solid var(--rule-strong);
}

.machine__plate {
  text-align: center;
  font-size: .6875rem; letter-spacing: .12em;
  text-wrap: balance;
  color: rgba(150,170,195,.85);
  text-shadow: 0 1px 0 rgba(0,0,0,.7);
  padding: 0 1.5rem 1.1rem;
}

/* ---------- Era strip ---------- */

.eraline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .9rem;
}
.era {
  position: relative;
  min-height: 330px;
  border: 1px solid var(--rule-soft);
  border-radius: 10px;
  overflow: hidden;
  background: #0b0f22;
  display: flex; align-items: stretch;
}
.era::before {
  content: ""; position: absolute; inset: 0;
  background-size: cover; background-position: center top;
  opacity: .5;
  transition: opacity .5s, transform .8s var(--ease);
}
.era:nth-child(1)::before { background-image: url('../media/era-1.webp'); }
.era:nth-child(2)::before { background-image: url('../media/era-2.webp'); }
.era:nth-child(3)::before { background-image: url('../media/era-3.webp'); }
.era:nth-child(4)::before { background-image: url('../media/era-4.webp'); }
.era:nth-child(5)::before { background-image: url('../media/era-5.webp'); }
.era::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,9,24,.05) 12%, rgba(7,9,24,.94) 62%);
}
.era:hover::before { opacity: .68; transform: scale(1.04); }
.era__body { position: relative; z-index: 1; width: 100%; padding: 9.5rem 1.1rem 1.3rem; }
.era__year { display: block; font-size: 1.75rem; font-weight: 700; line-height: 1; color: #fff; }
.era__name { display: block; font-size: .625rem; letter-spacing: .16em; color: var(--faint); margin-top: .5rem; }
.era__cap { font: 800 1.0625rem/1.25 var(--fd); letter-spacing: -.01em; margin-top: .8rem; }
.era__sub { font-size: .8125rem; line-height: 1.55; color: var(--dim); margin-top: .45rem; }
.era--now { border-color: rgba(95,220,255,.45); box-shadow: 0 0 44px -14px rgba(17,195,237,.4); }
.era__cap--grad {
  background: var(--grad-ink);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Prizes ledger ---------- */

.ledgerlist { border-top: 1px solid var(--rule); }
.lrow {
  display: grid;
  grid-template-columns: 1.2fr .7fr 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 1.6rem .6rem;
  border-bottom: 1px solid var(--rule-soft);
  position: relative;
  isolation: isolate;
}
.lrow:not(.lrow--head)::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(46,60,236,.1), transparent 70%);
  opacity: 0; transition: opacity .35s;
  pointer-events: none;
}
@media (hover: hover) {
  .lrow:not(.lrow--head):hover::before { opacity: 1; }
  .lrow:not(.lrow--head):hover .lrow__tier { transform: translateX(.6rem); }
}
.lrow--head {
  font-size: .625rem; letter-spacing: .24em; color: var(--faint);
  padding: .9rem .6rem;
}
.lrow--head span:nth-child(n+3) { text-align: end; margin-inline-end: -.24em; }
.lrow__tier { font: 700 1.25rem var(--fd); letter-spacing: -.01em; transition: transform .35s var(--ease); }
.lrow__match { color: var(--dim); font-size: .875rem; }
.lrow__share {
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 700;
  text-align: end;
  background: var(--grad-ink);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.lrow--t1 .lrow__share { background: linear-gradient(120deg, #35D2FF, #6D83FF); -webkit-background-clip: text; background-clip: text; }
.lrow--t2 .lrow__share { background: linear-gradient(120deg, #7B8CFF, #9D6BFF); -webkit-background-clip: text; background-clip: text; }
.lrow--t3 .lrow__share { background: linear-gradient(120deg, #B45CFF, #CE8BFF); -webkit-background-clip: text; background-clip: text; }
.lrow__share i { font-style: normal; font-size: .5em; }

/* ---------- Pillars ---------- */

.prow {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.5rem;
  padding: 2.4rem 0;
  border-top: 1px solid var(--rule);
}
.prow:last-child { border-bottom: 1px solid var(--rule); }
.prow__n {
  font: 700 4rem/0.9 var(--fm);
  color: transparent;
  -webkit-text-stroke: 1px var(--rule-strong);
}
.prow__body h3 { font: 700 1.375rem/1.25 var(--fd); letter-spacing: -.01em; margin-bottom: .6rem; }
.prow__k { font-size: .6875rem; letter-spacing: .12em; color: var(--faint); font-weight: 500; }
.prow__body p { color: var(--dim); max-width: 42rem; }
@media (max-width: 760px) {
  .prow__k {
    display: block;
    margin-top: .45rem;
    line-height: 1.7;
    text-wrap: balance;
  }
}

/* ---------- Partners ---------- */

.pgrid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 1fr;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.pgrid li {
  padding: 1.7rem 1.3rem;
  border-inline-start: 1px solid var(--rule-soft);
  display: flex; flex-direction: column; gap: .5rem;
  transition: background .35s;
}
.pgrid li:first-child { border-inline-start: 0; }
.pgrid li:hover { background: rgba(46,60,236,.07); }
.pgrid b { font: 700 1.0625rem var(--fd); }
.pgrid span { font-size: .6875rem; letter-spacing: .1em; color: var(--faint); line-height: 1.6; }

/* ---------- Charity ---------- */

.charity__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.charity__lede { color: var(--dim); margin-top: 1.3rem; max-width: 28rem; }

.charity__paperwrap { display: flex; justify-content: center; }

.paper {
  position: relative;
  width: min(400px, 100%);
  min-width: 0;
  background: var(--paper);
  color: var(--paper-ink);
  padding: 2rem 1.8rem 2.4rem;
  transform: rotate(2deg);
  box-shadow: 0 30px 70px -25px rgba(0,0,0,.85), 0 0 50px -20px rgba(139,22,224,.35);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), 97.5% 100%, 95% calc(100% - 10px), 92.5% 100%, 90% calc(100% - 10px), 87.5% 100%, 85% calc(100% - 10px), 82.5% 100%, 80% calc(100% - 10px), 77.5% 100%, 75% calc(100% - 10px), 72.5% 100%, 70% calc(100% - 10px), 67.5% 100%, 65% calc(100% - 10px), 62.5% 100%, 60% calc(100% - 10px), 57.5% 100%, 55% calc(100% - 10px), 52.5% 100%, 50% calc(100% - 10px), 47.5% 100%, 45% calc(100% - 10px), 42.5% 100%, 40% calc(100% - 10px), 37.5% 100%, 35% calc(100% - 10px), 32.5% 100%, 30% calc(100% - 10px), 27.5% 100%, 25% calc(100% - 10px), 22.5% 100%, 20% calc(100% - 10px), 17.5% 100%, 15% calc(100% - 10px), 12.5% 100%, 10% calc(100% - 10px), 7.5% 100%, 5% calc(100% - 10px), 2.5% 100%, 0 calc(100% - 10px));
  transition: transform .5s var(--ease);
}
@media (hover: hover) {
  .paper:hover { transform: rotate(0deg) scale(1.015); }
}

.paper__head { text-align: center; margin-bottom: 1.2rem; }
.paper__head b { display: block; font-size: 1.125rem; letter-spacing: .35em; }
.paper__head span { display: block; font-size: .625rem; letter-spacing: .2em; margin-top: .35rem; color: var(--paper-dim); }
.paper .paper__rule { display: block; height: 0; margin: .7rem 0; border-top: 2px dotted #b9b4a6; font-size: 0; letter-spacing: 0; }

.paper__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  padding: .45rem 0;
}
.paper__row span:first-child { color: var(--paper-dim); }
.paper__row span:nth-child(2) { text-align: start; }
.paper__row b { font-weight: 700; }
.paper__row--total { grid-template-columns: 1fr auto; font-size: .6875rem; color: var(--paper-dim); }
.paper__row--kv { grid-template-columns: auto 1fr; }
.paper__row--kv b { text-align: end; }
.paper__txs button.ptx { background: none; cursor: pointer; }

.paper__txs { display: grid; grid-template-columns: repeat(2, max-content); gap: .5rem; margin-top: 1rem; }
.ptx {
  font-family: var(--fm);
  font-size: .6875rem;
  padding: .45em .8em;
  border: 1px solid var(--paper-rule);
  border-radius: 3px;
  color: var(--paper-dim);
  transition: border-color .25s, color .25s, background .25s;
}
.ptx:hover { border-color: var(--purple); color: var(--purple); }
.ptx--static { cursor: default; }
.ptx--static:hover { border-color: var(--paper-rule); color: var(--paper-dim); }
.ptx--dark {
  border-color: var(--rule);
  color: var(--dim);
  background: rgba(11,15,38,.5);
  text-align: start;
}
.ptx--dark:hover { border-color: var(--cyan); color: var(--ink); background: rgba(17,195,237,.06); }
button.ptx:active { transform: translateY(1px); }

.paper__stamp {
  position: absolute; inset-inline-end: 1.2rem; bottom: 2.6rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .2em;
  text-align: center;
  line-height: 1.5;
  color: var(--purple);
  border: 2px solid var(--purple);
  border-radius: 6px;
  padding: .55em .8em;
  transform: rotate(-12deg);
  opacity: .8;
  pointer-events: none;
  -webkit-mask-image: var(--stamp-mask);
  mask-image: var(--stamp-mask);
}

/* ---------- Team ---------- */

.team { border-top: 1px solid var(--rule); }
/* Safari 15 has no overflow: clip, so the html/body guard does nothing there: keep the glow (and the full-bleed
   photo at 860px and below) from widening the page */
@supports not (overflow: clip) { .team { overflow-x: hidden; } }
.team__stage {
  position: relative; isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}
/* a faint brand glow behind the photo, so the picture sits in light instead of on a flat panel */
.team__stage::before {
  content: ""; position: absolute; inset: -8% -6% -8% 34%; z-index: -1; pointer-events: none;
  background: radial-gradient(58% 62% at 60% 50%, rgba(46,60,236,.2), rgba(139,22,224,.08) 55%, rgba(7,9,24,0) 75%);
}
.team__copy { display: flex; flex-direction: column; min-width: 0; }
/* two classes on purpose: the 340px rule for .sec__title must not shrink this title below the person's name */
.team .team__title { font-size: clamp(2.4rem, 5.6vw, 4.5rem); line-height: 1.02; }
.team__title .accent { display: inline-block; font-size: 1.14em; line-height: 1.05; padding-bottom: .08em; }
/* counter and arrows share one row above the name: they never move, whatever the length of the text below */
.team__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: clamp(1.5rem, 3vw, 2.6rem);
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--rule);
}
/* "01 / 05" always reads left to right, also on the right-to-left page (otherwise it shows as "05 / 01") */
.team__count { font-size: .8125rem; letter-spacing: .22em; color: var(--faint); direction: ltr; unicode-bidi: isolate; }
/* All people share one grid cell: the block is as tall as the longest text, so nothing jumps when the person changes */
.team__people { display: grid; margin-top: 1.3rem; }
.team__person {
  grid-area: 1 / 1;
  visibility: hidden; opacity: 0;
  transition: opacity .45s var(--ease), visibility 0s .45s;
}
.team__person.is-on { visibility: visible; opacity: 1; transition: opacity .45s var(--ease), visibility 0s; }
.team__name { font: 800 clamp(1.9rem, 3.4vw, 2.8rem)/1.1 var(--fd); letter-spacing: -.02em; }
.team__role {
  font: italic 500 clamp(1.05rem, 1.5vw, 1.25rem)/1.35 var(--fa);
  margin-top: .3rem;
  background: var(--grad-ink);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  width: fit-content; max-width: 100%;
}
.team__bio { margin-top: .95rem; color: var(--dim); font-size: .9375rem; line-height: 1.7; max-width: 31rem; text-wrap: pretty; }
/* text that is still to be supplied: tools/check.js refuses to pass while any [data-placeholder] is left */
.team [data-placeholder] { color: var(--faint); font-style: italic; }
.team__nav { display: flex; gap: .6rem; }
.team__arrow {
  width: 2.9rem; height: 2.9rem;
  display: grid; place-items: center;
  border: 1px solid var(--rule-strong);
  font-size: 1.15rem; line-height: 1;
  transition: border-color .25s, background-color .25s;
}
@media (hover: hover) { .team__arrow:hover { border-color: var(--cyan); background-color: rgba(17,195,237,.08); } }

/* No hard edge anywhere: the frame fades the two sides, each picture fades its own top and bottom. Two elements,
   so the two fades multiply without needing mask-composite. The text side fades over a longer distance. */
.team__photos {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.45) 10%, #000 30%, #000 76%, rgba(0,0,0,.55) 90%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.45) 10%, #000 30%, #000 76%, rgba(0,0,0,.55) 90%, rgba(0,0,0,0) 100%);
}
.team__photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  visibility: hidden; opacity: 0;
  transition: opacity .6s var(--ease), visibility 0s .6s;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.6) 7%, #000 18%, #000 76%, rgba(0,0,0,.5) 90%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.6) 7%, #000 18%, #000 76%, rgba(0,0,0,.5) 90%, rgba(0,0,0,0) 100%);
}
.team__photo.is-on { visibility: visible; opacity: 1; transition: opacity .6s var(--ease), visibility 0s; }
/* where each face sits in its picture, for the narrower thumb crop */
.team__photo--mazen, .team__photo--marc { object-position: 47% 50%; }
.team__photo--ranj { object-position: 60% 50%; }

.team__thumbs {
  /* one row of equal columns, however many people there are */
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  gap: clamp(.5rem, 1.4vw, 1.1rem);
  margin-top: clamp(1.6rem, 3.4vw, 2.6rem);
  padding-top: clamp(1.6rem, 3.4vw, 2.6rem);
  border-top: 1px solid var(--rule);
}
.team__thumb {
  position: relative; display: block; width: 100%;
  padding-bottom: .95rem;
  color: var(--faint); text-align: center;
  transition: color .3s;
}
.team__thumb img {
  width: 100%; height: auto; aspect-ratio: 10 / 9; object-fit: cover;
  /* shows through a portrait with a transparent background (rebaz.webp) */
  background: radial-gradient(85% 95% at 50% 42%, #1c2468 0%, #0d1130 62%, #090b1e 100%);
  filter: saturate(.8) brightness(.78);
  transition: filter .35s;
}
.team__thumb span { display: block; margin-top: .75rem; font: 700 clamp(.8rem, 1.5vw, 1.1rem)/1.2 var(--fd); }
.team__thumb::after {
  content: ""; position: absolute; inset-inline: 24%; bottom: 0; height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transition: transform .4s var(--ease);
}
.team__thumb[aria-pressed="true"] { color: var(--ink); }
.team__thumb[aria-pressed="true"] img { filter: none; }
.team__thumb[aria-pressed="true"]::after { transform: scaleX(1); }
@media (hover: hover) {
  .team__thumb:hover { color: var(--ink); }
  .team__thumb:hover img { filter: none; }
}
/* Scripts off: nothing can change the person, so all five texts show one under another, the row of photos stays
   as a plain picture row, and the controls that would do nothing (stage photo, counter, arrows) are left out */
.no-js .team__stage { grid-template-columns: minmax(0, 1fr); }
.no-js .team__stage::before, .no-js .team__photos, .no-js .team__bar { display: none; }
.no-js .team__people { margin-top: 2rem; }
.no-js .team__person { grid-area: auto; visibility: visible; opacity: 1; }
.no-js .team__person + .team__person { margin-top: 1.8rem; }
.no-js .team__thumb { pointer-events: none; color: var(--ink); }
.no-js .team__thumb img { filter: none; }
.no-js .team__thumb::after { display: none; }

/* ---------- Signup ---------- */

.signup { text-align: center; border-top: 1px solid var(--rule); }
.signup__title { font: 800 clamp(2rem, 4.4vw, 3.2rem)/1.15 var(--fd); letter-spacing: -.03em; }
.signup__lede { color: var(--dim); margin: .9rem auto 0; max-width: 34rem; }
/* Source order is address, tick box, button (the order people act in). Wide screens: address and button share
   the first row, the tick box sits under them. Phones (600px block below): one column in source order. */
.signup__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: .8rem;
  max-width: 460px;
  margin: 2rem auto 0;
}
.signup__form > * { grid-column: 1 / -1; }
.signup__form > input[type="email"] { grid-column: 1; grid-row: 1; }
.signup__form > .bigbtn { grid-column: 2; grid-row: 1; }
.signup__form > .consent { grid-row: 2; }
.signup__form > .signup__error { grid-row: 3; }
/* request in flight: the button stays focusable (aria-disabled), repeat presses are ignored by the script */
.signup__form > .bigbtn[aria-disabled="true"] { opacity: .6; cursor: progress; }
/* email field only: the consent tick box is an <input> inside the same form */
.signup__form input[type="email"] {
  min-width: 0;
  padding: 1em 1.2em;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: rgba(11,15,38,.6);
  color: var(--ink);
  font: 400 1rem var(--fb);
}
.signup__form input[type="email"]:focus {
  outline: none;
  border-color: rgba(17,195,237,.6);
  box-shadow: 0 0 0 3px rgba(17,195,237,.15);
}
.signup__form input[type="email"][aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px rgba(255,143,168,.15); }
/* consent tick box: the whole line is the label, so the text is clickable too */
.consent {
  display: flex; align-items: flex-start; gap: .7rem;
  margin-top: 1.1rem;
  text-align: start;
  font-size: .875rem; line-height: 1.5;
  color: var(--dim);
  cursor: pointer;
}
.consent input {
  flex: none;
  width: 1.15rem; height: 1.15rem;
  margin: .16rem 0 0;
  accent-color: var(--cyan);
  cursor: pointer;
}
/* dashed and only while not focused: with keyboard focus the global :focus-visible ring shows instead, so "focused"
   and "needs a tick" never look the same */
.consent input[aria-invalid="true"]:not(:focus-visible) { outline: 2px dashed var(--error); outline-offset: 3px; }
/* sits under the form and stays under the success line, where it explains that the confirmation email comes later */
.signup__note { max-width: 460px; margin: .5rem auto 0; font-size: .8125rem; line-height: 1.5; color: var(--faint); text-wrap: pretty; }
/* The script gives the success line the exact height of the form it replaces, so the page below does not jump.
   The min-height here is only an approximate fallback (English, mouse). */
.signup__success { display: grid; place-items: center; min-height: 7.6rem; margin-top: 2rem; font-size: .8125rem; line-height: 1.7; letter-spacing: .16em; color: var(--cyan); outline: none; text-wrap: balance; }
/* one full line is always reserved, so a one-line message or the "Sending…" status does not move the page */
.signup__error { display: block; margin-top: .8rem; font-size: .8125rem; line-height: 1.5; color: var(--error); min-height: 1.5em; }
.signup__error--status { color: var(--dim); }
.signup .fine { margin-top: 1.4rem; }

/* ---------- Footer ---------- */

.ftr { border-top: 1px solid var(--rule); padding: 3.5rem 0 2rem; }
.ftr__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.5fr 1fr;
  gap: 2.5rem;
}
.ftr__tag { color: var(--faint); font-size: .875rem; margin-top: 1rem; max-width: 19rem; }
.ftr__grid nav, .ftr__grid div { display: flex; flex-direction: column; align-items: flex-start; gap: .65rem; }
.ftr__grid h2 { font-size: .6875rem; font-weight: 500; letter-spacing: .28em; color: var(--faint); margin-bottom: .4rem; }
.ftr__grid a { font-size: .875rem; color: var(--dim); transition: color .25s; }
.ftr__grid a:hover { color: var(--ink); }
.ftr__grid .fine { margin-top: .3rem; letter-spacing: .02em; font-size: .75rem; }
.ftr__legal {
  margin-top: 3rem; padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
  font-size: .75rem; color: var(--faint);
}

/* ---------- Language menu ---------- */

.lang { position: relative; flex: none; }
.lang__btn {
  display: inline-flex; align-items: center; gap: .5em;
  height: 2.25rem; padding: 0 .85em;
  font-size: .6875rem; font-weight: 600; letter-spacing: .12em;
  color: var(--dim);
  background: rgba(11,15,38,.5);
  border: 1px solid var(--rule); border-radius: 999px;
  transition: color .25s, border-color .25s;
}
.lang__btn svg { width: 15px; height: 15px; flex: none; }
.lang__btn:hover, .lang__btn[aria-expanded="true"] { color: var(--ink); border-color: var(--dim); }
.lang__menu {
  position: absolute; top: calc(100% + .6rem); inset-inline-end: 0; z-index: 60;
  min-width: 12rem; padding: .4rem; margin: 0;
  background: rgba(9,12,30,.97);
  border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.85);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s, transform .25s var(--ease), visibility 0s .25s;
}
.lang.open .lang__menu { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .25s var(--ease), visibility 0s; }
.lang__item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; padding: .6rem .8rem;
  border-radius: 6px;
  font: 500 .9375rem var(--fb);
  color: var(--dim);
  text-align: start;
  transition: background .2s, color .2s;
}
.lang__item:hover, .lang__item:focus-visible { background: rgba(46,60,236,.16); color: var(--ink); outline: none; }
.lang__item[aria-selected="true"] { color: var(--ink); }
.lang__item[aria-selected="true"] .lang__code { color: var(--cyan); }
.lang__code { font: 600 .625rem var(--fm); letter-spacing: .14em; color: var(--faint); }

/* ---------- Right-to-left languages ---------- */

[dir="rtl"] .ticker__belt { animation-name: belt-rtl; }
[dir="rtl"] .tk-arrow { display: inline-block; transform: scaleX(-1); }
@keyframes belt-rtl { to { transform: translateX(25%); } }
[dir="rtl"] .lrow:not(.lrow--head)::before { background: linear-gradient(270deg, rgba(46,60,236,.1), transparent 70%); }
[dir="rtl"] .ticker::after { background: linear-gradient(270deg, rgba(9,11,30,0), #090b1e 45%); }
@media (hover: hover) {
  [dir="rtl"] .lrow:not(.lrow--head):hover .lrow__tier { transform: translateX(-.6rem); }
}
[dir="rtl"] .step::before { transform-origin: right center; }
[dir="rtl"] .board { background:
    radial-gradient(ellipse 55% 100% at 85% 50%, rgba(17,195,237,.09), transparent 70%),
    radial-gradient(ellipse 50% 100% at 12% 50%, rgba(139,22,224,.09), transparent 70%),
    rgba(11,15,38,.45); }
[dir="rtl"] .tickettilt { transform: rotate(4deg); }
[dir="rtl"] .paper { transform: rotate(-2deg); }
[dir="rtl"] .cant__stamp { transform: translateY(-50%) rotate(9deg); }
[dir="rtl"] .paper__stamp { transform: rotate(12deg); }
[dir="rtl"] .team__photos {
  -webkit-mask-image: linear-gradient(270deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.45) 10%, #000 30%, #000 76%, rgba(0,0,0,.55) 90%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(270deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.45) 10%, #000 30%, #000 76%, rgba(0,0,0,.55) 90%, rgba(0,0,0,0) 100%);
}
[dir="rtl"] .team__stage::before { inset: -8% 34% -8% -6%; transform: scaleX(-1); }
[dir="rtl"] .team__arrow span { display: inline-block; transform: scaleX(-1); }

/* Arabic: a proper Arabic face, no letter-spacing (it breaks the joined script), no italics */
html[lang="ar"] {
  --fd: 'Tajawal', 'Segoe UI', system-ui, sans-serif;
  --fb: 'Tajawal', 'Segoe UI', system-ui, sans-serif;
}
html[lang="ar"] [class] { letter-spacing: 0; }
html[lang="ar"] .accent, html[lang="ar"] .cant__line .accent { font-family: inherit; font-style: normal; font-weight: 800; }
html[lang="ar"] .team__role { font-family: inherit; font-style: normal; font-weight: 700; }
/* Russian: the first title word ("Знакомьтесь:") is one long word that cannot wrap, so the title runs smaller */
html[lang="ru"] .team__title { font-size: clamp(2rem, 4.4vw, 3.5rem); }
html[lang="ar"] .mega { line-height: 1.22; }
html[lang="ar"] .cant__mega, html[lang="ar"] .sec__title, html[lang="ar"] .signup__title { line-height: 1.3; }
html[lang="ar"] .mega__ghost { -webkit-text-stroke-width: 1.2px; }
html[lang="ar"] .hero__lede, html[lang="ar"] .sec__note, html[lang="ar"] .cant__kicker, html[lang="ar"] p { line-height: 1.85; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 2rem; z-index: 200;
  width: max-content;
  max-width: calc(100vw - 2rem);
  text-align: center;
  overflow-wrap: anywhere;
  transform: translate(-50%, 160%);
  opacity: 0;
  visibility: hidden;
  padding: .7em 1.4em;
  border-radius: 4px;
  font-size: .8125rem;
  color: var(--ink);
  background: rgba(11,15,38,.94);
  border: 1px solid rgba(17,195,237,.4);
  transition: transform .45s var(--ease), opacity .45s, visibility 0s .45s;
  pointer-events: none;
}
.toast.toast--sticky { pointer-events: auto; user-select: text; }
.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  transition: transform .45s var(--ease), opacity .45s, visibility 0s;
}

/* ---------- Responsive ---------- */

@media (max-width: 1020px) {
  .hero__grid { grid-template-columns: 1fr; gap: 2.6rem; }
  .hero { min-height: 0; }
  .hero__left { order: 1; }
  .board { order: 2; grid-template-columns: 1fr; gap: 1.4rem; padding: 1.4rem 1.6rem; }
  .board::before { display: none; }
  .board__cell--cd { border-top: 1px solid var(--rule-soft); padding-top: 1.3rem; }
  .hero__right { order: 3; justify-content: flex-start; }
  .tickettilt { transform: rotate(-2deg); }
  .steps__row { grid-template-columns: repeat(2, 1fr); row-gap: 2rem; }
  .step { padding-top: 1.4rem; }
  .step:nth-child(odd) { border-inline-start: 0; padding-inline-start: 0; }
  .cant__stamp { position: static; transform: rotate(-6deg); margin-top: 2.2rem; display: inline-block; }
  .eraline {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--rule-strong) transparent;
  }
  .eraline::-webkit-scrollbar { height: 6px; }
  .eraline::-webkit-scrollbar-track { background: transparent; }
  .eraline::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 3px; }
  .era { flex: 0 0 min(320px, 80vw); scroll-snap-align: start; }
  .charity__grid { grid-template-columns: minmax(0, 1fr); }
  .charity__paperwrap { justify-content: flex-start; }
  .ftr__grid { grid-template-columns: 1fr 1fr; }
  .pgrid { grid-template-columns: repeat(2, 1fr); }
  .pgrid li { border-top: 1px solid var(--rule-soft); }
  .pgrid li:nth-child(-n+2) { border-top: 0; }
  .pgrid li:nth-child(odd) { border-inline-start: 0; }
}

@media (min-width: 1021px) and (max-width: 1199px) {
  .pgrid { grid-template-columns: repeat(3, 1fr); }
  .pgrid li:nth-child(n+4) { border-top: 1px solid var(--rule-soft); }
  .pgrid li:nth-child(3n+1) { border-inline-start: 0; }
}

@media (max-width: 900px) {
  .callout { display: none; }
}

/* Short laptop screens: keep the jackpot billboard above the fold */
@media (min-width: 1021px) and (max-height: 860px) {
  .hero { padding-top: calc(var(--hh) + 1.6rem); padding-bottom: 2rem; }
  .hero__grid { gap: 1.6rem 2.5rem; }
  .stampline { margin-bottom: 1.2rem; }
  .mega { font-size: clamp(2.4rem, 4.4vw, 3.7rem); }
  .hero__lede { margin-top: 1rem; font-size: 1rem; }
  .hero__cta { margin-top: 1.4rem; }
  .hero__audit { margin-top: 1.3rem; }
  .ticket { --ticket-px: 1.6rem; width: min(370px, 88vw); padding: 1.5rem var(--ticket-px) 1.1rem; }
  .hole { max-width: 44px; font-size: .8125rem; }
  .board { --board-pad: 2rem; padding: 1.2rem var(--board-pad) 1.3rem; }
  .board__pot { --pot-size: clamp(2.4rem, 4.6vw, 3.8rem); }
  .seg b { font-size: clamp(1.7rem, 3vw, 2.5rem); }
}

/* Desktop nav just above the burger breakpoint: drop the logo tag so the row keeps its breathing room */
@media (min-width: 861px) and (max-width: 960px) {
  .logo__tag { display: none; }
}

@media (max-width: 860px) {
  /* team: heading, then the photo, then the person's text and the arrows */
  .team__stage { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .team__copy { display: contents; }
  .team__head { order: 1; }
  /* the photo runs edge to edge of the screen here, so only its top and bottom fade */
  .team__photos, [dir="rtl"] .team__photos {
    order: 2; margin-top: 1.2rem; margin-inline: calc(50% - 50vw);
    -webkit-mask-image: none; mask-image: none;
    /* the stage glow is off here: give the transparent portrait its own light to stand in */
    background: radial-gradient(48% 56% at 50% 46%, rgba(46,60,236,.22), rgba(139,22,224,.08) 55%, rgba(7,9,24,0) 80%);
  }
  .team__stage::before { display: none; }
  .team__bar { order: 3; margin-top: .4rem; }
  .team__people { order: 4; }
  .nav {
    position: fixed; inset: var(--hh) 0 auto;
    flex-direction: column; align-items: stretch; gap: 0;
    max-height: calc(100vh - var(--hh));
    max-height: calc(100dvh - var(--hh));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: rgba(7,9,24,.97);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--rule);
    padding: .8rem 1.5rem 1.5rem;
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    transition: opacity .3s ease, transform .35s var(--ease), visibility 0s .35s;
    z-index: -1;
  }
  .nav.open {
    opacity: 1;
    transform: none;
    visibility: visible;
    transition: opacity .3s ease, transform .35s var(--ease), visibility 0s;
  }
  .nav > a { flex-shrink: 0; }
  .nav > a:not(.cta) { padding: .85rem 0; font-size: 1.0625rem; }
  .nav .cta { margin-top: .9rem; text-align: center; }
  .burger { display: flex; }
}

/* Phone held sideways: Safari keeps the page inside the notch-safe area, so the full-bleed photo stops short of
   the screen edge with page-coloured bars beside it. Fade its two sides there (symmetric, so it also serves
   right-to-left). */
@media (max-width: 860px) and (orientation: landscape) and (max-height: 500px) {
  .team__photos, [dir="rtl"] .team__photos {
    -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, #000 14%, #000 86%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, #000 14%, #000 86%, rgba(0,0,0,0) 100%);
  }
}

@media (max-width: 600px) {
  .wrap { width: calc(100% - 2.2rem); }
  .team__thumbs { gap: .45rem; }
  .team__thumb { padding-bottom: .7rem; }
  .team__thumb span { margin-top: .5rem; font-size: .75rem; }
  .nav { padding-inline: 1.1rem; }
  .steps__row { grid-template-columns: 1fr; }
  .step { border-inline-start: 0; padding-inline-start: 0; }
  .lrow { grid-template-columns: 1fr auto; row-gap: .3rem; }
  .lrow--head { display: none; }
  .lrow__tier { grid-column: 1; }
  .lrow__share { grid-column: 2; grid-row: 1 / 3; }
  .lrow__match { grid-column: 1; }
  .prow { grid-template-columns: 1fr; gap: .6rem; }
  .prow__n { font-size: 2.6rem; }
  .signup__form { grid-template-columns: minmax(0, 1fr); }
  .signup__form > .consent { margin-top: .9rem; }
  .signup__form > .bigbtn { grid-column: 1; grid-row: 3; margin-top: .9rem; }
  .signup__form > .signup__error { grid-row: 4; }
  .signup__success { min-height: 13rem; }
  .paper { padding-bottom: 5.4rem; }
  .paper__stamp { inset-inline-end: 1.4rem; bottom: 1.5rem; }
  .ftr__grid { grid-template-columns: 1fr; }
  .ticket { --ticket-px: 1.4rem; padding: 1.5rem var(--ticket-px) 1.2rem; }
  .ticket__stub { gap: 1rem; }
  .ticket__cdval { white-space: nowrap; }
  .ticket__sub { letter-spacing: .08em; }
  .ticket__barcode { flex: 0 1 96px; min-width: 0; }
  .hole { max-width: 42px; font-size: .75rem; }
  .board { padding: 1.2rem 1.2rem 1.3rem; }
  .board__cd { flex-wrap: wrap; }
  .rack { width: min(100%, 284px); display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .4rem; }
  .rack li { width: auto; height: auto; aspect-ratio: 1 / 1; font-size: .875rem; }
  .machine__head { padding: .9rem 1.2rem; gap: .6rem; font-size: .625rem; letter-spacing: .06em; }
  .machine__out { padding: 1rem 1.2rem; justify-content: center; }
  .drawbtn { letter-spacing: .12em; }
  #draw-btn { min-width: 10.1em; }
  #machine-pause { min-width: 13em; }
  .machine__btns { justify-content: center; }
}

@media (max-width: 700px) {
  /* two rows: the unit name, then "REPLAY · DRAW Nº …" under it, so a phone also says which draw is on the rack.
     The illustration label stays hidden here, as before: its plate already says SIMULATION. */
  .machine__head { display: grid; grid-template-columns: auto minmax(0, 1fr); row-gap: .3rem; }
  .machine__headright { grid-column: 2; margin-inline-start: 0; }
  .machine__headright[data-machine="sim"] { display: none; }
  .rrow { grid-template-columns: minmax(0, 1fr) auto; row-gap: .7rem; }
  .rrow--head { display: none; }
  .rrow__date { text-align: end; }
  .rrow__nums { grid-column: 1 / -1; justify-content: flex-start; }
  .rrow__chips { justify-content: flex-start; }
}

/* Touch: grow hit areas to ~44px without changing how anything looks */
@media (pointer: coarse) {
  .ticker__pause::before { content: ""; position: absolute; inset: -6px; }
  .linebtn, .ftr__grid a, .ftr__grid .ptx { position: relative; }
  .linebtn::after { content: ""; position: absolute; inset: -7px -8px; }
  .hero__note a { position: relative; }
  .hero__note a::after { content: ""; position: absolute; inset: -13px -8px; }
  .consent, .signup__form > .consent { padding-block: .72rem; margin-top: .4rem; }
  .consent input { width: 1.35rem; height: 1.35rem; margin-top: .05rem; }
  .ftr__grid nav, .ftr__grid div { gap: 1.25rem; }
  .ftr__tag { margin-top: .4rem; }
  .ftr__grid a::after, .ftr__grid .ptx::after { content: ""; position: absolute; inset: -10px 0; }
}
/* stacked form (600px and below) on a touch screen: the tick box line already carries its own padding above the button */
@media (max-width: 600px) and (pointer: coarse) {
  .signup__form > .bigbtn { margin-top: .2rem; }
}

/* ---------- Narrow phones: keep each headline row on one line ---------- */

@media (max-width: 400px) {
  .mega { font-size: 9.4vw; }
}

@media (max-width: 340px) {
  .sec__title { font-size: 1.55rem; }
}

/* Narrow phones: the language pill needs the room more than the logo tag */
@media (max-width: 420px) {
  .logo__tag { display: none; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  .js [data-intro], .js [data-reveal] { opacity: 1; transform: none; }
  .ticker__belt { animation: none; }
  .ticker__pause { display: none; }
}
