/* ValueOddsAPI homepage motion layer (preview).
   Rule of thumb: every hidden starting state lives under html.motion, which motion-boot.js only sets
   when reduced motion is off. Without JS or with reduced motion the page is fully visible and static.
   Only opacity, transform and filter are animated; blur is used on text-sized elements only. */

:root {
  --mo-ease: cubic-bezier(.16, 1, .3, 1);
  --mo-dur: 800ms;
  --mo-step: 66ms;
}

/* ---------------------------------------------------------------- Hero: structure */
.hero { position: relative; isolation: isolate; overflow: hidden; }
@supports (overflow-clip-margin: 1px) {
  .hero { overflow: clip; overflow-clip-margin: 64px; }
}
.hero-glow { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; display: block; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
.hero-glow[data-state="on"] { opacity: 1; }
.hero-glow[data-state="off"] { display: none; }
html:not(.motion) .hero-glow { transition: none; }

.hero h1 .line { display: block; overflow-x: visible; overflow-y: clip; padding-bottom: .14em; margin-bottom: -.14em; }
.hero h1 .line > span { display: inline-block; }

/* Language pages: every headline keeps its three lines. --fit is the longest line in em (measured per language,
   +2.5%); the size only drops below the shared clamp when that line would not fit the hero column (100cqi).
   English never matches. */
.hero-copy:is(:lang(da), :lang(de), :lang(fr), :lang(es), :lang(it), :lang(pt), :lang(nl), :lang(sv), :lang(no), :lang(fi), :lang(is), :lang(pl), :lang(cs), :lang(sk), :lang(hu), :lang(ro), :lang(bg), :lang(el), :lang(hr), :lang(sr), :lang(sl), :lang(sq), :lang(mk), :lang(et), :lang(lv), :lang(lt), :lang(uk), :lang(ru), :lang(ka), :lang(hy), :lang(tr), :lang(ja), :lang(ko), :lang(zh), :lang(vi), :lang(th), :lang(id)) { container-type: inline-size; }
.hero h1:lang(da) { --fit: 8.1; }
.hero h1:lang(de) { --fit: 9.65; }
.hero h1:lang(fr) { --fit: 11.25; }
.hero h1:lang(es) { --fit: 9.2; }
.hero h1:lang(it) { --fit: 10.35; }
.hero h1:lang(pt) { --fit: 9.2; }
.hero h1:lang(nl) { --fit: 9.65; }
.hero h1:lang(sv) { --fit: 9.65; }
.hero h1:lang(no) { --fit: 11.05; }
.hero h1:lang(fi) { --fit: 10.7; }
.hero h1:lang(is) { --fit: 13.0; }
.hero h1:lang(pl) { --fit: 9.95; }
.hero h1:lang(cs) { --fit: 13.0; }
.hero h1:lang(sk) { --fit: 9.7; }
.hero h1:lang(hu) { --fit: 10.55; }
.hero h1:lang(ro) { --fit: 11.95; }
.hero h1:lang(bg) { --fit: 14.25; }
.hero h1:lang(el) { --fit: 12.55; }
.hero h1:lang(hr) { --fit: 10.85; }
.hero h1:lang(sr) { --fit: 8.2; }
.hero h1:lang(sl) { --fit: 8.6; }
.hero h1:lang(sq) { --fit: 9.35; }
.hero h1:lang(mk) { --fit: 13.5; }
.hero h1:lang(et) { --fit: 11.0; }
.hero h1:lang(lv) { --fit: 11.25; }
.hero h1:lang(lt) { --fit: 11.1; }
.hero h1:lang(uk) { --fit: 11.7; }
.hero h1:lang(ru) { --fit: 13.7; }
.hero h1:lang(ka) { --fit: 15.6; }
.hero h1:lang(hy) { --fit: 14.3; }
.hero h1:lang(tr) { --fit: 10.0; }
.hero h1:lang(ja) { --fit: 11.95; }
.hero h1:lang(ko) { --fit: 5.85; }
.hero h1:lang(zh) { --fit: 9.1; }
.hero h1:lang(vi) { --fit: 10.55; }
.hero h1:lang(th) { --fit: 8.95; }
.hero h1:lang(id) { --fit: 11.5; }
.hero h1:is(:lang(da), :lang(de), :lang(fr), :lang(es), :lang(it), :lang(pt), :lang(nl), :lang(sv), :lang(no), :lang(fi), :lang(is), :lang(pl), :lang(cs), :lang(sk), :lang(hu), :lang(ro), :lang(bg), :lang(el), :lang(hr), :lang(sr), :lang(sl), :lang(sq), :lang(mk), :lang(et), :lang(lv), :lang(lt), :lang(uk), :lang(ru), :lang(ka), :lang(hy), :lang(tr), :lang(ja), :lang(ko), :lang(zh), :lang(vi), :lang(th), :lang(id)) { font-size: min(clamp(40px, 5vw, 60px), calc(100cqi / var(--fit))); }

/* CJK pages: Japanese headings break between phrases, Korean breaks between words (not mid-word), and the
   wide-tracked mono labels get CJK-sized tracking. */
:lang(ja) :is(h1, h2, h3, summary) { word-break: auto-phrase; }
main:lang(ko), .consent:lang(ko) { word-break: keep-all; overflow-wrap: break-word; }
:is(:lang(ja), :lang(ko), :lang(zh)) :is(.eyebrow, .badge, .panel-head, .table-box th) { letter-spacing: .04em; }

/* The panel glow moves to a pseudo-element so it can grow with opacity + scale instead of box-shadow. */
.hero .panel { position: relative; isolation: isolate; box-shadow: none; }
.hero .panel::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; box-shadow: var(--shadow-glow); pointer-events: none; }

/* ---------------------------------------------------------------- Hero: load choreography (CSS only) */
@keyframes mo-rise { from { opacity: 0; transform: translate3d(0, 14px, 0); filter: blur(6px); } }
@keyframes mo-fade-up { from { opacity: 0; transform: translate3d(0, 12px, 0); } }
@keyframes mo-line { from { transform: translate3d(0, 108%, 0); } }
@keyframes mo-panel { from { opacity: 0; transform: translate3d(0, 22px, 0) scale(.98); } }
@keyframes mo-glow { from { opacity: 0; transform: scale(.86); } }

html.motion .hero .eyebrow-pill { animation: mo-rise 700ms var(--mo-ease) 40ms both; }
html.motion .hero h1 .line > span { animation: mo-line 900ms var(--mo-ease) both; }
html.motion .hero h1 .line:nth-child(1) > span { animation-delay: 120ms; }
html.motion .hero h1 .line:nth-child(2) > span { animation-delay: 210ms; }
html.motion .hero h1 .line:nth-child(3) > span { animation-delay: 300ms; }
html.motion .hero-copy > .body-lg { animation: mo-rise 800ms var(--mo-ease) 420ms both; }
html.motion .hero-copy > .actions { animation: mo-fade-up 700ms var(--mo-ease) 520ms both; }
html.motion .hero-copy > .caption { animation: mo-fade-up 700ms var(--mo-ease) 600ms both; }
html.motion .hero .panel { animation: mo-panel 1000ms var(--mo-ease) 260ms both; }
html.motion .hero .panel::after { animation: mo-glow 1000ms var(--mo-ease) 300ms both; }

/* ---------------------------------------------------------------- Cards: cursor spotlight + hover lift
   (kept before the reveal rules: while a group is revealing, its transition list wins; motion.js removes
   the group attribute once done, and this hover transition takes over) */
@media (hover: hover) and (pointer: fine) {
  html.motion .card { position: relative; isolation: isolate; transition: translate 400ms var(--mo-ease); }
  html.motion .card:hover { translate: 0 -2px; }
  html.motion .card::before,
  html.motion .card::after { content: ""; position: absolute; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity 350ms ease; }
  html.motion .card::before { inset: 0; z-index: -1; background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), rgba(71, 250, 190, .12), rgba(71, 250, 190, 0) 62%); }
  html.motion .card::after {
    inset: -1px; padding: 1px;
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), rgba(10, 127, 88, .7), rgba(10, 127, 88, 0) 70%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  }
  html.motion .card:hover::before,
  html.motion .card:hover::after { opacity: 1; }
}

/* ---------------------------------------------------------------- Reveal system */
html.motion [data-reveal] {
  transition: opacity var(--mo-dur) var(--mo-ease) var(--rd, 0ms),
              transform var(--mo-dur) var(--mo-ease) var(--rd, 0ms),
              filter var(--mo-dur) var(--mo-ease) var(--rd, 0ms);
}
html.motion [data-reveal]:not(.is-in) { opacity: 0; transform: translate3d(0, 14px, 0); filter: blur(6px); }
html.motion [data-reveal="lift"]:not(.is-in) { filter: none; }

/* Groups stagger their direct children; text children blur, cards and panels only lift. */
html.motion [data-reveal-group] > * {
  --cd: calc(var(--rd, 0ms) + var(--ci, 0) * var(--mo-step));
  transition: opacity var(--mo-dur) var(--mo-ease) var(--cd),
              transform var(--mo-dur) var(--mo-ease) var(--cd),
              filter var(--mo-dur) var(--mo-ease) var(--cd);
}
html.motion [data-reveal-group]:not(.is-in) > * { opacity: 0; transform: translate3d(0, 14px, 0); }
html.motion [data-reveal-group]:not(.is-in) > :is(p, h2, h3, .eyebrow, .story-head) { filter: blur(6px); }
[data-reveal-group] > :nth-child(2) { --ci: 1; }
[data-reveal-group] > :nth-child(3) { --ci: 2; }
[data-reveal-group] > :nth-child(4) { --ci: 3; }
[data-reveal-group] > :nth-child(5) { --ci: 4; }
[data-reveal-group] > :nth-child(6) { --ci: 5; }
[data-reveal-group] > :nth-child(n+7) { --ci: 6; }

/* Focused while hidden, or revealed instantly: no transition at all. */
html.motion .is-instant, html.motion .is-instant > * { transition: none !important; }

/* ---------------------------------------------------------------- Live-ticking hero prices */
.tick.is-live { position: relative; isolation: isolate; display: inline-flex; vertical-align: top; white-space: nowrap; }
.tick-c { position: relative; display: inline-block; height: 20px; line-height: 20px; overflow: hidden; vertical-align: top; }
.tick-c > span { display: block; }
.tick-c > .tick-in { position: absolute; left: 0; top: 0; width: 100%; }
.tick-flash { position: absolute; inset: -2px -5px; z-index: -1; border-radius: 6px; pointer-events: none; opacity: 0; background: var(--mint); }
.tick-flash.is-down { background: var(--negative); }
.odds-edge .tick-c { height: 16px; line-height: 16px; }
.odds-edge .tick.is-live { vertical-align: top; }
.odds-edge .tick-flash { inset: -1px -3px; border-radius: 4px; }

/* ---------------------------------------------------------------- Bookmaker marquee */
.marquee { display: flex; flex-direction: column; gap: 8px; width: 100%; align-items: center; }
.marquee-row { width: 100%; display: flex; justify-content: center; }
html.motion .marquee { gap: 10px; }
html.motion .marquee-row {
  display: block; overflow: hidden; padding: 2px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
}
html.motion .marquee-track { display: flex; width: max-content; animation: mo-marquee 72s linear infinite; animation-play-state: paused; }
html.motion .marquee-row-reverse .marquee-track { animation-duration: 80s; animation-direction: reverse; }
html.motion .marquee.is-running .marquee-track { animation-play-state: running; }
html.motion .marquee .bm-list { flex: none; flex-wrap: nowrap; justify-content: flex-start; max-width: none; padding-right: 8px; }
html.motion .marquee .bm { flex: none; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  html.motion .marquee.is-running .marquee-row:hover .marquee-track { animation-play-state: paused; }
}
@keyframes mo-marquee { to { transform: translate3d(-50%, 0, 0); } }

/* ---------------------------------------------------------------- Count-up stats */
.stat-value.is-counting { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Story section (static base)
   The odds-field canvas is transparent, so the section paints #0b0c0e itself. All DOM sits in the left
   column; the right ~55% of the stage stays free for the dot stream. */
.story { position: relative; isolation: isolate; background: var(--surface-inverse); color: var(--on-inverse); }
.story-stage { position: absolute; inset: 0; overflow: hidden; background: var(--surface-inverse); }
.story-field { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.story-field[data-state="off"] { display: none; }
.story-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11, 12, 14, .95) 0%, rgba(11, 12, 14, .88) 28%, rgba(11, 12, 14, .55) 42%, rgba(11, 12, 14, 0) 60%),
    linear-gradient(180deg, rgba(11, 12, 14, .7) 0%, rgba(11, 12, 14, 0) 16%, rgba(11, 12, 14, 0) 84%, rgba(11, 12, 14, .7) 100%);
}
.story-layer { position: relative; z-index: 1; padding: 112px 24px 40px; }
.story-grid { width: 100%; }
.story-copy { display: flex; flex-direction: column; gap: 32px; min-width: 0; max-width: 520px; }
.story-head { display: flex; flex-direction: column; gap: 14px; }
.story .eyebrow { color: var(--mint-on-inverse); }
.story .h1 { color: var(--on-inverse); max-width: 15ch; }
.story-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.story-step { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px; align-items: start; }
.story-num { font: 600 13px/28px var(--font-mono); letter-spacing: 1px; color: var(--mint-on-inverse); }
.story-step .h3 { color: var(--on-inverse); }
.story-step .body { color: var(--on-inverse-muted); margin-top: 4px; max-width: 46ch; text-wrap: pretty; }
.story-progress { display: none; }
.story-code { grid-column: 1 / -1; margin-top: 16px; min-width: 0; background: rgba(11, 12, 14, .96); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(131, 246, 200, .08); }
.story-caption { margin: 40px auto 0; color: var(--on-inverse-muted); max-width: 1200px; }
@media (max-width: 899px) {
  .story-layer { padding: 72px 20px 32px; }
  .story-scrim { background: linear-gradient(180deg, rgba(11, 12, 14, .55) 0%, rgba(11, 12, 14, .82) 50%, rgba(11, 12, 14, .94) 100%); }
  .story-code pre { padding: 12px; font-size: 11.5px; line-height: 18px; }
  .story-code .code-head { padding: 10px 12px; font-size: 12px; }
}

/* ---------------------------------------------------------------- Story: scroll-driven (desktop) */
@media (min-width: 900px) {
  html.motion .story { display: grid; height: 300vh; }
  html.motion .story > .story-stage,
  html.motion .story > .story-layer { grid-area: 1 / 1; position: sticky; inset: auto; top: 0; height: 100vh; align-self: start; }
  /* Text column anchored low-left, below the canvas labels that float in the upper middle. */
  html.motion .story-layer { display: flex; flex-direction: column; justify-content: flex-end; padding: 96px 24px 80px; }
  html.motion .story-caption { position: absolute; left: 24px; right: 24px; bottom: 28px; margin: 0 auto; }
  html.motion .story-progress { display: flex; gap: 8px; max-width: 360px; }
  /* Deliver: the JSON card takes the space above step 03 while the heading and steps 01–02 step back. */
  html.motion .story-code { position: absolute; left: 0; right: 0; bottom: calc(100% + 26px); margin: 0; }
  html.motion .story-head { transition: opacity 600ms var(--mo-ease), transform 600ms var(--mo-ease); }
  html.motion .story[data-step="2"] .story-head { opacity: 0; transform: translate3d(0, -10px, 0); }
  html.motion .story[data-step="2"] .story-step:nth-child(-n+2) { opacity: 0; }
}
@media (min-width: 900px) and (max-height: 760px) {
  html.motion .story-code pre { padding: 12px 16px; font-size: 12px; line-height: 17px; }
  html.motion .story-code .code-head { padding: 8px 16px; }
}
html.motion .story-progress span { position: relative; flex: 1 1 0; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .14); overflow: hidden; }
html.motion .story-progress span::after { content: ""; position: absolute; inset: 0; background: var(--mint); transform-origin: 0 50%; transform: scaleX(var(--f, 0)); }

html.motion .story-step { opacity: .25; transform: translate3d(-6px, 0, 0); transition: opacity 600ms var(--mo-ease), transform 600ms var(--mo-ease); }
html.motion .story[data-step="0"] .story-step:nth-child(1),
html.motion .story[data-step="1"] .story-step:nth-child(2),
html.motion .story[data-step="2"] .story-step:nth-child(3) { opacity: 1; transform: none; }
html.motion .story-code { opacity: 0; transform: translate3d(0, 16px, 0); transition: opacity 700ms var(--mo-ease), transform 700ms var(--mo-ease); }
html.motion .story[data-step="2"] .story-code { opacity: 1; transform: none; transition-delay: 120ms; }

/* ---------------------------------------------------------------- Story: mobile (sticky canvas on top, steps scroll beneath) */
@media (max-width: 899px) {
  html.motion .story-stage { position: sticky; inset: auto; top: 0; height: 55vh; z-index: 2; overflow: visible; }
  html.motion .story-stage::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 40px; pointer-events: none; background: linear-gradient(180deg, var(--surface-inverse), rgba(11, 12, 14, 0)); }
  html.motion .story-scrim { background: linear-gradient(180deg, rgba(11, 12, 14, .35) 0%, rgba(11, 12, 14, 0) 30%, rgba(11, 12, 14, 0) 70%, rgba(11, 12, 14, 1) 100%); }
  html.motion .story-layer { padding: 28px 20px 18vh; }
  html.motion .story-copy { gap: 20px; }
  html.motion .story-steps { gap: 18vh; padding-top: 4vh; }
  html.motion .story-step { padding: 22px 20px 24px; border: 1px solid var(--border-inverse); border-radius: var(--radius-lg); background: rgba(255, 255, 255, .03); transform: translate3d(0, 10px, 0); }
  html.motion .story-caption { margin-top: 24px; }
}

/* ---------------------------------------------------------------- Header: glass state after 24px */
.site-header .nav { transition: height 320ms var(--mo-ease), margin 320ms var(--mo-ease), background-color 320ms ease; }
.site-header.is-scrolled .nav {
  height: 54px; margin: 3px 0;
  background-color: color-mix(in srgb, var(--surface-card) 92%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
}
.site-header.mo-instant .nav { transition: none; }

/* ---------------------------------------------------------------- Page transitions */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  /* Named on the nav pill rather than .site-header: a view-transition-name makes an element a backdrop
     root, which would stop the nav's backdrop-filter from seeing the page behind it. */
  .site-header .nav { view-transition-name: site-header; }
  ::view-transition-old(root) { animation: mo-vt-out 280ms cubic-bezier(.4, 0, 1, 1) both; }
  ::view-transition-new(root) { animation: mo-vt-in 280ms var(--mo-ease) both; }
}
@keyframes mo-vt-out { to { opacity: 0; } }
@keyframes mo-vt-in { from { opacity: 0; transform: translate3d(0, 8px, 0); } }

/* ---------------------------------------------------------------- Reduced motion: belt and braces */
@media (prefers-reduced-motion: reduce) {
  .site-header .nav, .hero-glow { transition: none; }
  .marquee-track { animation: none !important; }
}
