/* =============================================
   ALMOST FRIDAY RUN CLUB — styles.css
   ============================================= */

:root {
  --bg-color: #080505;
  --text-color: #ffffff;
  --text-muted: #a3a3a3;
  --accent-orange: #ff5e00;
  --accent-gold: #ffaa00;
  --accent-amber: #ffcc00;
  --border-dim: rgba(255, 255, 255, 0.15);
  --border-bright: rgba(255, 255, 255, 0.4);

  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'Space Mono', monospace;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-display);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* =============================================
   NOISE OVERLAY
   ============================================= */

.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.12;
  filter: contrast(150%) brightness(100%);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* =============================================
   THERMAL BACKGROUND
   ============================================= */

.thermal-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: var(--bg-color);
  overflow: hidden;
}

.blob {
  position: absolute;
  filter: blur(80px);
  opacity: 0.6;
  animation: float 20s infinite ease-in-out;
  mix-blend-mode: screen;
}

.blob-1 {
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, var(--accent-orange), transparent 70%);
  top: -20%;
  left: -10%;
  animation-delay: 0s;
  opacity: 0;
}

.blob-2 {
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--accent-gold), transparent 70%);
  bottom: -10%;
  right: -10%;
  animation-delay: -5s;
  opacity: 0;
}

.blob-3 {
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, var(--accent-amber), transparent 70%);
  top: 40%;
  left: 30%;
  animation-delay: -10s;
  opacity: 0;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -50px) scale(1.1); }
  66%       { transform: translate(-20px, 20px) scale(0.9); }
}

.hero-photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: url('https://0i2ndwwibnmoagwh.public.blob.vercel-storage.com/nycm23_cs_225.png') center center / cover no-repeat;
  opacity: 1;
}

.hero-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(
    to bottom,
    rgba(8, 5, 5, 0.05) 0%,
    rgba(8, 5, 5, 0.25) 45%,
    rgba(8, 5, 5, 0.82) 68%,
    rgba(8, 5, 5, 1) 82%
  );
}

/* Scroll-driven darkening overlay — opacity set via JS */
.scroll-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  opacity: 0;
  pointer-events: none;
}

/* =============================================
   LAYOUT
   ============================================= */

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* =============================================
   HEADER
   ============================================= */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
  position: relative;
  z-index: 100;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text-color);
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-img {
  height: 140px;
  width: auto;
  filter: brightness(0) invert(1) drop-shadow(0 2px 10px rgba(0,0,0,0.7));
}

/* =============================================
   HERO
   ============================================= */

.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding: var(--space-xl) 0 var(--space-lg);
  gap: var(--space-lg);
}

.hero-content h1 {
  font-size: 4.8rem;
  line-height: 0.92;
  font-weight: 700;
  margin-bottom: var(--space-md);
  letter-spacing: -0.04em;
  max-width: 800px;
}

.hero-content p {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  max-width: 400px;
  line-height: 1.6;
}

.cta-btn {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--text-color);
  color: var(--bg-color);
  font-family: var(--font-mono);
  font-weight: 700;
  text-decoration: none;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: transform 0.2s, background 0.2s;
}

.cta-btn:hover {
  transform: translateY(-2px);
  background: var(--accent-amber);
}

/* =============================================
   CITIES SECTION
   ============================================= */

.cities-section {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border-dim);
}

.section-header {
  margin-bottom: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-header h2 {
  font-size: 3rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.section-header .sub {
  font-family: var(--font-mono);
  color: var(--accent-gold);
}

/* =============================================
   CITY CARDS GRID
   ============================================= */

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-dim);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 400px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--accent-orange);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-5px);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-gold));
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover::before {
  opacity: 1;
}

.city-name {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.run-details {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  line-height: 1.6;
  border-top: 1px solid var(--border-dim);
  padding-top: var(--space-sm);
}

.detail-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.detail-label {
  color: var(--text-color);
  opacity: 0.5;
}

.meet-link {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.meet-link:hover {
  color: var(--text-color);
}

.meet-with-time {
  display: flex;
  align-items: center;
  gap: 0.4em;
  flex-wrap: nowrap;
}

.meet-time {
  opacity: 0.5;
  font-size: 0.8em;
  white-space: nowrap;
}

/* =============================================
   CARD ACTIONS
   ============================================= */

.actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.btn-group {
  display: flex;
  gap: 10px;
}

.icon-btn {
  flex: 1;
  height: 40px;
  border: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--text-color);
  color: var(--bg-color);
}

.dm-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
  color: var(--text-muted);
}

.faq-link {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: underline;
  margin-top: 0.5rem;
}

.faq-link:hover {
  color: var(--text-color);
}

/* =============================================
   MODAL
   ============================================= */

.merch-btn {
  background: none;
  border: none;
  cursor: pointer;
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 5, 5, 0.85);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: #111;
  border: 1px solid var(--border-bright);
  padding: 2.5rem;
  max-width: 440px;
  width: calc(100% - 2.5rem);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-color);
}

.modal-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-gold);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.modal-body {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  color: var(--text-color);
}

/* =============================================
   FOOTER
   ============================================= */

footer {
  padding: var(--space-lg) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-dim);
}

.footer-link {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--text-color);
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: left;
    gap: var(--space-md);
  }
  .hero-content p {
    margin: 0 auto var(--space-md);
  }
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 1.25rem;
  }
  .hero {
    min-height: 100svh;
    padding: var(--space-lg) 0 var(--space-md);
    align-items: start;
  }
  .hero-content h1 {
    font-size: 2.4rem;
    line-height: 0.95;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: var(--space-md);
  }
  .section-header h2 {
    font-size: 2rem;
  }
  .cities-section {
    padding: var(--space-lg) 0;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .hero-photo {
    height: 100svh;
  }
  footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: var(--space-md) 0;
  }
}

@media (max-width: 390px) {
  .hero-content h1 {
    font-size: 2rem;
  }
  .card {
    padding: 1.25rem;
    min-height: unset;
  }
}
