/* carmeetscolorado.com */
:root {
  --bg: #f6f5f2;
  --bg-2: #efede8;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --border: #e3e0d9;
  --border-strong: #cfcbc2;
  --text: #16181c;
  --text-2: #4f535b;
  --muted: #7a7e86;
  --accent: #ff5a1f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(255, 90, 31, .12);
  --today: #ff5a1f;
  --shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 8px 24px rgba(20, 20, 30, .06);
  --shadow-lg: 0 24px 60px rgba(10, 10, 20, .25);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;

  --c-meet: #ff5a1f;
  --c-show: #3b82f6;
  --c-cars_and_coffee: #b7791f;
  --c-cruise: #0fa3a3;
  --c-racing: #e11d48;
  --c-track_day: #8b5cf6;
  --c-swap_meet: #4d9b2e;
  --c-auction: #c9a227;
  --c-club: #db2777;
  --c-other: #6b7280;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f12;
    --bg-2: #12151a;
    --surface: #161a20;
    --surface-2: #1b2028;
    --border: #262c35;
    --border-strong: #353d48;
    --text: #f3f1ec;
    --text-2: #c2c6cd;
    --muted: #8a919c;
    --accent-soft: rgba(255, 90, 31, .16);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f12;
  --bg-2: #12151a;
  --surface: #161a20;
  --surface-2: #1b2028;
  --border: #262c35;
  --border-strong: #353d48;
  --text: #f3f1ec;
  --text-2: #c2c6cd;
  --muted: #8a919c;
  --accent-soft: rgba(255, 90, 31, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 15px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; margin: 0; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--text-2); }
.btn:active { transform: scale(.97); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border); }
.btn--icon { padding: 0; width: 40px; }
.btn--sm.btn--icon { width: 36px; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { filter: brightness(1.06); border-color: var(--accent); }

/* ---------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__logo { height: 50px; width: auto; display: block; }
.brand__name { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -.03em; }
.brand__accent { color: var(--accent); }
.brand__tld { color: var(--muted); font-weight: 500; }
.topbar__actions { display: flex; gap: 4px; }

/* ---------- hero */
.hero { padding: 56px 0 28px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 720px; height: 720px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 14px; }
.hero h1 { font-size: clamp(34px, 6vw, 64px); line-height: 1.02; font-weight: 700; text-wrap: balance; }
.accent-text { color: var(--accent); }
.hero__sub { color: var(--text-2); font-size: clamp(15px, 1.6vw, 18px); max-width: 56ch; margin: 18px 0 0; }
.stats { display: flex; gap: 12px; margin: 28px 0 0; flex-wrap: wrap; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 18px; min-width: 128px; box-shadow: var(--shadow); }
.stat dt { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat dd { margin: 2px 0 0; font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.updated { color: var(--muted); font-size: 13px; margin: 14px 0 0; display: flex; align-items: center; gap: 8px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* ---------- this week rail */
.rail-section { margin-top: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 12px; }
.section-head h2 { font-size: 20px; }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 290px); gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 14px; margin: 0 -2px;
  scrollbar-width: thin;
}
.rail > * { scroll-snap-align: start; }

/* ---------- event card */
.card {
  position: relative; display: flex; gap: 14px; text-align: left; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; cursor: pointer; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.card::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cat, var(--c-other)); }
.card__date { flex: none; width: 52px; text-align: center; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); padding: 6px 0; height: fit-content; }
.card__dow { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card__day { display: block; font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.1; }
.card__mon { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--accent); }
.card__body { min-width: 0; flex: 1; }
.card__title { font-weight: 650; font-size: 15px; line-height: 1.3; margin: 2px 0 4px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta { color: var(--text-2); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.card__meta span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.card__meta svg { width: 14px; height: 14px; color: var(--muted); }
.card__src { color: var(--muted); font-size: 12px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px; color: var(--cat, var(--c-other));
  background: color-mix(in srgb, var(--cat, var(--c-other)) 14%, transparent);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- toolbar */
#calendar { margin-top: 28px; scroll-margin-top: 78px; }
.toolbar {
  position: sticky; top: 68px; z-index: 20; padding: 12px 0 10px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.toolbar__row { display: flex; gap: 10px; align-items: center; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; min-width: 0; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { color: var(--muted); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; height: 100%; }
select {
  height: 44px; padding: 0 36px 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  appearance: none; -webkit-appearance: none; cursor: pointer; max-width: 200px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.seg { display: flex; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; height: 44px; flex: none; }
.seg button { border: 0; background: transparent; padding: 0 16px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--text-2); }
.seg button[aria-selected="true"] { background: var(--text); color: var(--bg); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-size: 13px; font-weight: 550; color: var(--text-2); white-space: nowrap;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--cat, var(--text-2)); }
.chip small { color: var(--muted); font-weight: 500; }
.chip[aria-pressed="true"] { border-color: var(--cat, var(--text)); color: var(--text); background: color-mix(in srgb, var(--cat, var(--text)) 12%, var(--surface)); }

/* ---------- month grid */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 12px; }
.cal-head__nav { display: flex; align-items: center; gap: 6px; }
.cal-head h2 { font-size: 24px; min-width: 9.5ch; text-align: center; }
.grid-head { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 0 6px; }
.grid-head span { padding: 0 8px; }
.grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.day {
  background: var(--surface); min-height: 128px; padding: 6px; display: flex; flex-direction: column; gap: 3px;
  border: 0; text-align: left; cursor: pointer; position: relative; min-width: 0;
}
.day:hover { background: var(--surface-2); }
.day--out { background: var(--bg-2); }
.day--out .day__num { color: var(--muted); opacity: .6; }
.day--weekend:not(.day--out) { background: color-mix(in srgb, var(--surface) 97.5%, var(--accent)); }
.day--selected { box-shadow: inset 0 0 0 2px var(--accent); }
.day__num { font-size: 13px; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.day--today .day__num { background: var(--today); color: #fff; }
.day--past:not(.day--today) .pill { opacity: .55; }
.pill {
  display: block; font-size: 12px; line-height: 1.3; padding: 3px 6px 3px 7px; border-radius: 6px;
  background: color-mix(in srgb, var(--cat) 13%, transparent); border-left: 3px solid var(--cat);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text);
}
.pill b { font-weight: 600; color: var(--text-2); margin-right: 4px; font-variant-numeric: tabular-nums; }
.more { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 6px; }
.dots { display: none; gap: 3px; flex-wrap: wrap; padding: 0 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--cat); }

.day-panel { margin-top: 18px; }
.day-panel h3 { font-size: 18px; margin: 0 0 10px; }
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* ---------- list view */
.list-day { margin: 0 0 20px; }
.list-day__head {
  position: sticky; top: var(--sticky-top, 172px); z-index: 5; display: flex; align-items: baseline; gap: 10px;
  padding: 8px 0; background: var(--bg); font-family: var(--display); font-size: 17px; font-weight: 650;
}
.list-day__head small { color: var(--muted); font-family: var(--font); font-size: 13px; font-weight: 500; }
.list-day__head .tag { font-family: var(--font); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }

.empty { text-align: center; padding: 56px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-2); margin-top: 12px; }
.empty__title { font-family: var(--display); font-size: 20px; font-weight: 650; color: var(--text); margin: 0 0 6px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- modal */
.modal { border: 0; padding: 0; background: transparent; max-width: min(640px, calc(100vw - 24px)); width: 100%; max-height: calc(100dvh - 24px); color: var(--text); }
.modal::backdrop { background: rgba(5, 6, 8, .62); backdrop-filter: blur(4px); }
.modal[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal__card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); max-height: calc(100dvh - 24px); overflow-y: auto; }
.modal__close { position: absolute; top: 10px; right: 10px; z-index: 2; background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(6px); }
.modal__media { aspect-ratio: 2.4 / 1; background: var(--surface-2); overflow: hidden; }
.modal__media img { width: 100%; height: 100%; object-fit: cover; }
.modal__body { padding: 22px 24px 24px; }
.modal__body h2 { font-size: 26px; line-height: 1.15; margin: 10px 40px 14px 0; overflow-wrap: anywhere; }
.facts { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); }
.facts svg { margin-top: 2px; color: var(--muted); }
.facts a { color: var(--text); font-weight: 550; }
.modal__desc { color: var(--text-2); margin: 0 0 18px; white-space: pre-line; overflow-wrap: anywhere; }
.modal__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.modal__links h3 { font-family: var(--font); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.modal__links ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.modal__links a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); text-decoration: none; font-size: 14px; }
.modal__links a:hover { border-color: var(--border-strong); }
.modal__links a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.modal__links a small { color: var(--muted); flex: none; margin-left: auto; }
.modal__links a svg { width: 14px; height: 14px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; z-index: 60; box-shadow: var(--shadow-lg); }

/* ---------- footer */
.footer { margin-top: 64px; border-top: 1px solid var(--border); padding: 32px 0 44px; }
.footer__inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer__inner > div:first-child { max-width: 560px; }
.footer__brand { font-family: var(--display); font-weight: 700; font-size: 18px; margin: 0 0 6px; }
.footer .muted { font-size: 13px; margin: 0; }
.footer__links { display: flex; gap: 18px; font-size: 14px; font-weight: 550; }
.footer__links a { text-decoration: none; color: var(--text-2); }
.footer__links a:hover { color: var(--text); }

/* ---------- responsive */
@media (max-width: 900px) {
  .day { min-height: 104px; }
  .pill b { display: none; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .hide-sm { display: none; }
  .brand__logo { height: 44px; }
  .brand__name { font-size: 17px; }
  .hero { padding: 36px 0 18px; }
  .stats { gap: 8px; }
  .stat { flex: 1; min-width: 0; padding: 10px 12px; }
  .stat dd { font-size: 22px; }
  .toolbar__row { flex-wrap: wrap; }
  .search { flex: 1 1 100%; order: -1; }
  select { flex: 1; max-width: none; }
  .grid-head span { padding: 0; text-align: center; }
  .day { min-height: 58px; padding: 4px 2px; align-items: center; }
  .day__num { width: 24px; height: 24px; font-size: 12px; }
  .pill, .more { display: none; }
  .dots { display: flex; justify-content: center; }
  .cards { grid-template-columns: 1fr; }
  .cal-head h2 { font-size: 20px; }
  .modal { max-width: 100vw; margin: auto 0 0; max-height: 92dvh; }
  .modal__card { border-radius: 20px 20px 0 0; max-height: 92dvh; }
  .modal__body { padding: 18px 18px 28px; }
  .modal__body h2 { font-size: 22px; }
  .modal__actions .btn { flex: 1 1 auto; }
  .modal__links a small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
