/* Shared foundations for public races, history, sign-in and administration.
   Provider-specific data and page layouts stay in their own controllers/sheets. */
:root {
  --bg: #110f16;
  --surface: #19171f;
  --surface-raised: #211b25;
  --panel: var(--surface);
  --panel-high: var(--surface-raised);
  --line: #39313e;
  --text: #f5f1f7;
  --muted: #bdb2c4;
  --accent: #ff8799;
  --brand: #f24868;
  --action: #bd2544;
  --warning: #f0c17a;
  --radius: 18px;
  --shadow: 0 8px 28px #00000014;
  --content-width: 1640px;
  --page-gutter: clamp(16px, 3vw, 40px);
  --header-offset: 104px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color-scheme: dark;
}
body {
  color: var(--text);
  background: radial-gradient(ellipse 90% 470px at 72% 0%, #80203b22, transparent), var(--bg);
  -webkit-font-smoothing: antialiased;
}
body::before { display: none; }
.shell {
  width: min(calc(100% - var(--page-gutter) - var(--page-gutter)), var(--content-width));
  max-width: none;
  margin-inline: auto;
  padding-inline: 0;
}
.panel { background: var(--surface); border-color: var(--line); border-radius: var(--radius); }
.small { font-size: .875rem; line-height: 1.6; }
.eyebrow { font-size: .75rem; letter-spacing: .1em; line-height: 1.5; }
.text-link { font-size: .875rem; line-height: 1.5; text-underline-offset: 4px; }
.text-link:hover { text-decoration: underline; }
.button, .button.small {
  min-height: 44px;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.4;
  padding: 10px 16px;
  transition: background-color .15s, border-color .15s;
}
.button.primary { background: var(--action); border-color: var(--action); }
.button.primary:hover { background: #a8203c; border-color: #d74763; }
.badge, .tag { font-size: .8125rem; line-height: 1.45; border-radius: 8px; }
input, select, textarea { font-size: 1rem; border-radius: 10px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select { min-height: 44px; }
select {
  appearance: none;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
:focus-visible { outline: 2px solid #ff9aab; outline-offset: 4px; }
html { scroll-padding-top: var(--header-offset); }
/* One offset avoids adding legacy element margins to the sticky header. */
[id] { scroll-margin-top: 0 !important; }
.site-header {
  background: #141118f5;
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
}
.site-header .header-inner {
  min-height: 84px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-block: 14px;
}
.site-header .brand { gap: 12px; min-width: 0; font-size: 1rem; letter-spacing: -.01em; }
.site-header .brand img { width: 38px; height: 38px; flex: 0 0 38px; image-rendering: pixelated; }
.brand [data-site-text="site_name"] { display: block; font-size: 1rem; font-weight: 800; line-height: 1.35; }
.site-header .brand-sub { font-size: .75rem; letter-spacing: .12em; line-height: 1.5; margin-top: 4px; }
.site-header .header-inner nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.site-header nav > a, .site-header nav .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  font-size: .875rem;
  border-radius: 10px;
}
.site-header nav a[aria-current="page"] { color: var(--accent); background: #3a1d2a; box-shadow: inset 0 -2px #e84263; }
.site-header nav > a:not([hidden]) { visibility: visible; }
.footer {
  margin-top: 36px;
  padding-block: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .875rem;
  gap: 18px;
}
/* Sign-in uses the same panels, field rhythm and primary action as the editor. */
.login-wrap { min-height: min(760px, calc(100vh - 180px)); padding-block: clamp(32px, 6vw, 80px); }
.login-panel { width: min(100%, 500px); padding: clamp(24px, 4vw, 40px); margin: auto; }
.login-panel h1 { font-size: clamp(2rem, 4vw, 2.6rem); letter-spacing: -.04em; margin: 12px 0; }
.login-panel .field label { font-size: .875rem; margin-bottom: 8px; }
.login-panel .stack { gap: 20px; }
.login-panel .release { font-size: .8125rem; color: var(--muted); overflow-wrap: anywhere; }
.login-panel > .muted { margin-bottom: 24px; }
.login-panel .button { width: 100%; }
@media (max-width: 850px) {
  :root { --header-offset: 156px; }
  .site-header .header-inner { flex-wrap: wrap; gap: 12px; }
  .site-header .header-inner nav { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .site-header .header-inner { align-items: flex-start; }
  .site-header .brand { width: 100%; }
  .site-header .header-inner nav { width: 100%; gap: 6px; }
  .site-header nav > a, .site-header nav .text-button { padding: 9px 11px; }
  .site-header .header-inner .section-nav, .site-header .header-inner .community-nav:not([hidden]) { display: inline-flex; }
  .footer { align-items: flex-start; flex-direction: column; padding-block: 20px; margin-top: 24px; }
  .footer span:last-child { text-align: left; }
  .login-wrap { min-height: 0; padding-block: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
}
