/* Awesome Simracing – Race Poster design, plain CSS (no build step needed on
   the server). Wide italic type, slanted bands and parallelograms. Colours
   come from a few base colours (--c-*, the "Neon Pink" profile), which
   App\Support\Palette writes into each page; every token is derived from
   them, separately for light and dark. /styleguide shows all
   components and can switch the base colours for comparison. Dark mode:
   class "dark" on <html>, set from localStorage "theme" (shared with the
   Filament panels). Fonts: Anybody and Public Sans (SIL Open Font License),
   self-hosted in /fonts/race-poster (fonts.css, linked by the pages next to
   this file rather than imported, so both load in parallel). */

:root {
  --bg: var(--c-paper); --surface: #ffffff;
  --surface-2: color-mix(in oklab, var(--c-sky) 22%, #ffffff);
  --border: color-mix(in oklab, var(--c-ink) 16%, var(--c-paper));
  --text: var(--c-ink); --muted: color-mix(in oklab, var(--c-ink) 72%, var(--c-paper));
  --brand-text: var(--c-violet);
  --primary: var(--c-violet); --primary-ink: #ffffff;
  --accent: var(--c-accent); --accent-ink: var(--c-ink);
  --sky: var(--c-sky); --sky-ink: var(--c-ink);
  --band: var(--c-band); --band-text: #ffffff; --band-muted: color-mix(in oklab, var(--c-band) 18%, #ffffff);
  --shadow: var(--c-shadow, var(--c-violet));
  --highlight: var(--primary); /* hover and focus; the accent is too light on paper (under 3:1) */
  --danger: #d6263b; --success: #1f8a4c;
  --stripe: linear-gradient(var(--primary) 0 42%, var(--sky) 42% 84%, var(--accent) 84%);
  --stripe-h: linear-gradient(90deg, var(--primary) 0 42%, var(--sky) 42% 84%, var(--accent) 84%);
  --display: "Anybody", ui-sans-serif, system-ui, sans-serif;
  --font: "Public Sans", ui-sans-serif, system-ui, sans-serif;
  --slant: 10px;
}
html.dark {
  --bg: var(--c-night);
  --surface: color-mix(in oklab, var(--c-night) 88%, var(--c-violet));
  --surface-2: color-mix(in oklab, var(--c-night) 78%, var(--c-violet));
  --border: color-mix(in oklab, var(--c-night) 68%, var(--c-violet));
  --text: color-mix(in oklab, var(--c-sky) 6%, #ffffff);
  --muted: color-mix(in oklab, var(--text) 66%, var(--c-night));
  --brand-text: var(--text);
  --primary: var(--c-violet-dark, color-mix(in oklab, var(--c-violet) 62%, #ffffff)); --primary-ink: var(--c-night);
  --accent: var(--c-accent-dark, var(--c-accent)); --accent-ink: var(--c-night);
  --sky: var(--c-sky-dark, var(--c-sky)); --sky-ink: var(--c-night);
  --band: var(--c-band-dark); --band-muted: color-mix(in oklab, var(--c-band-dark) 16%, #ffffff);
  --shadow: var(--c-shadow-dark, var(--sky));
  --highlight: var(--accent);
  --danger: #ff5a6e; --success: #45c983;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 400 17px/1.6 var(--font); overflow-x: hidden; }
main { flex: 1 0 auto; }
a { color: var(--primary); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }
code { font-size: .88em; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
main { padding: 0 0 96px; }
main > .container:first-child { padding-top: 40px; }
.rp-hero + .container { padding-top: 16px; }

/* Type: wide, heavy italics for headings, a plain grotesque for reading. */
h1, h2, h3, .display { font-family: var(--display); font-style: italic; font-weight: 850; font-stretch: 125%; line-height: 1; letter-spacing: -.01em; }
.display { font-size: clamp(2.6rem, 7.5vw, 6.2rem); font-weight: 900; font-stretch: 140%; line-height: .9; letter-spacing: -.025em; margin: 0; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin: 0 0 16px; }
h2 { font-size: 1.8rem; margin: 40px 0 12px; }
h3 { font-size: 1.2rem; font-stretch: 115%; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.figures { font: italic 800 2rem var(--display); font-stretch: 120%; font-variant-numeric: tabular-nums; }

/* The three-colour stripe, used as the page's divider. */
.rp-stripes { height: 30px; margin-top: -1px; background: var(--stripe); clip-path: polygon(0 0, 100% 0, 100% 40%, 0 100%); }

/* Header: violet logo type on paper, a violet rule underneath. */
.site-header { background: var(--surface); border-bottom: 4px solid var(--primary); }
.site-header .container { display: flex; align-items: center; gap: 20px; min-height: 68px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--brand-text); font: italic 900 19px var(--display); font-stretch: 115%; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1 0 auto; }
.nav > a, .nav-group > a { display: block; padding: 6px 12px; color: var(--text); font: italic 800 16px var(--display); font-stretch: 105%; }
.nav-group > a { display: flex; align-items: center; }
.nav-caret { width: 16px; height: 16px; flex-shrink: 0; margin-left: 3px; stroke-width: 3; } /* heavier than the Heroicon, to match the type */ /* an icon, not ▾: Anybody has no such glyph, and the fallback font shifted the text down */
.nav a:hover { text-decoration: none; color: var(--highlight); }
.nav a.active { background: var(--primary); color: var(--primary-ink); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.nav-group { position: relative; }
.nav-sub { display: none; position: absolute; top: 100%; left: 0; z-index: 10; min-width: 190px; padding: 6px 0; background: var(--surface); border: 2px solid var(--text); box-shadow: 5px 5px 0 var(--shadow); }
.nav-sub a { display: block; padding: 6px 14px; color: var(--text); font-weight: 600; }
.nav-group:hover .nav-sub, .nav-group:focus-within .nav-sub { display: block; }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav-secondary { display: flex; gap: 2px; }
.nav-secondary a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; color: var(--muted); font-size: 15px; }
.nav-secondary a:hover { color: var(--text); text-decoration: none; }
.nav-secondary svg { width: 20px; height: 20px; }
.theme-switcher { display: inline-flex; border: 2px solid var(--primary); }
.theme-switcher button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 24px; padding: 0; background: none; border: 0; cursor: pointer; color: var(--primary); }
.theme-switcher svg { width: 16px; height: 16px; }
.theme-switcher button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); }
/* Icons only: the wide type needs the room. */
@media all { .nav-secondary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
@media (max-width: 640px) {
  .site-header .container { gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .nav { flex: 1 1 100%; min-width: 0; }
  .nav-sub, .nav-group:hover .nav-sub, .nav-group:focus-within .nav-sub { display: none; } /* the subnav on the page covers it */
  .header-actions { margin-left: 0; width: 100%; }
  .header-actions .btn { margin-left: auto; }
}

/* Buttons: parallelograms. The main action in the accent, the second in sky. */
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 calc(16px + var(--slant)); border: 0; background: var(--accent); color: var(--accent-ink); font: italic 800 16px/1 var(--display); font-stretch: 105%; cursor: pointer; clip-path: polygon(var(--slant) 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%); }
.btn:hover { text-decoration: none; background: var(--primary); color: var(--primary-ink); }
.btn.secondary { background: var(--sky); color: var(--sky-ink); }
.btn.secondary:hover { background: var(--primary); color: var(--primary-ink); }
.btn:focus-visible { outline: 0; box-shadow: inset 0 0 0 3px var(--text); }
.btn:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; margin-right: 8px; stroke-width: 2.5; }

/* Hero: the slanted band with the livery cut in. */
.rp-hero { overflow-x: clip; }
.rp-band { background: var(--band); color: var(--band-text); padding: 56px 0 72px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 3vw)); }
.rp-band-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px 48px; align-items: start; }
.rp-band-grid .display { grid-column: 1 / -1; text-wrap: balance; font-size: clamp(2.4rem, 6.4vw, 5.6rem); }
.rp-hero .display { color: var(--band-text); }
.rp-lede { max-width: 44ch; margin: 0 0 28px; font-size: 19px; color: var(--band-muted); }
.rp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.rp-hero .btn:hover { background: var(--band-text); color: var(--band); }
/* The livery ends on the right edge of the content, like the header, so the
   page stays balanced on wide screens. */
.rp-cutout { position: relative; display: block; clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%); }
.rp-cutout img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.rp-cutout span { position: absolute; right: 0; bottom: 0; padding: 6px 14px; background: var(--sky); color: var(--sky-ink); font: italic 800 15px var(--display); font-stretch: 115%; }
.rp-cutout:hover { text-decoration: none; }
@media (max-width: 900px) {
  .rp-band { padding: 40px 0 56px; }
  .rp-band-grid { grid-template-columns: 1fr; }
  .rp-cutout { margin: 0 -16px; clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 100%); }
  .rp-actions .btn { font-size: 15px; font-stretch: 100%; }
}

/* Totals: big italic numbers split by slanted rules. */
.site-totals { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.site-totals li + li { border-left: 3px solid var(--primary); transform: skewX(-10deg); }
.site-totals li + li .site-total { transform: skewX(10deg); }
.site-total { display: flex; flex-direction: column; padding: 8px 20px; color: var(--muted); }
.site-totals li:first-child .site-total { padding-left: 0; }
.site-total:hover { text-decoration: none; color: var(--highlight); }
.site-total strong { font: italic 900 clamp(1.6rem, 4vw, 2.8rem)/1 var(--display); font-stretch: 130%; color: var(--text); white-space: nowrap; }
.site-total-label { font-size: 15px; font-weight: 600; }
@media (max-width: 640px) {
  .site-totals { grid-template-columns: 1fr 1fr; row-gap: 16px; }
  .site-totals li:nth-child(3) { border-left: 0; transform: none; }
  .site-totals li:nth-child(3) .site-total { transform: none; padding-left: 0; }
}

/* Cards: printed on white, hard offset shadow, the image cut diagonally. */
.grid { display: grid; gap: 28px 22px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 2px solid var(--text); box-shadow: 6px 6px 0 var(--shadow); }
.card:hover, .panel:hover { box-shadow: 6px 6px 0 var(--accent); }
.card > a { display: block; }
.card img, .placeholder { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%); }
.card .body { padding: 4px 14px 14px; }
.card .title { display: block; color: var(--text); font: italic 800 18px/1.15 var(--display); font-stretch: 110%; overflow-wrap: anywhere; }
.card .meta { display: flex; flex-direction: column; margin-top: 4px; font-size: 14px; color: var(--muted); }
.card .meta .badge { align-self: flex-start; }

/* Artists: slanted number plates. Only the plate (::before) is slanted, so
   name and count stay upright on one left edge. The plate has a fixed
   height: the avatar's cut matches the slant (tan 10° × 88px ≈ 15.5px). */
.artists { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px 30px; padding-left: 8px; }
.artist { position: relative; isolation: isolate; display: grid; grid-template-columns: 92px minmax(0, 1fr); grid-template-rows: 1fr max-content max-content 1fr; column-gap: 12px; height: 88px; padding: 0 22px 0 0; color: var(--text); }
.artist::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--surface); border: 2px solid var(--text); box-shadow: 5px 5px 0 var(--shadow); transform: skewX(-10deg); }
.artist:hover { text-decoration: none; }
.artist:hover::before { box-shadow: 5px 5px 0 var(--accent); }
.artist img { grid-row: 1 / -1; width: 100px; height: 84px; margin: 2px 0 0 -8px; object-fit: cover; background: var(--surface-2); clip-path: polygon(17.5px 0, 100% 0, calc(100% - 14.8px) 100%, 2.7px 100%); }
.artist-name { grid-row: 2; font: italic 800 17px/1.15 var(--display); font-stretch: 110%; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.artist .meta { grid-row: 3; margin-top: 3px; font-size: 13px; color: var(--muted); }
.artist-count { font: italic 900 1.05rem/1 var(--display); font-stretch: 115%; color: var(--primary); }

/* User profile: the avatar cut like a number plate next to the name. */
.profile-header { display: flex; gap: 20px; align-items: center; margin-bottom: 16px; }
.profile-header > div { min-width: 0; }
.profile-header img { width: 96px; height: 96px; flex-shrink: 0; object-fit: cover; clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
.profile-header h1 { margin: 0 0 4px; overflow-wrap: anywhere; }
.profile-header p { margin: 0; }

/* Detail page. */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-header h1 { min-width: 0; overflow-wrap: anywhere; }
.page-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
.page-header-actions form { margin: 0; }
.two-col { display: grid; gap: 32px; grid-template-columns: 2fr 1fr; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
.hero img { width: 100%; clip-path: polygon(0 0, 100% 0, 100% 94%, 0 100%); }
.panel { background: var(--surface); border: 2px solid var(--text); box-shadow: 6px 6px 0 var(--shadow); padding: 20px; }
.panel.narrow, .panel.medium { margin: 0 auto; }
.panel.narrow { max-width: 520px; }
.panel.medium { max-width: 760px; }
.scroll-box { max-height: 50vh; overflow: auto; margin-bottom: 16px; padding: 12px 16px; border: 2px solid var(--border); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; font-size: 15px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
table.files { width: 100%; border-collapse: collapse; font-size: 15px; }
table.files td { padding: 7px 0; border-top: 2px solid var(--surface-2); }
table.files td:last-child { text-align: right; }

/* Forms. */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
input[type=search], input[type=text], select { min-height: 44px; padding: 0 14px; border: 2px solid var(--primary); border-radius: 0; background: var(--surface); color: var(--text); font: 400 16px var(--font); }
input:focus, select:focus { outline: 0; box-shadow: 4px 4px 0 var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 20px; height: 20px; }
.stack label { display: block; margin-bottom: 14px; font-weight: 700; }
.stack label.inline { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.stack input[type=text] { display: block; width: 100%; margin-top: 6px; }

.badge { display: inline-block; padding: 1px 10px; background: var(--sky); color: var(--sky-ink); font: italic 800 13px/1.5 var(--display); font-stretch: 110%; clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.flash { margin-bottom: 12px; padding: 14px 18px; border: 2px solid var(--primary); border-left: 10px solid var(--success); background: var(--surface); }
.flash.error { border-left-color: var(--danger); }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; font-size: 14px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs > *:not(:last-child)::after { content: "/"; margin-left: 8px; font-weight: 800; color: var(--primary); }
.subnav { display: flex; gap: 20px; margin-bottom: 20px; border-bottom: 2px solid var(--primary); }
.subnav a { padding: 6px 0; color: var(--muted); font: italic 800 17px var(--display); font-stretch: 115%; border-bottom: 6px solid transparent; margin-bottom: -2px; }
.subnav a:hover { text-decoration: none; color: var(--text); }
.subnav a.active { color: var(--text); border-bottom-color: var(--accent); }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 24px 0 0; padding: 0; list-style: none; }
.pagination a { display: block; padding: 8px 16px; background: var(--primary); color: var(--primary-ink); font: italic 800 15px var(--display); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.pagination a:hover { background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.pagination span { color: var(--muted); font-weight: 600; }

.empty { padding: 40px 32px; background: var(--surface); border: 2px dashed var(--primary); }
.empty p { margin: 0 0 6px; }
.empty .btn { margin-top: 12px; }

.site-footer { padding: 28px 0; font-size: 14px; background: var(--band); color: var(--band-text); }
.site-footer .container { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer a { color: var(--band-text); font-weight: 500; }

/* Content written in the CMS or by users (pages, descriptions). */
.content { max-width: 72ch; }
.content :is(h2, h3) { margin-top: 1.5em; }
.content img { height: auto; }
.content.panel { max-width: none; }
.hero + .gallery { margin-top: 8px; }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.gallery img { aspect-ratio: 4 / 3; object-fit: cover; clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%); }
.error { color: var(--danger); margin: 4px 0 12px; font-weight: 600; }
.home-content { margin-top: 48px; }

/* Desktop client page (/client). */
.client-hero .display { margin-bottom: 20px; }
.client-release { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 16px 0 0; color: var(--band-muted); font-size: 15px; }
.client-release strong { color: var(--band-text); }
.client-release a { color: var(--band-text); }
.client-sections { display: grid; gap: 8px 48px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.client-sections > :last-child { grid-column: 1 / -1; }
.client-sections > .panel { margin-top: 40px; scroll-margin-top: 24px; }
.client-sections .panel h2 { margin-top: 0; }
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: step; position: relative; margin: 0 0 16px; padding-left: 56px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 40px; height: 34px; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font: italic 900 20px/1 var(--display); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
@media (max-width: 900px) {
  .client-sections { grid-template-columns: 1fr; }
}

/* Error pages (errors/4xx, errors/5xx) */
.error-page { max-width: 640px; margin: 48px 0 64px; }
.error-code { margin: 0; font: italic 900 clamp(4rem, 14vw, 8rem)/1 var(--display); font-stretch: 125%; color: var(--primary); }
.error-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
