/* MEGROV V3*/

:root {
  --black: #0a0a0a;
  --charcoal: #1a1a1a;
  --gray: #707070;
  --gray-light: #909090;
  --white: #ffffff;
  --red: #d32f2f;
  --red-glow: #ff1744;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --border-width: 3px;
  --border-opacity: 0.3;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  font-family: var(--font-body);
  background: var(--black);
  color: var(--white);
  line-height: 1.6;
}

/* Darkness presets */
body[data-darkness="100"] { background: #0a0a0a; }
body[data-darkness="75"]  { background: #141414; }
body[data-darkness="50"]  { background: #1e1e1e; }
body[data-darkness="25"]  { background: #282828; }

body.loading #slides {
  opacity: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}

h1 {
  font-size: clamp(3rem, 10vw, 8rem);
}

h2 {
  font-size: clamp(2rem, 6vw, 4rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.2rem, 3vw, 2rem);
  margin: 2rem 0 1rem;
}

p {
  margin-bottom: 1rem;
  color: var(--gray-light);
}

a {
  color: var(--white);
  text-decoration: none;
  transition: all 0.2s;
}

/* THIN TRANSPARENT BORDERS */
.border-frame {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
}

.border-top,
.border-right,
.border-bottom,
.border-left {
  position: fixed;
  background: rgba(211, 47, 47, var(--border-opacity));
}

.border-top {
  top: 0;
  left: 0;
  right: 0;
  height: var(--border-width);
}

.border-right {
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--border-width);
}

.border-bottom {
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--border-width);
}

.border-left {
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--border-width);
}

/* NAV */
#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-logo img {
  height: 40px;
  cursor: pointer;
  transition: transform 0.2s;
}

.nav-logo:hover img {
  transform: scale(1.05);
}

.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

/* Hamburger menu - hidden by default */
.hamburger {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  gap: 4px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--white);
  transition: all 0.3s;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
  padding: 0.5rem 0;
  cursor: pointer;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width 0.2s;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* DARKNESS SLIDER */
.darkness-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gray);
}

#darkness-slider {
  width: 100px;
  height: 3px;
  background: var(--charcoal);
  outline: none;
  appearance: none;
  cursor: pointer;
  border-radius: 2px;
}

#darkness-slider::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--red);
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 0 4px var(--red);
}

#darkness-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--red);
  border: none;
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 0 4px var(--red);
}

/* DOT NAV */
.slide-dots {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dot {
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all 0.2s;
}

.dot:hover {
  background: rgba(255,255,255,0.6);
}

.dot.active {
  background: var(--red);
  width: 25px;
}

/* SLIDES - CRITICAL FIXES */
#slides {
  position: fixed;
  inset: 0;
  top: 88px;
  bottom: 50px;
  transition: opacity 0.5s;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
  display: block !important; /* Force display block for all slides */
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slide-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

/* SCROLL SLIDES - UNIFIED FIX */
.slide-inner.scroll {
  height: calc(100vh - 88px - 50px);
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: left;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 4rem;
  padding-bottom: 2rem;
  align-items: flex-start;
}

/* CUSTOM SCROLLBAR STYLES */
.slide-inner.scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--red) var(--charcoal);
}

.slide-inner.scroll::-webkit-scrollbar {
    width: 8px;
}

.slide-inner.scroll::-webkit-scrollbar-track {
    background: var(--charcoal);
}

.slide-inner.scroll::-webkit-scrollbar-thumb {
    background: var(--red);
    border-radius: 4px;
}

.slide-inner.scroll::-webkit-scrollbar-thumb:hover {
    background: var(--red-glow);
}

/* HOME */
.subtitle {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--gray);
  margin-bottom: 3rem;
  letter-spacing: 0.15em;
}

/* BUTTONS */
.cta-buttons {
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 0.8rem 1.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.btn-primary:hover {
  background: var(--red-glow);
  box-shadow: 0 0 20px var(--red);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: white;
  border-color: white;
}

.btn-outline:hover {
  background: white;
  color: var(--black);
}

.hint {
  margin-top: 3rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray);
  text-transform: uppercase;
}

/* ABOUT */
.about-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
  align-items: flex-start;
}

.bio p {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.about-photo {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.about-photo img {
  width: 220px;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.15);
  filter: grayscale(1) contrast(1.05);
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
}

blockquote {
  font-style: italic;
  color: var(--red);
  font-size: 1.2rem;
  margin: 2rem 0;
  padding-left: 1.5rem;
  border-left: 3px solid var(--red);
}

#about blockquote {
  margin-bottom: 1rem;
}

#about h3 {
  margin-top: 1rem;
}

.genres {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--charcoal);
  border-left: 4px solid var(--red);
}

.genres .label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--gray);
  display: block;
  margin-bottom: 0.5rem;
}

/* MAP */
.map-box {
  background: var(--charcoal);
  padding: 1.5rem;
  border: 1px solid rgba(255,255,255,0.1);
}

#map {
  width: 100%;
  height: 400px;
  background: var(--black);
  border: 2px solid rgba(211,47,47,0.5);
  margin-bottom: 1rem;
}

.map-legend {
  font-size: 0.85rem;
  color: var(--gray);
}

/* MIXES */
.mixes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1.5rem;
  margin-top: 2rem;
}

.mix-item {
  background: var(--charcoal);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s;
  overflow: hidden;
}

.mix-item:hover {
  border-color: var(--red);
  transform: translateY(-5px);
}

.mix-item iframe {
  width: 100%;
  height: 166px;
  border: none;
}

/* TOUR */

.cities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.cities span {
  background: var(--charcoal);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  transition: all 0.2s;
}

.cities span:hover {
  background: var(--red);
  border-color: var(--red);
}

#tour .tour-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
  align-items: flex-start;
}

#tour .tour-grid h3 {
  margin-top: 0;
}

/* VINYL */
.vinyl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Desktop: 4x4 grid */
@media (min-width: 1024px) {
  .vinyl-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Tablet: 3x3 grid */
@media (max-width: 1023px) and (min-width: 768px) {
  .vinyl-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile: 2x2 grid */
@media (max-width: 767px) {
  .vinyl-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.vinyl-item {
  background: var(--charcoal);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 1rem;
  transition: all 0.3s;
  cursor: pointer;
}

.vinyl-item:hover {
  border-color: var(--red);
  transform: translateY(-5px);
}

.vinyl-item img {
  width: 100%;
  display: block;
  margin-bottom: 0.5rem;
}

.vinyl-item .title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.vinyl-item .artist {
  font-size: 0.8rem;
  color: var(--gray);
}

/* BOOKING */
.book-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

.info h3 {
  margin-top: 2rem;
}

.info p {
  margin-bottom: 0.5rem;
}

.info a {
  color: var(--red);
  text-decoration: underline;
}

.info a:hover {
  color: var(--red-glow);
}

/* SOCIALS */
.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.socials a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
  transition: all 0.2s;
}

.socials a:hover {
  border-color: var(--red);
  background: var(--red);
}

/* FORM */
.form input,
.form select,
.form textarea {
  width: 100%;
  background: var(--black);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.8rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: white;
  margin-bottom: 1rem;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--red);
}

/* FOOTER */
#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-logo img {
  height: 30px;
  opacity: 0.8;
  cursor: pointer;
  transition: opacity 0.2s;
}

.footer-logo:hover img {
  opacity: 1;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray);
  display: flex;
  gap: 0.5rem;
}

.loading,
.empty {
  text-align: center;
  color: var(--gray);
  padding: 3rem;
  font-style: italic;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 1200px) {
  .mixes-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  /* TABLET NAVIGATION - Smaller text but still horizontal */
  .nav-menu {
    gap: 1.5rem;
  }
  
  .nav-link {
    font-size: 0.7rem;
  }
  
  .about-layout,
  .book-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-photo {
    justify-content: flex-start;
  }

  .about-photo img {
    width: 220px;
    max-width: 80%;
  }

  .slide-dots {
    display: none;
  }

  #tour .tour-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  /* MOBILE NAVIGATION */
  .nav-menu {
    position: fixed;
    top: 88px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--ease);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: 999;
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .hamburger {
    display: flex;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  /* MOBILE HEADINGS - CRITICAL FIX */
  .slide h2 {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
  }

  .slide-inner.scroll {
    height: calc(100vh - 88px - 50px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  /* TOUR MOBILE FIX */
  #tour .slide-inner.scroll {
    padding-bottom: 6rem;
  }

  .mixes-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  #music > .slide-inner.scroll > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  #main-nav {
    flex-wrap: wrap;
  }

  .nav-menu {
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.7rem;
  }

  .darkness-control {
    display: none;
  }

  .cta-buttons {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  #slides {
    top: 88px;
    bottom: 50px;
  }

  #footer {
    padding: 0.4rem 0.9rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .footer-logo img {
    height: 22px;
  }

  .footer-text {
    font-size: 0.65rem;
    flex-wrap: wrap;
  }

  .footer-links .footer-link {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--white);
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.2s;
  }

  .footer-links .footer-link:hover {
    color: var(--red-glow);
  }

  #tour .tour-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
  }
  
  .cities {
    margin-bottom: 2rem;
  }
}

/* CRITICAL HEADING FIX */
.slide-inner.scroll h2 {
    margin-top: 0 !important;
    padding-top: 0 !important;
    position: static !important;
    transform: none !important;
}

/* Force all scroll slides to have identical structure */
#about .slide-inner.scroll,
#mixes .slide-inner.scroll,
#music .slide-inner.scroll,
#tour .slide-inner.scroll,
#radio .slide-inner.scroll,
#vinyl .slide-inner.scroll,
#blog .slide-inner.scroll,
#book .slide-inner.scroll {
    padding-top: 4rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}

/* Mobile heading fix */
@media (max-width: 768px) {
    .slide h2 {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin-top: 0 !important;
        margin-bottom: 1rem !important;
    }
    
    #tour .slide-inner.scroll {
        padding-bottom: 8rem !important;
    }
}

/* ====== MOBILE CRITICAL FIXES ====== */
@media (max-width: 768px) {
    /* Dynamic viewport height for mobile */
    .slide-inner.scroll {
        height: calc(100dvh - var(--nav-height) - var(--footer-height)) !important;
        padding-top: 3rem !important;
        padding-bottom: 4rem !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Extra padding for tour slide to prevent button cut-off */
    #tour .slide-inner.scroll {
        padding-bottom: 8rem !important;
    }
    
    /* Force tour grid to stack properly */
    #tour .tour-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 3rem !important;
        margin-bottom: 3rem !important;
    }
    
    /* Space out cities lists */
    .cities {
        margin-bottom: 2rem !important;
    }
    
    /* Ensure all scroll containers use dynamic viewport height */
    .slide-inner.scroll {
        max-height: calc(100dvh - var(--nav-height) - var(--footer-height)) !important;
    }
}

/* Fallback for older browsers that don't support dvh */
@supports not (height: 100dvh) {
    @media (max-width: 768px) {
        .slide-inner.scroll {
            height: calc(100vh - var(--nav-height) - var(--footer-height)) !important;
        }
    }
}

/* Prevent swipe conflicts with scrollable content */
.slide-inner.scroll {
    overscroll-behavior: contain;
}

/* Ensure Hammer.js doesn't interfere with scrolling */
#slides {
    touch-action: pan-y;
}

/* BOOK slide specific fix */
#book .slide-inner.scroll {
    padding-bottom: 6rem !important;
    min-height: calc(100dvh - var(--nav-height) - var(--footer-height)) !important;
}

/* Ensure form is fully visible */
#book .book-layout {
    margin-bottom: 2rem;
}

/* ====== FOOTER FIXES ====== */
#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.1);
  min-height: 50px; /* Fixed height */
  max-height: 50px; /* Fixed height */
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Make the rotating session text smaller and fixed width */
#session {
  font-size: 0.65rem !important;
  min-width: 140px; /* Fixed width to prevent layout shift */
  text-align: left;
}

/* Mobile footer fixes */
@media (max-width: 768px) {
  #footer {
    padding: 0.8rem 1rem;
    min-height: 68px;
    max-height: 68px;
    flex-direction: row; /* Keep horizontal on mobile */
    align-items: center;
  }
  
  .footer-text {
    font-size: 0.6rem;
    gap: 0.3rem;
  }
  
  #session {
    font-size: 0.55rem !important;
    min-width: 120px;
  }
  
  .footer-links {
    display: none; /* Hide social links on mobile to save space */
  }
}