/* ================================================================
   THE BUGS — EPK STYLES
   Single-scroll EPK site for The Bugs (Toronto electroclash duo)
   Accent: hazard yellow #D4E642 / Body: IBM Plex Mono
   ================================================================ */

/* ----------------------------------------------------------------
   VARIABLES
   ---------------------------------------------------------------- */
:root {
  --bg:          #080808;
  --surface:     #111111;
  --surface-2:   #181818;
  --border:      #333333;
  --border-dim:  #252525;
  --text:        #f0f0f0;
  --text-mid:    #c0c0c0;
  --text-dim:    #7a7a7a;
  --accent:      #D4E642;
  --accent-dim:  #a8b830;
  --white:       #ffffff;

  --mono: 'IBM Plex Mono', 'Courier New', monospace;
  --sans: system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;

  /* Booker section reversal */
  --booker-bg:   #f2f2ed;
  --booker-text: #111111;
  --booker-dim:  #888;
}

/* ----------------------------------------------------------------
   SKIP LINK (keyboard accessibility)
   ---------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  z-index: 9999;
  text-decoration: none;
  transition: top 0.1s;
}

.skip-link:focus {
  top: 1rem;
}

/* ----------------------------------------------------------------
   RESET & BASE
   ---------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--mono);
  cursor: pointer;
}

/* ----------------------------------------------------------------
   TYPOGRAPHY SYSTEM
   ---------------------------------------------------------------- */

/* Section label — "listen", "watch", "about", etc. */
.section-label {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2.5rem;
  display: block;
}

/* ================================================================
   SECTION SEPARATORS — thin horizontal rules between sections
   ================================================================ */
.listen,
.watch,
.bio,
.shows,
.bookers,
.footer {
  border-top: 1px solid var(--border);
}

/* ================================================================
   1. HERO
   ================================================================ */
.hero {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  position: relative;
}

/* Wordmark: full-width, dark background, large */
.hero__wordmark {
  background-color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem 1.25rem;
  width: 100%;
}

.wordmark-img {
  width: 100%;
  max-width: 860px;
  height: auto;
  /* Stroke version is dark ink — invert to white on dark bg */
  filter: invert(1);
  /* Prevent drag of image */
  -webkit-user-drag: none;
  user-select: none;
}

/* Hero photo: full-width bleed, flex-grows to fill remaining vh */
.hero__photo {
  flex: 1;
  min-height: 55vh;
  overflow: hidden;
  position: relative;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

/* Tagline strip at bottom */
.hero__tagline {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
  text-align: center;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

/* ================================================================
   2. LISTEN
   ================================================================ */
.listen {
  padding: 4rem 1.5rem 4.5rem;
}

.listen > * {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.listen > .section-label {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* Track cards */
.tracks {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

.track-card {
  padding: 1.75rem 1.75rem 1.5rem;
  background: var(--surface);
  transition: background 0.15s;
}

.track-card + .track-card {
  border-top: 1px solid var(--border);
}

.track-card:hover {
  background: var(--surface-2);
}

/* Active playing state — inset shadow (no layout shift) */
.track-card.is-playing {
  box-shadow: inset 3px 0 0 var(--accent);
}

/* Play button loading state */
.play-btn.is-loading {
  opacity: 0.5;
  cursor: wait;
  pointer-events: none;
}

.track-info {
  margin-bottom: 1.25rem;
}

.track-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}

.track-note {
  display: block;
  font-size: 0.7rem;
  color: var(--text-mid);
  font-style: italic;
  line-height: 1.5;
}

/* Player controls row */
.track-player {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.play-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--accent);
  color: var(--bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, transform 0.1s;
}

.play-btn:hover {
  background: var(--white);
}

.play-btn:active {
  transform: scale(0.94);
}

.play-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Scrubber */
.progress-bar {
  position: relative;
  height: 3px;
  background: var(--border);
  cursor: pointer;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  pointer-events: none;
  transition: width 0.1s linear;
}

/* Native range hidden behind the progress bar div for interaction */
.progress-input {
  position: absolute;
  inset: -8px 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  height: calc(100% + 16px);
}

.time-display {
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* Streaming links */
.stream-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  max-width: 760px;
  margin: 2rem auto 0;
}

.stream-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.6rem;
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mid);
  transition: border-color 0.15s, color 0.15s;
}

.stream-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.stream-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ================================================================
   3. WATCH
   ================================================================ */
.watch {
  padding: 4rem 1.5rem 4.5rem;
  max-width: 1040px;
  margin: 0 auto;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.video-card {
  display: flex;
  flex-direction: column;
}

.video-placeholder {
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

/* When real video is added, iframe/video fill this space */
.video-card iframe,
.video-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
  background: #000;
}

.video-icon {
  font-size: 1.6rem;
  opacity: 0.25;
}

.video-label {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.video-caption {
  padding: 0.6rem 0 0;
  font-size: 0.65rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ================================================================
   4. BIO
   ================================================================ */
.bio {
  padding: 4rem 1.5rem 4.5rem;
  max-width: 1040px;
  margin: 0 auto;
}

.bio-layout {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.bio-text p {
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.bio-text p:last-child {
  margin-bottom: 0;
}

.bio-text em {
  font-style: italic;
  color: var(--accent);
}

.bio-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  align-self: start;
}

.bio-photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center top;
}

/* ================================================================
   5. SHOWS
   ================================================================ */
.shows {
  padding: 4rem 1.5rem 4.5rem;
  max-width: 760px;
  margin: 0 auto;
}

.shows-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.shows-subhead {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.shows-list {
  display: flex;
  flex-direction: column;
}

.show-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border-dim);
}

.show-item:first-child {
  border-top: 1px solid var(--border-dim);
}

.show-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.show-venue {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.show-city {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.show-date {
  font-size: 0.65rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Upcoming show — accent highlight */
.show-item--next .show-venue {
  color: var(--accent);
}

.show-item--next .show-date {
  color: var(--accent);
  opacity: 0.8;
}

/* ================================================================
   6. BOOKERS
   ================================================================ */
.bookers {
  padding: 4rem 1.5rem 4.5rem;
  max-width: 760px;
  margin: 0 auto;
}

.bookers-inner {
  max-width: 760px;
  margin: 0 auto;
}

.bookers-heading {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2.5rem;
}

.bookers-body {
  font-family: var(--mono);
  color: var(--text);
}

.bookers-body p {
  font-size: 0.9rem;
  line-height: 1.85;
  font-weight: 400;
  margin-bottom: 1.25rem;
}

.bookers-body p:last-child {
  margin-bottom: 0;
}

.bookers-contact {
  font-weight: 500;
  font-size: 0.9rem !important;
}

.bookers-body a {
  color: var(--accent);
  transition: opacity 0.15s;
}

.bookers-body a:hover {
  opacity: 0.75;
}

/* ================================================================
   7. FOOTER
   ================================================================ */
.footer {
  padding: 3rem 1.5rem;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-link {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  transition: color 0.15s;
}

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

.footer-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.footer-tagline {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-style: italic;
  opacity: 0.45;
  letter-spacing: 0.04em;
}

/* ================================================================
   BUG COUNTER — fixed overlay, bottom-right
   ================================================================ */
.bug-counter {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 900;
  background: var(--bg);
  border: 2px solid var(--accent);
  padding: 0.65rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text);
  box-shadow: 0 0 0 1px var(--bg), 0 4px 24px rgba(0,0,0,0.75);
}

.bug-count-label strong {
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
}

.bug-reset {
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-mid);
  padding: 0;
  cursor: pointer;
  transition: color 0.15s;
}

.bug-reset:hover {
  color: var(--accent);
}

.bug-reset:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ================================================================
   BUG ANIMATION LAYER
   ================================================================ */
.bug-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 800;
  overflow: hidden;
}

/* Individual swooping bug */
.bug {
  position: absolute;
  width: 96px;
  height: 96px;
  pointer-events: all;
  cursor: crosshair;
  user-select: none;
  will-change: transform;
}

.bug img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Splat — stays in place after click. JS positions left/top to center it. */
.splat {
  position: absolute;
  width: 90px;
  height: 90px;
  pointer-events: none;
  will-change: transform;
}

/* ================================================================
   RESPONSIVE — Narrow (≤ 900px)
   At these widths height: 100% on the hero img stops resolving
   correctly inside the flex container, creating a black void.
   Absolute positioning locks it to its container reliably.
   Desktop (> 900px) is untouched.
   ================================================================ */
@media (max-width: 900px) {
  .hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-position: 62% 20%;
  }
}

/* ================================================================
   RESPONSIVE — Tablet (≤ 768px)
   ================================================================ */
@media (max-width: 768px) {
  .bio-photos {
    grid-template-columns: 1fr;
  }

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

  .shows-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero__wordmark {
    padding: 2rem 1.25rem 1.75rem;
  }
}

/* ================================================================
   RESPONSIVE — Mobile (≤ 540px)
   ================================================================ */
@media (max-width: 540px) {
  .hero__tagline {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
  }

  .track-card {
    padding: 1.25rem;
  }

  .track-title {
    font-size: 1rem;
  }



  /* Footer: extra bottom padding so tagline clears the fixed counter */
  .footer {
    padding-bottom: 5rem;
  }

  .stream-links {
    flex-direction: column;
  }

  .stream-btn {
    width: 100%;
    justify-content: center;
  }

  /* Counter: shifted up enough to not sit on hero tagline */
  .bug-counter {
    bottom: 3.5rem;
    right: 0.75rem;
    font-size: 0.7rem;
    padding: 0.55rem 0.85rem;
    gap: 0.75rem;
  }
}

/* ================================================================
   REDUCED MOTION — disable all animations
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .progress-fill {
    transition: none;
  }

  /* bugs.js checks this and skips spawning entirely */
}
