@font-face {
  font-family: Space;
  src: url('/assets/fonts/space-grotesk-700.ttf');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: Space, system-ui, sans-serif;
  background: #18212a;
  color: #fff9ee;
}

body {
  margin: 0;
}

.hero {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  display: grid;
  align-items: center;
  min-height: 100svh;
  padding: 2rem clamp(2rem, 8vw, 9rem) 5rem;
  background: url('/assets/tallinn-waterfront-night.webp') center / cover no-repeat;
}

/* Transparent runner (alpha video) centred over the static waterfront,
   sized by height and standing on the bottom edge. */
.hero-video {
  position: absolute;
  z-index: -2;
  left: 50%;
  bottom: 0;
  height: min(94svh, 120vw);
  aspect-ratio: 720 / 918;
  display: block;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgb(13 20 27 / 85%), rgb(13 20 27 / 47%) 42%, transparent 64%),
    linear-gradient(0deg, rgb(13 20 27 / 64%), transparent 25%);
}

.hero-content {
  justify-self: start;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(4rem, 9vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.085em;
}

h1 span {
  display: block;
  margin-top: 0.8rem;
  padding-inline-start: 0.28em;
  font-size: clamp(0.8rem, 1.6vw, 1.2rem);
  line-height: 1.2;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.calendar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 3rem;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  background: #fff2dc;
  color: #1b252d;
  text-decoration: none;
}

.calendar-link:hover {
  background: #fffaf0;
}

.calendar-link:focus-visible {
  outline: 2px solid white;
  outline-offset: 4px;
}

@media (max-width: 700px) and (orientation: portrait) {
  .hero {
    align-items: end;
    justify-items: center;
    padding: 2rem 1rem max(5rem, calc(env(safe-area-inset-bottom) + 4.25rem));
  }

  /* Stand the runner above the title block so the copy never sits on the shirt. */
  .hero-video {
    bottom: 21svh;
    height: min(64svh, 124vw);
  }

  .hero::after {
    background: linear-gradient(0deg, rgb(13 20 27 / 93%), rgb(13 20 27 / 64%) 23%, transparent 49%);
  }

  .hero-content {
    justify-self: center;
    text-align: center;
  }
}

html, body { height: 100%; overflow: hidden; }
.hero-content { transition: opacity .45s ease, transform .65s cubic-bezier(.22,1,.36,1), filter .45s ease; }
.calendar-open .hero-content { opacity: 0; transform: translateY(-20px) scale(.96); filter: blur(10px); pointer-events: none; }
.calendar-overlay { position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; }
.calendar-overlay::backdrop { background: rgb(6 12 22 / 24%); animation: veil-in .65s ease both; }
.calendar-frame { display: block; width: 100%; height: 100%; border: 0; background: transparent; }
.calendar-overlay[open] .calendar-frame { animation: calendar-in .85s cubic-bezier(.16,1,.3,1) both; }
.calendar-close { position: absolute; z-index: 10; top: max(12px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); width: 42px; height: 42px; border: 1px solid rgb(210 216 255 / 28%); border-radius: 50%; color: #f1f2ff; background: rgb(23 30 47 / 80%); backdrop-filter: blur(16px); font: 28px/1 system-ui; cursor: pointer; transition: background .2s, transform .2s; }
.calendar-close:hover { background: #474b78; transform: rotate(90deg); }
.calendar-close:focus-visible { outline: 2px solid #b1b5ff; outline-offset: 4px; }
.calendar-overlay.is-closing { animation: calendar-out .32s ease both; }
@keyframes calendar-in { from { opacity: 0; transform: translateY(40px) scale(.93); filter: blur(12px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes calendar-out { to { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes veil-in { from { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .hero-content, .calendar-close { transition: none; } .calendar-overlay, .calendar-overlay::backdrop, .calendar-overlay[open] .calendar-frame { animation: none; } }

/* Close button: draw the cross with two bars so it sits dead centre in the circle
   (the × glyph rides low in most system fonts). */
.calendar-close { display: grid; place-items: center; padding: 0; font-size: 0; }
.calendar-close::before, .calendar-close::after { content: ''; grid-area: 1 / 1; width: 18px; height: 2px; border-radius: 1px; background: currentColor; transform: rotate(45deg); }
.calendar-close::after { transform: rotate(-45deg); }

/* While the calendar is open the runner steps aside so the two never overlap:
   left of the calendar in landscape, up above the wheel in portrait. */
.hero-video { transition: left .85s cubic-bezier(.16,1,.3,1), transform .85s cubic-bezier(.16,1,.3,1); }
@media (min-aspect-ratio: 5/4) {
  .calendar-open .hero-video { left: 19%; }
  .calendar-overlay { left: auto; right: 0; width: 62%; }
}
@media (max-aspect-ratio: 5/4) {
  .hero-video { transform-origin: 50% 0; }
  .calendar-open .hero-video { transform: translate(-50%, var(--lift, -18.5svh)) scale(var(--shrink, .8)); }
  /* fade the body out below the chest (rows 440-510 of 918) so it ends above the button */
  .calendar-open .hero-video { -webkit-mask-image: linear-gradient(#000 48%, transparent 55.5%); mask-image: linear-gradient(#000 48%, transparent 55.5%); }
}
@media (prefers-reduced-motion: reduce) { .hero-video { transition: none; } }
/* Sit the button in the strip above the calendar card, flush with its right edge. */
.calendar-close { top: max(7px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: 38px; height: 38px; }
/* Portrait: the close button is centred; home.js sets its top just above the wheel. */
@media (max-aspect-ratio: 5/4) {
  .calendar-close { left: 50%; right: auto; margin-left: -19px; }
}

/* Portrait calendar: logo on the left and the runner on the right, above the wheel. */
.calendar-logo { display: none; }
@media (max-aspect-ratio: 5/4) {
  .calendar-open .hero-video { left: 73%; }
  .calendar-logo { display: block; position: absolute; z-index: 5; left: 16px; top: 16px; margin: 0; font-weight: 700; font-size: 44px; line-height: .9; letter-spacing: -.085em; color: #fff9ee; pointer-events: none; }
  .calendar-logo span { display: block; margin-top: .45em; padding-inline-start: .28em; font-size: .22em; line-height: 1.2; letter-spacing: .28em; text-transform: uppercase; }
  .calendar-overlay[open] .calendar-logo { animation: calendar-in .85s cubic-bezier(.16,1,.3,1) both; }
}

/* Night Run Estonia partner logo: always bottom centre of the screen. While the
   calendar is open home.js moves it into the dialog so it stays above it. */
.partner-banner { position: fixed; z-index: 8; left: 0; right: 0; bottom: max(10px, env(safe-area-inset-bottom)); height: 32px; display: flex; justify-content: center; pointer-events: none; }
.partner-banner a { display: inline-flex; height: 100%; pointer-events: auto; transition: opacity .2s, transform .2s; }
.partner-banner a:hover { opacity: .82; transform: translateY(-1px); }
.partner-banner img { display: block; height: 100%; width: auto; filter: drop-shadow(0 2px 7px rgb(0 0 0 / 50%)); }

/* Portrait page wider than a phone (tablets, square windows): keep the calendar in a
   phone-width column so it uses the same stacked layout as on phones. */
@media (max-aspect-ratio: 5/4) {
  .calendar-overlay { left: 0; right: 0; width: min(100%, 760px); margin-inline: auto; }
}

/* Section menu on the hero: calendar first, then results and videos. */
.hero-menu { display: flex; flex-wrap: wrap; gap: .6rem; }
.menu-link { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 3rem; padding: .65rem 1.4rem; border: 1px solid rgb(255 242 220 / 45%); border-radius: 999px; color: #fff2dc; text-decoration: none; background: rgb(13 20 27 / 35%); backdrop-filter: blur(8px); transition: background .2s, border-color .2s; }
.menu-link:hover { background: rgb(255 242 220 / 14%); border-color: #fff2dc; }
.menu-link:focus-visible { outline: 2px solid white; outline-offset: 4px; }
@media (max-width: 700px) and (orientation: portrait) { .hero-menu { justify-content: center; } }
@media (max-width: 700px) and (orientation: portrait) {
  .hero-menu { flex-wrap: nowrap; gap: .4rem; }
  .hero-menu a { min-height: 2.75rem; padding: .55rem .95rem; font-size: .95rem; white-space: nowrap; }
}
.video-slide.active .video-count { display: none; }
.video-tap { position: absolute; z-index: 1; inset: 0; width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.video-slide.paused .video-tap { background: rgb(0 0 0 / 25%); }
.video-slide.paused .video-tap::after { content: ''; position: absolute; left: 50%; top: 50%; margin: -22px 0 0 -14px; border-style: solid; border-width: 22px 0 22px 36px; border-color: transparent transparent transparent rgb(255 255 255 / 90%); filter: drop-shadow(0 2px 8px rgb(0 0 0 / 60%)); }
.video-sound { position: absolute; z-index: 2; right: 12px; bottom: 12px; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgb(0 0 0 / 55%) center / 22px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H2v6h4l5 4z'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M19 5a10 10 0 0 1 0 14'/%3E%3C/svg%3E"); cursor: pointer; }
.video-feed.muted .video-sound { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H2v6h4l5 4z'/%3E%3Cpath d='m22 9-6 6M16 9l6 6'/%3E%3C/svg%3E"); }

/* One overlay for every section, laid out like the calendar: logo top left, runner
   top right (portrait) or on the left (landscape), then the bar with the section
   switch and the close button, then the content where the calendar wheel sits. */
.overlay-bar { position: absolute; z-index: 10; left: 0; right: 0; top: var(--bar-top, max(10px, env(safe-area-inset-top))); display: flex; justify-content: center; align-items: center; gap: 10px; pointer-events: none; }
.overlay-bar > * { pointer-events: auto; }
.overlay-tabs { display: flex; gap: 2px; padding: 3px; border: 1px solid rgb(210 216 255 / 20%); border-radius: 999px; background: rgb(23 30 47 / 80%); backdrop-filter: blur(16px); }
.overlay-tabs a { padding: 8px 15px; border-radius: 999px; color: rgb(241 242 255 / 72%); font: 500 14px/1.2 system-ui, sans-serif; text-decoration: none; transition: background .2s, color .2s; }
.overlay-tabs a:hover { color: #fff; }
.overlay-tabs a[aria-current] { color: #1b252d; background: #fff2dc; }
.overlay-tabs a:focus-visible { outline: 2px solid #b1b5ff; outline-offset: 2px; }
.overlay-bar .calendar-close { position: relative; inset: auto; margin: 0; flex: none; }
.calendar-overlay { --content-top: 64px; }
.overlay-view { position: absolute; z-index: 2; left: 0; right: 0; top: var(--content-top); bottom: 0; color: #fff9ee; }
.overlay-view[hidden] { display: none; }
.calendar-overlay[open] .overlay-view { animation: calendar-in .85s cubic-bezier(.16,1,.3,1) both; }
.calendar-frame.is-hidden { visibility: hidden; pointer-events: none; }
@media (min-aspect-ratio: 5/4) {
  .calendar-frame { position: absolute; left: 0; top: var(--content-top); height: calc(100% - var(--content-top)); }
}

.results-view { overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box; padding: 6px 16px 70px; }
.results-list { max-width: 680px; margin: 0 auto; }
.videos-view { overflow: hidden; }
@media (max-width: 420px) { .overlay-tabs a { padding: 8px 12px; font-size: 13px; } .result-card { padding: 15px 16px; } .result-name { font-size: 19px; } .result-time { font-size: 25px; } }

/* The logo goes top left in landscape too, over the runner's column. */
@media (min-aspect-ratio: 5/4) {
  .calendar-logo { display: block; position: absolute; z-index: 5; margin: 0; font-weight: 700; line-height: .9; letter-spacing: -.085em; color: #fff9ee; pointer-events: none; }
  .calendar-logo span { display: block; margin-top: .45em; padding-inline-start: .28em; font-size: .22em; line-height: 1.2; letter-spacing: .28em; text-transform: uppercase; }
  .calendar-overlay[open] .calendar-logo { animation: calendar-in .85s cubic-bezier(.16,1,.3,1) both; }
}

.results-list { display: grid; gap: 12px; padding: 0; list-style: none; }
.result-card { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 18px 20px; border: 1px solid rgb(255 249 238 / 10%); border-radius: 18px; background: linear-gradient(135deg, rgb(56 62 79 / 78%), rgb(31 36 49 / 86%)); backdrop-filter: blur(12px); }
.result-date { grid-column: 1 / -1; color: #b2aff5; font: 600 12px/1.2 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.result-name { margin: 0; font-size: 22px; line-height: 1.15; letter-spacing: -.03em; }
.result-distance { color: rgb(255 249 238 / 60%); font: 14px/1.4 system-ui, sans-serif; }
.result-time { grid-row: 2 / span 2; grid-column: 2; align-self: center; text-align: right; font-size: 30px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.result-time small { display: block; color: rgb(255 249 238 / 55%); font: 12px/1.4 system-ui, sans-serif; letter-spacing: 0; }
.result-link { grid-column: 1 / -1; justify-self: start; margin-top: 6px; color: #c8c7f9; font: 14px/1.4 system-ui, sans-serif; text-decoration: none; }
.result-link:hover { text-decoration: underline; }

.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play { position: absolute; inset: 0; width: 100%; border: 0; background: rgb(0 0 0 / 20%); cursor: pointer; }
.video-play::after { content: ''; position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin: -22px 0 0 -14px; border-style: solid; border-width: 22px 0 22px 36px; border-color: transparent transparent transparent rgb(255 255 255 / 90%); filter: drop-shadow(0 2px 8px rgb(0 0 0 / 60%)); }
.video-caption { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; margin: 0; padding: 40px 16px 16px; font: 600 15px/1.35 system-ui, sans-serif; background: linear-gradient(transparent, rgb(0 0 0 / 70%)); pointer-events: none; }
.video-slide.active .video-caption { display: none; }
.video-count { position: absolute; z-index: 2; top: 12px; right: 12px; padding: 4px 9px; border-radius: 999px; background: rgb(0 0 0 / 50%); font: 12px/1.4 system-ui, sans-serif; pointer-events: none; }
.video-slide.active .video-count { display: none; }
.video-status { position: absolute; inset: 40% 16px auto; margin: 0; text-align: center; color: rgb(255 249 238 / 60%); font: 15px/1.5 system-ui, sans-serif; }
.video-status:empty { display: none; }

/* Landscape: the overlay spans the screen so the logo can sit top left over the
   runner; the bar and the content share the column on the right. */
@media (min-aspect-ratio: 5/4) {
  .calendar-overlay { left: 0; right: 0; width: 100%; }
  .calendar-frame, .overlay-view, .overlay-bar { left: 38%; right: 0; width: auto; }
  .calendar-frame { width: 62%; }
  .calendar-logo { left: max(24px, env(safe-area-inset-left)); top: max(20px, env(safe-area-inset-top)); font-size: clamp(34px, 3.6vw, 56px); }
}
.results-view { -webkit-mask-image: linear-gradient(#000 calc(100% - 90px), transparent calc(100% - 30px)); mask-image: linear-gradient(#000 calc(100% - 90px), transparent calc(100% - 30px)); padding-bottom: 110px; }

/* Stories carousel: absolutely placed slides moved by home.js; neighbours are
   smaller, see-through and tucked under the current one. */
.video-feed { position: relative; height: 100%; overflow: hidden; outline: none; touch-action: pan-y; user-select: none; --drag: 0px; }
.video-slide { position: absolute; left: 50%; top: 6px; width: var(--w); height: var(--h); margin-left: calc(var(--w) / -2); translate: var(--drag) 0; transition: transform .45s cubic-bezier(.22,.8,.2,1), opacity .45s ease, translate .45s cubic-bezier(.22,.8,.2,1); }
.video-feed.dragging .video-slide { transition: none; }
.video-slide:not(.is-current) { cursor: pointer; }
.video-slide:not(.is-current) .video-play, .video-slide:not(.is-current) .video-count { display: none; }
.video-frame { position: relative; width: 100%; height: 100%; border-radius: 16px; overflow: hidden; background: #111 center / cover no-repeat; box-shadow: 0 20px 60px rgb(0 0 0 / 55%); }
.video-arrow { position: absolute; z-index: 20; top: 50%; width: 46px; height: 46px; margin-top: -23px; padding: 0; border: 1px solid rgb(210 216 255 / 28%); border-radius: 50%; background: rgb(23 30 47 / 80%); backdrop-filter: blur(12px); cursor: pointer; transition: background .2s; }
.video-arrow:hover { background: #474b78; }
.video-arrow::before { content: ''; position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; border: solid #f1f2ff; border-width: 0 2px 2px 0; }
.video-prev { left: max(12px, calc(50% - var(--w, 300px) / 2 - 54px)); }
.video-next { right: max(12px, calc(50% - var(--w, 300px) / 2 - 54px)); }
.video-prev::before { transform: translate(-30%, -50%) rotate(135deg); }
.video-next::before { transform: translate(-70%, -50%) rotate(-45deg); }
.video-arrow[hidden] { display: none; }
@media (hover: none) { .video-arrow { display: none; } }
@media (prefers-reduced-motion: reduce) { .video-slide { transition: none; } }

/* Bar at the bottom: of the screen in portrait, of the content column in landscape.
   The logo sits on the runner's chest (home.js places it); the content fills the
   space between the runner (portrait) or the top (landscape) and the bar. */
.calendar-overlay { --bar-space: calc(64px + env(safe-area-inset-bottom)); --content-top: 12px; }
.overlay-bar { top: auto; bottom: max(12px, env(safe-area-inset-bottom)); }
.overlay-view { bottom: var(--bar-space); }
.calendar-frame { height: calc(100% - var(--bar-space)); }
.calendar-logo { display: block; position: absolute; z-index: 5; margin: 0; transform: translate(-50%, -50%); text-align: center; font-weight: 700; line-height: .9; letter-spacing: -.085em; color: #fff9ee; text-shadow: 0 2px 14px rgb(0 0 0 / 35%); pointer-events: none; }
.calendar-logo span { display: block; margin-top: .4em; padding-inline-start: .28em; font-size: .24em; line-height: 1.2; letter-spacing: .28em; text-transform: uppercase; }
.calendar-overlay[open] .calendar-logo { animation: logo-in .85s cubic-bezier(.16,1,.3,1) both; }
@keyframes logo-in { from { opacity: 0; filter: blur(10px); } }
.results-view { padding-bottom: 40px; -webkit-mask-image: linear-gradient(#000 calc(100% - 40px), transparent); mask-image: linear-gradient(#000 calc(100% - 40px), transparent); }
@media (min-aspect-ratio: 5/4) {
  .calendar-frame { top: var(--content-top); height: calc(100% - var(--content-top) - var(--bar-space)); }
  .calendar-logo { left: 19%; top: 60%; }
  /* the partner logo moves under the runner so the bar has the column to itself */
  .calendar-open .partner-banner { right: 62%; }
}
@media (max-aspect-ratio: 5/4) {
  .calendar-open .hero-video { left: 50%; -webkit-mask-image: linear-gradient(#000 57%, transparent 65.5%); mask-image: linear-gradient(#000 57%, transparent 65.5%); }
  /* Partner logo: small, top right, in portrait. */
  .partner-banner { top: max(12px, env(safe-area-inset-top)); bottom: auto; left: auto; right: max(14px, env(safe-area-inset-right)); height: 22px; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .hero { padding-bottom: max(1.75rem, calc(env(safe-area-inset-bottom) + 1rem)); }
}
.video-slide { top: calc(50% - var(--h) / 2); }
.calendar-logo span { display: none; }
.result-card { display: flex; justify-content: space-between; gap: 16px; }
.result-main, .result-side { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-width: 0; }
.result-side { flex: none; align-items: flex-end; text-align: right; }
.result-time { grid-row: auto; grid-column: auto; font-size: 30px; line-height: 1; }
.result-place { color: rgb(255 249 238 / 55%); font: 13px/1.4 system-ui, sans-serif; }
.result-link { grid-column: auto; justify-self: auto; margin-top: 0; white-space: nowrap; }
@media (max-width: 420px) { .result-time { font-size: 25px; } .result-link { font-size: 13px; } }
/* Portrait: the fade starts below the print on the T-shirt (rows 640-705). */
@media (max-aspect-ratio: 5/4) { .calendar-open .hero-video { -webkit-mask-image: linear-gradient(#000 70%, transparent 77%); mask-image: linear-gradient(#000 70%, transparent 77%); } }
/* Landscape: no darkening gradient over the runner while a section is open. */
@media (min-aspect-ratio: 5/4) { .hero::after { transition: opacity .6s ease; } .calendar-open .hero::after { opacity: 0; } }
/* Hide YouTube's own interface: the player is taller than the frame, so its title
   bar (top) and logo / progress bar (bottom) fall outside the rounded frame while the
   9:16 video, fitted by width, fills it exactly. When paused, a blur covers YouTube's
   centre buttons and our own play sign shows instead. */
.video-frame iframe { top: -72px; height: calc(100% + 144px); }
.video-slide.paused .video-tap { -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); background: rgb(0 0 0 / 30%); }
.video-slide.active .video-frame { background-image: none !important; }
/* The Shorts player keeps one like button over the video (about 85% across, 90%
   down); the sound button sits exactly on top of it. */
.video-sound { width: 48px; height: 48px; right: calc(15.3% - 24px); bottom: calc(9.5% - 24px); background-color: rgb(0 0 0 / 72%); }

/* ---------------------------------------------------------------------------
   iOS-style tab bars (Liquid Glass): the home menu and the overlay bar share one
   floating glass capsule with icon-over-label items; the close button is a
   matching glass circle. The title is kept for screen readers only. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.hero { align-items: end; justify-items: center; padding: 0 16px max(18px, calc(env(safe-area-inset-bottom) + 8px)); }
.hero-content { justify-self: center; text-align: center; }
/* No title any more, so no side shade; only a soft floor under the bar. */
.hero::after { background: linear-gradient(0deg, rgb(13 20 27 / 70%), transparent 26%); }

/* Bigger runner, feet on the bottom edge behind the bar. */
.hero-video { height: min(112svh, 140vw); bottom: -6svh; }
@media (max-aspect-ratio: 5/4) {
  .hero { padding: 0 16px max(18px, calc(env(safe-area-inset-bottom) + 8px)); }
  .hero-video { bottom: 0; height: min(88svh, 150vw); }
  .hero::after { background: linear-gradient(0deg, rgb(13 20 27 / 80%), transparent 30%); }
}

/* Landscape home: the partner logo moves top right so the bar has the bottom. */
@media (min-aspect-ratio: 5/4) {
  body:not(.calendar-open) .partner-banner { top: max(16px, env(safe-area-inset-top)); bottom: auto; left: auto; right: max(20px, env(safe-area-inset-right)); height: 28px; }
}

.hero-menu, .overlay-tabs {
  display: flex; flex-wrap: nowrap; gap: 0; padding: 4px;
  border: 0; border-radius: 999px;
  background: linear-gradient(180deg, rgb(255 255 255 / 16%), rgb(255 255 255 / 7%));
  -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 38%), inset 0 -1px 0 rgb(255 255 255 / 10%), inset 0 0 0 1px rgb(255 255 255 / 12%), 0 10px 30px rgb(0 0 0 / 35%);
}
.hero-menu a, .hero-menu .calendar-link, .overlay-tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  box-sizing: border-box; min-width: 84px; min-height: 0; height: 54px; padding: 6px 16px;
  border: 0; border-radius: 999px; background: transparent;
  color: rgb(255 255 255 / 92%); text-decoration: none; white-space: nowrap;
  font: 600 11px/1.1 -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif; letter-spacing: .01em;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  transition: background .25s, color .25s, transform .2s;
}
.hero-menu a::before, .overlay-tabs a::before {
  content: ''; width: 24px; height: 24px; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
[data-view="calendar"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3.5'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3Ccircle cx='8.5' cy='14.5' r='.6' fill='black'/%3E%3Ccircle cx='12' cy='14.5' r='.6' fill='black'/%3E%3Ccircle cx='15.5' cy='14.5' r='.6' fill='black'/%3E%3C/svg%3E"); }
[data-view="results"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='13.5' r='7.5'/%3E%3Cpath d='M12 13.5V9.5M10 2.5h4M18.5 6.5l1.5-1.5'/%3E%3C/svg%3E"); }
[data-view="videos"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='15' rx='4'/%3E%3Cpath d='M10 9v6l5-3z' fill='black'/%3E%3C/svg%3E"); }
.hero-menu a:hover, .hero-menu .calendar-link:hover, .overlay-tabs a:hover { color: #fff; background: rgb(255 255 255 / 10%); border-color: transparent; }
.hero-menu a:active, .overlay-tabs a:active { transform: scale(.94); }
.overlay-tabs a[aria-current] {
  color: #fff;
  background: linear-gradient(180deg, rgb(255 255 255 / 26%), rgb(255 255 255 / 12%));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 40%), inset 0 0 0 1px rgb(255 255 255 / 10%);
}
.hero-menu a:focus-visible, .overlay-tabs a:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
@media (max-width: 420px) { .hero-menu a, .hero-menu .calendar-link, .overlay-tabs a { min-width: 0; padding: 6px 14px; font-size: 10.5px; } }

/* Close button: a glass circle the same height as the bar. */
.calendar-close, .overlay-bar .calendar-close {
  width: 62px; height: 62px; border: 0; color: #fff;
  background: linear-gradient(180deg, rgb(255 255 255 / 16%), rgb(255 255 255 / 7%));
  -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 38%), inset 0 -1px 0 rgb(255 255 255 / 10%), inset 0 0 0 1px rgb(255 255 255 / 12%), 0 10px 30px rgb(0 0 0 / 35%);
}
.calendar-close:hover { background: linear-gradient(180deg, rgb(255 255 255 / 24%), rgb(255 255 255 / 12%)); transform: none; }
.calendar-close::before, .calendar-close::after { width: 20px; }
.overlay-bar { gap: 12px; bottom: max(14px, calc(env(safe-area-inset-bottom) + 6px)); }
.calendar-overlay { --bar-space: calc(86px + env(safe-area-inset-bottom)); }
/* With a section open in landscape the runner goes back to his old size beside it. */
@media (min-aspect-ratio: 5/4) { .calendar-open .hero-video { height: min(94svh, 120vw); bottom: 0; } }

/* ---------------------------------------------------------------------------
   Liquid Glass v2. The blur and refraction live on a child layer (.glass-refract)
   so the droplet inside can refract the page too; the bar itself only draws the
   rim light, the tint and the pointer-following specular. */
.glass { position: relative; isolation: isolate; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  background: linear-gradient(180deg, rgb(255 255 255 / 10%), rgb(255 255 255 / 3%)) !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 50%), inset 0 -1px 1px rgb(255 255 255 / 14%), inset 1px 0 1px rgb(255 255 255 / 10%), inset -1px 0 1px rgb(255 255 255 / 10%),
    inset 0 0 0 1px rgb(255 255 255 / 10%), inset 0 -10px 18px -10px rgb(255 255 255 / 18%), 0 12px 36px rgb(0 0 0 / 38%), 0 2px 6px rgb(0 0 0 / 22%) !important; }
.glass-refract { position: absolute; z-index: -2; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none;
  -webkit-backdrop-filter: blur(10px) saturate(190%) brightness(1.06); backdrop-filter: blur(10px) saturate(190%) brightness(1.06); filter: url(#liquid-refract); }
/* rim caustics + pointer light (the close button uses its pseudo-elements for the cross) */
.glass:not(.calendar-close)::after { content: ''; position: absolute; z-index: -1; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120px 60px at var(--mx, 30%) var(--my, 0%), rgb(255 255 255 / 22%), transparent 70%),
    linear-gradient(115deg, rgb(255 255 255 / 0%) 30%, rgb(255 255 255 / 9%) 45%, rgb(255 255 255 / 0%) 60%);
  background-size: 100% 100%, 260% 100%; animation: glass-sheen 7s ease-in-out infinite; }
@keyframes glass-sheen { 0%, 100% { background-position: 0 0, 120% 0; } 50% { background-position: 0 0, -20% 0; } }

/* Items sit above the droplet. */
.hero-menu a, .overlay-tabs a { position: relative; z-index: 1; }
.hero-menu a:hover, .hero-menu .calendar-link:hover, .overlay-tabs a:hover { background: transparent; }
.overlay-tabs a[aria-current] { background: transparent; box-shadow: none; }

/* The droplet: a lens of brighter glass that slides between tabs and swells when held. */
.tab-bubble { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: var(--w, 80px); translate: var(--x, 0) 0;
  border-radius: 999px; opacity: 0; scale: .7; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, rgb(255 255 255 / 34%), rgb(255 255 255 / 12%) 55%, rgb(255 255 255 / 18%));
  -webkit-backdrop-filter: blur(3px) saturate(220%) brightness(1.18) contrast(1.05); backdrop-filter: blur(3px) saturate(220%) brightness(1.18) contrast(1.05);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 70%), inset 0 -2px 4px rgb(255 255 255 / 22%), inset 0 0 0 1px rgb(255 255 255 / 18%), inset 0 0 14px rgb(255 255 255 / 12%), 0 4px 14px rgb(0 0 0 / 22%);
  transition: translate .55s cubic-bezier(.34,1.45,.5,1), width .55s cubic-bezier(.34,1.45,.5,1), opacity .3s ease, scale .45s cubic-bezier(.34,1.56,.64,1), top .35s, bottom .35s; }
.tab-bubble.is-on { opacity: 1; scale: 1; }
.is-pressed .tab-bubble.is-on { scale: 1.16 1.22; transition-duration: .18s, .18s, .3s, .35s; }
.is-pressed { cursor: grabbing; }
.overlay-tabs a[aria-current]::before { animation: icon-pop .55s cubic-bezier(.34,1.56,.64,1); }
@keyframes icon-pop { 0% { transform: scale(.7) translateY(2px); } 55% { transform: scale(1.2) translateY(-2px); } 100% { transform: none; } }
.hero-menu a::before, .overlay-tabs a::before { transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.hero-menu a:hover::before, .overlay-tabs a:hover::before { transform: translateY(-2px) scale(1.08); }
.calendar-close { transition: transform .4s cubic-bezier(.34,1.56,.64,1), background .2s; }
.calendar-close:hover { transform: scale(1.06) rotate(90deg); }
.calendar-close:active { transform: scale(.9); }

/* ---- Entrances ------------------------------------------------------------ */
@keyframes bar-in { 0% { opacity: 0; transform: translateY(40px) scale(.8); filter: blur(10px); } 60% { opacity: 1; transform: translateY(-4px) scale(1.03); filter: blur(0); } 100% { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes runner-in { from { opacity: 0; filter: blur(14px) brightness(.6); } to { opacity: 1; filter: none; } }
.hero-menu { animation: bar-in 1s .35s cubic-bezier(.22,1,.36,1) both; }
.hero-video { animation: runner-in 1.4s ease both; }
.partner-banner a { animation: fade-up .9s .6s ease both; }
.calendar-open .hero-menu { animation: none; }
.calendar-overlay[open] .overlay-bar { animation: bar-in .8s .1s cubic-bezier(.22,1,.36,1) both; }
.result-card { animation: fade-up .6s cubic-bezier(.22,1,.36,1) both; transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .35s, border-color .3s; }
.result-card:nth-child(2) { animation-delay: .07s; } .result-card:nth-child(3) { animation-delay: .14s; } .result-card:nth-child(4) { animation-delay: .21s; }
.result-card:nth-child(5) { animation-delay: .28s; } .result-card:nth-child(n+6) { animation-delay: .35s; }
.result-card:hover { transform: translateY(-3px) scale(1.01); border-color: rgb(178 175 245 / 35%); box-shadow: 0 14px 34px rgb(0 0 0 / 35%); }
.result-time { background: linear-gradient(90deg, #fff9ee, #c8c7f9, #fff9ee); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: time-shine 5s linear infinite; }
@keyframes time-shine { to { background-position: -200% 0; } }
.video-slide.is-current .video-frame { animation: fade-up .6s cubic-bezier(.22,1,.36,1) both; }
@media (prefers-reduced-motion: reduce) {
  .glass:not(.calendar-close)::after, .hero-menu, .hero-video, .partner-banner a, .overlay-bar, .result-card, .result-time, .video-slide .video-frame, .overlay-tabs a::before { animation: none !important; }
  .tab-bubble { transition: opacity .2s; }
}

/* ---- Landscape calendar: wheel on top, details below ------------------------
   The calendar stacks the wheel above the month panel at widths up to 760px, so in
   landscape its frame becomes a centred column of that width inside the right side. */
@media (min-aspect-ratio: 5/4) {
  .calendar-frame { left: calc(38% + (62% - min(62%, 760px)) / 2); width: min(62%, 760px); }
}

/* ---- Apple Liquid Glass for the section pages ------------------------------ */
.overlay-view, .results-view { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif; }
.result-card {
  border: 0; border-radius: 28px;
  background: linear-gradient(180deg, rgb(255 255 255 / 13%), rgb(255 255 255 / 5%));
  -webkit-backdrop-filter: blur(26px) saturate(185%); backdrop-filter: blur(26px) saturate(185%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 45%), inset 0 -1px 1px rgb(255 255 255 / 12%), inset 0 0 0 1px rgb(255 255 255 / 11%), 0 18px 44px rgb(0 0 0 / 30%);
}
.result-card:hover { border-color: transparent; box-shadow: inset 0 1px 0 rgb(255 255 255 / 55%), inset 0 0 0 1px rgb(255 255 255 / 16%), 0 22px 50px rgb(0 0 0 / 38%); }
.result-date { color: #64d2ff; font-family: inherit; font-weight: 600; letter-spacing: .04em; }
.result-name { font-family: inherit; font-weight: 700; letter-spacing: -.02em; }
.result-distance, .result-place, .result-time small { color: rgb(235 235 245 / 62%); font-family: inherit; }
.result-time { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif; font-weight: 700; letter-spacing: -.02em;
  background-image: linear-gradient(90deg, #fff, #cfe9ff, #fff); }
.result-link { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; color: #fff; font-family: inherit; font-weight: 600;
  background: linear-gradient(180deg, rgb(255 255 255 / 20%), rgb(255 255 255 / 8%)); box-shadow: inset 0 1px 0 rgb(255 255 255 / 40%), inset 0 0 0 1px rgb(255 255 255 / 10%);
  transition: background .2s, transform .3s cubic-bezier(.34,1.56,.64,1); }
.result-link:hover { text-decoration: none; background: linear-gradient(180deg, rgb(255 255 255 / 30%), rgb(255 255 255 / 14%)); transform: scale(1.04); }

.video-frame { border-radius: 30px; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 14%), 0 24px 60px rgb(0 0 0 / 50%); }
.video-arrow, .video-sound, .video-count {
  border: 0; -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 45%), inset 0 0 0 1px rgb(255 255 255 / 12%), 0 8px 22px rgb(0 0 0 / 30%);
}
.video-arrow { background: linear-gradient(180deg, rgb(255 255 255 / 18%), rgb(255 255 255 / 6%)); transition: background .2s, transform .35s cubic-bezier(.34,1.56,.64,1); }
.video-arrow:hover { background: linear-gradient(180deg, rgb(255 255 255 / 28%), rgb(255 255 255 / 12%)); transform: scale(1.08); }
.video-arrow::before { border-color: #fff; }
.video-sound { background-color: rgb(255 255 255 / 14%); }
.video-count { background: rgb(255 255 255 / 14%); color: #fff; font-family: -apple-system, system-ui, sans-serif; font-weight: 600; }
.video-caption { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif; }
.video-status { color: rgb(235 235 245 / 62%); }
/* The results list is masked (fade at the bottom), which stops cards blurring the
   page behind it, so they carry the same smoky tint as the calendar glass. */
.result-card { background: linear-gradient(180deg, rgb(255 255 255 / 14%), rgb(255 255 255 / 4%)), rgb(24 26 34 / 55%); }

/* ---- Denser, blurrier glass ----------------------------------------------- */
/* The section views animate in with a blur; ending on filter: none (not blur(0))
   keeps them from cutting off the backdrop, so cards and buttons inside can blur
   the page for real. The results list drops its fade mask for the same reason. */
@keyframes view-in { from { opacity: 0; transform: translateY(40px) scale(.93); filter: blur(12px); } to { opacity: 1; transform: none; filter: none; } }
.calendar-overlay[open] .overlay-view { animation-name: view-in; }
.results-view { -webkit-mask-image: none; mask-image: none; }

.glass-refract { -webkit-backdrop-filter: blur(22px) saturate(180%) brightness(.92); backdrop-filter: blur(22px) saturate(180%) brightness(.92); }
.glass { background: linear-gradient(180deg, rgb(255 255 255 / 16%), rgb(255 255 255 / 7%)), rgb(28 30 38 / 34%) !important; }
.tab-bubble { -webkit-backdrop-filter: blur(8px) saturate(220%) brightness(1.2); backdrop-filter: blur(8px) saturate(220%) brightness(1.2); }
.result-card {
  background: linear-gradient(180deg, rgb(255 255 255 / 15%), rgb(255 255 255 / 5%)), rgb(26 28 36 / 48%);
  -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
}
.video-arrow, .video-sound, .video-count { -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); background-color: rgb(28 30 38 / 40%); }
/* An animated filter ends as blur(0), not none, and that still cuts off the
   backdrop; holding only the start frame (backwards) leaves filter: none after. */
.calendar-overlay[open] .overlay-view, .result-card, .video-slide.is-current .video-frame { animation-fill-mode: backwards; }

/* ---- More opaque glass ---------------------------------------------------- */
.glass { background: linear-gradient(180deg, rgb(255 255 255 / 14%), rgb(255 255 255 / 6%)), rgb(26 28 36 / 58%) !important; }
.result-card { background: linear-gradient(180deg, rgb(255 255 255 / 13%), rgb(255 255 255 / 4%)), rgb(24 26 34 / 72%); }
.video-arrow, .video-sound, .video-count { background-color: rgb(26 28 36 / 64%); }
