:root {
  --ink: #203c31;
  --green: #174a38;
  --muted: #637269;
  --cream: #fafaf7;
  --paper: #fff;
  --line: #dfe4dc;
  --yellow: #f1d170;
  --danger: #a23627;
  --radius: 8px;
  --radius-control: 6px;
  --surface-soft: #edf1e9;
  --border-control: #aab8ad;
  --green-hover: #0c3527;
  --danger-surface: #fff0e7;
  --danger-ink: #7e281e;
  --gutter: 40px;
  --page-space: 40px;
  --page-bottom: 64px;
  --panel-space: 32px;
  --form-width: 620px;
  --title-size: clamp(2rem, 4vw, 2.75rem);
  --section-title-size: clamp(1.5rem, 3vw, 1.8rem);
  --font-heading: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: Helvetica, Arial, sans-serif;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  font-size: 16px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; }
.icon { display: inline-block; width: 18px; height: 18px; flex: none; vertical-align: -.2em; background-color: currentColor; mask: var(--icon) center / contain no-repeat; -webkit-mask: var(--icon) center / contain no-repeat; }
.icon-copy { --icon: url("/icons/copy.svg"); }
.icon-printer { --icon: url("/icons/printer.svg"); }
.icon-x { --icon: url("/icons/x.svg"); }
.icon-chevron-left { --icon: url("/icons/chevron-left.svg"); }
.icon-chevron-right { --icon: url("/icons/chevron-right.svg"); }
.icon-pencil { --icon: url("/icons/pencil.svg"); }
.icon-download { --icon: url("/icons/download.svg"); }
.icon-user-plus { --icon: url("/icons/user-plus.svg"); }
.icon-external-link { --icon: url("/icons/external-link.svg"); }

a { color: inherit; text-underline-offset: .22em; }
button, input, select { font: inherit; }
button, a, input, select { touch-action: manipulation; }
button { cursor: pointer; }
a, button, input, select, summary { outline-offset: 5px; }
:focus-visible { outline: 3px solid #ad731d; }
button:disabled { opacity: .6; cursor: wait; }
h1, h2, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-heading); }
h1, h2 { font-weight: 650; letter-spacing: -.045em; line-height: 1.12; }
h1 { font-size: var(--title-size); margin-bottom: 16px; }
h1 em { font-style: normal; }
h2 { font-size: 1.4rem; margin-bottom: 12px; letter-spacing: -.025em; }
p { line-height: 1.65; }
main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); flex: 1; min-width: 0; }
.site-header { width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark { display: block; flex: none; }
.site-logo { display: block; width: 96px; height: auto; mix-blend-mode: multiply; }
nav { display: flex; gap: 28px; align-items: center; }
nav a { text-decoration: none; font-size: .9rem; font-weight: 600; }
nav a:hover, nav a[aria-current=page] { text-decoration: underline; }
.nav-register { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; background: var(--green); color: white; padding: 11px 19px; border-radius: var(--radius-control); }
.hero { display: grid; grid-template-columns: 1fr 1.08fr; gap: 60px; align-items: center; padding: 40px 0 56px; }
.hero-image { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1.12; object-fit: cover; object-position: 57% center; border-radius: var(--radius); }
.hero-copy { padding: 14px 0; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .13em; margin-bottom: 23px; }
.hero h1 { font-size: clamp(3.4rem, 6.3vw, 5.4rem); letter-spacing: -.05em; line-height: 1.06; margin-bottom: 26px; font-weight: 400; }
.hero h1 em { font-style: italic; color: var(--green); }
.hero-date { font-size: 1.05rem; font-weight: 650; margin: 0 0 16px; }
.hero-description { font-size: 1rem; color: var(--muted); margin-bottom: 26px; max-width: 440px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hero-actions .button { white-space: nowrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; line-height: 1.4; text-align: center; background: var(--green); color: white; padding: 13px 23px; border: 1px solid var(--green); border-radius: var(--radius-control); font-weight: 600; font-size: .95rem; text-decoration: none; min-height: 50px; transition: background .15s; }
.nav-register:hover { background: var(--green-hover); }
.button:hover { background: var(--green-hover); }
.button.secondary { background: transparent; color: var(--green); border-color: var(--border-control); }
.button.secondary:hover { background: var(--surface-soft); }
.full { width: 100%; }
.deadline { font-size: .8rem; line-height: 1.5; margin-top: 16px; color: var(--muted); max-width: 370px; }
.race-day { padding: 32px 0; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.race-day h2 { font-size: var(--section-title-size); margin-bottom: 24px; }
.race-day-details { display: grid; grid-template-columns: 1.2fr 1.1fr 1fr; gap: 32px; margin: 0; }
.race-day-details dt { font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.race-day-details dd { margin: 0; font-size: .9rem; line-height: 1.7; }
.race-day-details strong { display: block; font-weight: 600; }
.race-day-details span { display: block; color: var(--muted); }
.design-awards { padding: 40px 0; border-top: 1px solid var(--line); }
.awards-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.awards-heading .eyebrow { margin: 0 0 10px; font-size: .65rem; color: var(--green); }
.design-awards h2 { font-size: var(--section-title-size); margin: 0; }
.awards-heading > p { color: var(--muted); font-size: .85rem; margin: 0; }
.award-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; list-style: none; padding: 0; margin: 0; }
.award-card { --award-color: #286247; --award-tint: #eaf1e6; --award-ribbon: #b4d0a4; position: relative; padding: 24px 16px 30px; text-align: center; background: var(--award-tint); border-radius: 64px 64px 12px 12px; }
.award-card::before { content: ""; position: absolute; inset: 9px; border: 1px dashed var(--award-color); opacity: .25; border-radius: 56px 56px 6px 6px; pointer-events: none; }
.award-animal { --award-color: #876020; --award-tint: #faf0d7; --award-ribbon: #e9c571; }
.award-art { --award-color: #76558e; --award-tint: #f0eaf5; --award-ribbon: #cbb5de; }
.award-badge { display: block; width: 142px; height: 160px; margin: 0 auto 14px; color: var(--award-color); transform: rotate(-6deg); }
.award-animal .award-badge { transform: rotate(5deg); }
.award-art .award-badge { transform: rotate(-3deg); }
.badge-tails { fill: var(--award-ribbon); stroke: var(--award-color); stroke-width: 1.5; }
.badge-rosette { fill: var(--award-color); }
.badge-stitch { fill: none; stroke: var(--award-tint); stroke-width: 1.5; stroke-dasharray: 2 4; }
.badge-face, .badge-highlight { fill: var(--award-tint); }
.award-card h3 { position: relative; margin: 0 0 8px; font-size: clamp(1.25rem, 2.2vw, 1.65rem); font-weight: 400; letter-spacing: -.025em; color: var(--award-color); }
.award-card p { position: relative; margin: 0; font-size: .8rem; color: var(--ink); }
.race-gallery { padding: 32px 0 var(--page-bottom); border-top: 1px solid var(--line); }
.gallery-heading { margin-bottom: 24px; }
.gallery-heading h2 { font-size: var(--section-title-size); margin: 0; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.event-photo { display: block; width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); }
.gallery-photo { display: block; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; }
.gallery-photo img { transition: transform .2s ease; }
.gallery-photo:hover img { transform: scale(1.035); }
.viewer-open { overflow: hidden; }
.photo-viewer { width: min(1100px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 16px 20px; border: 0; border-radius: var(--radius); background: #142019; color: white; }
.photo-viewer[open] { display: flex; flex-direction: column; gap: 12px; }
.photo-viewer::backdrop { background: rgb(0 0 0 / .85); }
.viewer-toolbar, .viewer-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: none; }
.viewer-toolbar { font-size: .9rem; }
.photo-viewer button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid #607267; border-radius: var(--radius-control); background: transparent; color: white; padding: 10px 16px; min-height: 44px; font-size: .9rem; }
.photo-viewer button:hover { background: #304638; }
.photo-viewer button:focus-visible { outline-color: var(--yellow); }
.viewer-stage { min-height: 0; display: flex; justify-content: center; align-items: center; }
.viewer-stage img { display: block; width: 100%; height: min(70dvh, 780px); object-fit: contain; }
.text-link { font-weight: 600; font-size: .9rem; }
footer { width: calc(100% - 2 * var(--gutter)); max-width: calc(1200px - 2 * var(--gutter)); margin: 0 auto; border-top: 1px solid var(--line); padding: 32px 0; display: flex; justify-content: space-between; align-items: center; gap: 24px; color: var(--muted); font-size: .85rem; }
footer strong { color: var(--ink); font-weight: 600; }
footer p { margin: 6px 0 0; }
.organizer-link { font-size: .8rem; white-space: nowrap; }
.registration-page, .receipt-wrap { max-width: var(--form-width); margin: var(--page-space) auto var(--page-bottom); }
.page-heading { margin-bottom: 28px; }
.page-heading > :last-child { margin-bottom: 0; }
.page-heading h1 { margin-bottom: 12px; }
.page-heading p { color: var(--muted); margin-bottom: 0; }
.paper { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--panel-space); }
.small-tag { font-size: .75rem; letter-spacing: .1em; font-weight: 600; color: var(--muted); display: block; margin-bottom: 15px; }
.field { margin-bottom: 24px; }
.field label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 9px; }
input:not([type=checkbox]), select { display: block; width: 100%; min-width: 0; border: 1px solid var(--border-control); border-radius: var(--radius-control); background: white; color: var(--ink); padding: 12px 13px; min-height: 50px; }
input[aria-invalid=true], select[aria-invalid=true] { border-color: var(--danger); }
.name-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.field-hint, .field-error { font-size: .8rem; margin: 7px 0 0; line-height: 1.5; color: var(--muted); }
.field-error { color: var(--danger); }
.level-change-note { margin: -8px 0 24px; }
.privacy-note { font-size: .8rem; line-height: 1.65; color: var(--muted); margin: 20px 0 0; }
.honey { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.validation-summary { background: var(--danger-surface); border-left: 3px solid var(--danger); padding: 16px; margin-bottom: 22px; font-size: .88rem; color: var(--danger-ink); }
.validation-summary ul { padding-left: 20px; margin-bottom: 0; }
.validation-summary li + li { margin-top: 7px; }
.busy-text { display: none; }
.htmx-request .busy-text { display: inline; }
.htmx-request .idle-text { display: none; }
.loading { color: var(--muted); padding: 20px 0; margin: 0; }
.narrow { max-width: 740px; margin: var(--page-space) auto var(--page-bottom); }
.guide-page { margin: var(--page-space) 0 var(--page-bottom); }
.guide-page h3 { font-size: 1rem; font-weight: 650; margin: 0 0 12px; }
.guide-page a { overflow-wrap: anywhere; }
.guide-page address { font-style: normal; line-height: 1.7; }
.guide-page p { margin-bottom: 16px; }
.guide-pickup { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; padding: var(--panel-space); background: var(--surface-soft); border-radius: var(--radius); scroll-margin-top: 24px; }
.guide-pickup .event-photo { align-self: center; }
.guide-pickup h2, .guide-section > h2 { font-size: var(--section-title-size); margin-bottom: 24px; }
.guide-pickup p:last-child { margin-bottom: 0; }
.pickup-fee { font-size: 1.05rem; }
.pickup-details { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; margin: 24px 0; }
.guide-note { font-size: .85rem; color: var(--muted); }
.pickup-details .guide-note { margin: 10px 0 0; }
.pickup-hours { margin: 0; font-size: .9rem; line-height: 1.7; }
.pickup-hours div { margin-bottom: 8px; }
.pickup-hours dd { margin: 0; font-weight: 600; }
.pickup-unavailable { font-size: .85rem; font-weight: 600; margin: 12px 0 0; }
.guide-section { margin-top: 32px; padding-top: 32px; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.guide-rules-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; }
.car-specifications { margin: 20px 0 0; }
.car-specifications > div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: .9rem; line-height: 1.5; }
.car-specifications dd { margin: 0; flex: none; font-weight: 600; }
.guide-list { padding-left: 20px; margin: 0; line-height: 1.65; font-size: .95rem; }
.guide-list li { padding-left: 4px; }
.guide-list li + li { margin-top: 12px; }
.guide-building-copy { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 48px; }
.guide-building-copy p:last-child { margin-bottom: 0; }
.guide-closing { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); font-size: .9rem; }
.receipt-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.receipt-heading .small-tag { margin: 0; }
.receipt-label { text-align: center; margin: 30px 0 0; font-size: .75rem; font-weight: 600; letter-spacing: .1em; color: var(--muted); }
.race-number { text-align: center; font-size: 6.5rem; font-weight: 650; letter-spacing: -.06em; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--green); }
.receipt-reminders { margin: 20px 0 24px; padding: 20px 22px 20px 42px; border-radius: var(--radius); background: var(--surface-soft); font-size: .9rem; line-height: 1.6; }
.receipt-reminders li { padding-left: 4px; }
.receipt-reminders li + li { margin-top: 14px; }
.receipt-reminders li::marker { font-weight: 700; }
.receipt-reminders strong { font-weight: 650; }
.receipt-details { border-top: 1px solid var(--line); margin: 24px 0; }
.receipt-details > div { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 14px 0; font-size: .9rem; }
.receipt-details dt { color: var(--muted); }
.receipt-details dd { margin: 0; text-align: right; font-weight: 600; }
.muted { color: var(--muted); font-size: .9rem; }
.receipt-info { font-size: .9rem; margin: 24px 0; }
.receipt-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.receipt-wrap .text-link { display: inline-block; margin-top: 26px; }
.receipt-wrap #copy-status:empty { display: none; }
.admin-page { margin: var(--page-space) 0 var(--page-bottom); }
.section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading .eyebrow { margin-bottom: 12px; }
.section-heading h1 { margin: 0; }
.admin-toolbar { display: flex; gap: 12px; margin-bottom: 24px; align-items: center; }
.search-label { flex: 1; min-width: 0; }
.roster-notice { padding: 16px 20px; margin: 0 0 20px; border-left: 4px solid var(--green); border-radius: var(--radius-control); background: var(--surface-soft); font-size: .95rem; }
.roster-count { font-size: .95rem; padding: 20px 0; border-top: 1px solid var(--line); }
.roster-count strong { font-size: 1.6rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: .9rem; }
th { font-weight: 600; color: var(--muted); background: var(--surface-soft); }
th, td { padding: 17px 15px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border: 0; }
.number-cell { font-size: 1.1rem; font-weight: 700; }
.text-button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--green); font-size: .85rem; text-decoration: underline; text-underline-offset: .2em; padding: 7px; }
.duplicate-tag { display: block; font-size: .75rem; color: #93591d; margin-top: 4px; }
.empty { text-align: center; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); padding: 50px 25px; }
.empty p { color: var(--muted); margin-bottom: 0; }
.editor-form { max-width: var(--form-width); margin: 0 auto 32px; }
.editor-form h2 { margin-bottom: 24px; }
.editor-form form > .text-link { display: inline-block; margin-top: 20px; }
.message h2 { margin: 10px 0; }
.message p { color: var(--muted); margin-bottom: 0; }
.request-error { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 40px); width: 520px; background: var(--danger-surface); color: var(--danger-ink); border: 1px solid #d19a8a; border-radius: var(--radius); padding: 16px; box-shadow: 0 6px 30px #0002; font-size: .9rem; z-index: 10; }
.skip { position: absolute; left: 10px; top: -100px; padding: 15px; background: var(--paper); z-index: 20; }
.skip:focus { top: 10px; }
.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; }
@media (max-width: 900px) {
  :root { --gutter: 24px; }
  .hero { gap: 32px; }
  .hero h1 { font-size: 3.8rem; }
  .guide-pickup, .guide-rules-grid { gap: 28px; }
  .pickup-details { grid-template-columns: 1fr; }
}
@media (max-width: 750px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 30px 0 40px; }
  .hero-copy { padding: 0; }
  .hero-image { aspect-ratio: 4 / 3; object-position: center; }
  .hero-description { max-width: none; }
  .guide-pickup, .guide-rules-grid, .guide-building-copy { grid-template-columns: 1fr; }
  .pickup-details { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 650px) {
  :root { --gutter: 20px; --page-space: 28px; --page-bottom: 44px; --panel-space: 24px; }
  .site-header { padding-top: 14px; padding-bottom: 14px; gap: 12px; }
  .site-logo { width: 80px; }
  nav { gap: 16px; }
  nav a { font-size: .8rem; }
  .nav-register { padding: 10px 13px; }
  .hero h1 { font-size: clamp(3.3rem, 12vw, 4.4rem); margin-bottom: 22px; }
  .hero .eyebrow { margin-bottom: 18px; }
  .hero-date { font-size: 1.1rem; }
  .hero-description { font-size: .95rem; margin-bottom: 23px; }
  .hero-actions .button { flex: 1 1 auto; }
  .deadline { font-size: .75rem; }
  .race-gallery { padding: 28px 0 var(--page-bottom); }
  .race-day { padding: 28px 0; }
  .design-awards { padding: 28px 0; }
  .awards-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .award-list { grid-template-columns: 1fr; gap: 14px; }
  .award-card { display: flex; align-items: center; gap: 16px; padding: 18px 22px 18px 14px; border-radius: 12px; text-align: left; }
  .award-card::before { border-radius: 6px; }
  .award-badge { width: 94px; height: 106px; flex: none; margin: 0; }
  .award-card h3 { font-size: 1.25rem; }
  .race-day-details { grid-template-columns: 1fr; gap: 22px; }
  .gallery-heading { margin-bottom: 16px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .photo-viewer { padding: 12px; width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .viewer-stage img { height: min(65dvh, 650px); }
  .page-heading { margin-bottom: 24px; }
  .page-heading p { font-size: .9rem; }
  .name-grid { gap: 14px; grid-template-columns: 1.8fr 1fr; }
  .pickup-details { grid-template-columns: 1fr; gap: 22px; }
  .guide-section { margin-top: 32px; padding-top: 28px; }
  .race-number { font-size: 5.5rem; }
  .receipt-actions .button { flex: 1 1 100%; padding: 13px 15px; }
  .receipt-details > div { font-size: .85rem; gap: 12px; }
  footer { flex-direction: column; align-items: flex-start; padding: 24px 0; gap: 20px; }
  .admin-toolbar { flex-wrap: wrap; }
  .search-label { flex-basis: 100%; }
  .admin-toolbar .button { flex: 1; font-size: .85rem; }
  .section-heading .text-link { white-space: nowrap; }
}
@media (max-width: 360px) {
  :root { --gutter: 16px; --panel-space: 20px; }
  nav { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
@media print {
  .site-header, footer, .receipt-actions, .receipt-wrap .text-link, .request-error, .skip { display: none !important; }
  body { display: block; min-height: 0; background: white; color: black; }
  main { padding: 0; }
  .receipt-wrap { margin: 0; max-width: none; }
  .receipt-wrap .paper { border: 0; padding: 0; }
  .race-number { color: black; }
  .receipt-details { break-inside: avoid; }
}
