/* ─── Fonts ──────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Rubik';
  font-weight: 700;
  font-style: italic;
  font-display: swap;
  src: url('assets/fonts/Rubik-BoldItalic.woff2') format('woff2'),
       url('assets/fonts/Rubik-BoldItalic.ttf')   format('truetype');
}
@font-face {
  font-family: 'Rubik';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('assets/fonts/Rubik-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Rubik';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('assets/fonts/Rubik-Medium.ttf') format('truetype');
}
@font-face {
  font-family: 'Figtree';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('assets/fonts/Figtree-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Figtree';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('assets/fonts/Figtree-Medium.ttf') format('truetype');
}
@font-face {
  font-family: 'Figtree';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('assets/fonts/Figtree-SemiBold.ttf') format('truetype');
}
@font-face {
  font-family: 'Figtree';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('assets/fonts/Figtree-Bold.ttf') format('truetype');
}

/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-dark:        #262626;
  --bg-darker:      #0D0D0D;
  --text-primary:   #F9F9F9;
  --text-secondary: rgba(249, 249, 249, 0.65);
  --accent:         #C8C8C8;
  --accent-gradient: linear-gradient(135deg, #F0F0F0 0%, #909090 100%);
  --btn-dark-bg:    #0D0D0D;
  --btn-light-bg:   #F9F9F9;
  --btn-light-text: #262626;
  --btn-border:     rgba(140, 140, 140, 0.3);
  --shadow:         rgba(0, 0, 0, 0.35);
}

html, body {
  height: 100%;
  font-family: 'Figtree', system-ui, sans-serif;
  color: var(--text-primary);
  background: var(--bg-darker);
  overflow-x: hidden;
}

/* ─── Map — fullscreen, camera center offset via MapBox padding ──────────── */
#map {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ─── Overlay ────────────────────────────────────────────────────────────── */
#overlay {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  /* Dark left edge fades quickly so globe remains visible */
  background: linear-gradient(
    to right,
    rgba(13, 13, 13, 0.88) 0%,
    rgba(13, 13, 13, 0.72) 30%,
    rgba(13, 13, 13, 0.25) 50%,
    rgba(13, 13, 13, 0.0)  65%
  );
}

/* Only interactive elements receive pointer events */
.store-badge,
#site-footer a,
.header-inner {
  pointer-events: auto;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
#site-header {
  padding: 28px 36px;
}

.header-inner {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.header-logo {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 4px 16px var(--shadow);
}

.header-brand {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: 40px;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

/* ─── Hero — sits in first-third column, content left-aligned ───────────── */
#hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* horizontal padding centers the content block within the 33vw column */
  padding: 48px 40px;
  width: 33vw;
  max-width: 33vw;
}

.hero-headline {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(52px, 8vw, 96px);
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.hero-sub {
  font-family: 'Figtree', sans-serif;
  font-weight: 400;
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ─── Store Badges ───────────────────────────────────────────────────────── */
.download-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.store-badge {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

#playstore-btn .badge-img {
  height: 98px;
}

.store-badge:hover {
  transform: translateY(-2px);
  opacity: 0.88;
}

.badge-img {
  height: 66px;
  width: auto;
  display: block;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
#site-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 36px 32px;
  font-size: 12px;
  color: var(--text-secondary);
}

#site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}
#site-footer a:hover { color: var(--text-primary); }

.footer-sep { opacity: 0.4; }

/* ─── Gym Markers (DOM, zoom ≥ 10) ──────────────────────────────────────── */
.gym-marker {
  border-radius: 9%;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid rgba(200, 200, 200, 0.6);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: var(--bg-dark);
}

.gym-marker:hover {
  transform: scale(1.18);
  box-shadow: 0 4px 18px rgba(180, 180, 180, 0.25);
}

.gym-marker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ─── Mapbox GL Cluster Canvas ───────────────────────────────────────────── */
.mapboxgl-canvas { cursor: grab; }
.mapboxgl-canvas:active { cursor: grabbing; }

/* ─── MapBox Popup ───────────────────────────────────────────────────────── */
.mapboxgl-popup-content {
  background: var(--bg-dark) !important;
  color: var(--text-primary);
  font-family: 'Figtree', sans-serif;
  border-radius: 2px;
  padding: 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  min-width: 200px;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

.mapboxgl-popup-tip {
  display: none;
}

.popup-inner {
  padding: 16px 20px;
}

.popup-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.popup-address {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.4;
}

.popup-streak {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: 20px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.popup-streak-label {
  font-family: 'Figtree', sans-serif;
  font-weight: 500;
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.mapboxgl-popup-close-button {
  display: none;
}

/* ─── MapBox attribution — full opacity ─────────────────────────────────── */
.mapboxgl-ctrl-attrib {
  font-size: 11px;
}

/* ─── Gym Operator CTA — fixed bottom right ─────────────────────────────── */
.gym-operator-btn {
  position: fixed;
  bottom: 38px;
  right: 58px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(13, 13, 13, 0.92);
  border: 1px solid rgba(200, 200, 200, 0.3);
  color: var(--text-primary);
  font-family: 'Figtree', sans-serif;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(8px);
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
  transition: border-color 0.2s ease, background 0.2s ease;
  pointer-events: auto;
}

.gym-operator-btn:hover {
  border-color: rgba(200, 200, 200, 0.7);
  background: rgba(26, 26, 26, 0.97);
}

.gym-operator-label {
  color: var(--text-primary);
}

.gym-operator-arrow {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 15px;
  transition: transform 0.2s ease;
}

.gym-operator-btn:hover .gym-operator-arrow {
  transform: translateX(3px);
}

/* ─── Desktop footer (now outside overlay) ───────────────────────────────── */
@media (min-width: 601px) {
  /* Footer sits visually at the bottom of the viewport via absolute positioning
     relative to the overlay's full-height column */
  #site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 15;
    pointer-events: auto;
  }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  body {
    display: flex;
    flex-direction: column;
  }

  #overlay {
    order: 1;
    /* No min-height: hero can be shorter so the globe is teased below */
    min-height: auto;
    background: var(--bg-darker);
    pointer-events: auto;
    padding-bottom: 40px;
  }

  /* Globe section */
  #map {
    position: relative;
    order: 2;
    height: 70dvh;
    flex-shrink: 0;
  }

  /* Footer below the globe */
  #site-footer {
    order: 3;
    flex-wrap: wrap;
    padding: 20px 24px 28px;
  }

  #hero {
    width: 100%;
    max-width: 100%;
    padding: 24px 24px 32px;
  }

  .header-logo { width: 52px; height: 52px; }
  .header-brand { font-size: 26px; }

  .download-buttons { flex-direction: column; }

  .gym-operator-btn {
    bottom: 20px;
    right: 20px;
  }
}
