:root {
  --bg: #f3f0e8;          /* dry sand */
  --card: #ffffff;
  --text: #19201b;
  --muted: #5d665f;
  --line: #e2dccd;
  --accent: #2c5a39;      /* gum-tree green */
  --accent-ink: #ffffff;
  --brand: #d2602a;       /* SA red dirt */
  --brand-ink: #ffffff;
  --night: #121814;       /* header / hero */
  --night-2: #1d2a21;
  --radius: 14px;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;

  /* Race level colours */
  --beginner: #2e9e57;
  --club: #2f6fd0;
  --school: #0f9aa8;
  --state: #d9761e;
  --national: #8a4fd1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1210;
    --card: #171d19;
    --text: #eceee9;
    --muted: #a1aaa3;
    --line: #29312c;
    --accent: #7fc890;
    --accent-ink: #0e1a12;
    --brand: #ec7a40;
    --night: #090c0a;
    --night-2: #141c17;
    --beginner: #4cc477;
    --club: #6a9ff0;
    --school: #3cc3d0;
    --state: #f0954a;
    --national: #b086f0;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 17px; line-height: 1.5; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--night); color: #fff; position: relative; z-index: 20; }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 12px; padding-bottom: 12px; }
.bar-left { display: flex; align-items: center; gap: 22px; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 1.55rem; letter-spacing: 0.02em; text-transform: uppercase; text-decoration: none; color: #fff; line-height: 1; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand b { color: var(--brand); font-weight: 800; }
.brand-short { display: none; }
.site-header nav .nav-home { display: none; }
.site-header nav { display: flex; gap: 30px; }
.site-header nav a, .home-link { text-decoration: none; color: rgba(255,255,255,0.72); font-family: var(--display); font-weight: 700; font-size: 1.12rem; letter-spacing: 0.05em; text-transform: uppercase; padding: 6px 0; border-bottom: 3px solid transparent; white-space: nowrap; }
.site-header nav a[aria-current="page"], .site-header nav a:hover, .home-link[aria-current="page"], .home-link:hover { color: #fff; border-bottom-color: var(--brand); }
.menu-btn { display: none; align-items: center; gap: 8px; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.35); border-radius: 10px; padding: 8px 12px; font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 16px; height: 2px; background: #fff; border-radius: 2px; position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -5px; } .menu-icon::after { top: 5px; }
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .site-header nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--night); flex-direction: column; gap: 0; padding: 4px 16px 14px; border-top: 1px solid rgba(255,255,255,0.08); box-shadow: 0 14px 24px -12px rgba(0,0,0,0.5); }
  .site-header.nav-open nav { display: flex; }
  .site-header nav a { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 1.25rem; }
  .site-header nav a[aria-current="page"] { color: var(--brand); border-bottom-color: rgba(255,255,255,0.08); }
  .home-link { display: none; }
  .site-header nav .nav-home { display: block; }
}
@media (max-width: 480px) {
  .brand-long { display: none; } .brand-short { display: inline; }
  .brand { font-size: 1.45rem; }
}

main { padding-bottom: 40px; }
main > .wrap, #calendar-view > .wrap { padding-top: 8px; }
h1, h2, .month-bar h2 { font-family: var(--display); letter-spacing: 0.01em; }
h1 { font-size: 2.2rem; line-height: 1.05; margin: 0 0 8px; text-transform: uppercase; font-weight: 800; }
.lead { color: var(--muted); margin: 0 0 16px; font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* Level colours */
.lvl-beginner { --lvl: var(--beginner); }
.lvl-club { --lvl: var(--club); }
.lvl-school { --lvl: var(--school); }
.lvl-state { --lvl: var(--state); }
.lvl-national { --lvl: var(--national); }

/* Level toggle buttons */
.levels { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.level-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 0.95rem; font-weight: 600; cursor: pointer; }
.level-btn .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--lvl); }
.level-btn { transition: opacity .12s, box-shadow .12s; }
.levels.filtering .level-btn[aria-pressed="true"] { border-color: var(--lvl); box-shadow: 0 0 0 2px var(--lvl); }
.levels.filtering .level-btn[aria-pressed="false"] { opacity: 0.45; text-decoration: line-through; }
.level-all { --lvl: var(--brand); }
.level-all[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--text); }

/* Month bar */
.month-bar { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.month-bar h2 { margin: 0; font-size: 1.9rem; font-weight: 800; text-transform: uppercase; }
.nav-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.nav-btn:hover { border-color: var(--accent); }

/* Calendar grid */
.cal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head { background: var(--night-2); }
.cal-head span { text-align: center; font-family: var(--display); font-size: 0.95rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.85); padding: 9px 0; }
.day { min-height: 96px; padding: 6px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: none; text-align: left; display: flex; flex-direction: column; gap: 3px; cursor: default; min-width: 0; }
.cal-grid > :nth-child(7n) { border-right: 0; }
.day.blank { background: var(--bg); }
.day .num { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.day.past .num { opacity: 0.6; }
.day.today .num { background: var(--brand); color: #fff; border-radius: 999px; width: 26px; height: 26px; display: inline-grid; place-items: center; opacity: 1; }
.day.has { cursor: pointer; }
.day.has:hover, .day.picked { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chip { display: block; background: var(--lvl); color: #fff; border-radius: 6px; padding: 2px 6px; font-size: 0.75rem; font-weight: 600; line-height: 1.3; overflow: hidden; }
.chip-text { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day.past .chip { opacity: 0.55; }

@media (max-width: 640px) {
  .day { min-height: 54px; padding: 4px; align-items: center; }
  .day .num { font-size: 0.8rem; }
  .chip { width: 9px; height: 9px; padding: 0; border-radius: 50%; display: inline-block; }
  .chip-text { display: none; }
  .chips { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}

.today-link { text-align: right; margin: 12px 0 0; }
.today-link .btn[hidden] { display: none; }
.btn-small { font-size: 1rem; padding: 7px 14px; }
.list-month { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-size: 1.05rem; margin: 10px 0 -2px; }
.list-month:first-child { margin-top: 0; }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; padding: 4px 0; text-decoration: underline; font-size: 0.95rem; }

/* List under calendar */
.list-title { font-size: 1.15rem; margin: 22px 0 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.race-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.race { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--text); }
.race:hover { border-color: var(--accent); }
.race.done { opacity: 0.6; }
.bar { flex: 0 0 5px; align-self: stretch; border-radius: 4px; background: var(--lvl); }
.race-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.race-when { font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.race-name { font-weight: 700; font-size: 1.05rem; }
.race-where { color: var(--muted); font-size: 0.95rem; }
.tag { flex: none; display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: var(--lvl); background: color-mix(in srgb, var(--lvl) 14%, transparent); }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; color: var(--muted); }
@media (max-width: 480px) { .race .tag { display: none; } }

/* Race page */
.back { display: inline-block; margin-bottom: 14px; text-decoration: none; font-weight: 600; }
.detail-when { font-weight: 700; color: var(--accent); font-size: 1.1rem; margin: 0 0 12px; }
.detail-summary { font-size: 1.1rem; max-width: 640px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 22px; }
.btn { font-family: var(--display); font-size: 1.15rem; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 700; display: inline-block; padding: 11px 22px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; cursor: pointer; }
.btn-main { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-main:hover { filter: brightness(1.08); }
.facts { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; max-width: 640px; }
.facts > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-weight: 700; color: var(--muted); }
.facts dd { margin: 0; }
@media (max-width: 480px) { .facts > div { grid-template-columns: 1fr; gap: 0; } }

/* Content pages */
.content { max-width: 720px; }
.content h2 { font-size: 1.25rem; margin: 28px 0 8px; }
.content ul, .content ol { padding-left: 1.3em; }
.content li { margin-bottom: 6px; }
.callout { background: var(--card); border-left: 4px solid var(--brand); border-radius: 8px; padding: 12px 16px; margin: 16px 0; }
.link-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.link-list li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 0; }
.link-list a { font-weight: 700; }
.link-list span { display: block; color: var(--muted); font-size: 0.95rem; }

.site-footer { background: var(--night); color: rgba(255,255,255,0.75); font-size: 0.95rem; margin-top: 10px; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.5fr; gap: 28px; padding-top: 34px; padding-bottom: 26px; }
.site-footer h2 { font-family: var(--display); font-size: 1.1rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; margin: 0 0 10px; }
.site-footer p { margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: rgba(255,255,255,0.85); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .brand { margin-bottom: 12px; font-size: 1.35rem; }
.site-footer .brand:hover { text-decoration: none; }
.contact-soon { display: inline-block; border: 1px dashed rgba(255,255,255,0.3); border-radius: 8px; padding: 6px 10px; font-size: 0.9rem; }
.foot-links { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-top: 14px; padding-bottom: 14px; font-family: var(--display); font-weight: 700; font-size: 1.1rem; letter-spacing: 0.04em; text-transform: uppercase; }
.foot-links span { color: var(--brand); }
.foot-links::before, .foot-bottom::before { content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px; background: rgba(255,255,255,0.1); }
.foot-bottom { position: relative; padding-top: 14px; padding-bottom: 22px; font-size: 0.85rem; color: rgba(255,255,255,0.55); }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-legal { grid-column: 1 / -1; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; gap: 22px; } }

/* ---- Hero banners ---- */
.hero { position: relative; background: radial-gradient(120% 90% at 85% 0%, #2c4a33 0%, var(--night-2) 45%, var(--night) 100%); color: #fff; overflow: hidden; }
.hero .topo { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.13; pointer-events: none; }
.hero .wrap { position: relative; padding-top: 42px; padding-bottom: 110px; }
.hero .kicker { font-family: var(--display); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand); margin: 0 0 8px; font-size: 1rem; }
.hero h1 { font-size: clamp(2.6rem, 9vw, 4.6rem); line-height: 0.95; margin: 0 0 14px; color: #fff; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.sub { max-width: 560px; color: rgba(255,255,255,0.82); font-size: 1.08rem; margin: 0 0 22px; }
.hero .btn { margin: 0 8px 8px 0; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.4); }
.btn-ghost:hover { border-color: #fff; }
.hero .ridge { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 90px; display: block; }
.hero.small .wrap { padding-top: 30px; padding-bottom: 80px; }
.hero.small h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); }
.hero.small .ridge { height: 64px; }
.ridge .far { fill: #2a3f30; }
.ridge .near { fill: var(--bg); }
.ridge .trail { fill: none; stroke: var(--brand); stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; }
@media (prefers-color-scheme: dark) { .ridge .far { fill: #1e2c22; } }

/* Calendar polish */
.cal { box-shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgba(20, 30, 22, 0.35); }
.day.today .num { background: var(--brand); }
.race { border-left-width: 1px; }
.race:hover { border-color: var(--brand); transform: translateY(-1px); transition: transform .12s, border-color .12s; }
.race-name { font-family: var(--display); font-size: 1.3rem; font-weight: 700; letter-spacing: 0.01em; line-height: 1.15; }
.list-title { font-size: 1.5rem; text-transform: uppercase; font-weight: 800; }
.level-btn { font-family: var(--display); font-size: 1.05rem; letter-spacing: 0.03em; text-transform: uppercase; }
.content h2 { font-size: 1.6rem; text-transform: uppercase; font-weight: 800; }
.detail-when { color: var(--brand); }
.detail { padding-top: 22px; }
#cal-start { scroll-margin-top: 12px; }

/* ---- Gear guide ---- */
.gear-page { padding-top: 8px; }
.notice { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; font-size: 0.95rem; }
.gear-filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.gear-filters label { display: flex; flex-direction: column; gap: 4px; font-family: var(--display); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); min-width: 0; }
.gear-filters select { font: inherit; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 1rem; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; }
@media (max-width: 760px) { .gear-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gear-count { color: var(--muted); font-size: 0.95rem; margin: 12px 0; }
.gear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 20px; }
.gear-grid .empty { grid-column: 1 / -1; }
.gear-card { font: inherit; color: var(--text); text-align: left; cursor: pointer; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: border-color .12s, transform .12s; }
.gear-card:hover, .gear-card:focus-visible { border-color: var(--brand); transform: translateY(-2px); }
.gear-art { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; background: radial-gradient(120% 100% at 80% 0%, #2c4a33, var(--night)); color: var(--brand); }
.gear-art svg { width: 38%; height: auto; }
.gear-art .sale { position: absolute; top: 10px; left: 10px; }
.gear-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 14px; }
.gear-brand { font-size: 0.85rem; font-weight: 700; color: var(--brand); }
.gear-name { font-family: var(--display); font-size: 1.35rem; font-weight: 800; text-transform: uppercase; line-height: 1.05; }
.gear-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.gear-price { font-family: var(--display); font-size: 1.35rem; font-weight: 800; }
.gear-price s, .gd-price s { font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.sale { display: inline-block; font-family: var(--display); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: var(--brand); border-radius: 6px; padding: 2px 8px; }
.skill { font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: var(--lvl); background: color-mix(in srgb, var(--lvl) 14%, transparent); white-space: nowrap; }
.skill-beginner { --lvl: var(--beginner); }
.skill-intermediate { --lvl: var(--club); }
.skill-racer { --lvl: var(--state); }
@media (max-width: 520px) { .gear-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .gear-name { font-size: 1.1rem; } .gear-price { font-size: 1.15rem; } .gear-row { flex-wrap: wrap; } .gear-body { padding: 10px 11px 12px; } }

/* Gear pop-up */
.gear-dialog { border: 0; padding: 0; border-radius: 18px; width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--card); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,0.45); }
.gear-dialog::backdrop { background: rgba(8, 12, 10, 0.65); }
.gd-inner { position: relative; display: grid; grid-template-columns: 0.9fr 1.1fr; }
.gd-art { display: grid; place-items: center; min-height: 260px; background: radial-gradient(120% 100% at 80% 0%, #2c4a33, var(--night)); color: var(--brand); }
.gd-art svg { width: 46%; }
.gd-text { padding: 22px 22px 20px; }
.gd-name { font-family: var(--display); font-size: 2rem; font-weight: 800; text-transform: uppercase; line-height: 1; margin: 4px 0 8px; }
.gd-price { font-family: var(--display); font-size: 1.6rem; font-weight: 800; margin: 0 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gear-take { margin: 0 0 16px; font-size: 0.95rem; }
.gear-take dt { font-weight: 700; color: var(--muted); margin-top: 8px; }
.gear-take dd { margin: 0; }
.gd-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(0,0,0,0.55); color: #fff; cursor: pointer; z-index: 1; }
.gd-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.gd-close:hover { background: rgba(0,0,0,0.75); }
.gd-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gear-checked { font-size: 0.82rem; color: var(--muted); margin: 12px 0 0; }
@media (max-width: 640px) { .gd-inner { grid-template-columns: 1fr; } .gd-art { min-height: 160px; } .gd-name { font-size: 1.7rem; } }

/* ---- Home page ---- */
.home { padding-top: 6px; }
.home-block { margin: 10px 0 34px; }
.home-block h2 { font-size: 1.9rem; font-weight: 800; text-transform: uppercase; margin: 0 0 12px; }
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-head h2 { margin: 0; }
.home-head { margin-bottom: 12px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--text); transition: border-color .12s, transform .12s; }
.tile:hover { border-color: var(--brand); transform: translateY(-2px); }
.tile-icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--night-2); color: var(--brand); }
.tile-icon svg { width: 26px; height: 26px; }
.tile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tile strong { font-family: var(--display); font-size: 1.45rem; text-transform: uppercase; line-height: 1.05; }
.tile-text span { color: var(--muted); font-size: 0.95rem; }
.tile-go { flex: none; font-size: 1.8rem; line-height: 1; color: var(--brand); }
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr; gap: 10px; } }
.home-block:last-child { margin-bottom: 10px; }
.about-block p { max-width: 680px; }

.filter-box > summary { display: none; }
@media (max-width: 640px) {
  .filter-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
  .filter-box > summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; list-style: none; }
  .filter-box > summary::-webkit-details-marker { display: none; }
  .filter-box > summary::after { content: "+"; font-size: 1.5rem; color: var(--brand); }
  .filter-box[open] > summary::after { content: "−"; }
  .filter-box .gear-filters { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
}
@media (max-width: 480px) { .foot-links { gap: 6px 10px; } .fl-cut { flex-basis: 100%; height: 0; overflow: hidden; font-size: 0; } }

/* Gear tabs and reviews */
.g-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.g-tab { font-family: var(--display); font-weight: 700; font-size: 1.1rem; letter-spacing: 0.04em; text-transform: uppercase; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.g-tab[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand);  }
.our-take { background: var(--bg); border-left: 4px solid var(--brand); border-radius: 6px; padding: 8px 12px; }
.tested { position: absolute; right: 10px; top: 10px; background: #fff; color: var(--night); font-family: var(--display); letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
@media (max-width: 480px) { .g-tabs { gap: 6px; } .g-tab { font-size: 0.95rem; padding: 7px 11px; letter-spacing: 0.02em; } }
@media (max-width: 380px) { .g-tabs { gap: 5px; } .g-tab { font-size: 0.9rem; padding: 6px 9px; letter-spacing: 0; } }

/* Where to ride */
.ride-list { list-style: none; padding: 0 !important; margin: 0 0 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.content .ride-list li { margin: 0; display: flex; }
.ride { flex: 1; display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: var(--radius); padding: 14px 16px 12px; color: var(--text); text-decoration: none; box-shadow: 0 6px 16px -10px rgba(0,0,0,0.35); transition: transform .12s, box-shadow .12s, border-color .12s; }
.ride:hover, .ride:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 24px -12px rgba(0,0,0,0.45); border-color: var(--brand); }
.ride-head { display: flex; flex-direction: column; gap: 2px; }
.ride-name { font-family: var(--display); font-weight: 800; font-size: 1.45rem; text-transform: uppercase; line-height: 1.1; }
.ride-where { color: var(--muted); font-size: 0.92rem; }
.ride-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ride-tag { font-size: 0.8rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.ride-text { flex: 1; }
.ride-go { align-self: flex-start; margin-top: 4px; font-family: var(--display); font-weight: 800; font-size: 1.05rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--brand-ink); background: var(--brand); border-radius: 8px; padding: 6px 12px; }
@media (max-width: 640px) { .ride-list { grid-template-columns: 1fr; } }
.callout.warn { border-left-color: #d9a400; }

/* Race-day checklist */
.download-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; background: var(--card); border: 2px solid var(--brand); border-radius: var(--radius); padding: 18px 20px; margin: 4px 0 20px; }
.download-box strong { display: block; font-family: var(--display); font-size: 1.5rem; text-transform: uppercase; letter-spacing: 0.02em; }
.download-box span { color: var(--muted); }
.btn-big { font-size: 1.3rem; padding: 14px 24px; }
.btn-big::before { content: "⬇ "; }
.cl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cl-group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 6px 16px -12px rgba(0,0,0,0.35); }
.cl-wide { grid-column: 1 / -1; }
.cl-wide .cl { columns: 2; column-gap: 24px; }
.cl-wide .cl li { break-inside: avoid; }
.cl-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--night); color: #fff; }
.cl-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--brand); color: #fff; }
.cl-icon svg { width: 19px; height: 19px; }
.content .cl-head h2 { margin: 0; font-size: 1.3rem; color: #fff; text-transform: uppercase; }
.cl-count { margin-left: auto; font-family: var(--display); font-weight: 700; font-size: 1rem; color: rgba(255,255,255,0.7); }
.cl-group.done .cl-count { color: var(--brand); }
.cl-group.done .cl-count::after { content: " ✓"; }
.cl { list-style: none; padding: 4px 16px 6px !important; margin: 0; }
.content .cl li { margin: 0; }
.cl label { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.cl li:last-child label, .cl-wide .cl li label { border-bottom: 1px solid var(--line); }
.cl > li:last-child label { border-bottom: 0; }
.cl input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border: 2px solid var(--muted); border-radius: 6px; background: var(--bg); display: grid; place-items: center; cursor: pointer; transition: background .12s, border-color .12s; }
.cl input:hover { border-color: var(--brand); }
.cl input:checked { background: var(--brand); border-color: var(--brand); }
.cl input:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.cl input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cl input:checked + span { text-decoration: line-through; color: var(--muted); }
.cl-progress { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 18px; }
.cl-progress-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cl-progress-top strong { font-family: var(--display); font-size: 1.3rem; text-transform: uppercase; }
.cl-bar { height: 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; margin: 10px 0 8px; }
.cl-bar span { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 999px; transition: width .25s; }
.cl-progress.all-done .cl-bar span { background: #2e9e5b; }
.cl-note { margin: 0; color: var(--muted); font-size: 0.9rem; }
.download-box { flex-wrap: nowrap; }
.db-icon { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--brand); color: #fff; }
.db-icon svg { width: 28px; height: 28px; }
.db-text { flex: 1; min-width: 0; }
@media (max-width: 640px) { .download-box { flex-wrap: wrap; } .db-icon { display: none; } .cl-wide .cl { columns: 1; } }
@media (max-width: 640px) { .cl-grid { grid-template-columns: 1fr; } .download-box a { width: 100%; text-align: center; } }

/* Checklist banner on other pages */
.checklist-banner { display: flex; align-items: center; gap: 14px; background: var(--card); color: var(--text); border: 2px solid var(--brand); border-radius: var(--radius); padding: 14px 18px; margin: 14px 0 18px; text-decoration: none; transition: transform .12s; }
.checklist-banner:hover { transform: translateY(-2px); }
.checklist-banner .cb-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 1.4rem; }
.checklist-banner strong { display: block; font-family: var(--display); font-size: 1.35rem; text-transform: uppercase; }
.checklist-banner span.cb-sub { color: var(--muted); font-size: 0.95rem; }
.checklist-banner .cb-go { margin-left: auto; font-family: var(--display); font-weight: 800; font-size: 1.05rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--brand-ink); background: var(--brand); border-radius: 8px; padding: 7px 14px; white-space: nowrap; }
@media (max-width: 520px) { .checklist-banner .cb-go { display: none; } }

/* ---- Polish: date badges, heading accents, footer ridge, links, motion ---- */
.date-badge { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 54px; padding: 6px 0 5px; border-radius: 10px; background: color-mix(in srgb, var(--lvl) 12%, var(--card)); border-top: 4px solid var(--lvl); line-height: 1; }
.date-badge b { font-family: var(--display); font-size: 1.65rem; font-weight: 800; color: var(--text); }
.date-badge small { font-family: var(--display); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lvl); margin-top: 2px; }
.race.done .date-badge { filter: grayscale(0.6); }

/* Small dashed "trail" under section headings */
.home-block h2::after, .content h2::after { content: ""; display: block; width: 46px; height: 4px; margin-top: 6px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--brand) 0 12px, transparent 12px 18px); }
.home-head h2::after { margin-top: 4px; }
.cl-head h2::after { display: none; }
.list-title { padding-bottom: 12px; background: repeating-linear-gradient(90deg, var(--brand) 0 12px, transparent 12px 18px) left bottom / 46px 4px no-repeat; }

/* Home banner numbers */
.hero-stats { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 16px 0 0; padding: 0; color: rgba(255,255,255,0.75); font-size: 0.95rem; }
.hero-stats[hidden] { display: none; }
.hero-stats li { display: flex; align-items: baseline; gap: 6px; }
.hero-stats b { font-family: var(--display); font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1; }
.hero-stats li + li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin-right: 10px; align-self: center; }
@media (max-width: 480px) { .hero-stats { gap: 6px 18px; } .hero-stats li + li::before { display: none; } }

/* Hills along the top of the footer, matching the banners */
.site-footer { position: relative; margin-top: 56px; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: -40px; height: 41px; background: var(--night); pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 40 L0 26 L110 12 L220 24 L340 6 L460 22 L580 10 L700 26 L830 8 L950 22 L1080 4 L1200 18 L1200 40 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 40 L0 26 L110 12 L220 24 L340 6 L460 22 L580 10 L700 26 L830 8 L950 22 L1080 4 L1200 18 L1200 40 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }

/* Links page: tidier cards */
.content .link-list { padding-left: 0; }
.link-list li { position: relative; padding: 14px 44px 14px 16px; transition: border-color .12s, transform .12s; }
.link-list li:hover { border-color: var(--brand); transform: translateY(-1px); }
.link-list li > a:first-child { font-family: var(--display); font-size: 1.3rem; font-weight: 700; line-height: 1.15; text-decoration: none; color: var(--text); }
.link-list li > a:first-child::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.link-list li::after { content: "\2197"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--brand); pointer-events: none; }
.link-list span { margin-top: 2px; }
.link-list span a { position: relative; z-index: 1; }

/* Gentle fade-up as pages open (skipped if the phone asks for less motion) */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  .hero .wrap > * { animation: rise .5s ease-out backwards; }
  .hero .wrap > :nth-child(2) { animation-delay: .06s; }
  .hero .wrap > :nth-child(3) { animation-delay: .12s; }
  .hero .wrap > :nth-child(n+4) { animation-delay: .18s; }
  .tile, .ride, .link-list li, .cl-group { animation: rise .45s ease-out backwards; animation-delay: .15s; }
}

/* Back to top button */
.to-top { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 30; width: 46px; height: 46px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--brand); color: #fff; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,0.3); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { filter: brightness(1.08); }
.to-top:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.to-top svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

@media print {
  .site-header, .site-footer, .to-top, .hero .ridge, .hero .topo, .download-box, .no-print, .callout { display: none !important; }
  body { background: #fff; color: #000; }
  .hero { background: none; color: #000; }
  .hero .wrap { padding: 0 0 8px; }
  .hero h1 { color: #000; font-size: 2.2rem; }
  .hero .kicker { color: #000; }
  .hero p.sub { color: #333; margin-bottom: 0; }
  main { padding: 0; }
  .content { max-width: none; }
  .cl-grid { display: block; columns: 2; column-gap: 28px; }
  .cl-group { break-inside: avoid; border: 0; margin: 0 0 6px; background: none; box-shadow: none; }
  .cl-head { background: none; color: #000; padding: 6px 0 0; }
  .content .cl-head h2 { color: #000; }
  .cl-icon, .cl-count { display: none; }
  .cl, .cl-wide .cl { padding: 0 !important; columns: 1; }
  .cl input:checked { background: none; }
  .cl input:checked::after { display: none; }
  .cl input:checked + span { text-decoration: none; color: #000; }
  .content .cl-group h2 { font-size: 1.1rem; margin: 10px 0 2px; }
  .cl label { padding: 3px 0; font-size: 0.9rem; border-color: #ccc; }
  .cl input { appearance: none; -webkit-appearance: none; border: 1.5px solid #000; border-radius: 3px; width: 14px; height: 14px; }
}
