/* C.R.E.C. — dark, from the jersey: navy, topo lines, red stripe, trail green, sunset amber */
:root {
  --bg: #0a1024; --bg2: #101938; --panel: rgba(255,255,255,.055); --panel-line: rgba(255,255,255,.1);
  --text: #eef1f8; --muted: #9ba6c4; --red: #d8412f; --green: #5fbf6d; --amber: #f3c66b; --white: #fff;
  --radius: 14px; --max: 1040px; --gutter: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.6 Inter, system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); overflow-x: hidden; }
body::before { /* slow-drifting topo lines behind everything */
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='400' viewBox='0 0 600 400'%3E%3Cg fill='none' stroke='%235fbf6d' stroke-opacity='.09' stroke-width='1'%3E%3Cpath d='M0 60C100 20 180 110 300 70S480 20 600 70'/%3E%3Cpath d='M0 120C110 80 190 170 310 130S490 80 600 130'/%3E%3Cpath d='M0 185C120 145 200 235 320 195S500 145 600 195'/%3E%3Cpath d='M0 250C130 210 210 300 330 260S510 210 600 260'/%3E%3Cpath d='M0 320C140 280 220 370 340 330S520 280 600 330'/%3E%3C/g%3E%3C/svg%3E");
  animation: drift 90s linear infinite;
}
@keyframes drift { from { transform: translate3d(0,0,0); } to { transform: translate3d(-600px, -200px, 0); } }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } html { scroll-behavior: auto; } }

h1, h2, h3, .brand span { font-family: Oswald, Inter, sans-serif; text-transform: uppercase; letter-spacing: .02em; color: var(--white); margin: 0 0 .4em; line-height: 1.05; }
h1 { font-size: clamp(2.4rem, 7vw, 4.6rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin-top: 1em; position: relative; padding-left: .55em; }
h2::before { content: ""; position: absolute; left: 0; top: .12em; bottom: .12em; width: 4px; background: var(--red); border-radius: 2px; }
h3 { font-size: 1.15rem; }
a { color: var(--white); } a:hover { color: var(--amber); }
p { margin: .4em 0 .9em; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; }
.err { color: #ff7a6b; font-weight: 600; }
.flash { background: rgba(95,191,109,.15); border: 1px solid rgba(95,191,109,.4); color: #c9f0d0; padding: .6em .9em; border-radius: 10px; max-width: var(--max); margin: 1rem auto; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .5rem max(var(--gutter), env(safe-area-inset-left)); background: rgba(10,16,36,.8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--panel-line); transition: background .3s, border-color .3s; }
.top.over { position: fixed; top: 0; left: 0; right: 0; background: linear-gradient(rgba(5,8,26,.5), rgba(5,8,26,0) 78%); border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; align-items: flex-start; padding-top: 1.2rem; padding-bottom: 1.4rem; }
.top.over .mark { height: clamp(130px, 16vw, 230px); transition: height .35s ease; }
.top.over nav { margin-top: .9rem; }
.top.over.scrolled { align-items: center; padding-top: .5rem; }
.top.over.scrolled .mark { height: 56px; }
.top.over.scrolled nav { margin-top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.top.over.scrolled { background: rgba(10,16,36,.8); border-bottom: 1px solid var(--panel-line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding-bottom: .5rem; }
.brand { display: flex; align-items: center; text-decoration: none; }
.mark { height: 56px; width: auto; display: block; filter: drop-shadow(0 2px 10px rgba(0,0,0,.55)); }
.top nav { display: flex; gap: .3rem 1.6rem; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.top nav a { color: #e9edf7; text-decoration: none; font-weight: 600; font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; padding: .3em 0; position: relative; }
.top nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px; background: var(--green); transition: right .25s; }
.top nav a:hover::after, .top nav a.active::after { right: 0; }
.top nav a:hover { color: #fff; }
.top nav .join-pill { border: 2px solid var(--green); border-radius: 999px; padding: .45em 1.3em; background: rgba(10,16,36,.35); }
.top nav .join-pill::after { display: none; }
.top nav .join-pill:hover { background: var(--green); color: #06130a; }
.top nav .pill { background: var(--green); color: #06130a; padding: .3em .9em; border-radius: 999px; }
.top nav .pill::after { display: none; }
/* phone: MENU pill opens a dropdown of the sections */
.menu-btn { display: none; font: 600 .78rem Inter, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: #fff; background: rgba(10,16,36,.35); border: 2px solid var(--green); border-radius: 999px; padding: .55em 1.4em; cursor: pointer; }
.menu-btn:hover { background: var(--green); color: #06130a; }
@media (max-width: 720px) {
  .menu-btn { display: inline-block; }
  .mark { height: 44px; }
  .top.over .mark { height: clamp(96px, 30vw, 140px); }
  .top.over nav { margin-top: 0; }
  .top nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(10,16,36,.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--panel-line); padding: .4rem 0 .8rem; }
  .top.menu-open nav { display: flex; }
  .top.menu-open { background: rgba(10,16,36,.96); }
  .top nav a { font-size: 1rem; letter-spacing: .14em; padding: .8em var(--gutter); border-bottom: 1px solid var(--panel-line); }
  .top nav a::after { display: none; }
  .top nav a.active { color: var(--green); }
  .top nav .join-pill, .top nav .pill { margin: .8rem var(--gutter) 0; text-align: center; border-bottom: 0; padding: .6em 1.3em; }
}

main { max-width: var(--max); margin: 0 auto; padding: 1.2rem var(--gutter) 3rem; }
main.wide { max-width: 1400px; }
.is-home main { padding-top: 0; }
.narrow { max-width: var(--max); margin-left: auto; margin-right: auto; }
footer { border-top: 1px solid var(--panel-line); color: var(--muted); font-size: .875rem; padding: 1.4rem var(--gutter) 3rem; text-align: center; }

/* ---------- hero ---------- */
.hero { position: relative; height: 100svh; min-height: 560px; width: 100vw; margin: 0 0 0 calc(50% - 50vw); overflow: hidden; } /* edge to edge on any monitor */
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 40% 55%; display: block; }
#dirt { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22%; background: linear-gradient(transparent, rgba(10,16,36,.9)); pointer-events: none; }
.hero-copy { position: relative; z-index: 2; padding: 0 max(var(--gutter), 5vw) 11vh; max-width: 720px; }
.hero h1 { font-size: clamp(1.7rem, 4.2vw, 3rem); text-shadow: 0 4px 24px rgba(0,0,0,.6); margin-bottom: .2em; }
.lede { font-size: clamp(1rem, 1.6vw, 1.2rem); color: #e4e8f3; text-shadow: 0 2px 12px rgba(0,0,0,.6); margin: .2em 0 1.1em; }
.cta { display: flex; gap: .7rem; flex-wrap: wrap; }
.scroll-cue { position: absolute; left: 50%; bottom: 20px; z-index: 2; width: 24px; height: 38px; margin-left: -12px; border: 2px solid rgba(255,255,255,.5); border-radius: 13px; }
.scroll-cue span { position: absolute; left: 50%; top: 6px; width: 4px; height: 7px; margin-left: -2px; border-radius: 2px; background: #fff; animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }
.sec { scroll-margin-top: 92px; padding-top: 1.5rem; }
@media (max-width: 720px) { .hero-copy { padding-bottom: 13vh; } .hero-img { object-position: 50% 50%; } }

/* ---------- buttons & forms ---------- */
.btn, button[type=submit], summary.btn { display: inline-block; background: var(--red); color: #fff; border: 0; border-radius: 999px; padding: .7em 1.5em;
  font: 600 1rem Inter, sans-serif; letter-spacing: .01em; text-decoration: none; cursor: pointer; transition: transform .15s, background .15s; }
.btn:hover, button[type=submit]:hover { background: #ee4f3b; transform: translateY(-1px); color: #fff; }
.btn.ghost { background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.6); }
.btn.ghost:hover { background: rgba(255,255,255,.16); }
.btn.sm { padding: .45em 1em; font-size: .9rem; }
button[type=submit]:disabled { background: #4a5273; cursor: default; transform: none; }
summary.btn { list-style: none; width: max-content; } summary::-webkit-details-marker { display: none; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--white); text-decoration: underline; cursor: pointer; }
.linklike.danger { color: #ff8a7a; }
.inline { display: inline; }
form.join, form.login, form.stack, form.upload { display: grid; gap: .7rem; max-width: 28em; }
form.login.row { grid-template-columns: 1fr auto; max-width: 30em; align-items: center; }
label { display: grid; gap: .3rem; font-weight: 500; font-size: .92rem; color: #cfd6e8; }
input, select, textarea { font: inherit; color: var(--text); padding: .65em .8em; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: rgba(255,255,255,.07); width: 100%; }
input::placeholder { color: #7f89a8; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); border-color: var(--green); }
select option { color: #111; }
.hp { position: absolute; left: -9999px; }
.filepick { background: var(--green); color: #06130a; text-align: center; padding: 1em; border-radius: var(--radius); cursor: pointer; font-weight: 700; display: block; }
.filepick input { display: none; }
#progress { list-style: none; padding: 0; margin: 0; font-size: .9rem; display: grid; gap: .3rem; }
#progress li { display: flex; align-items: center; gap: .5rem; } #progress img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
#progress .ok { color: var(--green); } #progress .bad { color: #ff8a7a; }

/* ---------- rides ---------- */
.rides { display: grid; gap: .8rem; }
.ride { display: flex; gap: 1.1rem; background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius); padding: 1rem 1.1rem; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.ride:hover { border-color: var(--amber); transform: translateY(-2px); color: inherit; }
.ride-date { min-width: 8em; display: flex; flex-direction: column; }
.ride-date .d { font-family: Oswald, sans-serif; font-size: 1.15rem; color: var(--amber); text-transform: uppercase; letter-spacing: .03em; }
.ride-date .t { color: var(--muted); font-size: .9rem; }
.ride h3 { margin: 0 0 .15em; } .ride .loc { margin: 0; color: var(--muted); }
.rides.past .ride { opacity: .65; }
.crumb { font-size: .9rem; } .crumb a { color: var(--muted); }
.facts { display: grid; grid-template-columns: 5em 1fr; gap: .35em 1em; background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.facts dt { font-weight: 600; color: var(--amber); } .facts dd { margin: 0; }
.prose { max-width: 42em; font-size: 1.05rem; } .prose p { margin-bottom: 1em; }
.two { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .two { grid-template-columns: 1.2fr 1fr; } }

/* ---------- album ---------- */
.album { margin-top: 1.5rem; scroll-margin-top: 1rem; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.bar h1, .bar h2 { margin: 0; }
.month { margin-top: 1.4em; }
.mosaic { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 30vw; grid-auto-flow: dense; gap: 4px; margin: 1rem calc(-1 * var(--gutter)) 0; }
@media (min-width: 720px) { .mosaic { grid-template-columns: repeat(5, 1fr); grid-auto-rows: 13vw; gap: 6px; margin: 1rem 0 0; } }
@media (min-width: 1400px) { .mosaic { grid-auto-rows: 180px; } }
.mosaic .ph { display: block; overflow: hidden; background: var(--bg2); border-radius: 4px; }
.mosaic .ph.big { grid-column: span 2; grid-row: span 2; } .mosaic .ph.tall { grid-row: span 2; }
.mosaic .ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.mosaic .ph:hover img { transform: scale(1.05); }
.gate { background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius); padding: 1.3rem; max-width: 34em; margin-top: 1rem; }
#lightbox { position: fixed; inset: 0; background: rgba(5,8,26,.96); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 50; padding: 1rem; }
#lightbox[hidden] { display: none; }
#lightbox img { max-width: 100%; max-height: 84vh; object-fit: contain; border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
#lightbox p { color: #d6dbe8; margin: .6em 0 0; text-align: center; }
#lightbox .close { position: absolute; top: .4rem; right: .9rem; background: none; border: 0; color: #fff; font-size: 2.4rem; cursor: pointer; }

/* ---------- sponsors: white marks stacked on navy ---------- */
.sponsor-list { list-style: none; padding: 0; margin: 0; columns: 2; }
.sponsor-list li { padding: .15em 0; } .sponsor-list a { text-decoration: none; color: #dfe4f1; } .sponsor-list a:hover { color: var(--amber); }
.sponsor-stack { display: flex; flex-direction: column; align-items: center; gap: 2.2rem; padding: 1rem 0 1.5rem; }
.sponsor { display: flex; align-items: center; justify-content: center; text-decoration: none; opacity: .92; transition: opacity .15s, transform .15s; }
.sponsor:hover { opacity: 1; transform: scale(1.04); }
.sponsor img { max-width: min(260px, 70vw); max-height: 84px; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.wordmark { font-family: Oswald, sans-serif; font-weight: 700; text-transform: uppercase; color: #fff; text-align: center; letter-spacing: .08em; font-size: 2rem; line-height: 1; }

/* ---------- photos from @cre_cyclists: Instagram ring ---------- */
.mosaic .ph.ig { position: relative; outline: 3px solid transparent; outline-offset: -3px;
  background: linear-gradient(var(--bg2), var(--bg2)) padding-box, linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7) border-box; border: 3px solid transparent; }
.mosaic .ph.ig::after { content: ""; position: absolute; right: 6px; bottom: 6px; width: 18px; height: 18px; border-radius: 5px; border: 2px solid #fff; box-sizing: border-box;
  background: radial-gradient(circle at 50% 50%, transparent 4px, #fff 4px, #fff 6px, transparent 6px), radial-gradient(circle at 72% 28%, #fff 1.5px, transparent 2px); opacity: .9; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }

/* ---------- manager tables ---------- */
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius); overflow: hidden; font-size: .95rem; }
th, td { text-align: left; padding: .6em .8em; border-bottom: 1px solid var(--panel-line); vertical-align: top; }
th { background: rgba(255,255,255,.06); font-weight: 600; color: #cfd6e8; }
.acts { white-space: nowrap; } .acts > * { margin-right: .6em; }
.mini { height: 28px; background: #fff; padding: 2px; border-radius: 4px; }
details form { margin-top: .5rem; }
.grid.small { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.grid.small .ph img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; display: block; }
@media (max-width: 600px) { table, thead, tbody, tr, td, th { display: block; } th { display: none; } td { border: 0; padding: .2em .8em; } tr { border-bottom: 1px solid var(--panel-line); padding: .5em 0; } .acts { white-space: normal; } }

/* ---- Add + tile, trusted-device prompt ---- */
.mosaic .ph.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; cursor: pointer; text-align: center;
  background: rgba(95,191,109,.08); border: 2px dashed rgba(95,191,109,.6); color: #cfeeD5; user-select: none; transition: background .15s, border-color .15s, transform .15s; }
.mosaic .ph.add:hover, .mosaic .ph.add:focus-visible { background: rgba(95,191,109,.16); border-color: var(--green); outline: none; }
.mosaic .ph.add.over { background: rgba(95,191,109,.28); border-style: solid; transform: scale(1.02); }
.mosaic .ph.add.busy { border-style: solid; border-color: var(--amber); cursor: progress; }
.mosaic .ph.add .plus { font-family: Oswald, sans-serif; font-size: 2.6rem; line-height: 1; color: var(--green); }
.mosaic .ph.add .lbl { font-weight: 600; font-size: .95rem; color: #fff; }
.mosaic .ph.add .hint { font-size: .72rem; color: var(--muted); padding: 0 .6em; }
.mosaic .ph.new { outline: 2px solid var(--green); outline-offset: -2px; }
#pw-modal { position: fixed; inset: 0; z-index: 60; background: rgba(5,8,26,.8); display: flex; align-items: center; justify-content: center; padding: 1rem; }
#pw-modal[hidden] { display: none; }
.pw { background: var(--bg2); border: 1px solid var(--panel-line); border-radius: var(--radius); padding: 1.4rem; width: min(100%, 26em); display: grid; gap: .7rem; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.pw h3 { margin: 0; } .pw p { margin: 0; color: #cfd6e8; }
.pw .row { display: flex; gap: 1rem; align-items: center; }

.sponsors-h { margin-top: 1.8rem; color: var(--amber); letter-spacing: .12em; }

/* ---- living topo lines: a small dot with a short fading tail runs along each ring ---- */
.hero-topo { position: absolute; left: -6%; top: -8%; width: 70%; height: 80%; pointer-events: none; mix-blend-mode: screen;
  animation: topoDrift 46s ease-in-out infinite alternate; transform-origin: 30% 40%; }
.hero-topo .tl { fill: none; stroke: #5fbf6d; stroke-opacity: .07; stroke-width: 1; stroke-linejoin: round; }
.hero-topo .td { fill: none; stroke: #c8ffd2; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 4 996; stroke-dashoffset: 1000;
  animation: topoDot var(--t, 20s) linear infinite; animation-delay: var(--d, 0s); filter: drop-shadow(0 0 3px rgba(140,255,160,.9)); }
.hero-topo .tt { fill: none; stroke: #8ff0a0; stroke-opacity: .45; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 22 978; stroke-dashoffset: 1022;
  animation: topoTail var(--t, 20s) linear infinite; animation-delay: var(--d, 0s); }
@keyframes topoDot { to { stroke-dashoffset: 0; } }
@keyframes topoTail { to { stroke-dashoffset: 22; } }
@keyframes topoDrift { from { transform: translate(0, 0) rotate(0deg) scale(1); } to { transform: translate(-28px, 18px) rotate(-1.5deg) scale(1.04); } }
@media (max-width: 720px) { .hero-topo { width: 110%; height: 55%; top: -4%; left: -10%; } }
@media (prefers-reduced-motion: reduce) { .hero-topo, .hero-topo .td, .hero-topo .tt { animation: none; } .hero-topo .td, .hero-topo .tt { display: none; } .hero-topo .tl { stroke-opacity: .2; } }
