/* ============================================================
   SEIRC Entries: home.css (public home page, after pages.css)
   One rhythm for the page: sections 48px apart, a heading row (uppercase title + muted line), cards at --r-card.
   The hero top bar and the countdowns are driven by js/home.js.
   ============================================================ */

/* ---------- top bar over the hero: hidden at the top, fades in as the hero logo slides under it ---------- */
.topbar.over-hero { position: fixed; left: 0; right: 0;
  transition: background-color var(--mo-3) var(--e-settle), border-color var(--mo-3) var(--e-settle), box-shadow var(--mo-3) var(--e-settle); }
.topbar.over-hero.shown { box-shadow: 0 8px 24px -16px rgba(27,36,64,.35); }
.topbar.over-hero .topbar-in > *, .topbar.over-hero .brand-sub { transition: opacity var(--mo-3) var(--e-settle), translate var(--mo-3) var(--e-settle), visibility 0s; }
.topbar.over-hero .brand-logo { transform-origin: 0 0; }
@media (scripting: enabled) {
  .topbar.over-hero:not(.shown) { background: transparent; border-bottom-color: transparent; pointer-events: none; }
  .topbar.over-hero:not(.shown) .topbar-in > *, .topbar.over-hero:not(.shown) .brand-sub { opacity: 0; translate: 0 -6px; visibility: hidden; transition-delay: 0s, 0s, var(--mo-3); }
  /* the logo stays visible while it flies between the hero and the bar */
  .topbar.over-hero.flying .brand { opacity: 1; translate: none; visibility: visible; transition: none; }
}
.hero-logo { height: 64px; width: auto; display: block; margin-bottom: var(--s4); transition: opacity var(--mo-2) var(--e-settle); }
.hero-logo.flown { opacity: 0; }
@media (max-width: 599px) { .hero-logo { height: 46px; } }

/* ---------- primary "Enter now": SEIRC blue, white text, the same states in the bar and the hero ---------- */
.topbar nav a.nav-cta { background: var(--blue); color: #fff; border-radius: var(--r-pill); padding: var(--s2) var(--s4);
  transition: background-color var(--mo-1) ease, transform var(--mo-1) ease; }
.topbar nav a.nav-cta:hover { background: var(--blue-2); }
.topbar nav a.nav-cta:active { transform: translateY(1px); }
.topbar nav.navsheet a.nav-cta { justify-content: center; margin-bottom: var(--s1); }
/* On the blue band: the primary is solid white with blue text and a lift; the secondary is a quiet outline. */
.btn.primary-on-band { background: #fff; color: var(--blue); box-shadow: 0 12px 28px -10px rgba(4,18,64,.8); }
.btn.primary-on-band:hover { background: var(--pale); }
.btn.secondary-on-band { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.55); font-weight: 600; }
.btn.secondary-on-band:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.btn.secondary-on-band span { transition: transform var(--mo-1, 90ms) ease; }
.btn.secondary-on-band:hover span { transform: translateX(3px); }
/* "Notify me" dialog (before entries open): the page behind softens and blurs, the sheet rises in */
.notify-dlg { width: min(480px, calc(100vw - 2 * var(--gutter))); max-height: calc(100dvh - 2 * var(--s4)); overflow-y: auto; border: 0; border-radius: var(--r-sheet); padding: var(--s5);
  box-shadow: 0 32px 80px -24px rgba(4,18,64,.55); color: var(--ink); }
.notify-dlg[open] { position: fixed; inset: 0; margin: auto; z-index: 50; }
.notify-dlg::backdrop { background: rgba(10,22,60,.32); -webkit-backdrop-filter: blur(6px) saturate(1.1); backdrop-filter: blur(6px) saturate(1.1); }
.notify-dlg-title { display: flex; align-items: center; gap: var(--s2); margin: 0 0 var(--s2); font-size: var(--fs-lg); padding-right: var(--s7); }
.notify-dlg-title .ic { color: var(--blue); }
.notify-dlg-title:focus { outline: none; }
.notify-dlg .hint { margin: 0 0 var(--s5); font-size: var(--fs-sm); }
.notify-dlg .hcd { display: grid; justify-items: center; margin-bottom: var(--s5); padding: var(--s4); border-radius: var(--r-card); background: var(--bg); }
.notify-dlg-x { position: absolute; top: var(--s3); right: var(--s3); margin: 0; }
.notify-dlg-actions { margin: var(--s5) 0 0; display: flex; justify-content: flex-end; }
@media (prefers-reduced-motion: no-preference) {
  .notify-dlg[open] { animation: dlg-in var(--mo-4) var(--e-weight); }
  .notify-dlg[open]::backdrop { animation: m-fade var(--mo-3) var(--e-settle); }
}
@keyframes dlg-in { from { opacity: 0; transform: translateY(16px) scale(.97); } }

/* ---------- hero ---------- */
.band.hero { padding-bottom: var(--s5); }
.hero-grid { display: grid; gap: var(--s6); align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); } .band.hero { padding-top: var(--s7); } }
.hero-map { min-width: 0; }
.hero-stat { background: rgba(255,255,255,.94); color: var(--ink); border-radius: var(--r-pill); padding: var(--s2) var(--s4); font-size: var(--fs-sm); box-shadow: 0 4px 16px rgba(27,36,64,.15); backdrop-filter: blur(6px); }
.hero-stat b { color: var(--blue); font-weight: 800; }
.hero-pills { margin-bottom: var(--s5); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s2); }
/* Tertiary on the band: a text link, so the primary "Enter now" leads. */
.btn.text.on-band { color: #fff; background: transparent; padding-inline: var(--s3); }
.btn.text.on-band span { transition: transform var(--mo-1, 90ms) ease; }
.btn.text.on-band:hover { background: rgba(255,255,255,.1); }
.btn.text.on-band:hover span { transform: translateX(3px); }

/* countdowns: the hero's foot, below a hairline. Entries (primary) leads; racing (secondary) sits quieter beside it. */
.countdowns { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s5) var(--s6);
  margin-top: var(--s6); padding-top: var(--s5);
  background: linear-gradient(rgba(255,255,255,.16), rgba(255,255,255,.16)) var(--gutter) 0 / calc(100% - 2 * var(--gutter)) 1px no-repeat; }

/* ---------- countdown tiles (CountdownClock.razor): a sheen sweeps each tile in turn, a glow breathes behind it,
   and a changed number rolls in as the old one rolls out. Numbers are tabular in fixed-size tiles, so nothing moves. */
.hcd { --tw: 76px; --th: 84px; --fs: 44px; --tg: var(--s3); --tr: 14px;
  --tile: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.08)); --edge: rgba(255,255,255,.34);
  --digit: #fff; --unit: #DCE5F7; --glow: rgba(41,189,220,.6); --shine: rgba(255,255,255,.42); --seam: rgba(4,18,64,.18); }
.hcd.secondary { --tw: 56px; --th: 60px; --fs: 26px; --tg: var(--s3); --tr: 10px;
  --tile: rgba(255,255,255,.08); --edge: rgba(255,255,255,.2); --digit: #E7EDF8; --glow: rgba(184,200,235,.22); --shine: rgba(255,255,255,.2); }
.hcd.light { --tile: linear-gradient(180deg, #fff, var(--pale)); --edge: var(--light); --digit: var(--blue); --unit: var(--muted);
  --glow: rgba(18,71,188,.2); --shine: rgba(255,255,255,.9); --seam: rgba(18,71,188,.08); }
.hcd.compact { --tw: 60px; --th: 64px; --fs: 32px; --tg: var(--s2); --tr: 12px; }
.hcd p { margin: 0; }
.hcd .hcd-label { margin-bottom: var(--s3); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--unit); }
.hcd.primary:not(.light) .hcd-label { color: #fff; }
.hcd-clock { display: flex; gap: var(--tg); }
.hcd-clock[hidden] { display: none; }
.hcd-u { position: relative; isolation: isolate; display: grid; justify-items: center; gap: var(--s2); width: var(--tw); }
.hcd-u::before { content: ""; position: absolute; z-index: -1; left: 10%; right: 10%; top: 12%; height: calc(var(--th) * .8); border-radius: 50%;
  background: var(--glow); filter: blur(16px); opacity: .45; }
.hcd-tile { position: relative; display: grid; place-items: center; width: 100%; height: var(--th); overflow: hidden; border-radius: var(--tr);
  background: linear-gradient(transparent calc(50% - .5px), var(--seam) 50%, transparent calc(50% + .5px)), var(--tile);
  border: 1px solid var(--edge); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 12px 24px -16px rgba(4,18,64,.8);
  color: var(--digit); font-size: var(--fs); font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hcd-tile i { font-style: normal; display: block; }
.hcd-tile::before { content: attr(data-prev); position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; }
.hcd-tile::after { content: ""; position: absolute; top: -20%; bottom: -20%; left: 0; width: 45%; pointer-events: none;
  background: linear-gradient(100deg, transparent, var(--shine), transparent); transform: translateX(-160%) skewX(-14deg); }
.hcd-u small { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--unit); white-space: nowrap; }
.hcd.secondary .hcd-u small { font-size: 10px; letter-spacing: .06em; }
@media (prefers-reduced-motion: no-preference) {
  .hcd-u::before { animation: hcd-breathe 4.8s ease-in-out infinite; animation-delay: calc(var(--i) * -1.2s); }
  .hcd.secondary .hcd-u::before { animation-duration: 6.4s; }
  .hcd-tile::after { animation: hcd-sheen 7s var(--e-move) infinite; animation-delay: calc(1s + var(--i) * 140ms); }
  .hcd.secondary .hcd-tile::after { animation-duration: 9s; animation-delay: calc(4s + var(--i) * 140ms); }
  .hcd-tile.tick i { animation: hcd-in var(--mo-4) var(--e-weight); }
  .hcd-tile.tick::before { animation: hcd-out var(--mo-4) var(--e-settle); }
}
@keyframes hcd-breathe { 50% { opacity: .95; transform: scale(1.08); } }
@keyframes hcd-sheen { 0%, 78% { transform: translateX(-160%) skewX(-14deg); } 100% { transform: translateX(330%) skewX(-14deg); } }
@keyframes hcd-in { from { transform: translateY(-75%); opacity: 0; } }
@keyframes hcd-out { from { transform: none; opacity: 1; } to { transform: translateY(75%); opacity: 0; } }
@media (max-width: 599px) {
  .countdowns { gap: var(--s5); }
  .hcd:not(.compact):not(.secondary) { --tw: 68px; --th: 76px; --fs: 38px; }
}

/* ---------- sections: one heading pattern, one rhythm ---------- */
.home-sec { padding: var(--sec-y) 0 0; }
.home-sec:last-of-type { padding-bottom: var(--sec-y); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); margin-bottom: var(--s5); }
.sec-head h2 { margin: 0; font-size: var(--fs-h2); font-weight: 800; text-transform: uppercase; letter-spacing: .01em; }
.sec-head p { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }

/* how it works: five numbered steps; a row on desktop, a list on the phone */
.how { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.how li { display: grid; grid-template-columns: 32px 1fr; gap: 2px var(--s3); align-content: start; padding: var(--s4); background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); }
.how-num { grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: var(--fs-sm); font-weight: 800; }
.how h3 { margin: 0; font-size: var(--fs-md); align-self: center; }
.how p { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
@media (min-width: 900px) {
  .how { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .how li { grid-template-columns: 1fr; gap: var(--s2); padding: var(--s5) var(--s4); }
  .how-num { grid-row: auto; margin-bottom: var(--s1); }
}

/* venues: a map excerpt in the site's tones (or a plain backdrop), the venue's pin, then the facts */
.venues { display: grid; grid-template-columns: 1fr; gap: var(--s4); }
@media (min-width: 600px) { .venues { grid-template-columns: 1fr 1fr; } }
.venues > .venue-card { --vc: var(--blue); display: flex; flex-direction: column; padding: 0; overflow: hidden; margin-top: 0; }
.venues > .venue-card.ld { --vc: var(--purple); }
.venue-map { position: relative; aspect-ratio: 2 / 1; border-bottom: 3px solid var(--vc);
  background: linear-gradient(90deg, rgba(255,255,255,.75) 2px, transparent 2px) 0 0 / 44px 44px, linear-gradient(rgba(255,255,255,.75) 2px, transparent 2px) 0 0 / 44px 44px, var(--pale); }
.venue-map img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.venue-pin { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; border-radius: 50%; translate: -50% -50%; background: var(--vc);
  box-shadow: 0 0 0 4px #fff, 0 0 0 12px color-mix(in srgb, var(--vc) 22%, transparent), 0 6px 14px rgba(27,36,64,.35); }
/* Map / Street view: the street image waits under the map at the same box (no shift) and crossfades in */
.venue-street, .venue-pin { transition: opacity var(--mo-3) var(--e-move); }
.venue-street { position: absolute; inset: 0; opacity: 0; }
.venue-map.street .venue-street { opacity: 1; }
.venue-map.street .venue-pin { opacity: 0; }
.venue-view { position: absolute; left: var(--s3); top: var(--s3); z-index: 1; }
.venue-view[hidden] { display: none; }
.venue-view button { min-height: 32px; font-size: var(--fs-sm); }
.venue-pano { position: absolute; right: var(--s2); bottom: var(--s2); padding: var(--s1) var(--s2); border-radius: var(--r-pill);
  background: rgba(255,255,255,.92); color: var(--ink); font-size: var(--fs-xs); font-weight: 600; text-decoration: none; box-shadow: var(--shadow); }
.venue-pano:hover { text-decoration: underline; }
.venue-body { display: grid; gap: var(--s1); padding: var(--card-pad); }
.venue-body h3 { margin: 0; color: var(--vc); font-size: var(--fs-lg); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.venue-place { margin: 0; font-weight: 600; }
.venue-addr { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.venue-dir { justify-self: start; margin-top: var(--s3); }

/* races: a client-logo reel of every event (two copies of the set, sliding by one set), then the formats */
.reel { overflow: hidden; padding: var(--s2) 0 var(--s4);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.reel-track { display: flex; width: max-content; animation: reel 70s linear infinite; }
.reel:hover .reel-track, .reel:focus-within .reel-track { animation-play-state: paused; }
.reel-set { display: flex; gap: var(--s3); margin: 0; padding: 0 var(--s3) 0 0; list-style: none; }
.reel-tile { flex: none; display: grid; gap: 2px; min-width: 156px; padding: var(--s3) var(--s4); background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); }
.reel-tile b { font-size: 22px; font-weight: 800; letter-spacing: .01em; color: var(--ink); }
.reel-tile.para b { color: var(--blue); }
.reel-tile small { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.reel-tile span { font-size: var(--fs-sm); font-weight: 600; color: var(--blue); font-variant-numeric: tabular-nums; }
@keyframes reel { to { transform: translateX(-50%); } }

.formats { display: grid; gap: var(--s3); margin: var(--s4) 0; }
.formats > div { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.formats dt { min-width: 104px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.formats dd { margin: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.fmt { padding: var(--s1) var(--s3); border-radius: var(--r-pill); background: var(--pale); color: var(--blue); font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }

.races-disc > summary { list-style: none; }
.races-disc > summary::-webkit-details-marker { display: none; }
.races-disc .when-open, .races-disc[open] .when-closed { display: none; }
.races-disc[open] .when-open { display: inline; }
.races-chev { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; translate: 0 -2px; transition: rotate var(--mo-3) var(--e-settle), translate var(--mo-3) var(--e-settle); }
.races-disc[open] .races-chev { rotate: -135deg; translate: 0 2px; }
.races-card { padding: 0; overflow: hidden; margin-top: var(--s3); animation: m-arrive var(--mo-3) var(--e-settle) both; }
table.races-t { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.races-t th { text-align: left; background: var(--pale); color: var(--blue); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; padding: var(--s2) var(--s3); }
table.races-t td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.races-t th:first-child, table.races-t td:first-child { white-space: nowrap; }

/* ---------- reduced motion: the bar just fades (home.js), numbers don't slide, the reel is a row you can scroll ---------- */
@media (prefers-reduced-motion: reduce) {
  .topbar.over-hero .topbar-in > * { translate: none !important; }
  .races-card { animation: none; }
  .reel { overflow-x: auto; }
  .reel-track { animation: none; }
  .reel-set[aria-hidden] { display: none; }
}
