/* ══════════════════════════════════════════
   AGORA RUNS
   #8b1f1f · #fdfdfd · Titillium Web
   ══════════════════════════════════════════ */

:root {
  --red:     #8b1f1f;
  --white:   #fdfdfd;
  --surface: #f4f1ef;
  --dark:    #141414;
  --mid:     #1e1e1e;
  --gray:    #888;
  --muted:   #bbb;
  --border:  rgba(0,0,0,.08);
  --max-w:   1100px;
  --nav-h:   64px;
}

/* ── Reset ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Titillium Web', sans-serif;
  background: var(--white);
  color: var(--dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ── Layout ──────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 100px 40px;
}

/* ── Label ───────────────────────────────── */
.label {
  display: block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}
.label.light { color: rgba(253,253,253,.4); }

/* ── Headings ────────────────────────────── */
h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  margin-bottom: 40px;
  color: var(--dark);
}
h2.light { color: var(--white); }

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-block;
  font-family: 'Titillium Web', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 13px 32px;
  border: 1px solid transparent;
  transition: background .22s, border-color .22s, color .22s;
  cursor: pointer;
}
.btn-red {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-red:hover { background: #711a1a; border-color: #711a1a; }

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(253,253,253,.4);
}
.btn-outline:hover { border-color: var(--white); }

.btn-outline-dark {
  background: transparent;
  color: var(--dark);
  border-color: rgba(0,0,0,.2);
}
.btn-outline-dark:hover { border-color: var(--dark); }

/* ── Reveal animations ───────────────────── */
.reveal-up, .reveal-left, .reveal-right, .reveal-fade {
  opacity: 0;
  transition: opacity .65s ease, transform .65s ease;
}
.reveal-up    { transform: translateY(28px); }
.reveal-left  { transform: translateX(-28px); }
.reveal-right { transform: translateX(28px); }
.reveal-fade  { transform: scale(.97); }
.revealed     { opacity: 1 !important; transform: none !important; }

/* ══════════════════════════════════════════
   NAV
   ══════════════════════════════════════════ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .35s, border-color .35s, backdrop-filter .35s;
}
#navbar.scrolled {
  background: rgba(15,15,15,.92);
  backdrop-filter: blur(10px);
  border-bottom-color: rgba(255,255,255,.05);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.nav-brand img {
  width: 30px;
  height: 30px;
  filter: brightness(0) invert(1);
}
.nav-brand span {
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--white);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-links a {
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(253,253,253,.55);
  transition: color .2s;
}
.nav-links a:hover { color: var(--white); }
.nav-cta {
  color: var(--white) !important;
  border: 1px solid rgba(139,31,31,.5);
  padding: 7px 18px;
}
.nav-cta:hover { background: var(--red); border-color: var(--red); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--white);
  transition: transform .3s, opacity .3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-mobile {
  display: none;
  flex-direction: column;
  background: rgba(15,15,15,.97);
  padding: 16px 40px 24px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(253,253,253,.55);
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: color .2s;
}
.nav-mobile a:last-child { color: var(--red); border-bottom: none; }
.nav-mobile a:hover { color: var(--white); }

/* ══════════════════════════════════════════
   HERO
   ══════════════════════════════════════════ */
#hero {
  position: relative;
  min-height: 100vh;
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('picture1.jpg');
  background-size: cover;
  background-position: center;
  opacity: .35;
  transform: scale(1.04);
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(20,20,20,.2) 0%, rgba(20,20,20,.7) 100%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 80px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.hero-logo {
  width: 150px;
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
#hero h1 {
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 700;
  color: var(--white);
  letter-spacing: .04em;
  line-height: 1;
}
.hero-sub {
  font-size: .95rem;
  font-weight: 300;
  color: rgba(253,253,253,.4);
  letter-spacing: .06em;
}
#hero .btn { margin-top: 8px; }

/* ══════════════════════════════════════════
   ABOUT
   ══════════════════════════════════════════ */
#about { background: var(--white); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}
.about-text h2 { margin-bottom: 16px; }
.about-text p {
  font-size: .97rem;
  font-weight: 300;
  color: #555;
  line-height: 1.85;
  margin-bottom: 40px;
}
.about-stats {
  display: flex;
  gap: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.astat-num {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
  margin-bottom: 6px;
}
.astat-plus { font-size: 1.3rem; font-weight: 700; }
.astat-label {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gray);
}
.about-photo img {
  width: 100%;
  height: 460px;
  object-fit: cover;
}

/* ══════════════════════════════════════════
   RUNS
   ══════════════════════════════════════════ */
#runs { background: var(--mid); }
.runs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.06);
  margin-top: 16px;
}
.run-item {
  padding: 44px 36px;
  background: var(--mid);
  transition: background .25s;
}
.run-item:hover { background: #222; }
.run-num {
  display: block;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .2em;
  color: var(--red);
  opacity: .55;
  margin-bottom: 16px;
  transition: opacity .25s;
}
.run-item:hover .run-num { opacity: .9; }
.run-item h3 {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(253,253,253,.8);
  margin-bottom: 12px;
}
.run-item p {
  font-size: .88rem;
  font-weight: 300;
  color: rgba(253,253,253,.4);
  line-height: 1.75;
  margin-bottom: 24px;
}
.run-when {
  font-size: .63rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(253,253,253,.22);
}

/* ══════════════════════════════════════════
   RACES
   ══════════════════════════════════════════ */
#races { background: var(--white); }
.races-list { display: flex; flex-direction: column; }
.race-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.race-row:first-child { border-top: 1px solid var(--border); }
.race-year {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .15em;
  color: var(--red);
}
.race-info strong {
  display: block;
  font-size: .93rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.race-info p {
  font-size: .83rem;
  font-weight: 300;
  color: var(--gray);
  line-height: 1.5;
}
.race-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.race-tags span {
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  border: 1px solid rgba(139,31,31,.22);
  padding: 4px 10px;
}

/* ══════════════════════════════════════════
   RECENT RUNS (Strava)
   ══════════════════════════════════════════ */
#recent-runs { background: var(--surface); }
.strava-runs { display: flex; flex-direction: column; }
.run-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.run-entry:first-child { border-top: 1px solid var(--border); }
.run-entry-left strong {
  display: block;
  font-size: .92rem;
  font-weight: 600;
  margin-bottom: 3px;
}
.run-entry-left span {
  font-size: .8rem;
  font-weight: 300;
  color: var(--gray);
}
.run-entry-right {
  display: flex;
  gap: 32px;
  text-align: right;
  flex-shrink: 0;
}
.run-stat { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.run-stat strong {
  font-size: .92rem;
  font-weight: 700;
  color: var(--red);
}
.run-stat span {
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.runs-loading {
  display: flex;
  gap: 8px;
  padding: 48px 0;
  justify-content: center;
}
.loading-dot {
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: 50%;
  opacity: .2;
  animation: blink 1.2s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: .2s; }
.loading-dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100% { opacity: .2; } 50% { opacity: 1; } }
.runs-error {
  padding: 40px 0;
  color: var(--gray);
  font-size: .88rem;
}
.runs-error a { color: var(--red); text-decoration: underline; }
.strava-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
}
.strava-note { font-size: .7rem; color: var(--muted); }
.strava-note a { color: var(--red); }

/* ══════════════════════════════════════════
   COMMUNITY
   ══════════════════════════════════════════ */
#community { background: var(--white); }
.gallery {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
}
.gal-main { position: relative; overflow: hidden; }
.gal-side { display: flex; flex-direction: column; gap: 10px; }
.gal-item { position: relative; overflow: hidden; }
.gal-main img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  transition: transform .5s ease;
}
.gal-item img {
  width: 100%;
  height: 100%;
  min-height: 235px;
  object-fit: cover;
  transition: transform .5s ease;
}
.gal-main:hover img, .gal-item:hover img { transform: scale(1.03); }
.gal-cap {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 14px 18px;
  background: linear-gradient(transparent, rgba(0,0,0,.5));
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.75);
}
.gal-empty {
  background: var(--surface);
  min-height: 235px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gal-empty span {
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ══════════════════════════════════════════
   MERCH
   ══════════════════════════════════════════ */
#merch { background: var(--white); }
.merch-wrap {
  position: relative;
  user-select: none;
}
.merch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  filter: blur(6px);
  opacity: .45;
  pointer-events: none;
}
.merch-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.merch-img {
  background: var(--surface);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.merch-img img {
  width: 100%;
  filter: saturate(0);
  opacity: .4;
}
.merch-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--dark);
}
.merch-price {
  font-size: .8rem;
  font-weight: 300;
  color: var(--gray);
}
.merch-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.merch-soon {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--dark);
  border: 1px solid rgba(0,0,0,.15);
  padding: 12px 32px;
  background: rgba(253,253,253,.85);
  backdrop-filter: blur(4px);
}

/* ══════════════════════════════════════════
   JOIN
   ══════════════════════════════════════════ */
#join {
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.join-inner {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
  padding: 100px 40px;
}
#join h2 { margin-bottom: 14px; }
#join p {
  font-size: .97rem;
  font-weight: 300;
  color: var(--gray);
  margin-bottom: 40px;
  line-height: 1.75;
}
.join-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
footer { background: var(--dark); }
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 52px 40px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.footer-left { display: flex; align-items: center; gap: 14px; }
.footer-logo {
  width: 28px;
  filter: brightness(0) invert(1);
  opacity: .5;
}
.footer-left p {
  font-size: .75rem;
  color: rgba(253,253,253,.28);
  letter-spacing: .05em;
}
.footer-right { display: flex; gap: 28px; }
.footer-right a {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(253,253,253,.32);
  transition: color .2s;
}
.footer-right a:hover { color: var(--white); }
.footer-base {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 40px;
}
.footer-base p {
  font-size: .68rem;
  color: rgba(253,253,253,.14);
  letter-spacing: .07em;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-photo { order: -1; }
  .about-photo img { height: 300px; }

  .runs-grid { grid-template-columns: 1fr; }

  .race-row { grid-template-columns: 60px 1fr; }
  .race-tags { display: none; }

  .run-entry-right { gap: 20px; }

  .gallery { grid-template-columns: 1fr; }
  .gal-main img { height: 300px; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 24px; }
}

@media (max-width: 540px) {
  .container, .join-inner { padding: 70px 24px; }
  .nav-inner { padding: 0 24px; }
  .hero-logo { width: 120px; }
  .about-stats { gap: 24px; }
  .run-entry-right { display: none; }
}
