html:has(.public-home) { scroll-behavior: smooth; }
.page:has(.public-home) { width: 100%; margin: 0 auto 0; }
.public-home { display: block; letter-spacing: 0; }
.home-inner { width: min(1120px, calc(100% - 80px)); margin-inline: auto; min-width: 0; }
.home-hero { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: 400px; height: min(600px, calc(100svh - 240px)); overflow: hidden; background: #203629; color: #fff; }
.home-hero-media { position: absolute; z-index: -2; inset: 0; }
.home-hero-image { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 52%; }
.home-hero::after { content: ''; position: absolute; z-index: -1; inset: 0; background: #061b142e; }
.home-hero-content { padding: 40px 0 64px; }
.home-hero-wordmark { display: block; width: 120px; height: 60px; object-fit: contain; filter: brightness(0) invert(1); margin-bottom: 14px; }
.home-hero h1 { max-width: 580px; margin: 0; color: white; font-size: 52px; font-weight: 800; font-style: italic; line-height: 1.08; text-shadow: 0 2px 12px #0005; }
.home-hero-content > p { max-width: 460px; margin: 18px 0 0; font-size: 20px; line-height: 1.5; color: #fff; text-shadow: 0 1px 8px #0008; }
.home-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 28px; margin-top: 16px; }
.home-primary-link { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 46px; max-width: 100%; padding: 12px 20px; border: 1px solid transparent; border-radius: 5px; background: var(--primary); color: white; font-size: 14px; font-weight: 650; text-decoration: none; }
.home-primary-link:hover { background: var(--primary-hover); color: white; }
.home-hero .home-primary-link { background: white; color: #194734; }
.home-hero .home-primary-link:hover { background: #edf5f0; }
.home-hero-link, .home-text-link { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; color: var(--primary); font-size: 13px; font-weight: 650; text-decoration: none; }
.home-hero-link { color: white; font-size: 15px; font-weight: 750; text-shadow: 0 1px 2px #000, 0 0 6px #000, 0 0 12px #000; }
.home-hero-link:hover { color: white; }
.home-hero-link .link-underline { border-bottom-width: 2px; filter: drop-shadow(0 1px 2px #0009); }
.home-text-link:hover { color: var(--primary-hover); }
.home-text-link i, .home-hero-link i { flex: 0 0 auto; font-size: 12px; }
.home-starts { padding-block: 42px 52px; scroll-margin-top: 96px; }
.home-starts .home-section-heading { margin-bottom: 12px; }
.home-points-description { max-width: 760px; margin: 0 0 24px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.home-section-heading { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-bottom: 26px; }
.home-section-heading > div { min-width: 0; }
.home-eyebrow { margin: 0 0 7px; color: var(--primary); font-size: 12px; font-weight: 650; }
.home-section-heading h2 { margin: 0; font-size: 30px; line-height: 1.25; font-weight: 750; }
.home-race-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.home-race-row { position: relative; isolation: isolate; display: flex; flex-direction: column; grid-column: span 2; min-width: 0; overflow: hidden; border: 1px solid #d6e3dc; border-top: 3px solid var(--primary); border-radius: 8px; background: #f6f9f7; }
@media (min-width: 1001px) {
    /* Fill the last two cards, or balance the last four into two pairs. */
    .home-race-row:nth-last-child(2):nth-child(3n + 1),
    .home-race-row:nth-last-child(2):nth-child(3n + 1) ~ .home-race-row,
    .home-race-row:nth-last-child(4):nth-child(3n + 1),
    .home-race-row:nth-last-child(4):nth-child(3n + 1) ~ .home-race-row { grid-column: span 3; }
}
.home-race-row:only-child { grid-column: 1 / -1; }
.home-race-row::before { content: ''; position: absolute; z-index: -1; top: -82px; right: -42px; width: 220px; height: 160px; border: 1px solid #dce8e0; border-radius: 50%; box-shadow: 0 0 0 12px #f6f9f7, 0 0 0 13px #dce8e0, 0 0 0 25px #f6f9f7, 0 0 0 26px #dce8e0; transform: rotate(-25deg); pointer-events: none; }
.home-race-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 20px 22px 0; }
.home-race-distance { font-size: 32px; line-height: 1.15; font-weight: 800; font-style: italic; letter-spacing: -1px; color: #14513e; overflow-wrap: anywhere; }
.home-race-info { min-width: 0; padding: 12px 22px 20px; }
.home-race-info h3 { margin: 0; font-size: 19px; line-height: 1.35; }
.home-race-info p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 8px 0 0; color: #596c62; font-size: 12px; }
.home-race-info p i { margin-right: 3px; }
.home-race-countdown { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid #d6e3dc; border-radius: 4px; background: #fff; color: #37624e; font-size: 11px; font-weight: 650; }
.home-race-countdown::before { content: ''; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: #4c9776; }
.home-race-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-top: auto; padding: 12px 22px; border-top: 1px solid #dce7e0; background: #fff; }
.home-race-join { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 40px; margin-left: auto; padding: 9px 14px; border-radius: 4px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 650; text-decoration: none; }
.home-race-join:hover { background: var(--primary-hover); color: #fff; }
.home-race-join i { font-size: 11px; }
@media (min-width: 769px) {
    .home-race-row:only-child { display: grid; grid-template-columns: minmax(140px, max-content) minmax(0, 1fr) auto; }
    .home-race-row:only-child .home-race-top { flex-direction: column; justify-content: center; align-items: flex-start; padding: 24px; border-right: 1px solid #dce7e0; }
    .home-race-row:only-child .home-race-info { align-self: center; padding: 24px; }
    .home-race-row:only-child .home-race-footer { flex-direction: column; justify-content: center; align-items: stretch; margin: 0; padding: 20px 24px; border-top: 0; border-left: 1px solid #dce7e0; }
    .home-race-row:only-child .home-race-join { margin: 0; }
}
.home-races-empty { display: flex; align-items: center; gap: 22px; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.home-races-empty > i { flex: 0 0 36px; color: #aa7b27; font-size: 30px; }
.home-races-empty h3 { margin: 0 0 6px; font-size: 17px; }
.home-races-empty p { margin: 0; max-width: 620px; color: var(--muted); font-size: 14px; }
.home-preview-band { padding-block: 48px 52px; border-top: 1px solid #e6ebe8; border-bottom: 1px solid #e6ebe8; background: #f4f7f5; }
.home-preview-tabs { display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; border-bottom: 1px solid #cfd9d3; }
.is-ready .home-preview-tabs { display: grid; }
.home-preview-tabs button { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.home-preview-tabs button:hover { background: #e9f0ec; color: var(--primary); }
.home-preview-tabs button[aria-selected=true] { border-bottom-color: var(--primary); color: var(--primary); }
.home-preview-stage { padding: 20px 28px 24px; border: 1px solid #d7e0da; border-radius: 6px; background: white; box-shadow: 0 5px 16px #183b2710; }
.home-demo-label { margin: 0 0 16px; color: var(--muted); font-size: 11px; text-align: right; }
.home-preview-panel { min-width: 0; min-height: 430px; }
.home-preview-panel[hidden] { display: none; }
[data-home-previews]:not(.is-ready) .home-preview-panel + .home-preview-panel { margin-top: 28px; }
.home-preview-panel:focus-visible { outline-offset: 8px; }
.home-demo-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.home-demo-heading h3 { margin: 0; font-size: 21px; line-height: 1.3; }
.home-demo-heading p { margin: 7px 0 0; font-size: 12px; color: var(--muted); }
.home-demo-heading p span { padding-inline: 6px; }
.home-demo-status { flex: 0 0 auto; padding: 4px 8px; border-radius: 4px; background: #eef1ef; color: #5f6a63; font-size: 11px; }
.home-demo-table { min-width: 360px; }
.home-demo-table th { font-size: 12px; }
.home-demo-table td { height: 48px; }
.home-demo-table tbody tr:last-child td { border-bottom: 0; }
.home-demo-medal { display: inline-block; object-fit: contain; vertical-align: middle; width: 20px; height: 24px; margin-left: 8px; }
.home-demo-table .is-current-user { background: #eff7f2; }
.home-demo-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 20px; }
.home-demo-metrics > div { padding-left: 20px; border-left: 1px solid var(--line); min-width: 0; }
.home-demo-metrics > div:first-child { padding-left: 0; border: 0; }
.home-demo-metrics dt { color: var(--muted); font-size: 11px; }
.home-demo-metrics dd { margin: 4px 0 0; font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; }
.home-demo-metrics small { font-size: 13px; font-weight: 500; }
.home-demo-activities { min-width: 560px; }
.home-demo-activities td { height: 43px; padding-block: 10px; }
.home-demo-record { display: flex; align-items: center; gap: 10px; color: #9b6a13; font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; }
.home-demo-record i { font-size: 18px; }
.home-demo-stats-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 36px; }
.home-demo-stats-grid .home-demo-table { min-width: 300px; }
.home-demo-weeks { min-width: 0; padding-left: 28px; border-left: 1px solid var(--line); }
.home-demo-weeks h4 { margin: 10px 0 20px; font-size: 14px; }
.home-demo-week { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 20px; font-size: 12px; }
.home-demo-week > span { color: var(--muted); }
.home-demo-week meter { grid-column: 1 / -1; width: 100%; height: 8px; }
.home-demo-week meter::-webkit-meter-bar { border: 0; border-radius: 2px; background: #edf1ee; }
.home-demo-week meter::-webkit-meter-optimum-value { border-radius: 2px; background: #80a993; }
.home-demo-week meter::-moz-meter-bar { border-radius: 2px; background: #80a993; }
.home-join { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 380px; margin-block: 40px 56px; overflow: hidden; border-radius: 6px; background: #202925; color: #fff; }
.home-join-media { position: absolute; z-index: -2; inset: 0; }
.home-join-image { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 65% center; }
.home-join::after { content: ''; position: absolute; z-index: -1; inset: 0; background: #06110d38; }
.home-join-content { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; width: 480px; max-width: 100%; min-width: 0; padding: 40px; text-align: left; }
.home-join h2 { max-width: 440px; margin: 0; color: #fff; font-size: 30px; font-weight: 750; line-height: 1.2; text-shadow: 0 2px 6px #0007; }
.home-join-content > p { max-width: 400px; margin: 16px 0 0; color: #fff; font-size: 15px; line-height: 1.6; text-shadow: 0 1px 6px #0009; }
.home-join-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 28px; }
.home-join .home-primary-link { background: #e0bd6b; color: #202925; }
.home-join .home-primary-link:hover { background: #eed398; }
.home-join .home-text-link { color: #fff; font-size: 13px; text-shadow: 0 1px 6px #0009; }
.home-join .home-text-link:hover { color: #e0bd6b; }
.home-join :focus-visible { outline-color: #e0bd6b; }

@media (min-width: 1280px) {
    .home-hero { height: min(max(600px, 20vw), calc(100svh - 200px)); }
    .home-hero-image { object-position: left 80%; }
    .home-hero-content { width: min(1440px, calc(100% - 80px)); }
}
@media (max-width: 1000px) {
    .home-hero h1 { font-size: 44px; max-width: 470px; }
    .home-inner { width: calc(100% - 48px); }
    .home-race-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-race-list > .home-race-row { grid-column: auto; }
    .home-race-list > .home-race-row:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .home-demo-stats-grid { gap: 20px; }
    .home-demo-weeks { padding-left: 20px; }
    .home-join { align-items: flex-end; min-height: 520px; }
    .home-join-image { object-position: center top; }
    .home-join-content { width: 100%; padding: max(220px, 50%) 32px 32px; }
}
@media (max-width: 768px) {
    .home-inner { width: calc(100% - 32px); }
    .home-hero { height: min(520px, calc(100svh - 200px)); min-height: 340px; }
    .home-hero-image { object-position: 68% center; }
    .home-hero-content { padding: 24px 0 40px; }
    .home-hero-wordmark { width: 90px; height: 45px; margin-bottom: 12px; }
    .home-hero h1 { max-width: 380px; font-size: 36px; }
    .home-hero-content > p { max-width: 290px; margin-top: 14px; font-size: 17px; }
    .home-hero-actions { gap: 8px 12px; margin-top: 14px; }
    .home-primary-link { gap: 10px; padding: 11px 15px; font-size: 13px; }
    .home-hero-link { font-size: 14px; }
    .home-starts { padding-block: 28px 32px; scroll-margin-top: 120px; }
    .home-section-heading { gap: 10px; margin-bottom: 20px; }
    .home-section-heading h2 { font-size: 25px; }
    .home-section-heading > .home-text-link { min-height: 32px; font-size: 12px; }
    .home-race-list { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .home-race-top { padding: 18px 18px 0; }
    .home-race-distance { font-size: 30px; }
    .home-race-info { padding: 12px 18px 18px; }
    .home-race-info h3 { font-size: 18px; }
    .home-race-footer { padding: 12px 18px; }
    .home-races-empty { align-items: flex-start; gap: 16px; padding-block: 20px; }
    .home-races-empty h3 { font-size: 16px; }
    .home-races-empty p { font-size: 13px; }
    .home-preview-band { padding-block: 32px; }
    .home-preview-tabs { width: 100%; margin-top: 10px; }
    .home-preview-tabs button { gap: 7px; padding-inline: 7px; font-size: 12px; }
    .home-preview-stage { padding: 16px; }
    .home-preview-panel { min-height: 430px; }
    .home-demo-heading { flex-wrap: wrap; gap: 8px 16px; margin-bottom: 20px; }
    .home-demo-heading h3 { font-size: 18px; }
    .home-demo-table th, .home-demo-table td { padding-inline: 10px; }
    #home-preview-races .home-demo-table { min-width: 0; font-size: 12px; }
    #home-preview-races .home-demo-table th, #home-preview-races .home-demo-table td { padding-inline: 8px; }
    #home-preview-races .race-quality-value, #home-preview-races .race-quality-heading { min-width: 72px; padding-inline: 5px; }
    .home-demo-medal { width: 16px; height: 20px; margin-left: 4px; }
    .home-demo-metrics dd { font-size: 19px; }
    .home-demo-metrics > div { padding-left: 12px; }
    .home-demo-stats-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .home-demo-weeks { display: none; }
    .home-join { margin-block: 32px 40px; }
    .home-join-content { padding-inline: 24px; }
    .home-join h2 { font-size: 26px; }
    .home-join-content > p { max-width: 340px; font-size: 14px; }
    .home-join-actions { flex-direction: column; gap: 14px; margin-top: 24px; }
}
@media (max-width: 380px) {
    .home-hero h1 { font-size: 32px; }
    .home-hero-actions { gap: 6px 8px; }
    .home-hero-link { gap: 6px; font-size: 13px; }
    .home-race-distance { font-size: 27px; }
    .home-demo-metrics dd { font-size: 17px; }
}
@media (min-width: 769px) and (max-height: 600px) {
    .home-hero { min-height: 0; height: calc(100svh - 180px); }
    .home-hero-content { padding-block: 20px; }
    .home-hero-wordmark { display: none; }
    .home-hero h1 { max-width: 700px; font-size: 32px; }
    .home-hero-content > p { max-width: 700px; margin-top: 10px; font-size: 16px; }
    .home-hero-actions { margin-top: 12px; }
    .home-starts { padding-top: 24px; }
}
@media (max-width: 768px) and (max-height: 650px) {
    .home-hero-wordmark { display: none; }
}
