/* CSS Custom Properties */
:root {
  --red: #e50000;
  --glitch-blue: #4ce0ff;
  --white: #fff;
  --dark: #0a0a0a;
  --pad: 42px;
  --text-blue: #8ce0ff;
  --border-radius: 8px;
  --box-shadow: 0 6px 42px #000b;
  --transition: 0.18s ease;
}

/* Mobile-first responsive padding */
@media (max-width: 480px) {
  :root { 
    --pad: 12px; 
  }
}

@media (max-width: 768px) {
  :root { 
    --pad: 16px; 
  }
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
  /* Prevent horizontal scroll on mobile */
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #111 url('/img/poster_1.jpg') no-repeat center center fixed;
  background-size: cover;
  background-attachment: fixed;
  max-width: 100vw;
  overflow-x: hidden;
  font-family: 'Special Elite', 'Roboto Mono', monospace;
  min-height: 100vh;
  color: var(--red);
  text-align: center;
  position: relative;
  /* Prevent zoom on form elements on iOS */
  -webkit-text-size-adjust: 100%;
  /* Smooth scrolling on iOS */
  -webkit-overflow-scrolling: touch;
}

/* Optimize background for mobile */
@media (max-width: 768px) {
  body {
    background-attachment: scroll;
    background-size: cover;
    /* Prevent rubber band scrolling on iOS */
    overscroll-behavior: none;
  }
}

/* Mobile landscape optimization */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    background-size: cover;
    background-position: center center;
  }
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--dark);
  color: var(--white);
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  transition: top var(--transition);
}

.skip-link:focus {
  top: 6px;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Readability overlay - optimized */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  pointer-events: none;
  z-index: 0;
  will-change: auto;
}

main {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 var(--pad);
}

/* Enhanced mobile padding */
@media (max-width: 480px) {
  main { 
    padding: 0 var(--pad); 
  }
}

/* Typography optimizations */
a {
  color: var(--text-blue);
  text-decoration: none;
  transition: color var(--transition);
  /* Better touch targets on mobile */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

a:hover, 
a:focus { 
  color: var(--white); 
  text-decoration: underline; 
}

a:focus {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* Header styles */
.buttons { 
  margin: 26px 0; 
}

.buttons a { 
  margin: 0 10px; 
  display: inline-block;
  border-radius: 50%;
  transition: transform var(--transition);
  /* Better touch targets */
  min-width: 44px;
  min-height: 44px;
}

.buttons a:hover,
.buttons a:focus {
  transform: scale(1.1);
}

.logo-container {
  display: block;
  margin: 36px auto 14px auto;
  width: 100%;
  text-align: center;
}

/* Mobile logo adjustments */
@media (max-width: 480px) {
  .logo-container {
    margin: 20px auto 10px auto;
  }
}

/* Optimized logo animation */
.site-logo {
  max-width: 600px;
  width: 90vw;
  height: auto;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 1.1s cubic-bezier(.36,1.41,.62,1), 
              transform 0.8s cubic-bezier(.36,1.41,.62,1);
  will-change: opacity, transform;
  margin: 0 auto;
  display: block;
}

.site-logo.visible { 
  opacity: 1; 
  transform: scale(1);
  will-change: auto;
}

/* Mobile logo sizing */
@media (max-width: 480px) {
  .site-logo {
    width: 95vw;
    max-width: 320px;
  }
}

/* Navigation under logo */
.main-nav {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 22px 0;
  flex-wrap: wrap;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 2px solid var(--red);
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--text-blue);
  background: rgba(0,0,0,0.5);
  text-decoration: none;
  transition: transform var(--transition), 
              box-shadow var(--transition), 
              background var(--transition), 
              color var(--transition);
  /* Better touch targets on mobile */
  min-height: 44px;
  text-align: center;
}

.main-nav a:hover, 
.main-nav a:focus {
  transform: translateY(-1px);
  background: rgba(229,0,0,0.25);
  box-shadow: 0 0 16px #e50000cc, 0 2px 18px #000c;
  color: #fff;
}

/* Mobile navigation adjustments */
@media (max-width: 480px) {
  .main-nav {
    gap: 6px;
    margin: 16px 0;
  }
  
  .main-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    font-size: 0.8em;
    flex: 1;
    min-width: 65px;
    max-width: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .main-nav a {
    padding: 8px 10px;
    font-size: 0.75em;
    min-width: 60px;
  }
}

/* Headers with consistent styling */
.pump {
  color: var(--red);
  font-weight: 900;
  font-size: 1.9em;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 14px #770000, 0 0 6px #111;
  margin: 0.3em 0 0.2em 0;
  position: relative;
  z-index: 3;
  transition: color 0.2s;
}

/* Mobile header sizing */
@media (max-width: 480px) {
  .pump {
    font-size: 1.4em;
    margin: 0.2em 0 0.1em 0;
  }
}

/* Optimized glitch effect */
.glitch {
  font-size: 3.0em;
  font-weight: 800;
  letter-spacing: 0.04em;
  position: relative;
  margin: 36px 0 12px 0;
  display: inline-block;
  color: var(--red) !important;
  z-index: 1;
  transition: color var(--transition);
  max-width: 100vw;
  overflow-wrap: break-word;
  contain: layout style;
  /* Better text rendering on mobile */
  text-rendering: optimizeLegibility;
}

/* Mobile glitch sizing */
@media (max-width: 768px) {
  .glitch {
    font-size: 2.2em;
    margin: 24px 0 8px 0;
  }
}

@media (max-width: 480px) {
  .glitch {
    font-size: 1.8em;
    margin: 20px 0 6px 0;
    line-height: 1.2;
  }
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0; 
  width: 100%; 
  top: 0;
  z-index: -1; 
  opacity: .82; 
  pointer-events: none;
  font-weight: inherit; 
  font-size: inherit;
}

.glitch::before {
  color: var(--red);
  text-shadow: -1.2px 1.2px 2px var(--red);
  animation: glitchTop 2s infinite linear alternate-reverse;
}

.glitch::after {
  color: var(--glitch-blue);
  text-shadow: 2px -1px 2px var(--glitch-blue);
  animation: glitchBottom 1.5s infinite linear alternate-reverse;
}

/* Reduce glitch intensity on mobile */
@media (max-width: 480px) {
  .glitch::before {
    text-shadow: -0.8px 0.8px 1px var(--red);
  }
  
  .glitch::after {
    text-shadow: 1.2px -0.6px 1px var(--glitch-blue);
  }
}

/* Optimized keyframes */
@keyframes glitchTop {
  0%, 100% { transform: translate(0,0); }
  15% { transform: translate(2.5px,-1.5px); }
  30% { transform: translate(-2.5px,2.5px); }
  45% { transform: translate(-1.5px,-2px); }
  60% { transform: translate(1px,2.5px); }
  75% { transform: translate(-1.5px,1.5px); }
}

@keyframes glitchBottom {
  0%, 100% { transform: translate(0,0); }
  10% { transform: translate(-1.5px,2.5px); }
  25% { transform: translate(1.5px,-2px); }
  40% { transform: translate(-2.5px,2px); }
  65% { transform: translate(2px,-1.5px); }
  80% { transform: translate(1.5px,2.5px); }
}

/* Section styling */
section, 
.shows, 
.merch-section, 
#discography, 
.center-text { 
  color: var(--red); 
}

.shows-text, 
.shows p, 
p, 
.image-attribution,
.album, 
.album ol, 
.release-date, 
.footer-credits {
  color: var(--text-blue) !important;
  font-size: 1.05em;
}

/* Mobile text sizing */
@media (max-width: 480px) {
  .shows-text, 
  .shows p, 
  p, 
  .image-attribution,
  .album, 
  .album ol, 
  .release-date, 
  .footer-credits {
    font-size: 0.95em;
    line-height: 1.5;
  }
}

/* Shows section with aftermath.webp background */
.shows {
  position: relative;
  background: url('/img/aftermath.webp') center / cover no-repeat;
  border-radius: 22px;
  overflow: hidden;
  margin-bottom: 38px;
}
.shows::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 0;
}

/* Shows container */
.shows-container {
  background: rgba(10,10,10,0.83);
  border-radius: 22px;
  max-width: 820px;
  margin: 0 auto 38px auto;
  box-shadow: var(--box-shadow);
  padding: 38px 4vw;
  position: relative;
  z-index: 2;
  border: 0 solid #222;
}

@media (max-width: 900px) { 
  .shows-container { 
    padding: 22px 3vw; 
  } 
}

@media (max-width: 600px) { 
  .shows-container { 
    padding: 16px 2vw; 
    max-width: 96vw; 
    border-radius: 16px;
  } 
}

@media (max-width: 480px) { 
  .shows-container { 
    padding: 12px 3vw; 
    max-width: 95vw; 
    border-radius: 12px;
  } 
}

/* Chain divider - big, scrolling with content (foreground) */
.chain-divider {
  width: 100%;
  height: 50px; /* much bigger */
  margin: 44px 0 16px 0;
  background-image: url('/chain_red.svg');
  background-repeat: repeat-x;
  background-size: auto 220px; /* scale by height so links are large */
  background-position: center; /* centered in the divider */
  /* Ensure it scrolls with content (not fixed background) */
  background-attachment: scroll;
  border: none;
  padding: 0;
  overflow: hidden;
  contain: strict;
  position: relative;
}

/* Remove old animation layers */
.chain-divider::before,
.chain-divider::after { content: none; }

/* Remove old keyframes (kept empty to override earlier definitions) */
@keyframes infiniteChain {}

/* Mobile: much bigger chains - 300% increase */
@media (max-width: 600px) {
  .chain-divider {
    height: 120px;
    background-size: auto 120px;
    background-attachment: scroll; /* avoid jank on low-end mobile */
    margin: 24px 0 12px 0;
  }
}

@media (max-width: 480px) {
  .chain-divider {
    height: 105px;
    background-size: auto 105px;
    margin: 20px 0 10px 0;
  }
}

/* Tour poster optimization */
.center-50 { 
  width: 70%; 
  margin: 0 auto; 
}

.tour-poster picture, 
.tour-poster img {
  display: block; 
  width: 100%; 
  height: auto; 
  border-radius: 12px; 
  margin-top: 1.5em;
}

/* Mobile tour poster */
@media (max-width: 768px) {
  .center-50 { 
    width: 90%; 
  }
}

@media (max-width: 480px) {
  .center-50 { 
    width: 95%; 
  }
  
  .tour-poster picture, 
  .tour-poster img {
    border-radius: 8px;
    margin-top: 1em;
  }
}

/* Lightbox triggers */
.lightbox-trigger { 
  cursor: pointer; 
  border: 2px solid #333;
  transition: transform var(--transition),
              border-color var(--transition),
              box-shadow var(--transition);
  /* Better touch interaction */
  touch-action: manipulation;
}

.lightbox-trigger:hover, 
.lightbox-trigger:focus {
  transform: scale(1.02);
  border-color: var(--red);
  box-shadow: 0 0 16px #e50000cc, 0 2px 18px #000c;
  outline: none;
}

/* Mobile touch optimization */
@media (max-width: 480px) {
  .lightbox-trigger:active {
    transform: scale(0.98);
  }
}

/* Gallery optimizations */
.thumbnail-container {
  display: flex; 
  align-items: center; 
  justify-content: center;
  background: rgba(0,0,0,0.23);
  border-radius: 12px;
  padding: 20px 0; 
  margin-bottom: 16px; 
  min-height: 200px;
  overflow-x: auto; 
  max-width: 100vw;
  contain: layout;
  /* Better touch scrolling */
  -webkit-overflow-scrolling: touch;
}

/* Mobile gallery container */
@media (max-width: 480px) {
  .thumbnail-container {
    padding: 12px 0;
    min-height: 120px;
    border-radius: 8px;
  }
}

.thumbnail-bar {
  display: flex; 
  flex-direction: row; 
  gap: 4px;
  overflow-x: auto; 
  padding: 8px 0; 
  width: 100%;
  scrollbar-color: var(--red) #222; 
  scrollbar-width: thin;
  max-width: 100vw;
  scroll-behavior: smooth;
  /* Better mobile scrolling */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

/* Hide scrollbars on mobile for cleaner look */
@media (max-width: 768px) {
  .thumbnail-bar {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .thumbnail-bar::-webkit-scrollbar {
    display: none;
  }
}

/* Optimized gallery images */
.gallery-image {
  height: 190px; 
  width: auto; 
  margin: 0 2px; 
  border-radius: 6px;
  cursor: pointer; 
  transition: transform var(--transition), 
              box-shadow var(--transition), 
              border var(--transition);
  border: 2px solid #333; 
  object-fit: cover; 
  background: #000; 
  flex-shrink: 0; 
  max-width: 99vw;
  will-change: transform;
  /* Better touch interaction */
  touch-action: manipulation;
}

.gallery-image:hover, 
.gallery-image:focus {
  transform: scale(1.12); 
  border-color: var(--red); 
  z-index: 1;
  box-shadow: 0 0 16px #e50000cc, 0 2px 18px #000c;
  outline: none;
}

/* Mobile gallery images */
@media (max-width: 768px) {
  .gallery-image {
    height: 120px;
    margin: 0 1px;
  }
  
  .gallery-image:hover, 
  .gallery-image:focus {
    transform: scale(1.05);
  }
}

@media (max-width: 480px) {
  .gallery-image {
    height: 80px;
    border-radius: 4px;
  }
  
  .gallery-image:active {
    transform: scale(0.95);
  }
}

/* Gallery scroll buttons */
#scroll-left, 
#scroll-right {
  background: rgba(0,0,0,0.6);
  border: none; 
  color: var(--white);
  font-size: 2.1em; 
  padding: 0 10px;
  border-radius: 50%; 
  cursor: pointer; 
  margin: 0 6px;
  transition: background var(--transition);
  /* Better touch targets */
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

#scroll-left:hover, 
#scroll-right:hover { 
  background: var(--red); 
}

/* Mobile scroll buttons */
@media (max-width: 768px) {
  #scroll-left, 
  #scroll-right {
    font-size: 1.8em;
    padding: 0 8px;
    margin: 0 4px;
    min-width: 40px;
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  #scroll-left, 
  #scroll-right {
    font-size: 1.5em;
    padding: 0 6px;
    margin: 0 2px;
    min-width: 36px;
    min-height: 36px;
  }
}

/* Merch section */
.merch-image {
  width: 1000px; 
  max-width: 99vw; 
  margin-top: 25px;
  border-radius: var(--border-radius); 
  border: 2.5px solid #333; 
  box-shadow: 0 10px 42px #000a;
  display: block; 
  margin-left: auto; 
  margin-right: auto;
}

/* Mobile merch image */
@media (max-width: 480px) {
  .merch-image {
    margin-top: 15px;
    border-radius: 6px;
    border: 2px solid #333;
  }
}

/* Album list optimization */
.album-list {
  display: flex; 
  flex-wrap: nowrap; 
  overflow-x: auto; 
  justify-content: flex-start;
  gap: 22px; 
  padding: 30px 0 20px 0; 
  margin-bottom: 22px;
  scrollbar-color: #999 #222; 
  scrollbar-width: thin; 
  max-width: 100vw;
  scroll-behavior: smooth;
  /* Better mobile scrolling */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

/* Mobile album list */
@media (max-width: 768px) {
  .album-list {
    gap: 12px;
    padding: 20px 0 15px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .album-list::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 480px) {
  .album-list {
    gap: 8px;
    padding: 15px 0 10px 0;
  }
}

.album {
  background: rgba(0,0,0,0.63);
  padding: 20px 18px; 
  border-radius: 11px; 
  margin: 0 0 10px 0;
  min-width: 290px; 
  max-width: 370px; 
  flex: 0 0 320px; 
  display: inline-block; 
  vertical-align: top;
  box-shadow: 0 2px 16px #0008; 
  color: var(--red); 
  font-size: 1.07em;
}

/* Mobile album sizing */
@media (max-width: 768px) {
  .album {
    min-width: 250px;
    max-width: 300px;
    flex: 0 0 270px;
    padding: 16px 14px;
  }
}

@media (max-width: 480px) {
  .album {
    min-width: 200px;
    max-width: 250px;
    flex: 0 0 220px;
    padding: 12px 10px;
    font-size: 0.95em;
    border-radius: 8px;
  }
}

.album-cover { 
  width: 100%; 
  max-width: 250px; 
  border-radius: var(--border-radius); 
  margin-bottom: 10px; 
  cursor: pointer; 
  border: 2px solid #333;
  transition: transform var(--transition),
              border-color var(--transition),
              box-shadow var(--transition);
  touch-action: manipulation;
}

.album-cover:hover,
.album-cover:focus { 
  transform: scale(1.02); 
  border-color: var(--red); 
  box-shadow: 0 0 16px #e50000cc, 0 2px 18px #000c;
  outline: none;
}

/* Mobile album cover */
@media (max-width: 480px) {
  .album-cover {
    border-radius: 6px;
  }
  
  .album-cover:active {
    transform: scale(0.98);
  }
}

.album h3 { 
  margin: 7px 0 4px 0; 
  font-size: 1.18em; 
  color: var(--red) !important; 
  font-weight: bold; 
}

/* Mobile album title */
@media (max-width: 480px) {
  .album h3 {
    font-size: 1.1em;
    margin: 5px 0 3px 0;
  }
}

.album ol {
  text-align: left; 
  display: inline-block; 
  margin: 0 auto; 
  padding-left: 18px;
  font-size: 15px; 
  color: var(--text-blue); 
  word-break: break-word;
}

/* Mobile album list */
@media (max-width: 480px) {
  .album ol {
    font-size: 13px;
    padding-left: 15px;
  }
}

.release-date {
  color: #fff; 
  font-size: 15px; 
  margin: 2px 0 8px 0; 
  font-weight: bold; 
  letter-spacing: 0.02em;
  text-shadow: 0 0 7px #d7000088;
}

/* Mobile release date */
@media (max-width: 480px) {
  .release-date {
    font-size: 13px;
  }
}

/* Spotify embed */
.spotify-embed-wrapper {
  margin: 46px auto 32px auto; 
  max-width: 860px; 
  border-radius: 18px;
  box-shadow: 0 6px 36px #000a; 
  background: rgba(0,0,0,0.5);
  padding: 12px 0; 
  display: flex; 
  justify-content: center; 
  overflow-x: auto; 
  max-width: 100vw;
}

.spotify-embed-wrapper iframe {
  width: 98vw; 
  max-width: 800px; 
  min-height: 510px; 
  border: none; 
  border-radius: 16px;
  display: block; 
  margin: 0 auto;
}

/* Mobile Spotify embed */
@media (max-width: 768px) {
  .spotify-embed-wrapper {
    margin: 30px auto 20px auto;
    border-radius: 12px;
    padding: 8px 0;
  }
  
  .spotify-embed-wrapper iframe {
    min-height: 400px;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .spotify-embed-wrapper {
    margin: 20px auto 15px auto;
    border-radius: 8px;
    padding: 6px 0;
  }
  
  .spotify-embed-wrapper iframe {
    width: 95vw;
    min-height: 350px;
    border-radius: 8px;
  }
}

/* Lightbox optimization */
.lightbox {
  display: none; 
  position: fixed; 
  z-index: 10001; 
  left: 0; 
  top: 0; 
  width: 100vw; 
  height: 100vh;
  background: url('/img/war.webp') center / cover no-repeat;
  background-color: rgba(10,10,10,0.97);
  background-blend-mode: overlay;
  justify-content: center; 
  align-items: center; 
  flex-direction: column;
  transition: opacity var(--transition); 
  text-align: center; 
  max-width: 100vw;
  overflow-x: hidden;
  contain: strict;
  /* Prevent scrolling behind lightbox on mobile */
  overscroll-behavior: contain;
}

.lightbox.show { 
  display: flex; 
}

.lightbox-content {
  max-width: 97vw; 
  max-height: 85vh; 
  border-radius: 16px; 
  box-shadow: 0 0 50px #000c;
  margin: 0 auto 8px auto; 
  background: #181818; 
  border: 2px solid var(--red); 
  display: block;
  transition: opacity var(--transition);
  /* Better image rendering on mobile */
  image-rendering: auto;
}

/* Mobile lightbox content */
@media (max-width: 768px) {
  .lightbox-content {
    max-width: 95vw;
    max-height: 80vh;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .lightbox-content {
    max-width: 93vw;
    max-height: 75vh;
    border-radius: 8px;
    border-width: 1px;
  }
}

.lightbox-caption {
  color: var(--text-blue); 
  margin: 0 0 7px 0; 
  font-size: 1.12em; 
  letter-spacing: 0.02em;
  max-width: 800px; 
  margin-left: auto; 
  margin-right: auto; 
  text-align: center; 
  word-break: break-word;
  padding: 0 10px;
}

/* Mobile lightbox caption */
@media (max-width: 480px) {
  .lightbox-caption {
    font-size: 0.95em;
    padding: 0 15px;
    line-height: 1.4;
  }
}

.lightbox-close, 
.lightbox-nav {
  position: absolute; 
  background: rgba(20,20,20,0.85); 
  color: #fff; 
  padding: 7px 18px; 
  font-size: 2.0em;
  border: 2px solid var(--red); 
  border-radius: 12px; 
  cursor: pointer; 
  box-shadow: 0 0 18px #000d;
  transition: background var(--transition), 
              border var(--transition), 
              color var(--transition); 
  z-index: 101; 
  opacity: 0.96; 
  outline: none;
  /* Better touch targets */
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.lightbox-close { 
  right: 16px; 
  top: 16px; 
}

.lightbox-nav { 
  top: 50%; 
  transform: translateY(-50%); 
  font-size: 2.6em; 
}

.lightbox-prev { 
  left: 4vw; 
}

.lightbox-next { 
  right: 4vw; 
}

/* Mobile lightbox controls */
@media (max-width: 768px) {
  .lightbox-close, 
  .lightbox-nav {
    padding: 5px 12px;
    font-size: 1.6em;
    border-radius: 8px;
    min-width: 40px;
    min-height: 40px;
  }
  
  .lightbox-close {
    right: 12px;
    top: 12px;
  }
  
  .lightbox-nav {
    font-size: 2.0em;
  }
  
  .lightbox-prev {
    left: 3vw;
  }
  
  .lightbox-next {
    right: 3vw;
  }
}

@media (max-width: 480px) {
  .lightbox-close, 
  .lightbox-nav {
    padding: 4px 10px;
    font-size: 1.4em;
    border-radius: 6px;
    min-width: 36px;
    min-height: 36px;
  }
  
  .lightbox-close {
    right: 8px;
    top: 8px;
  }
  
  .lightbox-nav {
    font-size: 1.8em;
  }
  
  .lightbox-prev {
    left: 2vw;
  }
  
  .lightbox-next {
    right: 2vw;
  }
}

.lightbox-close:hover, 
.lightbox-close:focus,
.lightbox-nav:hover, 
.lightbox-nav:focus {
  background: #e50000; 
  color: #fff; 
  border-color: #fff;
  box-shadow: 0 0 28px #e50000cc, 0 2px 22px #000c;
}

/* Footer */
footer {
  margin-top: 24px; 
  color: var(--red); 
  background: rgba(0,0,0,0.92);
  padding: 6px 0; 
  border-radius: 22px 22px 0 0; 
  max-width: 100vw;
}

footer img { 
  width: 316px; 
  margin: 20px auto 10px auto;
  display: block; 
}

/* Mobile footer */
@media (max-width: 768px) {
  footer {
    border-radius: 16px 16px 0 0;
  }
  
  footer img {
    width: 250px;
    margin: -30px auto -100px auto;
  }
}

@media (max-width: 480px) {
  footer {
    border-radius: 12px 12px 0 0;
    margin-top: 16px;
  }
  
  footer img {
    width: 200px;
    margin: -20px auto -80px auto;
  }
}

/* Footer social icons */
.footer-social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 12px 0 8px 0;
}
.footer-social .social-link {
  display: inline-flex;
  width: 42px;
  height: 42px;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--text-blue);
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
  /* Better touch interaction */
  touch-action: manipulation;
  /* Force perfect circular shape */
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
}
.footer-social .social-link:hover,
.footer-social .social-link:focus {
  transform: translateY(-1px) scale(1.05);
  background: rgba(229,0,0,0.25);
  box-shadow: 0 0 12px #e50000cc, 0 2px 16px #000c;
  color: #fff;
  border-color: #fff;
}
.footer-social .social-icon {
  width: 22px;
  height: 22px;
  display: block;
  /* Prevent icon scaling issues */
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
}

/* Mobile footer social - perfectly round scaling */
@media (max-width: 600px) {
  .footer-social { 
    gap: 12px; 
  }
  .footer-social .social-link { 
    width: 38px; 
    height: 38px; 
    min-width: 38px;
    min-height: 38px;
    max-width: 38px;
    max-height: 38px;
  }
  .footer-social .social-icon { 
    width: 20px; 
    height: 20px; 
    min-width: 20px;
    min-height: 20px;
    max-width: 20px;
    max-height: 20px;
  }
}

@media (max-width: 480px) {
  .footer-social { 
    gap: 10px; 
  }
  .footer-social .social-link { 
    width: 36px; 
    height: 36px; 
    min-width: 36px;
    min-height: 36px;
    max-width: 36px;
    max-height: 36px;
  }
  .footer-social .social-icon { 
    width: 18px; 
    height: 18px; 
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
  }
}

.footer-credits { 
  color: var(--text-blue); 
  font-size: 1em; 
  margin-top: -20px; 
}

.footer-credits a { 
  color: var(--text-blue); 
  font-weight: bold; 
}

.footer-credits a:hover { 
  color: var(--white); 
  text-decoration: underline; 
}

/* Mobile footer text */
@media (max-width: 480px) {
  .footer-credits,
  footer p {
    font-size: 0.9em;
    line-height: 1.4;
  }
}

/* Transmission section background with dark overlay */
.transmission {
  position: relative;
  background: url('../img/vietnam.webp') center / cover no-repeat;
  border-radius: 22px;
  overflow: hidden;
  margin-bottom: 38px;
}
.transmission::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 0;
}
.transmission-container {
  position: relative;
  z-index: 1;
  background: rgba(10,10,10,0.83);
  border-radius: 22px;
  max-width: 820px;
  margin: 0 auto;
  box-shadow: var(--box-shadow);
  padding: 38px 4vw;
  border: 0 solid #222;
}

/* Ticker optimization */
.ticker {
  width: 100%;
  background: rgba(10,0,0,0.95);
  border-top: 2px solid var(--red);
  border-bottom: 2px solid var(--red);
  height: 2.7em;
  display: flex; 
  align-items: center;
  contain: layout;
  /* Better mobile performance */
  will-change: transform;
}

/* Mobile ticker */
@media (max-width: 480px) {
  .ticker {
    height: 2.2em;
    border-width: 1px;
  }
}

.ticker__viewport {
  overflow: hidden; 
  width: 100%;
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.ticker__track {
  display: flex;
  will-change: transform;
  transform: translateX(0);
}

.ticker__text {
  display: inline-block; 
  padding: 0 .05rem; 
  white-space: nowrap;
  font-weight: bold; 
  letter-spacing: .04em; 
  text-shadow: 0 0 8px #d00, 1px 1px #000;
  color: var(--text-blue);
  font-size: 1.8em;
}

/* Mobile ticker text */
@media (max-width: 768px) {
  .ticker__text {
    font-size: 1.4em;
  }
}

@media (max-width: 480px) {
  .ticker__text {
    font-size: 1.1em;
    letter-spacing: .02em;
  }
}

/* Shows list styling */
ul.shows-list { 
  list-style: none !important; 
  padding-left: 0 !important; 
  margin-left: 0 !important; 
}

ul.shows-list li::marker { 
  content: ""; 
}

.shows-list li { 
  font-size: 1.3em; 
  line-height: 1.55; 
}

.shows-list li a { 
  font-size: 1em; 
}

/* Mobile shows list */
@media (max-width: 480px) {
  .shows-list li {
    font-size: 1.1em;
    line-height: 1.4;
  }
}

/* Font families */
.glitch, h1, h2, .section-title,
.album h3, #shows-heading,
.transmission .glitch, .merch-section .glitch,
#discography .glitch, #player .glitch, .pump {
  font-family: "Special Elite", "Roboto Mono", monospace !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Consistent 3-column shows layout */
.pro-list {
  margin: 28px auto 0; 
  padding: 0; 
  max-width: 820px; 
  list-style: none;
}

.show {
  display: grid;
  grid-template-columns: 110px 1fr 260px;
  align-items: center;
  column-gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dotted var(--red);
}

.show:last-child { 
  border-bottom: 0; 
}

.show__link { 
  display: contents; 
  color: inherit; 
  text-decoration: none; 
  /* Better touch target */
  touch-action: manipulation;
}

.show__date {
  grid-column: 1; 
  justify-self: start; 
  text-align: left;
  font-weight: 900; 
  color: var(--red); 
  min-width: 110px;
}

.show__city {
  grid-column: 2; 
  justify-self: center; 
  text-align: center;
  letter-spacing: .06em; 
  font-weight: 800; 
  text-transform: uppercase;
}

.show__venue {
  grid-column: 3; 
  justify-self: end; 
  text-align: right; 
  font-weight: 900;
}

.show__meta {
  grid-column: 3; 
  justify-self: end; 
  text-align: right; 
  opacity: .95; 
  margin-left: 8px;
}

.show:hover .show__city, 
.show:hover .show__venue { 
  color: #fff; 
}

/* Mobile shows layout - switch to 2 column stacked */
@media (max-width: 680px) {
  .show {
    grid-template-columns: 90px 1fr;
    row-gap: 4px;
    column-gap: 12px;
  }
  .show__date { 
    grid-column: 1; 
    grid-row: 1; 
    min-width: 90px; 
    font-size: 0.9em;
  }
  .show__city { 
    grid-column: 2; 
    grid-row: 1; 
    justify-self: start; 
    text-align: left; 
    font-size: 0.95em;
  }
  .show__venue { 
    grid-column: 2; 
    grid-row: 2; 
    justify-self: start; 
    text-align: left; 
    font-size: 0.9em;
    font-weight: 700;
  }
  .show__meta { 
    grid-column: 2; 
    grid-row: 3; 
    justify-self: start; 
    text-align: left; 
    font-size: 0.85em;
  }
}

@media (max-width: 480px) {
  .show {
    grid-template-columns: 75px 1fr;
    column-gap: 10px;
    padding: 10px 0;
  }
  .show__date {
    min-width: 75px;
    font-size: 0.85em;
  }
  .show__city {
    font-size: 0.9em;
  }
  .show__venue {
    font-size: 0.85em;
  }
  .show__meta {
    font-size: 0.8em;
  }
}

/* Merch section centering */
#merch.merch-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#merch .glitch {
  display: inline-block;
  margin-bottom: 20px;
}

#merch a {
  display: block;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  /* Better touch target */
  touch-action: manipulation;
}

#merch .merch-image {
  display: block;
  width: 100%;
  max-width: 1000px;
  margin: 25px auto 0;
  border-radius: var(--border-radius);
  border: 2.5px solid #333;
}

/* Back-to-top button */
.back-to-top {
  position: fixed;
  inset: auto 18px 18px auto;
  z-index: 2147483647;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 2px solid var(--red);
  background: rgba(0,0,0,0.65);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='18 15 12 9 6 15'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60% 60%;
  color: var(--white);
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  font-family: "Roboto Mono", monospace, system-ui, sans-serif;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity var(--transition),
              transform var(--transition),
              visibility var(--transition),
              background var(--transition),
              box-shadow var(--transition),
              border-color var(--transition);
  /* Better touch interaction */
  touch-action: manipulation;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover,
.back-to-top:focus {
  outline: none;
  background: rgba(229,0,0,0.25);
  border-color: var(--white);
  box-shadow: 0 0 18px #e50000cc, 0 2px 18px #000c;
  color: #fff;
}

/* Mobile back-to-top */
@media (max-width: 768px) {
  .back-to-top {
    width: 42px;
    height: 42px;
    inset: auto 15px 15px auto;
  }
}

@media (max-width: 480px) {
  .back-to-top {
    width: 38px;
    height: 38px;
    inset: auto 12px 12px auto;
    font-size: 14px;
  }
}

/* Mobile landscape optimizations */
@media (max-height: 500px) and (orientation: landscape) {
  .pump {
    font-size: 1.2em;
    margin: 0.1em 0;
  }
  
  .glitch {
    font-size: 1.6em;
    margin: 15px 0 5px 0;
  }
  
  .logo-container {
    margin: 15px auto 8px auto;
  }
  
  .site-logo {
    width: 70vw;
    max-width: 280px;
  }
  
  .main-nav {
    margin: 12px 0;
    gap: 8px;
  }
  
  .main-nav a {
    padding: 8px 12px;
    font-size: 0.85em;
  }
  
  .chain-divider {
    height: 20px;
    background-size: auto 20px;
    margin: 15px 0 8px 0;
  }
  
  .shows-container {
    padding: 12px 2vw;
  }
}

/* High DPI displays optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .gallery-image,
  .album-cover,
  .lightbox-trigger,
  .merch-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Dark mode optimization for mobile */
@media (prefers-color-scheme: dark) {
  body::before {
    background: rgba(0, 0, 0, 0.75);
  }
  
  .shows-container,
  .transmission-container,
  .album {
    background: rgba(5,5,5,0.9);
  }
}

/* Performance hints for animations */
.gallery-image,
.lightbox-trigger,
.main-nav a,
.site-logo,
.back-to-top,
.social-link {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Focus management improvements */
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* Mobile touch optimization */
@media (max-width: 768px) {
  /* Improve touch targets */
  button,
  a,
  .lightbox-trigger,
  .gallery-image {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: rgba(229, 0, 0, 0.3);
  }
  
  /* Prevent text selection on interactive elements */
  .main-nav a,
  .show__link,
  .footer-social .social-link {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  /* Better scrolling performance */
  .thumbnail-bar,
  .album-list {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  
  .gallery-image,
  .album {
    scroll-snap-align: start;
  }
}

/* Optimize spacing for bottom elements */
.spotify-embed-wrapper,
#player.center-text,
#discography,
.album-list,
section:last-of-type {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

footer { 
  margin-top: 10px !important; 
}

/* Print styles for better accessibility */
@media print {
  .lightbox,
  .back-to-top,
  .chain-divider,
  .ticker,
  .footer-social {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .glitch,
  .pump,
  .shows-text,
  .shows p,
  p {
    color: black !important;
    text-shadow: none !important;
  }
}
