/* hirox.app — Ink: ink ground, paper hairlines, one lime accent. Tokens match design-guideline.html. */

@font-face { font-family: "Metropolis"; src: url("/fonts/metropolis-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("/fonts/metropolis-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("/fonts/metropolis-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Whois Mono"; src: url("/fonts/whois-mono.woff") format("woff"); font-weight: 400; font-display: swap; }

:root {
  --canvas: #090b0c;
  --panel: #111416;
  --panel-raised: #15191b;
  --line: #2a3032;
  --line-strong: #596366;
  --paper: #f7f6f2;
  --ink: #090b0c;
  --accent: #b9f20b;
  --text: #f2f4ef;
  --muted: #8e9894;
  --muted-strong: #bdc4c0;
  --danger: #ff8a7a;
  --sans: "Metropolis", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Whois Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --max: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; background: var(--canvas); }
body { margin: 0; background: var(--canvas); color: var(--text); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; }

.wrap { width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; }

/* The character decode (see signal-decode.js) */
.decode-word { display: inline-block; white-space: nowrap; }
.decode-glyph { position: relative; display: inline-block; overflow: hidden; vertical-align: top; }
.decode-glyph::before { content: attr(data-target-character); visibility: hidden; }
.decode-live { position: absolute; inset: 0; display: block; width: 100%; text-align: center; pointer-events: none; }
hirox-signal-decode { display: block; }

/* Bar */
.bar { position: absolute; inset: 0 0 auto; z-index: 5; padding: 22px 0; }
.bar-inner { display: flex; align-items: center; justify-content: space-between; }
.bar-mark img { width: 92px; }
.bar-link { font: 400 12px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; color: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px; padding: 11px 18px; transition: border-color 0.2s, color 0.2s; }
.bar-link:hover { border-color: var(--accent); color: var(--accent); }

/* Shared type */
.eyebrow { display: flex; align-items: center; gap: 10px; font: 400 12px/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.lede { color: var(--muted-strong); font-size: 16px; line-height: 1.5; max-width: 31rem; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex: none; }
.live-dot[data-status="live"] { background: var(--accent); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(185, 242, 11, 0.55); } 70% { box-shadow: 0 0 0 9px rgba(185, 242, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(185, 242, 11, 0); } }

.pill { display: inline-flex; align-items: center; justify-content: center; gap: 12px; height: 56px; padding: 0 28px; border: 0; border-radius: 999px; background: var(--accent); color: var(--ink); font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer; transition: transform 0.15s, box-shadow 0.2s; }
.pill:hover { transform: translateY(-1px); box-shadow: 0 10px 30px -12px rgba(185, 242, 11, 0.6); }
.pill:disabled { opacity: 0.6; cursor: progress; transform: none; }
.pill-wide { width: 100%; height: clamp(46px, 6svh, 56px); }

/* Hero: copy and form beside the world */
/* The hero fills the window; type, fields and the globe scale with its height. */
.hero { min-height: 100svh; display: grid; align-items: center; padding: 84px 0 32px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 500px) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-copy { display: grid; gap: clamp(12px, 2.2svh, 26px); }
.hero-head { display: grid; gap: clamp(10px, 1.8svh, 20px); }
h1 { font: 600 clamp(36px, min(4.6vw, 6.8svh), 72px)/0.98 var(--sans); letter-spacing: -0.025em; color: var(--paper); }
.tagline { font: 500 18px/1.2 var(--sans); color: var(--accent); }
/* The world column runs to the window edge so the globe grows on wide screens. */
.hero-world { position: sticky; top: 24px; display: grid; gap: 10px; margin-right: calc((min(100vw - var(--gutter) * 2, var(--max)) - 100vw) / 2); }
.globe-stage { position: relative; height: calc(100svh - 140px); min-height: 440px; max-height: 960px; }
.globe-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.globe-stage canvas.is-over-dot { cursor: pointer; }
.globe-stage canvas.is-dragging { cursor: grabbing; }
.world-hint { text-align: center; font: 400 11px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.count { position: absolute; z-index: 2; top: 0; left: 0; display: grid; gap: 4px; pointer-events: none; }
.count-value { font: 400 clamp(34px, 3.4vw, 46px)/1 var(--mono); color: var(--paper); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.count-value.is-ticking { animation: tick 1.4s ease-out; }
@keyframes tick { 0% { color: var(--accent); } 100% { color: var(--paper); } }
.count-label { font: 400 12px/1.3 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

/* Application card */
.apply-card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: clamp(16px, 2.6svh, 28px); scroll-margin-top: 24px; }
.apply-form { display: grid; gap: clamp(10px, 1.6svh, 18px); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { position: relative; display: grid; gap: 6px; min-width: 0; align-content: start; }
.field-label { font: 400 11px/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.field input, .picker { width: 100%; height: clamp(40px, 5.2svh, 52px); padding: 0 16px; background: var(--canvas); color: var(--paper); border: 1px solid var(--line); border-radius: 12px; font: 400 16px var(--sans); outline: none; transition: border-color 0.2s; }
.field input::placeholder { color: #59615f; }
.field input:focus, .picker:focus-visible { border-color: var(--accent); }
.field input[aria-invalid="true"], .picker[aria-invalid="true"] { border-color: var(--danger); }
.picker { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; }
.picker [data-value] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #59615f; }
.is-chosen .picker [data-value] { color: var(--paper); }
.picker svg { width: 12px; height: 12px; color: var(--muted); flex: none; }
.field small, .form-error { color: var(--danger); font-size: 13px; }
.field small:empty, .form-error:empty { display: none; }
.check { display: flex; gap: 12px; align-items: flex-start; color: var(--muted-strong); font-size: 14px; line-height: 1.45; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.turnstile:empty { display: none; }
.fine { color: var(--muted); font-size: 12px; }
.fine a { color: var(--muted-strong); }

/* City search */
.city-options { position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; right: 0; min-width: 260px; max-height: 320px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: var(--panel-raised); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.8); }
.opens-up .city-options { top: auto; bottom: calc(100% - 14px); }
.city-options li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.city-options li[aria-selected="true"] { background: #1d2224; box-shadow: inset 2px 0 0 var(--accent); }
.option-name { color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.option-name mark { background: none; color: var(--accent); }
.option-detail { font: 400 10px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.city-options li.is-custom .option-name { color: var(--muted-strong); }

/* Division modal */
.sheet { width: min(640px, calc(100% - 32px)); max-height: min(720px, calc(100svh - 48px)); padding: 0; background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9); }
.sheet::backdrop { background: rgba(9, 11, 12, 0.72); backdrop-filter: blur(6px); }
.sheet[open] { animation: sheet-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 24px 8px; }
.sheet-head h3 { font: 600 26px/1.1 var(--sans); color: var(--paper); margin-top: 8px; }
.sheet-close { width: 40px; height: 40px; display: grid; place-items: center; background: transparent; border: 1px solid var(--line-strong); border-radius: 50%; cursor: pointer; color: var(--paper); }
.sheet-close svg { width: 12px; height: 12px; }
.sheet-close:hover { border-color: var(--accent); }
.division-groups { display: grid; gap: 20px; padding: 16px 24px 26px; }
.division-group h4 { font: 400 11px/1.3 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.division-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.division-option { display: grid; gap: 4px; text-align: left; padding: 14px 16px; background: var(--canvas); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.division-option strong { font: 600 16px/1.2 var(--sans); color: var(--paper); }
.division-option span { font-size: 13px; color: var(--muted); }
.division-option:hover, .division-option:focus-visible { border-color: var(--line-strong); outline: none; }
.division-option[aria-pressed="true"] { border-color: var(--accent); background: rgba(185, 242, 11, 0.07); }
.division-option[aria-pressed="true"] strong { color: var(--accent); }

.apply-done { display: grid; gap: 12px; justify-items: start; padding: 6px 0; }
.done-position { font: 400 clamp(56px, 7vw, 84px)/1 var(--mono); color: var(--accent); letter-spacing: -0.03em; }
.apply-done h3 { font: 600 26px/1.15 var(--sans); color: var(--paper); }

/* Join banners: pinned to the world, and in the corner */
.pin-layer { position: absolute; inset: 0; pointer-events: none; }
.pin { position: absolute; left: 0; top: 0; transition: opacity 0.35s; will-change: transform; }
.pin.is-away, .pin.is-leaving { opacity: 0; }
.pin-stem { position: absolute; left: -0.5px; bottom: 0; width: 1px; height: 16px; background: linear-gradient(to top, rgba(185, 242, 11, 0.9), rgba(185, 242, 11, 0.2)); }
.pin-card { position: absolute; bottom: 16px; left: -10px; transform-origin: 10px 100%; animation: pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }
.pin.is-flipped .pin-card { left: auto; right: -10px; transform-origin: calc(100% - 10px) 100%; }
.pin.is-apart .pin-card { left: 14px; }
.pin.is-apart.is-flipped .pin-card { left: auto; right: 14px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.86); } }

.pin-card, .toast { display: grid; gap: 2px; min-width: 176px; padding: 10px 14px 11px; background: rgba(9, 11, 12, 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line-strong); border-left: 2px solid var(--accent); border-radius: 4px 12px 12px 4px; white-space: nowrap; }
.banner-kicker { display: flex; align-items: center; gap: 7px; font: 400 10px/1.5 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.banner-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.banner-name { font: 600 15px/1.3 var(--sans); color: var(--paper); }
.banner-place { font-size: 13px; color: var(--muted-strong); }
.banner-division { font: 400 10px/1.6 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pin--replay .pin-card { border-left-color: rgba(185, 242, 11, 0.55); }
.pin--replay .banner-kicker { color: var(--muted-strong); }
.pin--replay .banner-dot { background: var(--muted); }
.pin--you .pin-card { border-color: var(--accent); background: rgba(20, 26, 8, 0.92); box-shadow: 0 0 0 4px rgba(185, 242, 11, 0.08), 0 18px 40px -16px rgba(185, 242, 11, 0.35); }
.pin--you .banner-name { color: var(--accent); font-size: 17px; }

.toasts { position: fixed; z-index: 30; right: 24px; bottom: 24px; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 10px; pointer-events: none; }
.toast { min-width: 260px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9); animation: toast-in 0.5s cubic-bezier(0.2, 1.2, 0.4, 1); transition: opacity 0.4s, transform 0.4s; }
.toast.is-leaving { opacity: 0; transform: translateX(16px); }
.toast:not(.is-live) .banner-kicker { color: var(--muted-strong); }
.toast:not(.is-live) .banner-dot { background: var(--muted); }
.toast.is-live .banner-dot { animation: pulse 1.6s infinite; }
.toast.is-you { border-color: var(--accent); }
.toast.is-you .banner-name { color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateX(28px) scale(0.96); } }

/* What you are applying for */
.moments-section { padding: clamp(64px, 8vw, 112px) 0; border-top: 1px solid var(--line); }
.moments-section hirox-signal-decode { display: grid; gap: 14px; margin-bottom: 36px; }
h2 { font: 600 clamp(30px, 3.4vw, 44px)/1.05 var(--sans); letter-spacing: -0.02em; color: var(--paper); }
.moments { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.moments li { display: grid; gap: 6px; align-content: start; padding: 18px 20px 0 0; border-top: 1px solid var(--line-strong); }
.moments li + li { padding-left: 20px; border-left: 1px solid var(--line); }
.moments span { font: 400 12px/1.6 var(--mono); color: var(--accent); letter-spacing: 0.1em; }
.moments strong { font-weight: 600; color: var(--paper); }
.moments em { font-style: normal; color: var(--muted); font-size: 15px; line-height: 1.45; }

/* Footer world */
.foot { position: relative; border-top: 1px solid var(--line); overflow: hidden; }
.foot-content { position: relative; z-index: 2; display: grid; grid-template-columns: 1.2fr 1fr 1.4fr; gap: 32px; padding: 56px 0; }
.foot-brand { display: grid; gap: 12px; align-content: start; }
.foot-brand img { width: 120px; }
.foot-brand p { color: var(--accent); font-weight: 500; }
.foot-links { display: grid; gap: 10px; align-content: start; }
.foot-links a { color: var(--muted-strong); text-decoration: none; }
.foot-links a:hover { color: var(--paper); }
.foot-note { color: var(--muted); font-size: 13px; line-height: 1.6; }
/* Where we meet next: the next ten races on the engraved map */
.races { padding: clamp(64px, 8vw, 112px) 0 clamp(40px, 5vw, 72px); border-top: 1px solid var(--line); }
.races-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 32px; align-items: end; }
.races-head hirox-signal-decode { display: grid; gap: 14px; }
.races-note { color: var(--muted); font-size: 15px; line-height: 1.5; }
.terrain-stage { position: relative; margin-top: 8px; }
.terrain.is-over-race { cursor: pointer; }
.terrain { display: block; width: 100%; height: clamp(360px, 52vw, 640px); -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent); }

.race-list { list-style: none; margin-block: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); }
.race-list li { opacity: calc(0.4 + var(--glow, 1) * 0.6); transition: opacity 0.2s; border-bottom: 1px solid var(--line); }
.race-list li:not(:nth-child(5n + 1)) { border-left: 1px solid var(--line); }
.race-list li.is-lit, .race-list li:hover { opacity: 1; }
.race-list a { display: grid; gap: 1px; padding: 10px 14px 12px; text-decoration: none; color: inherit; outline: none; }
.race-list li:first-child .race-n, .race-list li.is-lit .race-n { color: var(--accent); }
.race-n, .race-when, .race-in { font: 400 10px/1.6 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.race-when { color: var(--muted-strong); }
.race-name { font: 600 15px/1.3 var(--sans); color: var(--paper); }
.race-list li.is-lit .race-name { color: var(--accent); }

.photo-credits { margin-top: 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.photo-credits summary { cursor: pointer; font: 400 11px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; width: max-content; }
.photo-credits summary:hover { color: var(--paper); }
.photo-credits ul { margin: 12px 0 0; padding: 0; list-style: none; columns: 2; column-gap: 32px; }
.photo-credits li { break-inside: avoid; margin-bottom: 6px; }
.photo-credits a { color: var(--muted-strong); }
.photo-credits strong { color: var(--muted-strong); font-weight: 500; }

/* A race's card: the city in black and white, the details over it */
.race-card { width: 280px; display: grid; gap: 6px; animation: pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }
/* Beside the beam's top, so the card stays on the map. */
.pin--race > .race-card { position: absolute; top: -12px; left: 16px; transform-origin: 0 12px; }
.pin--race.is-flipped > .race-card { left: auto; right: 16px; transform-origin: 100% 12px; }
.pin--race .pin-stem { display: none; }
.toasts.is-quiet { opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0s 0.3s; }
.race-photo { position: relative; height: 168px; overflow: hidden; border-radius: 4px 14px 14px 4px; border: 1px solid var(--line-strong); border-left: 2px solid var(--accent); background: var(--panel) repeating-linear-gradient(0deg, transparent 0 5px, rgba(247, 246, 242, 0.05) 5px 6px); box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.9); }
.race-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.15) brightness(0.8); }
.race-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(9, 11, 12, 0.95) 8%, rgba(9, 11, 12, 0.35) 55%, rgba(9, 11, 12, 0.05)); }
.race-body { position: absolute; z-index: 1; left: 14px; right: 14px; bottom: 12px; display: grid; gap: 1px; }
.race-kicker { display: flex; align-items: center; gap: 7px; font: 400 10px/1.5 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.race-city { font: 600 24px/1.1 var(--sans); color: var(--paper); letter-spacing: -0.01em; }
.race-dates { font-size: 14px; color: var(--paper); }
.race-country { font: 400 10px/1.6 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-strong); }
.race-credit { font-size: 9.5px; line-height: 1.35; color: var(--muted); white-space: normal; text-shadow: 0 1px 2px #000; }

.is-offline .count-label::after { content: " — the live world is unavailable right now."; text-transform: none; letter-spacing: 0; }

@media (max-width: 960px) {
  .hero { min-height: 0; display: block; padding-top: 84px; }
  .hero-grid { grid-template-columns: 1fr; gap: 8px; }
  .hero-world { position: relative; top: 0; order: -1; margin-right: 0; }
  .globe-stage { height: min(90vw, 520px); min-height: 0; }
  .hero-copy { padding-top: 0; }
  .moments { grid-template-columns: 1fr; }
  .moments li, .moments li + li { padding: 14px 0; border-left: 0; }
  .foot-content { grid-template-columns: 1fr 1fr; }
  .races-head { grid-template-columns: 1fr; gap: 12px; }
  .photo-credits ul { columns: 1; }
  .race-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .race-list li:not(:nth-child(5n + 1)) { border-left: 0; }
  .race-list li:nth-child(even) { border-left: 1px solid var(--line); }
  .foot-note { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .toast { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; padding: 8px 12px 9px; }
  .toast .banner-kicker { flex-basis: 100%; }
  .toast .banner-division { display: none; }
  .toast:not(:first-child) { display: none; }
  /* Out of the way while the visitor types. */
  body:has(.apply-form:focus-within) .toasts { display: none; }
  .sheet { margin: auto auto 0; width: 100%; max-width: none; border-radius: 22px 22px 0 0; }
  .pin-card { min-width: 150px; }
}

/* Privacy, terms and 404 */
.doc-page .bar { position: relative; }
.doc { max-width: 720px; padding: 48px 0 96px; display: grid; gap: 16px; }
.doc h1 { font-size: clamp(40px, 5vw, 56px); margin-bottom: 4px; }
.doc h2 { font-size: 22px; line-height: 1.3; margin-top: 20px; }
.doc p, .doc li { color: var(--muted-strong); }
.doc ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.doc a:not(.pill) { color: var(--paper); }
.doc-404 { min-height: 60svh; align-content: center; justify-items: start; }
.doc-foot { padding-bottom: 56px; }
