/*
 * Mario Adrion - site styles.
 *
 * Layout is Crosswind utilities in the views; this file holds the tokens, the
 * faces, and the handful of components utilities cannot express. Crosswind's
 * sheet loads after this one, so any rule here that competes with a utility
 * on the same property doubles its class to win (`.display.display`).
 *
 * z-index scale: 10 sticky nav, 20 skip link.
 */

@font-face {
  font-family: 'Anybody';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 50% 150%;
  font-display: swap;
  src: url('/assets/fonts/anybody-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/geist-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #0e0e0d;
  --ink-raised: #171715;
  --ink-sunk: #0a0a09;
  --paper: #f3f1ea;
  --muted: #a8a59d;
  --rule: rgb(243 241 234 / 0.12);
  /* Stage-sign yellow. The one accent, used for action and nothing else. */
  --accent: #f5c542;
  --accent-ink: #141208;
  --radius: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

html {
  background: var(--ink);
  color: var(--paper);
  /* `clip`, not `hidden`: hidden turns body into the scroll container and
     silently breaks position: sticky on the nav. */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* A client-scope wrapper stx puts around components must not become a box,
   or it traps sticky descendants inside its own height. */
body > div[data-stx-scope] { display: contents; }

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- Type ---------- */

.display.display {
  font-family: 'Anybody', 'Geist', sans-serif;
  font-stretch: 62%;
  font-weight: 850;
  text-transform: uppercase;
  line-height: 0.86;
  letter-spacing: -0.01em;
}

.heading.heading {
  font-family: 'Anybody', 'Geist', sans-serif;
  font-stretch: 70%;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: 0;
}

.eyebrow {
  font-family: 'Geist', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.muted { color: var(--muted); }
.accent { color: var(--accent); }
.rule { border-color: var(--rule); }
.surface { background: var(--ink-raised); }

.prose-bio p + p { margin-top: 1.1em; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0 1.6rem;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.975rem;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: #ffd35c; }

.btn-ghost { border-color: rgb(243 241 234 / 0.28); color: var(--paper); }
.btn-ghost:hover { border-color: var(--paper); }

.btn-sm { min-height: 2.5rem; padding: 0 1.1rem; font-size: 0.875rem; }

/* ---------- Nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(14 14 13 / 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--rule);
}
@media (prefers-reduced-transparency: reduce) {
  .site-nav { background: var(--ink); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  transition: color 0.2s var(--ease);
}
.nav-link:hover { color: var(--paper); }

.nav-socials { align-items: center; gap: 0.25rem; margin-right: -0.25rem; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 1.25rem;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.icon-btn:hover { color: var(--paper); background: rgb(255 255 255 / 0.07); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Phone menu. Shown off the button's aria-expanded, so the panel itself
   carries no client binding. */
.menu-btn {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.5rem;
  border-radius: 999px;
  color: var(--paper);
  font-size: 1.5rem;
}
.menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-btn .menu-close,
.menu-btn[aria-expanded="true"] .menu-open { display: none; }
.menu-btn[aria-expanded="true"] .menu-close { display: inline-block; }
.mobile-menu {
  display: none;
  position: absolute;
  inset: 4rem 0 auto 0;
  background: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.menu-btn[aria-expanded="true"] + .mobile-menu { display: block; }
.mobile-link {
  display: block;
  padding: 0.85rem 0;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.mobile-socials { display: flex; flex-wrap: wrap; gap: 0.25rem; padding-top: 0.75rem; margin-left: -0.5rem; }
@media (min-width: 768px) { .menu-btn, .mobile-menu { display: none !important; } }

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

.hero-stage {
  position: relative;
  isolation: isolate;
}

/* The spotlight. A comic stands in one light; the hero does too. */
.hero-stage::before {
  content: '';
  position: absolute;
  /* Oversized so the light fades out inside its own box: an ellipse that
     reaches the edge of the pseudo-element is cut flat there. */
  inset: -30% -45% -4%;
  z-index: -1;
  background:
    radial-gradient(ellipse 30% 40% at 50% 42%, rgb(255 244 214 / 0.17), transparent 72%),
    radial-gradient(ellipse 34% 8% at 50% 95%, rgb(255 244 214 / 0.09), transparent 72%);
  pointer-events: none;
}

.hero-figure {
  width: min(100%, 36rem);
  margin-inline: auto;
}

/* On a phone the face comes first, but only as tall as leaves the name and
   both buttons in the first screen. */
@media (max-width: 767px) {
  .hero-figure {
    width: auto;
    max-height: 38svh;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-stage::before { animation: lights-up 1.4s var(--ease) both; }
  .hero-figure { animation: walk-on 1.1s var(--ease) 0.1s both; }
  .hero-copy > * { animation: rise 0.9s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms + 150ms); }
}

@keyframes lights-up {
  0% { opacity: 0; }
  35% { opacity: 0.55; }
  45% { opacity: 0.25; }
  100% { opacity: 1; }
}
@keyframes walk-on {
  from { opacity: 0; transform: translateY(40px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Marquee: the tour's reach, one line ---------- */

.marquee {
  overflow: hidden;
  background: var(--accent);
  color: var(--accent-ink);
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: 2.75rem;
  padding: 0.95rem 0;
}
.marquee-track span {
  font-family: 'Anybody', sans-serif;
  font-stretch: 70%;
  font-weight: 800;
  font-size: 1.35rem;
  text-transform: uppercase;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 2.75rem;
}
.marquee-track span::after {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.55;
}
@media (prefers-reduced-motion: no-preference) {
  .marquee-track { animation: marquee 60s linear infinite; }
  .marquee:hover .marquee-track { animation-play-state: paused; }
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Tour ---------- */

.month-label {
  position: sticky;
  top: 5.5rem;
}

.run {
  display: grid;
  gap: 1.25rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
}
.run:first-child { border-top: 0; padding-top: 0.5rem; }

@media (min-width: 900px) {
  .run {
    grid-template-columns: 8.5rem minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: start;
  }
}

.run-dates {
  font-family: 'Anybody', sans-serif;
  font-stretch: 65%;
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--accent);
}

.run-place {
  font-family: 'Anybody', sans-serif;
  font-stretch: 75%;
  font-weight: 750;
  font-size: 1.55rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.times {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
@media (min-width: 900px) {
  .times { justify-content: flex-end; }
}

.time-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  min-width: 7.25rem;
  padding: 0.6rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--rule);
  background: var(--ink-raised);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.time-chip:hover { border-color: var(--accent); background: rgb(245 197 66 / 0.08); }
.time-chip:active { transform: scale(0.98); }
.time-chip .when { font-weight: 650; font-size: 0.95rem; }
.time-chip .cta {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.time-chip[aria-disabled='true'] { pointer-events: none; opacity: 0.55; }
.time-chip[aria-disabled='true'] .cta { color: var(--muted); }

/* ---------- Forms ---------- */

.field-label { font-size: 0.925rem; font-weight: 600; color: var(--paper); }
.field-hint { font-weight: 400; color: var(--muted); }

.field {
  width: 100%;
  min-height: 3.1rem;
  padding: 0 1rem;
  border-radius: 12px;
  border: 1px solid rgb(243 241 234 / 0.22);
  background: var(--ink-sunk);
  color: var(--paper);
  font: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(245 197 66 / 0.25);
}

.field-error { font-size: 0.875rem; color: #ffb4a3; }
.field-trap { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }

.city-done {
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  background: rgb(245 197 66 / 0.12);
  border: 1px solid rgb(245 197 66 / 0.4);
  font-weight: 600;
}

/* ---------- Special ---------- */

.special-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink-sunk);
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.8);
}
.special-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.special-poster {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.special-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease), filter 0.6s var(--ease); }
.special-frame:hover .special-still { transform: scale(1.02); filter: brightness(0.85); }
.special-frame iframe { z-index: 1; background: var(--ink-sunk); }

.special-play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 5.5rem;
  height: 5.5rem;
  margin: -2.75rem 0 0 -2.75rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 2.25rem;
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.45);
  transition: transform 0.3s var(--ease);
}
.special-poster:hover .special-play { transform: scale(1.06); }

/* ---------- About / facts ---------- */

.fact {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 1.75rem;
  background: var(--ink-raised);
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 13rem;
}
.fact-accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.fact-accent .muted { color: rgb(20 18 8 / 0.72); }
.fact-photo { padding: 0; min-height: 22rem; }
.fact-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.fact-figure {
  font-family: 'Anybody', sans-serif;
  font-stretch: 62%;
  font-weight: 850;
  font-size: clamp(3rem, 2.2rem + 3vw, 4.75rem);
  line-height: 0.9;
  text-transform: uppercase;
}

/* ---------- Socials ---------- */

.social {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--ink-raised);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.social:hover { border-color: var(--accent); transform: translateY(-2px); }
.social:active { transform: translateY(0) scale(0.99); }
.social .icon { font-size: 1.5rem; flex: none; }
.social .arrow { margin-left: auto; color: var(--muted); transition: transform 0.2s var(--ease), color 0.2s var(--ease); }
.social:hover .arrow { color: var(--accent); transform: translate(2px, -2px); }

/* ---------- Contact ---------- */

.contact-card {
  display: grid;
  gap: 0.35rem;
  padding: 1.5rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--ink-raised);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-card:active { transform: translateY(0) scale(0.99); }
.contact-name {
  font-family: 'Anybody', sans-serif;
  font-stretch: 75%;
  font-weight: 750;
  font-size: 1.7rem;
  line-height: 1.05;
  text-transform: uppercase;
}
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  color: var(--accent);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---------- Scroll reveal ---------- */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* A run's place links to its city page. Reads as the heading it was. */
.run-place-link { color: inherit; text-decoration: none; }
.run-place-link:hover { color: var(--accent); }
.run-place-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* City page: the other places on the tour. */
.more-city {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0;
  color: var(--paper);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.more-city:hover { color: var(--accent); }
