/* Hard Lines: Welsh hillside palette, trail-sign type, race-plate runs. */

@font-face {
    font-family: "Barlow Condensed";
    src: url("fonts/BarlowCondensed-ExtraBold.ttf") format("truetype");
    font-weight: 800;
    font-display: swap;
}
@font-face {
    font-family: "Barlow Condensed";
    src: url("fonts/BarlowCondensed-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: "Barlow";
    src: url("fonts/Barlow-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Barlow";
    src: url("fonts/Barlow-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-display: swap;
}

:root {
    --pine: #17241D;
    --moss: #2C3B31;
    --moss-line: #3E5244;
    --bracken: #B5541F;
    --bracken-hi: #E07E45;
    --plate: #F4F4EF;
    --plate-ink: #141814;
    --fern: #A3B79E;
    --bark: #6B4A2E;

    --g-green: #2F8F4E;
    --g-blue: #2862C4;
    --g-red: #C8322A;
    --g-black: #0F120F;
    --g-orange: #DB6F14;

    --display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --text: "Barlow", system-ui, sans-serif;

    /* type scale, ratio ~1.25 */
    --t-sm: 0.875rem;
    --t-base: 1.0625rem;
    --t-md: 1.3125rem;
    --t-lg: 1.75rem;
    --t-xl: 2.5rem;

    --gutter: clamp(16px, 4vw, 48px);
    --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--pine);
    color: var(--plate);
    font: 400 var(--t-base)/1.55 var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter) 64px;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--bracken-hi); text-underline-offset: 3px; }
a:hover { color: var(--plate); }

:focus-visible {
    outline: 3px solid var(--bracken-hi);
    outline-offset: 3px;
    border-radius: 2px;
}

h1, h2 {
    font-family: var(--display);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.005em;
    margin: 0;
}

.skip {
    position: absolute;
    left: -999px;
    top: 8px;
    background: var(--plate);
    color: var(--plate-ink);
    padding: 8px 12px;
    z-index: 10;
}
.skip:focus { left: 8px; }

/* --- header ---------------------------------------------------------------- */

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 18px var(--gutter);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--plate);
    text-decoration: none;
}
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name {
    font: 800 1.6rem/1 var(--display);
    letter-spacing: 0.01em;
}

.basket-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--plate);
    text-decoration: none;
    font-weight: 600;
}
.basket-count {
    min-width: 2.1em;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--plate);
    color: var(--plate-ink);
    font: 800 1.15rem/1.2 var(--display);
    text-align: center;
}
/* The one bit of motion: the basket plate kicks when something is added. */
.basket-link.bump .basket-count { animation: bump 0.5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump {
    0% { transform: translateY(0) rotate(0); }
    40% { transform: translateY(-6px) rotate(-6deg); background: var(--bracken-hi); }
    100% { transform: translateY(0) rotate(0); }
}

/* --- home -------------------------------------------------------------------- */

.hero {
    position: relative;
    padding: clamp(40px, 9vw, 120px) 0 clamp(32px, 6vw, 72px);
    isolation: isolate;
}
.contours {
    position: absolute;
    inset: 0 calc(var(--gutter) * -1);
    width: calc(100% + var(--gutter) * 2);
    height: 100%;
    color: var(--moss-line);
    z-index: -1;
}
.hero-title {
    font-size: clamp(4rem, 15vw, 11.5rem);
    line-height: 0.86;
    letter-spacing: -0.01em;
    max-width: 9ch;
    color: var(--plate);
    text-shadow: 0 2px 0 var(--pine);
}
.hero-sub {
    max-width: 38ch;
    margin: 24px 0 0;
    font-size: var(--t-md);
    line-height: 1.45;
    color: var(--fern);
}

.days {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 2px solid var(--moss-line);
}
.day {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 28px;
    padding: 22px 0;
    border-bottom: 1px solid var(--moss-line);
    color: var(--plate);
    text-decoration: none;
}
.day:hover .day-dm, .day:focus-visible .day-dm { color: var(--bracken-hi); }
.day-date { display: flex; flex-direction: column; }
.day-dow { color: var(--fern); font-weight: 600; }
.day-dm {
    font: 800 clamp(2.4rem, 5vw, 3.4rem)/0.95 var(--display);
    transition: color 0.15s;
}
.day-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.day-count { font: 700 var(--t-md)/1.2 var(--display); }
.day-span { color: var(--fern); }
.day-cams { display: flex; flex-wrap: wrap; gap: 6px 14px; width: 100%; }
.day-strip { display: flex; gap: 6px; }
.day-strip img {
    width: 112px;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 3px;
    background: var(--moss);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--plate);
}
/* Trail grade marker: the same shapes as the signs (black is a diamond). */
.marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex: none;
    box-shadow: 0 0 0 2px var(--pine), 0 0 0 3px rgba(244, 244, 239, 0.5);
}
.marker.grade-black { border-radius: 1px; transform: rotate(45deg) scale(0.85); }
.marker.grade-blue { border-radius: 2px; }
.marker.grade-red { clip-path: polygon(50% 0, 100% 100%, 0 100%); box-shadow: none; }

.grade-green { background: var(--g-green); }
.grade-blue { background: var(--g-blue); }
.grade-red { background: var(--g-red); }
.grade-black { background: var(--g-black); }
.grade-orange { background: var(--g-orange); }

/* --- shared page bits --------------------------------------------------------- */

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0 0;
    font-size: var(--t-sm);
    font-weight: 600;
}
.crumbs a { color: var(--fern); text-decoration: none; }
.crumbs a:hover { color: var(--plate); }
.crumbs a + a::before { content: "/"; margin-right: 6px; color: var(--moss-line); }

.page-head { padding: 20px 0 28px; }
.page-head h1 { font-size: clamp(2.6rem, 7vw, 4.75rem); }
.lede { margin: 12px 0 0; max-width: 60ch; color: var(--fern); font-size: var(--t-md); line-height: 1.45; }

.empty { padding: 72px 0; max-width: 40ch; }
.empty h1, .empty h2 { font-size: var(--t-xl); margin-bottom: 12px; }
.empty p { color: var(--fern); margin: 0 0 24px; }

.warn { color: #F2C14E; font-weight: 600; margin: 12px 0 0; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 20px;
    border: 0;
    border-radius: 999px;
    background: var(--bracken);
    color: #fff;
    font: 600 var(--t-base)/1.2 var(--text);
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: #C55F27; color: #fff; }
.btn-price { font: 800 1.25rem/1 var(--display); }
.btn-quiet { background: transparent; color: var(--plate); box-shadow: inset 0 0 0 2px var(--moss-line); }
.btn-quiet:hover { background: var(--moss); }
.btn-big { padding: 16px 32px; font-size: var(--t-md); }

.link-btn {
    background: none;
    border: 0;
    padding: 4px;
    color: var(--fern);
    font: inherit;
    font-size: var(--t-sm);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.link-btn:hover { color: var(--plate); }

/* --- the number plate ------------------------------------------------------------ */

.plate {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    min-width: 8.2rem;
    background: var(--plate);
    color: var(--plate-ink);
    border-radius: 10px 10px 14px 14px;
    overflow: hidden;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}
/* the two zip-tie holes */
.plate::before, .plate::after {
    content: "";
    position: absolute;
    top: 5px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pine);
    z-index: 1;
}
.plate::before { left: 7px; }
.plate::after { right: 7px; }
.plate-band {
    display: block;
    padding: 3px 18px 2px;
    color: #fff;
    font: 700 0.8rem/1.25 var(--display);
    letter-spacing: 0.02em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.plate-band.grade-black { box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.2); }
.plate-num {
    display: block;
    padding: 2px 12px 4px;
    font: 800 2.35rem/1 var(--display);
    font-variant-numeric: tabular-nums;
    text-align: center;
    letter-spacing: -0.01em;
}
.plate-sec { font-size: 0.5em; vertical-align: 0.82em; margin-left: 1px; color: #555B55; }

.plate-lg { min-width: 14rem; }
.plate-lg .plate-band { font-size: 1rem; padding: 6px 22px 4px; }
.plate-lg .plate-num { font-size: 4.6rem; padding: 4px 16px 8px; }
.plate-lg::before, .plate-lg::after { top: 8px; width: 8px; height: 8px; }

.plate-sm { min-width: 6.4rem; }
.plate-sm .plate-num { font-size: 1.75rem; }
.plate-sm .plate-band { font-size: 0.72rem; }

/* --- day ----------------------------------------------------------------------------- */

.cams {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}
.cams a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px var(--moss-line);
    color: var(--plate);
    text-decoration: none;
    font-size: var(--t-sm);
    font-weight: 600;
}
.cams a[aria-current] { background: var(--plate); color: var(--plate-ink); }
.cams a[aria-current] .tag { color: var(--plate-ink); }
.cams-n { color: var(--fern); }
.cams a[aria-current] .cams-n { color: #555B55; }

/* Hour rail: sticks to the top so you can jump through the day. */
.hours {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 4px;
    margin: 0 calc(var(--gutter) * -1) 8px;
    padding: 10px var(--gutter);
    overflow-x: auto;
    background: var(--pine);
    border-bottom: 1px solid var(--moss-line);
    scrollbar-width: none;
}
.hours::-webkit-scrollbar { display: none; }
.hours a {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
    padding: 6px 8px 5px;
    border-radius: 8px;
    color: var(--plate);
    text-decoration: none;
    font: 800 1.5rem/1 var(--display);
}
.hours a:hover { background: var(--moss); }
.hours-n { font: 600 0.72rem/1.4 var(--text); color: var(--fern); }

.hour { padding-top: 28px; scroll-margin-top: 76px; }
.hour-title {
    display: flex;
    align-items: baseline;
    gap: 14px;
    font-size: var(--t-xl);
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 2px solid var(--moss-line);
}
.hour-n { font: 600 var(--t-sm)/1 var(--text); color: var(--fern); }

.runs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    gap: 28px 18px;
}
.run {
    position: relative;
    display: block;
    padding-bottom: 30px;
    color: var(--plate);
    text-decoration: none;
}
.run img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 4px;
    background: var(--moss);
}
/* The plate hangs off the bottom of the photo, like it's zip-tied to the bars. */
.run .plate {
    position: absolute;
    left: 12px;
    bottom: 0;
    transform: rotate(-2deg);
    transition: transform 0.15s;
}
.run:hover .plate, .run:focus-visible .plate { transform: rotate(0) translateY(-3px); }
.run-shots {
    position: absolute;
    right: 0;
    bottom: 4px;
    color: var(--fern);
    font-size: var(--t-sm);
}

/* --- photo -------------------------------------------------------------------------- */

.shot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 32px;
    align-items: start;
    padding-top: 16px;
}
.shot-view { margin: 0; }
.shot-view img {
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    background: var(--moss);
    border-radius: 4px;
}
.shot-view figcaption { margin-top: 10px; color: var(--fern); font-size: var(--t-sm); }

.shot-side { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.shot-side .plate { transform: rotate(-2deg); }
.shot-when { margin: -6px 0 0; color: var(--fern); font-weight: 600; }

.run-strip { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.run-strip a { display: block; border-radius: 4px; box-shadow: 0 0 0 2px transparent; }
.run-strip a[aria-current] { box-shadow: 0 0 0 3px var(--plate); }
.run-strip img { width: 84px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; }

.buy { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.buy .btn { width: 100%; }
.buy form { margin: 0; }
.buy-done { margin: 0; color: var(--fern); }

.riders { display: flex; gap: 20px; font-weight: 600; }

/* --- basket and order ----------------------------------------------------------------- */

.lines { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--moss-line); }
.line {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--moss-line);
}
.line img { width: 120px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 3px; }
.line-what { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.line-day { color: var(--fern); font-size: var(--t-sm); }
.line-price { font: 800 var(--t-lg)/1 var(--display); }
.line form { margin: 0; }

.total { padding: 28px 0; max-width: 46ch; }
.total p { margin: 0 0 18px; color: var(--fern); }

.bought {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 28px 18px;
}
.bought li { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.bought img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; }

/* --- search ---------------------------------------------------------------------- */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.search {
    display: flex;
    gap: 8px;
    max-width: 560px;
    margin-top: 28px;
}
.search input, .coupon input, .filter-form input, .filter-form select {
    min-width: 0;
    padding: 12px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--moss);
    color: var(--plate);
    font: 400 var(--t-base)/1.2 var(--text);
    box-shadow: inset 0 0 0 1px var(--moss-line);
}
.search input { flex: 1; }
.search input::placeholder { color: var(--fern); opacity: 0.8; }
.filter-form input, .filter-form select { border-radius: 8px; padding: 10px 12px; color-scheme: dark; }

.filters { margin: 0 0 20px; }
.filters summary { cursor: pointer; color: var(--fern); font-weight: 600; }
.filter-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-top: 14px; }
.filter-form label { display: flex; flex-direction: column; gap: 6px; font-size: var(--t-sm); color: var(--fern); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px;
    background: var(--moss);
    color: var(--plate);
    text-decoration: none;
    font-size: var(--t-sm);
    font-weight: 600;
}
.chip:hover { background: var(--moss-line); color: var(--plate); }
.chip[aria-current] { background: var(--plate); color: var(--plate-ink); }
.chip-n { color: var(--fern); font-weight: 400; }
.result-line { margin: 20px 0 0; }
.hour-title a { color: inherit; text-decoration: none; }
.hour-title a:hover { color: var(--bracken-hi); }

/* --- photo of the day -------------------------------------------------------------- */

.potd {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr);
    gap: 32px;
    align-items: center;
    margin: 0 0 56px;
}
.potd-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; background: var(--moss); }
.potd-text { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.potd-text h2 { font-size: var(--t-xl); }
.potd-caption { margin: 0; font-size: var(--t-md); line-height: 1.4; max-width: 30ch; }
.potd-text .plate { transform: rotate(-2deg); }
.potd-when { margin: -4px 0 0; color: var(--fern); font-weight: 600; }
.potd-badge { margin: -8px 0 0; color: var(--bracken-hi); font-weight: 600; }

/* --- coupons --------------------------------------------------------------------------- */

.coupon { margin: 0 0 22px; }
.coupon label { display: block; margin-bottom: 8px; font-weight: 600; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input { flex: 1; text-transform: uppercase; letter-spacing: 0.04em; }
.coupon-on p { margin: 0; }
.sums {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 24px;
    margin: 0 0 18px;
    padding: 12px 0;
    border-top: 1px solid var(--moss-line);
    border-bottom: 1px solid var(--moss-line);
}
.sums dt { color: var(--fern); }
.sums dd { margin: 0; text-align: right; font-weight: 600; }

/* --- parks ------------------------------------------------------------------------- */

.section-title { font-size: var(--t-xl); margin: 0 0 18px; }
.parks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 28px 20px;
}
.park { display: flex; flex-direction: column; gap: 4px; color: var(--plate); text-decoration: none; }
.park img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; background: var(--moss); margin-bottom: 8px; }
.park-name { font: 800 var(--t-lg)/1.05 var(--display); }
.park:hover .park-name, .park:focus-visible .park-name { color: var(--bracken-hi); }
.park-area { color: var(--plate); font-weight: 600; }
.park-meta { color: var(--fern); font-size: var(--t-sm); }

/* --- footer ------------------------------------------------------------------------- */

.foot {
    border-top: 1px solid var(--moss-line);
    padding: 24px var(--gutter) 32px;
    color: var(--fern);
    font-size: var(--t-sm);
}
.foot p { max-width: var(--max); margin: 0 auto; }

/* --- small screens ------------------------------------------------------------------ */

@media (max-width: 820px) {
    .day { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .day-strip { overflow: hidden; }
    .day-strip img { width: calc((100% - 18px) / 4); min-width: 0; }
    .shot { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .shot-view img { max-height: none; }
    .line { grid-template-columns: 84px minmax(0, 1fr) auto; }
    .line img { width: 84px; }
    .line form { grid-column: 2 / -1; }
    .potd { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
