/* ============================================================
   Sunset Run Club
   Palette runs dusk -> coral -> gold, with SF fog as the cool
   counterweight and warm sand as the page ground.
   ============================================================ */

:root {
  --dusk-900: #1c1129;
  --dusk-800: #2b1a3d;
  --plum-700: #3a2340;
  --plum-500: #7a5a86;
  --rose-500: #a9587f;

  --coral-500: #ff6b4a;
  --coral-600: #e8532f;
  --gold-400: #ffb648;
  --gold-300: #ffd27a;
  --gold-100: #ffe9b8;

  --cream-50: #fdf7ee;
  --sand-100: #f8eddf;
  --sand-200: #eeddc7;
  --sand-300: #ddc6a8;

  --fog-200: #dfe7eb;
  --fog-400: #9fb3bd;

  --ink-900: #2a2130;
  --ink-700: #4a3f52;
  --ink-500: #6b6072;

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 1180px;
  --radius: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-900);
  background: var(--cream-50);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 120;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 0;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--dusk-900); color: var(--cream-50);
  padding: 0.75rem 1.25rem; border-radius: 0 0 var(--radius) 0;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2.5px solid var(--coral-500);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  font-family: var(--body);
  font-weight: 600; font-size: 0.97rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--coral-500), var(--coral-600));
  color: #fff;
  box-shadow: 0 6px 20px -6px rgba(232, 83, 47, 0.7);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -8px rgba(232, 83, 47, 0.85); }

.btn-ghost {
  background: rgba(253, 247, 238, 0.09);
  color: var(--cream-50);
  border: 1.5px solid rgba(253, 247, 238, 0.45);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(253, 247, 238, 0.2); transform: translateY(-2px); }

.btn-small { padding: 0.55rem 1.2rem; font-size: 0.88rem; }
.btn-large { padding: 1.05rem 2.4rem; font-size: 1.05rem; }

.text-link {
  display: inline-block;
  font-weight: 600;
  color: var(--coral-600);
  text-decoration: none;
  border-bottom: 1.5px solid rgba(232, 83, 47, 0.35);
  padding-bottom: 1px;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.text-link:hover { border-color: var(--coral-600); }

/* ---------------- nav ---------------- */

nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1.1rem, 4vw, 2.5rem);
  padding-top: calc(1rem + env(safe-area-inset-top, 0px));
  transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

nav.scrolled {
  background: rgba(28, 17, 41, 0.82);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 0 rgba(253, 247, 238, 0.1);
  padding-top: calc(0.7rem + env(safe-area-inset-top, 0px));
  padding-bottom: 0.7rem;
}

.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--cream-50); text-decoration: none;
  font-family: var(--display);
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 24;
  font-weight: 600; font-size: 1.12rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-mark { width: 26px; height: 26px; flex-shrink: 0; filter: drop-shadow(0 0 9px rgba(255, 182, 72, 0.6)); }

.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a:not(.btn) {
  color: rgba(253, 247, 238, 0.85);
  text-decoration: none; font-size: 0.93rem; font-weight: 500;
  transition: color 0.18s ease;
}
.nav-links a:not(.btn):hover { color: var(--gold-300); }

/* ---------------- hero ---------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden;
  isolation: isolate;
}

.hero-scene { position: absolute; inset: 0; z-index: -1; }

.sky {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    #160d24 0%,
    #2b1a3d 18%,
    #5d2a56 34%,
    #a9426b 50%,
    #e35c4a 64%,
    #ff8348 74%,
    #ffb648 84%,
    #ffd98a 94%,
    #ffe9b8 100%
  );
}

.stars { position: absolute; top: 0; left: 0; width: 100%; height: 42%; opacity: 0.75; }
.star-field circle { fill: #fff6e0; }

.sun-glow {
  position: absolute;
  left: 50%; bottom: 26%;
  width: min(140vw, 1500px); aspect-ratio: 1;
  transform: translate(-50%, 50%);
  background: radial-gradient(
    circle,
    rgba(255, 226, 150, 0.55) 0%,
    rgba(255, 170, 90, 0.32) 28%,
    rgba(255, 120, 80, 0.14) 48%,
    rgba(255, 110, 80, 0) 68%
  );
}

.sun {
  position: absolute;
  left: 50%; bottom: 26%;
  width: clamp(130px, 22vw, 260px); aspect-ratio: 1;
  transform: translate(-50%, 50%);
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #fff6df 0%, #ffe193 38%, #ffb648 72%, #ff8a4c 100%);
  box-shadow: 0 0 90px 30px rgba(255, 190, 110, 0.45);
}

/* SF fog: slow horizontal drift across the sun line */
.fog-band {
  position: absolute; left: -30%;
  width: 160%; border-radius: 50%;
  background: linear-gradient(90deg,
    rgba(223, 231, 235, 0) 0%,
    rgba(223, 231, 235, 0.38) 22%,
    rgba(240, 240, 238, 0.52) 50%,
    rgba(223, 231, 235, 0.34) 76%,
    rgba(223, 231, 235, 0) 100%);
  filter: blur(26px);
  will-change: transform;
}
.fog-1 { bottom: 30%; height: clamp(46px, 7vw, 92px); opacity: 0.55; animation: drift-right 48s linear infinite; }
.fog-2 { bottom: 20%; height: clamp(60px, 9vw, 120px); opacity: 0.42; animation: drift-left 66s linear infinite; }

@keyframes drift-right {
  from { transform: translateX(-12%); }
  to   { transform: translateX(12%); }
}
@keyframes drift-left {
  from { transform: translateX(10%); }
  to   { transform: translateX(-10%); }
}

.dune-layer {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%;
  display: block;
  will-change: transform;
}
.dune-back  { height: 46%; opacity: 0.55; }
.dune-mid   { height: 36%; opacity: 0.72; }
.dune-front { height: 26%; }

/* film grain so the gradients don't read as flat vector mush */
.grain {
  position: absolute; inset: 0;
  opacity: 0.15; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2.5rem) clamp(4.5rem, 11vh, 8rem);
}

.eyebrow {
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold-300);
  margin: 0 0 1.1rem;
}

.hero h1 {
  font-size: clamp(3.4rem, 13vw, 9rem);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 144;
  font-weight: 600;
  color: #fff8ec;
  letter-spacing: -0.035em;
  line-height: 0.88;
  text-shadow: 0 4px 40px rgba(60, 20, 40, 0.4);
}

.tagline {
  font-family: var(--display);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 36;
  font-size: clamp(1.15rem, 3.1vw, 1.75rem);
  font-weight: 400;
  font-style: italic;
  color: var(--gold-100);
  margin: 1.1rem 0 2rem;
  max-width: 22ch;
  line-height: 1.25;
}

/* trail marker: the at-a-glance strip, styled like a wooden trail sign */
.trail-marker {
  display: inline-flex; flex-wrap: wrap; align-items: center;
  gap: clamp(1rem, 4vw, 2.4rem);
  padding: 1rem 1.6rem;
  background: rgba(28, 17, 41, 0.34);
  border: 1px solid rgba(255, 233, 184, 0.28);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  margin-bottom: 2rem;
}
.trail-item { display: flex; flex-direction: column; gap: 0.15rem; }
.trail-label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold-300);
}
.trail-value { font-size: 1.02rem; font-weight: 600; color: #fff8ec; }
.trail-div { width: 1px; align-self: stretch; background: rgba(255, 233, 184, 0.3); }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.85rem; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 1.6rem;
  transform: translateX(-50%);
  width: 34px; height: 34px;
  color: rgba(255, 248, 236, 0.6);
  animation: bob 2.6s ease-in-out infinite;
}
.scroll-cue svg { width: 100%; height: 100%; }
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 7px); }
}

/* ---------------- shared section furniture ---------------- */

.section {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3.25rem, 6.5vw, 5rem) clamp(1.25rem, 5vw, 2.5rem);
}

.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }

.kicker {
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--coral-600);
  margin: 0 0 0.9rem;
  display: flex; align-items: center; gap: 0.7rem;
}
.kicker::after {
  content: ""; flex: 1; height: 1px; max-width: 5rem;
  background: linear-gradient(90deg, var(--sand-300), transparent);
}
.kicker-light { color: var(--gold-300); }
.kicker-light::after { background: linear-gradient(90deg, rgba(255, 210, 122, 0.5), transparent); }

.section h2 {
  font-size: clamp(2rem, 5.2vw, 3.3rem);
  color: var(--ink-900);
  text-wrap: balance;
}

.lede { font-size: 1.12rem; color: var(--ink-700); max-width: 44ch; }
.lede-light { color: rgba(253, 247, 238, 0.82); }

/* Reveal on scroll. Gated on .js so the page still renders if the
   script never runs — otherwise every section sits at opacity 0. */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------------- essentials ---------------- */

.essentials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.essential-card {
  position: relative;
  padding: 2rem 1.75rem 1.9rem;
  background: linear-gradient(170deg, var(--sand-100), var(--cream-50));
  border: 1px solid var(--sand-200);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.essential-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold-400), var(--coral-500));
}
.essential-card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px -22px rgba(58, 35, 64, 0.5); }

.essential-icon { width: 38px; height: 38px; color: var(--coral-600); margin-bottom: 1rem; display: block; }
.essential-card h3, .transit-card h3 {
  font-size: 1.32rem; margin-bottom: 0.5rem;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 32;
}
.essential-card p, .transit-card p { color: var(--ink-700); font-size: 0.98rem; margin: 0; }

/* ---------------- why ---------------- */

.why {
  position: relative;
}
.why-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
}
.why-copy p:not(.kicker):not(.lede) { color: var(--ink-700); }
.why-copy h2 { margin-bottom: 1.2rem; }
.why-copy .lede { margin-bottom: 1.1rem; max-width: none; }

.why-stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem;
  padding: 2.4rem 2rem;
  background: var(--dusk-900);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.why-stat::after {
  content: ""; position: absolute; right: -40%; top: -55%;
  width: 115%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 182, 72, 0.3), transparent 62%);
}
.stat-number {
  font-family: var(--display);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 144;
  font-size: clamp(4.5rem, 12vw, 7rem);
  line-height: 0.85;
  color: var(--gold-400);
  position: relative;
}
.stat-label {
  font-size: 0.97rem; line-height: 1.5;
  color: rgba(253, 247, 238, 0.78);
  max-width: 24ch;
  position: relative;
}

/* ---------------- upcoming runs ---------------- */

.run-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  background: linear-gradient(150deg, var(--sand-100), var(--cream-50) 70%);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius);
}

.run-card-date {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.25rem 1.5rem;
  background: var(--dusk-900);
  border-radius: 12px;
  color: var(--cream-50);
  min-width: 108px;
}
.run-month { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.18em; color: var(--gold-400); }
.run-day {
  font-family: var(--display);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 96;
  font-size: 3.4rem; line-height: 1; margin: 0.15rem 0;
}
.run-year { font-size: 0.82rem; letter-spacing: 0.14em; color: rgba(253, 247, 238, 0.65); }

.run-card-body h3 { font-size: 1.5rem; margin-bottom: 0.6rem; }
.run-card-body p { color: var(--ink-700); }

/* ---------------- coffee strip ---------------- */

.coffee-strip {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(0.9rem, 2.5vw, 1.5rem);
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(1.5rem, 3.5vw, 2.25rem) clamp(1.25rem, 5vw, 2.5rem);
  border-top: 1px solid var(--sand-200);
  border-bottom: 1px solid var(--sand-200);
  text-align: left;
}
.coffee-icon { width: clamp(30px, 5vw, 38px); height: auto; color: var(--coral-600); flex-shrink: 0; }
.coffee-strip p {
  font-family: var(--display);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 48;
  font-size: clamp(1.1rem, 2.9vw, 1.65rem);
  font-style: italic;
  color: var(--ink-900);
  margin: 0;
  text-wrap: balance;
}

/* ---------------- dune dividers into dark bands ---------------- */

/* The cream above spills into the dark band as a dune ridge. */
.band-dune {
  position: absolute; top: -1px; left: 0;
  width: 100%; height: clamp(38px, 5.5vw, 78px);
  display: block;
  pointer-events: none;
}
.band-dune path { fill: var(--cream-50); }

/* ---------------- join (full-bleed dusk band) ---------------- */

.join-section {
  max-width: none;
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
  background: linear-gradient(160deg, var(--dusk-800), var(--dusk-900) 55%, #180f24);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.join-section::before {
  content: ""; position: absolute; left: 50%; top: -30%;
  width: min(120vw, 1100px); aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 140, 80, 0.22), transparent 60%);
}
.join-inner { position: relative; max-width: 40rem; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.join-section .kicker { justify-content: center; }
.join-section .kicker::after { display: none; }
.join-section h2 { color: #fff8ec; margin-bottom: 1rem; }
.join-section .lede { margin-bottom: 2.2rem; }

/* ---------------- organizers ---------------- */

.organizer-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
  max-width: 44rem;
}
.organizer-card {
  padding: 2rem 1.75rem;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius);
  background: var(--cream-50);
}
.organizer-avatar { width: 58px; height: 58px; margin-bottom: 1.1rem; }
.organizer-avatar svg { width: 100%; height: 100%; }
.organizer-card h3 { font-size: 1.35rem; }
.organizer-role {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--coral-600);
  margin: 0.25rem 0 0.7rem;
}
.organizer-card p:last-child { color: var(--ink-700); font-size: 0.97rem; margin: 0; }

.organizer-open { border-style: dashed; background: transparent; }
.organizer-open .organizer-role { color: var(--ink-500); }
.organizer-avatar-open {
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--sand-300); border-radius: 50%;
  color: var(--ink-500);
}
.organizer-avatar-open svg { width: 26px; height: 26px; }

/* ---------------- getting there ---------------- */

.transit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
}
.transit-card {
  padding: 1.75rem 1.6rem;
  border-left: 3px solid var(--gold-400);
  background: linear-gradient(100deg, var(--sand-100), transparent 85%);
  border-radius: 0 var(--radius) var(--radius) 0;
}

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

footer {
  position: relative;
  overflow: hidden;
  background: var(--dusk-900);
  color: rgba(253, 247, 238, 0.72);
  text-align: center;
  padding: clamp(4rem, 8vw, 5.5rem) 1.5rem clamp(3rem, 7vw, 4.5rem);
  padding-bottom: calc(clamp(3rem, 7vw, 4.5rem) + env(safe-area-inset-bottom, 0px));
}
.footer-mark { width: 34px; height: 34px; filter: drop-shadow(0 0 14px rgba(255, 182, 72, 0.55)); }
.footer-name {
  font-family: var(--display);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 48;
  font-size: 1.5rem; color: #fff8ec;
  margin: 0.6rem 0 0.35rem;
}
.footer-fine { font-size: 0.9rem; margin: 0; }

/* ---------------- responsive ---------------- */

@media (max-width: 880px) {
  .why-grid { grid-template-columns: 1fr; }
  .why-stat { flex-direction: row; align-items: center; gap: 1.5rem; padding: 1.75rem; }
  .stat-number { font-size: 4.5rem; }
}

@media (max-width: 940px) {
  .nav-links a:not(.btn) { display: none; }
}

@media (max-width: 720px) {
  .hero h1 { letter-spacing: -0.03em; }
  .trail-marker {
    width: 100%;
    flex-direction: column; align-items: stretch;
    gap: 0.75rem;
    padding: 1rem 1.2rem;
  }
  .trail-div { display: block; width: auto; height: 1px; align-self: stretch; }
  /* On a phone the content column covers the horizon, so the sun moves
     into the open pocket of sky beside the headline. */
  .sun, .sun-glow { left: 78%; bottom: 43%; }
  .sun { width: clamp(96px, 30vw, 150px); }
  .cta-row .btn { flex: 1 1 auto; }
  .run-card { grid-template-columns: 1fr; text-align: left; }
  .run-card-date { flex-direction: row; align-items: baseline; gap: 0.6rem; width: fit-content; padding: 0.7rem 1.1rem; }
  .run-day { font-size: 2.2rem; margin: 0; }
  .scroll-cue { display: none; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .essential-card, .organizer-card { padding: 1.6rem 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
