/* Lotería Perpetua — one ticket, drawn with Canvas2D (print.js), on every
 * device. `#stage` (main.js, three.js) is a second, optional layer on top: a
 * WebGL canvas that lights and tilts the exact same drawing, used as a
 * texture. It feature-detects itself and never runs at all if that fails, so
 * every rule below this comment has to keep making sense with `#stage`
 * deleted from the page — the flat card is the product, not its fallback. */
:root {
  --ink: #f6efe0;
  --dim: #b7ab93;
  --gold: #f0c250;
  --gold-deep: #a2761d;
  --cyan: #6fe5ff;
  --bg: #0b0906;
  --ui: clamp(13px, 0.62vw + 10px, 15px);
  --serif: 'Playfair Display', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--ui);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: clip;
  overscroll-behavior-y: none;
  /* One texture for the whole page, not just the stage: a repeating
   * diagonal hairline that tiles with no seam (`repeating-linear-gradient`
   * has no fixed origin), so the boundary between the flat marketing
   * background and the ticket stage below never shows as a different
   * surface — just the same grain continuing. */
  background:
    repeating-linear-gradient(135deg,
      rgba(240, 194, 80, 0.035) 0px,
      rgba(240, 194, 80, 0.035) 1px,
      transparent 1px,
      transparent 15px),
    var(--bg);
}

/* First paint. Covers the page while the ticket paints and the draw ticker
 * settles, so the first thing anyone sees is never a bare "—" placeholder.
 * boot.js fades it after a short minimum hold; the `loader-auto-hide`
 * animation is a pure-CSS backstop that fades it on its own if a script
 * error ever stops that handoff, so nobody is stuck behind it. */
#loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  background: var(--bg);
  opacity: 1;
  transition: opacity 0.5s ease;
  animation: loader-auto-hide 0s 3s forwards;
}
#loader.hide { opacity: 0; pointer-events: none; }
@keyframes loader-auto-hide {
  to { opacity: 0; pointer-events: none; }
}
.loader-mark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.3rem, 3.6vw, 1.8rem);
  letter-spacing: 0.01em;
  color: var(--ink);
}
.loader-mark em { font-style: italic; color: var(--gold); }
.loader-dot {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--gold) 55%, transparent);
  animation: pip-gold 1.3s ease-out infinite;
}
@keyframes pip-gold {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklab, var(--gold) 55%, transparent); }
  70%  { box-shadow: 0 0 0 0.7em transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  #loader { transition: none; }
  .loader-dot { animation: none; }
}

/* The ticket section: the next thing on the page after the landing copy,
 * normal document flow. Nothing fixed or hidden here — `#stage` is what's
 * fixed (below), and main.js is what defers its render loop until this
 * section scrolls into view; this box is just where the card would sit
 * either way, and what `#stage` reads to know where to draw it. */
#experience {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 5vh, 2.6rem);
  min-height: 100dvh;
  padding: calc(2.5rem + env(safe-area-inset-top)) clamp(1rem, 4vw, 2.5rem)
           calc(2rem + env(safe-area-inset-bottom));
  /* The glow lifting the card off the page — centered in the middle of the
   * section and fully faded out before it reaches any edge (top, bottom,
   * or sides), so it never touches the boundary with #marketing above it.
   * A gradient anchored at the edge (as this used to be) is bright exactly
   * where the seam would show; anchored in the middle, with room to fade,
   * it never does. */
  background: radial-gradient(60% 45% at 50% 42%, #1a1409 0%, transparent 100%);
}

/* The printed card. 1.6 x 2.25 is the ticket's real aspect (see print.js),
 * so the canvas box matches the print and `paintTicket` never letterboxes.
 * Height-bound first: this is a portrait object on a page usually shorter
 * than it is wide, and a card that overflows the fold is a card nobody
 * scrolls to.
 *
 * No border, no background — the drawing carries its own rounded corners and
 * punched talon in the alpha channel; `border-radius` below only rounds the
 * lift, which is a plain `box-shadow` and rectangular by nature. Not
 * `filter: drop-shadow()`: a filter rasterizes the canvas's actual alpha
 * channel and blurs it, and chained twice (as this was) is a known way to
 * stall the compositor on weaker Android GPU drivers — which can hitch the
 * whole OS, not just the tab. box-shadow draws a blurred rectangle behind the
 * box instead: a straight edge shows through the punched holes rather than
 * hugging the silhouette, a small trade against a page that can hang a phone. */
.flat-card {
  display: block;
  aspect-ratio: 1.6 / 2.25;
  height: min(56dvh, 30rem);
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 24px 40px -12px rgba(0, 0, 0, 0.55), 0 0 24px -6px rgba(240, 194, 80, 0.22);
}
@media (max-height: 620px) and (orientation: landscape) {
  .flat-card { height: min(74dvh, 22rem); }
}

/* `#stage`: the WebGL canvas, created by main.js only after it confirms
 * WebGL actually works. Fixed and full-viewport because the card inside it
 * has to track `.flat-card`'s screen position as the page scrolls past a
 * canvas that itself never moves. `alpha: true` on the renderer (gl.js) is
 * what lets `#marketing`'s own backgrounds keep covering it everywhere
 * except the mostly-transparent glow behind `#experience` — the same reason
 * z-index only needs to clear `body`'s background, not `#marketing`'s. */
#stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;    /* tilt reads pointermove on window, not on this */
}

/* Once `#stage` is actually drawing, `.flat-card` becomes a texture source
 * only — still sized and painted by ticket-ui.js exactly as before, still a
 * normal flex item taking up its usual box, just not the thing on screen.
 * Deliberately not `display: none` (which zeros `getBoundingClientRect()`
 * and breaks both ticket-ui.js's resize-to-fit and ticket.js's anchor math)
 * and not `position: absolute` (which would take it out of flex flow and
 * hand its placement to the flex-container static-position rules instead of
 * just leaving it exactly where it already was). Plain opacity leaves the
 * layout untouched and the rect correct every frame. */
#experience.staged .flat-card {
  opacity: 0;
  pointer-events: none;
}

/* A mint changes the digits printed on the card, which on a still page is
 * easy to miss, so it takes one gold pulse. */
#experience.minted .flat-card { animation: card-mint 0.5s ease-out; }
@keyframes card-mint {
  0%   { box-shadow: 0 24px 40px -12px rgba(0, 0, 0, 0.55), 0 0 34px -4px rgba(240, 194, 80, 0.7); }
  100% { box-shadow: 0 24px 40px -12px rgba(0, 0, 0, 0.55), 0 0 24px -6px rgba(240, 194, 80, 0.22); }
}

/* The text stub: number, series, serial as a printed panel. Fallback for the
 * one case left — a browser that refuses a 2D canvas context — so `.carded`
 * folds it away the moment the real card actually paints. Bronze rule, warm
 * sheen off the top-left, and a punched edge matching the card's own talon. */
#experience.carded .ticket-info { display: none; }
.ticket-info {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5em;
  padding: clamp(1.3rem, 4vh, 1.9rem) clamp(1.5rem, 6vw, 2.8rem)
           clamp(1.3rem, 4vh, 1.9rem) clamp(2.5rem, 9vw, 3.8rem);
  border: 1px solid color-mix(in oklab, var(--gold) 32%, transparent);
  border-radius: 10px;
  background:
    linear-gradient(168deg, color-mix(in oklab, var(--gold) 10%, transparent), transparent 68%),
    #120e08;
  box-shadow: 0 26px 64px -32px #000, 0 0 0 1px #ffffff0a inset;
}
.ticket-info::before {
  content: '';
  position: absolute;
  left: clamp(0.85rem, 3vw, 1.3rem);
  top: 1.1rem;
  bottom: 1.1rem;
  width: 6px;
  background: radial-gradient(circle at 3px 3px, #0b0906 2.3px, transparent 2.5px) 0 0 / 6px 13px repeat-y;
}
.ti-label {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--dim) 70%, transparent);
}
.ti-number {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 5.6vw, 2.3rem);
  letter-spacing: 0.11em;
  color: var(--gold);
}
.ti-serial {
  font-family: var(--mono);
  font-size: clamp(0.74rem, 2.6vw, 0.9rem);
  letter-spacing: 0.12em;
  color: color-mix(in oklab, var(--ink) 58%, transparent);
}

/* Same one-shot as the card, for the fallback stub. */
#experience.minted .ticket-info { animation: stub-mint 0.52s ease-out; }
@keyframes stub-mint {
  0%   { border-color: var(--gold); box-shadow: 0 0 34px -4px #f0c25066, 0 26px 64px -32px #000; }
  100% { border-color: color-mix(in oklab, var(--gold) 32%, transparent); box-shadow: 0 0 0 0 #f0c25000, 0 26px 64px -32px #000; }
}

.dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75em;
}

.btn {
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #1a1206;
  border: 0;
  border-radius: 999px;
  padding: 0.78em 1.7em;
  cursor: pointer;
  background: linear-gradient(180deg, #ffe6a4, var(--gold) 48%, #c08d24);
  box-shadow: 0 1px 0 #fff7dd inset, 0 -1px 0 #7c5711 inset, 0 12px 32px -12px #f0c25088;
  transition: transform 0.16s ease, box-shadow 0.24s ease, filter 0.24s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 1px 0 #fff7dd inset, 0 -1px 0 #7c5711 inset, 0 18px 40px -14px #f0c250aa; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.55; cursor: progress; transform: none; }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* No JavaScript. The content column stays readable at any width; the grid
 * track (not a max-width on the box) is what centers it. */
.ns {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: min(52rem, 100%);
  place-content: center;
  justify-items: center;
  gap: 0.8rem;
  padding: 2rem;
  overflow-y: auto;
  background: var(--bg);
  text-align: center;
}
.ns h2 { font-family: var(--serif); font-weight: 500; margin: 0; }
.ns p { margin: 0; color: var(--dim); line-height: 1.55; }
.ns img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 0.6rem;
}
/* ===================================================================== */
/* The landing page above the stage.
 *
 * Flat on purpose: type, hairlines, two gradients and one motif — the ticket
 * perforation, which shows up as the section dividers and as the tear line
 * down the price card. It costs nothing next to the WebGL below, and it shares
 * no rule with the experience, so it can be rewritten without risking the
 * scene.
 *
 * Live values (`data-role`) are painted by chain.js. Every one of them has a
 * static fallback in the markup, because the network is allowed to be down. */
/* ===================================================================== */

#marketing {
  position: relative;
  z-index: 2;                    /* above the fixed stage, below the grain */
  padding-bottom: 1px;           /* contains the last child's margin */
}

/* The wordmark, and nothing around it. Absolutely positioned so it costs the
 * hero no height, small enough to read as a mark rather than a heading, and
 * dim enough that the eye reaches the headline first. It brightens on hover,
 * which is the only affordance it needs. */
.logo {
  position: absolute;
  z-index: 3;
  top: calc(clamp(1.4rem, 3vh, 2.2rem) + env(safe-area-inset-top));
  left: clamp(1.15rem, 4vw, 3rem);
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: color-mix(in oklab, var(--ink) 58%, transparent);
  transition: color 0.25s ease;
}
.logo span { color: color-mix(in oklab, var(--dim) 45%, transparent); }
.logo:hover { color: var(--ink); }
.logo:hover span { color: var(--dim); }
.logo:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; border-radius: 3px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--gold) 74%, transparent);
  margin: 0 0 1.4em;
}

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

.m-hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(clamp(2rem, 6vh, 5rem) + env(safe-area-inset-top))
           clamp(1.15rem, 4vw, 3rem) clamp(3rem, 9vh, 6rem);
  max-width: 78rem;
  margin-inline: auto;
}

/* The claim the whole page rests on, stated as a live fact before it is stated
 * as a sentence: a draw number that is currently ticking. */
.ticker {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5em;
  align-self: flex-start;
  margin: 0 0 1.8em;
  font-family: var(--mono);
  font-size: clamp(0.7rem, 1.5vw, 0.82rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--ink) 62%, transparent);
}
/* The number is a link to the block it names: the page's one outside claim,
 * one click from proof. Underlined only on hover — at this size and tracking a
 * permanent rule would read as a mistake in the middle of the sentence. */
.ticker [data-role='height'] {
  color: var(--gold);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.ticker [data-role='height']:hover { border-bottom-color: color-mix(in oklab, var(--gold) 60%, transparent); }
.ticker [data-role='height']:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* A block was found. One gold strike on the number, which is the only place the
 * draw is named now that the header is gone. */
.ticker [data-role='height'].struck { animation: draw-struck 1.6s ease-out; }
@keyframes draw-struck {
  0%   { color: #fff6d8; text-shadow: 0 0 18px color-mix(in oklab, var(--gold) 85%, transparent); }
  100% { color: var(--gold); text-shadow: 0 0 0 transparent; }
}
.ticker .sep { color: color-mix(in oklab, var(--ink) 30%, transparent); }
.ticker [data-role='since'] { font-variant-numeric: tabular-nums; }
.dot {
  align-self: center;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--cyan) 70%, transparent);
  animation: pip 2.4s ease-out infinite;
}
@keyframes pip {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklab, var(--cyan) 55%, transparent); }
  70%  { box-shadow: 0 0 0 0.7em transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.m-hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 8.6vw, 6.8rem);
  line-height: 0.96;
  letter-spacing: -0.022em;
  margin: 0 0 0.55em;
  text-wrap: balance;
}
.m-hero h1 em {
  font-style: italic;
  line-height: 1.2;
  background: linear-gradient(96deg, var(--gold) 4%, #fff6d8 44%, var(--gold-deep) 94%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.m-lede {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.62;
  color: var(--dim);
  text-wrap: pretty;
}

.m-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2.4em;
}

.m-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding: 1.05em 1.9em;
  border: 1px solid color-mix(in oklab, var(--ink) 24%, transparent);
  border-radius: 999px;
  transition: border-color 0.22s ease, background 0.22s ease, transform 0.16s ease;
}
.m-cta:hover {
  border-color: var(--gold);
  background: color-mix(in oklab, var(--gold) 10%, transparent);
  transform: translateY(-1px);
}
.m-cta:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
/* One gold button per screen, and it always means the same thing: go and look
 * at the ticket. Same treatment as the mint button downstairs, on purpose. */
.m-cta.gold {
  color: #1a1206;
  border-color: transparent;
  background: linear-gradient(180deg, #ffe6a4, var(--gold) 48%, #c08d24);
  box-shadow: 0 1px 0 #fff7dd inset, 0 -1px 0 #7c5711 inset, 0 14px 34px -16px #f0c25099;
}
.m-cta.gold:hover { filter: brightness(1.05); background: linear-gradient(180deg, #ffe6a4, var(--gold) 48%, #c08d24); }

/* ---------------------------------------------------------- perforation */

/* The section rule as a tear line, with a punch hole bitten out of each margin.
 * One element, no images: the dashes are a repeating gradient and the holes are
 * two circles filled with the page background. */
.perf {
  position: relative;
  height: 1px;
  /* The holes hang 7 px past each end, so the rule stops short of the viewport
   * by that much — otherwise they are what makes the page scroll sideways. */
  width: calc(100% - 16px);
  max-width: 78rem;
  margin: 0 auto;
  background: repeating-linear-gradient(90deg,
    color-mix(in oklab, var(--gold) 38%, transparent) 0 9px,
    transparent 9px 20px);
}
.perf::before,
.perf::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid color-mix(in oklab, var(--gold) 28%, transparent);
  transform: translateY(-50%);
}
.perf::before { left: -7px; }
.perf::after  { right: -7px; }

/* ------------------------------------------------------------------ stats */

/* Four figures, no sentences. This is the whole offer for anyone who reads one
 * screen and leaves. */
.m-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: clamp(2rem, 5vw, 3.5rem);
  padding: clamp(3rem, 9vh, 6rem) clamp(1.15rem, 4vw, 3rem);
  max-width: 78rem;
  margin-inline: auto;
}
.m-stats div { display: flex; flex-direction: column; gap: 0.5em; }
.m-stats b {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 5.4vw, 3.9rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(150deg, #fff6d8 8%, var(--gold) 52%, var(--gold-deep) 98%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.m-stats b i {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.32em;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-left: 0.35em;
  vertical-align: 0.9em;
}
.m-stats span {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--dim) 88%, transparent);
  line-height: 1.5;
}

/* -------------------------------------------------------------------- pot */

/* The prize. Centred and given a whole band to itself because it is the only
 * number on the page the reader did not already know, and because every other
 * figure here is something they pay or wait for. */
.m-pot {
  padding: clamp(3rem, 9vh, 6rem) clamp(1.15rem, 4vw, 3rem);
  max-width: 78rem;
  margin-inline: auto;
  text-align: center;
  background: radial-gradient(60% 90% at 50% 40%, color-mix(in oklab, var(--gold) 8%, transparent), transparent 72%);
}
.pot-big {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.5rem, 8vw, 5.2rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 0.28em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(150deg, #fff6d8 6%, var(--gold) 48%, var(--gold-deep) 98%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pot-big i {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.24em;
  letter-spacing: 0.2em;
  vertical-align: 0.9em;
  margin-left: 0.15em;
}
/* The peso conversion, quieter than the headline figure: it moves every ninety
 * seconds and it is the number nobody quotes back to you. */
.pot-fiat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.7em;
  margin: 0 0 1.8em;
  font-family: var(--mono);
  font-size: clamp(0.92rem, 2.4vw, 1.35rem);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.pot-fiat span { color: color-mix(in oklab, var(--ink) 28%, transparent); }
.pot-fiat b { font-weight: 500; }
.pot-note {
  margin: 0 auto;
  max-width: 48ch;
  color: color-mix(in oklab, var(--dim) 84%, transparent);
  line-height: 1.65;
  text-wrap: pretty;
}

/* ------------------------------------------------------------ then / now */

/* The comparison is the pitch, so it is carried by the styling as much as by
 * the words: the past is dim and unruled, the present is lit and has a gold
 * edge holding it up. */
.m-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(3rem, 9vh, 6rem) clamp(1.15rem, 4vw, 3rem);
  max-width: 78rem;
  margin-inline: auto;
  scroll-margin-top: 2rem;
}
.m-band .n {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 1.2em;
}
.m-band h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}
.m-band p {
  margin: 0;
  color: var(--dim);
  line-height: 1.65;
  max-width: 38ch;
  text-wrap: pretty;
}
.m-then {
  padding-left: 1.6rem;
  border-left: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  opacity: 0.62;
}
.m-then .n { color: color-mix(in oklab, var(--dim) 80%, transparent); }
.m-now {
  padding-left: 1.6rem;
  border-left: 1px solid var(--gold);
}
.m-now .n { color: var(--gold); }
.m-now h2 { color: var(--ink); }

/* ------------------------------------------------------------------ price */

.m-price {
  padding: clamp(2rem, 6vh, 4rem) clamp(1.15rem, 4vw, 3rem) clamp(3.5rem, 10vh, 7rem);
  max-width: 78rem;
  margin-inline: auto;
}

/* A ticket, because the thing being sold is a ticket: body, tear line, stub.
 * The card downstairs is the same object rendered in brass. */
.stub {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 16rem);
  border: 1px solid color-mix(in oklab, var(--gold) 26%, transparent);
  border-radius: 16px;
  background:
    radial-gradient(80% 120% at 0% 0%, color-mix(in oklab, var(--gold) 9%, transparent), transparent 62%),
    linear-gradient(180deg, #14100a, #0c0906);
  box-shadow: 0 40px 90px -50px #000, 0 0 60px -30px color-mix(in oklab, var(--gold) 40%, transparent);
}
.stub-body { padding: clamp(1.8rem, 4vw, 3rem); }

.m-amount {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3rem, 10vw, 6rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 0.5em;
  background: linear-gradient(96deg, var(--gold) 4%, #fff6d8 44%, var(--gold-deep) 94%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.m-amount span {
  font-family: var(--mono);
  font-size: clamp(0.7rem, 1.6vw, 0.86rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  vertical-align: 0.62em;
  margin-left: 0.4em;
  -webkit-text-fill-color: var(--dim);
}
.stub-note {
  margin: 0 0 2.2em;
  max-width: 42ch;
  color: var(--dim);
  line-height: 1.65;
  text-wrap: pretty;
}
/* Fine print, and it should read like it: the currency has to be findable on
 * the page without competing with the price above it. */
.price-fine {
  margin: 1.6em 0 0;
  max-width: 40ch;
  font-size: 0.76rem;
  line-height: 1.6;
  color: color-mix(in oklab, var(--dim) 62%, transparent);
  text-wrap: pretty;
}
.price-fine b { color: color-mix(in oklab, var(--dim) 92%, transparent); font-weight: 600; }
.price-fine + .price-fine { margin-top: 0.7em; }
.price-fine a {
  color: color-mix(in oklab, var(--gold) 78%, transparent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--gold) 28%, transparent);
}
.price-fine a:hover { border-bottom-color: var(--gold); }

/* The tear: the same dashes as the section rules, turned on their side, with a
 * punch bitten out of the card's top and bottom edge. */
.stub-tear {
  position: relative;
  background: repeating-linear-gradient(180deg,
    color-mix(in oklab, var(--gold) 34%, transparent) 0 9px,
    transparent 9px 20px);
}
.stub-tear::before,
.stub-tear::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid color-mix(in oklab, var(--gold) 26%, transparent);
  transform: translate(-50%, -50%);
}
.stub-tear::before { top: 0; }
.stub-tear::after  { top: 100%; }

.stub-side {
  padding: clamp(1.8rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
}
.stub-side ul {
  list-style: none;
  margin: 0 0 1.8em;
  padding: 0;
  display: grid;
  gap: 0.62em;
}
.stub-side li {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--ink) 74%, transparent);
  padding-left: 1.5em;
  position: relative;
}
/* The same lozenge the printed card uses for its own micro list. */
.stub-side li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.4em;
  width: 0.58em;
  height: 0.58em;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  background: color-mix(in oklab, var(--gold) 30%, transparent);
}
.stub-foot {
  margin: auto 0 0;
  font-size: 0.86rem;
  line-height: 1.6;
  color: color-mix(in oklab, var(--dim) 82%, transparent);
  text-wrap: pretty;
}
.stub-foot a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--gold) 34%, transparent);
  white-space: nowrap;
}
.stub-foot a:hover { border-bottom-color: var(--gold); }

/* ------------------------------------------------------------------- next */

/* The roadmap. Panels rather than plain columns: unbuilt things have to look
 * different from the ticket they sit under, or the page starts selling them.
 * Círculos gets the full width and the gold edge — it is the one people ask
 * for by name. */
.m-next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.2rem, 2.6vw, 1.8rem);
  padding: clamp(3rem, 9vh, 6rem) clamp(1.15rem, 4vw, 3rem);
  max-width: 78rem;
  margin-inline: auto;
  scroll-margin-top: 2rem;
}
.m-next > header {
  grid-column: 1 / -1;
  margin-bottom: clamp(0.4rem, 2vh, 1rem);
}
.m-next > header h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
  margin: 0.35em 0 0.4em;
}
.m-next > header p {
  margin: 0;
  max-width: 54ch;
  color: var(--dim);
  line-height: 1.65;
  text-wrap: pretty;
}
.next-card {
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  border-radius: 14px;
  background: color-mix(in oklab, var(--ink) 3%, transparent);
}
.next-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  letter-spacing: -0.01em;
  margin: 0 0 0.55em;
}
.next-card p {
  margin: 0 0 0.9em;
  color: var(--dim);
  line-height: 1.65;
  text-wrap: pretty;
}
.next-card p:last-child { margin-bottom: 0; }
.next-card b { color: var(--ink); font-weight: 500; }
.next-card .next-tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--dim) 80%, transparent);
  margin-bottom: 1.2em;
}
/* Círculos: full width, lit, and the only card here allowed to look like the
 * ticket. */
.next-card.feature {
  grid-column: 1 / -1;
  border-color: color-mix(in oklab, var(--gold) 30%, transparent);
  background:
    radial-gradient(70% 130% at 0% 0%, color-mix(in oklab, var(--gold) 9%, transparent), transparent 64%),
    linear-gradient(180deg, #14100a, #0c0906);
}
.next-card.feature h3 { color: var(--gold); }
.next-card.feature p { max-width: 62ch; }
.next-card.feature b { color: var(--gold); font-weight: 600; }
.next-card.feature .next-tag { color: var(--gold); }
/* Tiers: a plain card, but the copy runs long and reads badly in a half-width
 * column, so it takes the full row like the feature does. */
.next-card.wide { grid-column: 1 / -1; }

/* ------------------------------------------------------------------ steps */

/* Three numbered beats. The whole product fits in them, so they are read in
 * one pass: a gold ordinal, a line, a sentence. */
.m-steps {
  display: grid;
  /* Exactly three, so the beats never leave a fourth empty track on a wide
   * screen; they stack whole at the narrow breakpoint below. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3.2rem);
  padding: clamp(3rem, 9vh, 6rem) clamp(1.15rem, 4vw, 3rem);
  max-width: 78rem;
  margin-inline: auto;
  scroll-margin-top: 2rem;
}
.m-steps > header { grid-column: 1 / -1; }
.m-steps > header h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.4em;
}
.m-steps > header p {
  margin: 0;
  max-width: 52ch;
  color: var(--dim);
  line-height: 1.65;
  text-wrap: pretty;
}
.step .n {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  color: var(--gold);
  margin-bottom: 1em;
}
.step h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  letter-spacing: -0.01em;
  margin: 0 0 0.55em;
  padding-top: 1.1em;
  border-top: 1px solid color-mix(in oklab, var(--gold) 26%, transparent);
}
.step p {
  margin: 0;
  color: var(--dim);
  line-height: 1.65;
  max-width: 38ch;
  text-wrap: pretty;
}

/* -------------------------------------------------------------------- faq */

/* Answers, not blurbs. Closed by default so the page still reads in one
 * scroll; every row is a plain <details>, so it works with no JavaScript and
 * ctrl-F finds the text a browser has collapsed. */
.m-faq {
  padding: clamp(2rem, 6vh, 4rem) clamp(1.15rem, 4vw, 3rem) clamp(3.5rem, 10vh, 7rem);
  max-width: 60rem;
  margin-inline: auto;
  scroll-margin-top: 2rem;
}
.m-faq > h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.3em;
}
.m-faq > .faq-lede {
  margin: 0 0 clamp(1.6rem, 4vh, 2.6rem);
  max-width: 52ch;
  color: var(--dim);
  line-height: 1.65;
  text-wrap: pretty;
}
.faq-q {
  border-top: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
}
.faq-q:last-of-type {
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
}
.faq-q > summary {
  cursor: pointer;
  list-style: none;
  position: relative;
  padding: 1.15em 2.6em 1.15em 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.05rem, 1.9vw, 1.3rem);
  letter-spacing: -0.01em;
  line-height: 1.35;
  transition: color 0.2s ease;
}
.faq-q > summary::-webkit-details-marker { display: none; }
.faq-q > summary:hover { color: var(--gold); }
.faq-q > summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
/* The same lozenge the ticket stub uses, rotated open. */
.faq-q > summary::after {
  content: '';
  position: absolute;
  right: 0.4em;
  top: 1.55em;
  width: 0.55em;
  height: 0.55em;
  border: 1px solid var(--gold);
  background: color-mix(in oklab, var(--gold) 30%, transparent);
  transform: rotate(45deg);
  transition: transform 0.25s ease, background 0.25s ease;
}
.faq-q[open] > summary { color: var(--gold); }
.faq-q[open] > summary::after {
  transform: rotate(135deg) scale(0.86);
  background: transparent;
}
.faq-a {
  padding: 0 2.6em 1.7em 0;
  max-width: 62ch;
}
.faq-a p {
  margin: 0 0 0.9em;
  color: var(--dim);
  line-height: 1.7;
  text-wrap: pretty;
}
.faq-a p:last-child { margin-bottom: 0; }
.faq-a b { color: var(--ink); font-weight: 500; }
/* The founding-customer promise. It sits inside an answer about long odds, so
 * it has to read as the one guaranteed thing on the page: gold edge, lit
 * panel, and the only lozenge-tagged block in the FAQ. */
.faq-promise {
  margin: 1.4em 0 0;
  padding: 1.25em 1.4em;
  border: 1px solid color-mix(in oklab, var(--gold) 30%, transparent);
  border-radius: 12px;
  background:
    radial-gradient(90% 140% at 0% 0%, color-mix(in oklab, var(--gold) 10%, transparent), transparent 66%),
    color-mix(in oklab, var(--gold) 4%, transparent);
}
.faq-promise p { margin: 0; color: var(--ink); }
.faq-promise b { font-weight: 600; color: var(--gold); }
.faq-promise .promise-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.9em;
}
.faq-foot {
  margin: clamp(2rem, 5vh, 3rem) 0 0;
  padding-top: 1.6rem;
  color: color-mix(in oklab, var(--dim) 82%, transparent);
  line-height: 1.7;
  text-wrap: pretty;
}

/* --------------------------------------------------------------- narrow */

@media (max-width: 720px) {
  /* The stub cannot keep a side panel at this width without both columns
   * becoming unreadable, so the ticket tears horizontally instead — which is
   * how a real one tears anyway. */
  .stub { grid-template-columns: minmax(0, 1fr); }
  .stub-tear {
    height: 1px;
    background: repeating-linear-gradient(90deg,
      color-mix(in oklab, var(--gold) 34%, transparent) 0 9px,
      transparent 9px 20px);
  }
  .stub-tear::before { top: 50%; left: 0; }
  .stub-tear::after  { top: 50%; left: 100%; }
  .stub-body { padding-bottom: clamp(1.4rem, 5vw, 2rem); }
  .stub-side { padding-top: clamp(1.4rem, 5vw, 2rem); }
  .m-actions .m-cta { flex: 1 1 100%; }
  .faq-a { padding-right: 0.5em; }
  .faq-q > summary { padding-right: 2.2em; }
  .m-steps { grid-template-columns: minmax(0, 1fr); }
  .m-next { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot { animation: none; }
}

/* ===================================================================== */
/* Panel del sorteo (/lotperp/dashboard/) and Tu ticket (/lotperp/panel/).
 * Same tokens and vocabulary as the landing page (.eyebrow, .ticker, .m-cta,
 * .btn, .ti-label/.ti-serial), just laid out as a single centred column
 * instead of a hero — neither page has a 3D stage or a scroll story, they are
 * read once and left. .logo is `position: absolute` on the landing page, so
 * the column gets the same top offset as padding to keep clear of it. */
.pd-page {
  max-width: 34rem;
  margin: 0 auto;
  padding: calc(clamp(1.4rem, 3vh, 2.2rem) + env(safe-area-inset-top) + 3.6rem)
           clamp(1.1rem, 4vw, 1.6rem) calc(4rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: clamp(1.6rem, 4vh, 2.4rem);
}
.pd-head h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1.08;
  margin: 0 0 0.5em;
}
.pd-lede { margin: 0 0 1.2em; color: var(--dim); line-height: 1.55; }
.pd-nav { display: flex; flex-wrap: wrap; gap: 0.6em; }

/* The ticker card: the same header-strip ticker, plus the pot, plus a
 * mempool gauge, boxed like the ticket stub so it reads as one instrument. */
.pd-ticker-card {
  padding: clamp(1.4rem, 4vw, 2rem);
  border: 1px solid color-mix(in oklab, var(--gold) 26%, transparent);
  border-radius: 16px;
  background:
    radial-gradient(80% 120% at 0% 0%, color-mix(in oklab, var(--gold) 9%, transparent), transparent 62%),
    linear-gradient(180deg, #14100a, #0c0906);
  box-shadow: 0 40px 90px -50px #000, 0 0 60px -30px color-mix(in oklab, var(--gold) 40%, transparent);
  display: flex;
  flex-direction: column;
  gap: 1.3em;
}
.pd-pot { text-align: center; }
.pd-pot-big {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-variant-numeric: tabular-nums;
  background: linear-gradient(150deg, #fff6d8 6%, var(--gold) 48%, var(--gold-deep) 98%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pd-pot-fiat { margin: 0.3em 0 0; color: var(--dim); }
.pd-pot-fiat b { color: var(--ink); font-weight: 600; }

.pd-load { display: flex; flex-direction: column; gap: 0.5em; }
.pd-load-track {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--ink) 12%, transparent);
  overflow: hidden;
}
.pd-load-bar {
  height: 100%;
  width: calc(var(--load, 0) * 1%);
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  transition: width 0.6s ease;
}
.pd-load-label { margin: 0; font-family: var(--mono); font-size: 0.72rem; color: var(--dim); }

/* Community counters: same three-up grid the landing page's .m-stats uses. */
.pd-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  text-align: center;
}
.pd-stat b {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}
.pd-stat span { font-size: 0.78rem; color: var(--dim); }
.pd-foot { color: var(--dim); font-size: 0.85rem; line-height: 1.6; }
.pd-foot a { color: var(--gold); text-decoration: none; border-bottom: 1px solid color-mix(in oklab, var(--gold) 34%, transparent); }
.pd-foot a:hover { border-bottom-color: var(--gold); }

/* Lookup form: a single mono field shaped like the serial it expects, so
 * typing it in feels like transcribing the ticket rather than filling a form. */
.pd-lookup { display: flex; flex-direction: column; gap: 0.6em; }
.pd-lookup-row { display: flex; gap: 0.6em; flex-wrap: wrap; }
#serial-input {
  flex: 1 1 14rem;
  font: inherit;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: #120e08;
  border: 1px solid color-mix(in oklab, var(--gold) 30%, transparent);
  border-radius: 10px;
  padding: 0.78em 1em;
}
#serial-input::placeholder { color: color-mix(in oklab, var(--dim) 55%, transparent); }
#serial-input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.pd-status { margin: 0; font-size: 0.85rem; color: var(--dim); min-height: 1.4em; }
.pd-status.err { color: #ff9d7a; }

/* Multi-field signup form: same box-vocabulary as .pd-lookup, one labeled
 * field per row instead of the single mono serial field. */
.pd-form { display: flex; flex-direction: column; gap: 1em; margin-bottom: 1.6em; }
.pd-field { display: flex; flex-direction: column; gap: 0.4em; }
.pd-input {
  font: inherit;
  color: var(--ink);
  background: #120e08;
  border: 1px solid color-mix(in oklab, var(--gold) 30%, transparent);
  border-radius: 10px;
  padding: 0.78em 1em;
}
.pd-input::placeholder { color: color-mix(in oklab, var(--dim) 55%, transparent); }
.pd-input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.pd-form .btn { align-self: flex-start; }

/* One card per registered device, same stub-box vocabulary as .pd-result. */
.pd-device-list { display: flex; flex-direction: column; gap: 0.8em; }
.pd-device-card {
  padding: clamp(1rem, 3vw, 1.4rem);
  border: 1px solid color-mix(in oklab, var(--gold) 26%, transparent);
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--gold) 6%, transparent), transparent 60%);
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}
.pd-device-head { display: flex; align-items: center; justify-content: space-between; gap: 1em; }
.pd-device-head b { font-family: var(--serif); font-size: 1.1rem; }

/* The result panel: same stub-box vocabulary as the ticket price section. */
.pd-result {
  padding: clamp(1.4rem, 4vw, 2rem);
  border: 1px solid color-mix(in oklab, var(--gold) 26%, transparent);
  border-radius: 16px;
  background:
    radial-gradient(80% 120% at 0% 0%, color-mix(in oklab, var(--gold) 9%, transparent), transparent 62%),
    linear-gradient(180deg, #14100a, #0c0906);
  box-shadow: 0 40px 90px -50px #000, 0 0 60px -30px color-mix(in oklab, var(--gold) 40%, transparent);
  display: flex;
  flex-direction: column;
  gap: 1.4em;
}
.pd-result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1em; }
.pd-r-number {
  margin: 0.15em 0 0.3em;
  font-family: var(--mono);
  font-size: clamp(1.3rem, 4.4vw, 1.7rem);
  letter-spacing: 0.08em;
  color: var(--gold);
}
.pd-status-pill {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.4em 0.8em;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--cyan) 45%, transparent);
  color: var(--cyan);
  white-space: nowrap;
}
.pd-status-pill.off {
  border-color: color-mix(in oklab, var(--dim) 45%, transparent);
  color: var(--dim);
}

.pd-progress { display: flex; flex-direction: column; gap: 0.5em; }
.pd-progress-track {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--ink) 12%, transparent);
  overflow: hidden;
}
.pd-progress-bar {
  height: 100%;
  width: calc(var(--pct, 0) * 1%);
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  transition: width 0.6s ease;
}
.pd-progress-label { margin: 0; font-size: 0.8rem; color: var(--dim); font-variant-numeric: tabular-nums; }

.pd-r-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  text-align: center;
  padding-top: 1.1em;
  border-top: 1px solid color-mix(in oklab, var(--gold) 26%, transparent);
}
.pd-r-grid b {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 3.6vw, 1.5rem);
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}
.pd-r-grid span { font-size: 0.72rem; color: var(--dim); }
.pd-r-foot { margin: 0; font-size: 0.8rem; color: var(--dim); }

@media (max-width: 480px) {
  .pd-stats, .pd-r-grid { grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
  .pd-result-head { flex-direction: column; }
}

/* Links dropped into the dock, under the mint button — same treatment as
 * every other inline gold link on the page. */
.dock .ti-serial { color: var(--dim); }
.dock .ti-serial a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--gold) 34%, transparent);
}
.dock .ti-serial a:hover { border-bottom-color: var(--gold); }
