/* ==========================================================================
   WOITH // DESIGN SYSTEM & STYLESHEET
   Dark Dystopian Cosmic Cyber-Aesthetic with Warm Ember Accents
   ========================================================================== */

:root {
  /* Color Palette Tokens */
  --bg-deep: #030206;
  --bg-void: #08060f;
  --color-amber: #ffb703;
  --color-amber-glow: rgba(255, 183, 3, 0.4);
  --color-copper: #fb8500;
  --color-gold-light: #fff0d0;
  --color-gold: #d4af37;
  --color-text-main: #f1f0f5;
  --color-text-muted: #8e8a9f;

  /* Glassmorphism Tokens */
  --glass-bg: rgba(12, 9, 20, 0.55);
  --glass-border: rgba(255, 183, 3, 0.18);
  --glass-border-hover: rgba(255, 183, 3, 0.45);

  /* Typography */
  --font-serif: 'Cinzel', serif;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Grotesk', monospace;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: var(--color-text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

/* Shared focus treatment for every interactive surface */
:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 3px;
}

/* Canvas Background */
#webgl-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/*
  If Three.js or WebGL is unavailable the canvas stays blank, so the page paints
  its own void instead of a flat black rectangle.
*/
html.no-visuals body {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 183, 3, 0.10) 0%, rgba(255, 69, 0, 0.05) 22%, rgba(3, 2, 6, 0) 55%),
    radial-gradient(circle at 50% 50%, #0a0713 0%, var(--bg-deep) 70%);
}

/* UI Overlay Layout */
.ui-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
}

/* Make interactive controls inside UI clickable */
.top-bar, .bottom-bar {
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   HEADER & LOGO
   -------------------------------------------------------------------------- */
.top-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
}

.logo-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /*
    300px matches the size the emblem has always been laid out at. One value
    drives both dimensions so it stays square — a non-square wrapper stretches
    the circular vignette behind it into an ellipse. The vh term is a guard that
    keeps it clear of the nav on short viewports.
  */
  width: min(300px, 75vw, 62vh);
  height: min(300px, 75vw, 62vh);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(3, 2, 6, 0.98) 0%, rgba(3, 2, 6, 0.78) 32%, rgba(3, 2, 6, 0) 53%);
  opacity: 0.95;
  transition: opacity var(--transition-smooth);
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  pointer-events: auto;
  z-index: 5;
  will-change: transform, filter;
}

.logo-wrapper:hover {
  opacity: 1.0;
}

.logo-wrapper picture {
  display: contents;
}

/*
  The tracking eye sits behind the emblem and shows through its centre
  aperture. Both layers live inside .logo-wrapper, so the hover tilt and
  audio-driven scaling apply to the eye and the metal in one piece.
*/
.eye-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.brand-logo-img {
  position: relative;
  z-index: 1;
}

.brand-logo-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
  user-select: none;
}

/* --------------------------------------------------------------------------
   BOTTOM BAR & CONTROLS
   -------------------------------------------------------------------------- */
.bottom-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  width: 100%;
}

/* Info Navigation Links */
.info-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border);
  color: var(--color-gold-light);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  padding: 0.55rem 1.1rem;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-btn:hover,
.nav-btn:focus-visible {
  background: rgba(255, 183, 3, 0.15);
  border-color: var(--color-amber);
  color: #ffffff;
  box-shadow: 0 0 15px var(--color-amber-glow);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   DIALOG & GLASSMODAL SYSTEM
   -------------------------------------------------------------------------- */
dialog.glass-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0;
  width: 90%;
  max-width: 600px;
  max-height: min(84vh, 780px);
  overflow: auto;
  overscroll-behavior: contain;
  background: rgba(10, 7, 18, 0.85);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid var(--glass-border-hover);
  border-radius: 20px;
  color: var(--color-text-main);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 183, 3, 0.12);
  outline: none;
  opacity: 0;
  scale: 0.95;
  transition: opacity 0.3s ease, scale 0.3s ease, overlay 0.3s allow-discrete, display 0.3s allow-discrete;
}

dialog.glass-dialog[open] {
  opacity: 1;
  scale: 1;
}

/* A default scrollbar reads as a bright white slab against the glass. */
dialog.glass-dialog {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 183, 3, 0.35) transparent;
}

dialog.glass-dialog::-webkit-scrollbar {
  width: 10px;
}

dialog.glass-dialog::-webkit-scrollbar-track {
  background: transparent;
}

dialog.glass-dialog::-webkit-scrollbar-thumb {
  background: rgba(255, 183, 3, 0.28);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 100px;
}

dialog.glass-dialog::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 183, 3, 0.5);
  background-clip: content-box;
}

@starting-style {
  dialog.glass-dialog[open] {
    opacity: 0;
    scale: 0.95;
  }
}

dialog::backdrop {
  background: rgba(2, 1, 5, 0.75);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease, display 0.3s allow-discrete;
}

dialog[open]::backdrop {
  opacity: 1;
}

@starting-style {
  dialog[open]::backdrop {
    opacity: 0;
  }
}

.dialog-content {
  position: relative;
  padding: 2.5rem;
}

/*
  Sticky rather than absolute: the discography scrolls well past a screenful,
  and an absolutely positioned close button scrolled out of reach with it.
*/
.dialog-close {
  position: sticky;
  top: 0.4rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 15, 32, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--color-text-muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
  margin: -1.2rem -1.2rem -0.4rem auto;
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast),
              color var(--transition-fast), box-shadow var(--transition-fast);
}

.dialog-close:hover,
.dialog-close:focus-visible {
  background: rgba(255, 183, 3, 0.15);
  border-color: var(--color-amber);
  color: var(--color-amber);
  box-shadow: 0 0 12px var(--color-amber-glow);
}

.dialog-header {
  margin-bottom: 1.8rem;
  border-bottom: 1px solid rgba(255, 183, 3, 0.15);
  padding-bottom: 1rem;
}

.dialog-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--color-gold-light);
  text-shadow: 0 0 10px var(--color-amber-glow);
}

.dialog-subtitle {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--color-amber);
  opacity: 0.8;
}

.dialog-body p {
  line-height: 1.7;
  font-size: 0.95rem;
  color: var(--color-text-main);
  margin-bottom: 1.2rem;
  opacity: 0.9;
}

.dialog-note {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* Band Credits */
.band-creds {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem 1.2rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 183, 3, 0.1);
}

.cred-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.cred-role {
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
}

.cred-name {
  color: var(--color-amber);
  font-weight: 600;
  text-align: right;
}

/* Discography Release Cards */
.release-grid {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.release-card {
  display: flex;
  gap: 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  padding: 1rem;
  border-radius: 12px;
  align-items: center;
}

.release-art-img {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: cover;
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

/* Cover art is hotlinked; this is what a failed fetch falls back to. */
.release-art-img.is-missing {
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 183, 3, 0.22) 0%, rgba(3, 2, 6, 0) 65%),
    linear-gradient(140deg, #14101f 0%, #060410 100%);
}

.release-card:hover .release-art-img {
  transform: scale(1.05);
  border-color: var(--color-amber);
}

.release-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.release-type {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-amber);
  letter-spacing: 0.15em;
}

.release-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  color: var(--color-gold-light);
}

.release-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-amber);
  text-decoration: none;
  margin-top: 0.3rem;
  letter-spacing: 0.1em;
  transition: color var(--transition-fast);
}

.release-link:hover,
.release-link:focus-visible {
  color: #ffffff;
}

/* Tour List */
.tour-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.tour-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
}

.tour-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-amber);
  font-weight: 600;
}

.tour-details {
  display: flex;
  flex-direction: column;
  margin-right: auto;
}

.tour-venue {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-main);
  letter-spacing: 0.05em;
}

.tour-city {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.tour-btn {
  display: inline-block;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--color-amber);
  color: var(--color-amber);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.35rem 0.8rem;
  border-radius: 100px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tour-btn:hover,
.tour-btn:focus-visible {
  background: var(--color-amber);
  color: #030206;
}

/* External Transmissions */
.links-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--color-gold-light);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.link-icon {
  flex-shrink: 0;
  width: 1.1em;
  font-size: 0.95rem;
  line-height: 1;
  text-align: center;
}

.social-link:hover,
.social-link:focus-visible {
  background: rgba(255, 183, 3, 0.15);
  border-color: var(--color-amber);
  transform: translateY(-3px);
  box-shadow: 0 0 15px var(--color-amber-glow);
}

/* --------------------------------------------------------------------------
   AUDIO TOGGLE
   -------------------------------------------------------------------------- */
.audio-toggle {
  position: relative;
  z-index: 100;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  color: var(--color-text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.audio-toggle:hover,
.audio-toggle:focus-visible {
  border-color: var(--color-amber);
  color: var(--color-amber);
  box-shadow: 0 0 16px var(--color-amber-glow);
  transform: scale(1.08);
}

.audio-toggle.playing {
  color: var(--color-amber);
  border-color: var(--color-amber);
  animation: audio-pulse 2.5s infinite ease-in-out;
}

/*
  Buffering. On a cold cellular connection the first tap has to fetch the whole
  drone before a sound exists, and an unchanged button reads as "nothing
  happened" — which is exactly when people tap again and cancel themselves.
*/
.audio-toggle.pending {
  color: var(--color-amber);
  border-color: rgba(255, 183, 3, 0.55);
  animation: audio-waiting 1s infinite linear;
}

@keyframes audio-waiting {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@keyframes audio-pulse {
  0%, 100% { box-shadow: 0 0 8px var(--color-amber-glow); }
  50% { box-shadow: 0 0 20px var(--color-amber-glow); }
}

/* --------------------------------------------------------------------------
   CUSTOM BIOMECHANICAL CURSOR
   -------------------------------------------------------------------------- */
#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  border: 1px solid var(--color-amber);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
  transition: width 0.15s ease, height 0.15s ease, border-color 0.15s ease,
              background-color 0.15s ease, opacity 0.15s ease;
  mix-blend-mode: difference;
}

/* Revealed by ui.js once the pointer has given it a position to hold. */
#custom-cursor.is-active {
  opacity: 1;
}

#custom-cursor::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background-color: var(--color-gold-light);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

#custom-cursor.hover {
  width: 40px;
  height: 40px;
  border-color: var(--color-gold);
  background-color: rgba(255, 69, 0, 0.15);
}

#custom-cursor.click {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

/*
  The native cursor is only hidden once the custom one is confirmed live, so a
  script failure can never leave a visitor with no pointer at all. Dialogs keep
  the system cursor because their text is selectable.
*/
html.js-cursor body {
  cursor: none;
}

html.js-cursor .glass-dialog {
  cursor: auto;
}

/* No hovering pointer means nothing to follow — the ring would sit stranded
   in the top-left corner of every phone screen. */
@media (hover: none), (pointer: coarse) {
  #custom-cursor {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   NOSCRIPT
   -------------------------------------------------------------------------- */
.noscript-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: min(90%, 420px);
  padding: 2rem;
  text-align: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-hover);
  border-radius: 20px;
}

.noscript-panel h2 {
  font-family: var(--font-serif);
  letter-spacing: 0.3em;
  color: var(--color-gold-light);
  margin-bottom: 1rem;
}

.noscript-panel p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.6rem;
}

.noscript-panel a {
  color: var(--color-amber);
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   ERROR PAGE (404)
   -------------------------------------------------------------------------- */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 183, 3, 0.10) 0%, rgba(255, 69, 0, 0.04) 24%, rgba(3, 2, 6, 0) 58%),
    radial-gradient(circle at 50% 50%, #0a0713 0%, var(--bg-deep) 70%);
}

.error-panel {
  width: min(90%, 460px);
  padding: 2rem 0;
  text-align: center;
}

.error-mark {
  width: min(180px, 45vw);
  height: auto;
  opacity: 0.9;
  filter: drop-shadow(0 0 30px rgba(255, 183, 3, 0.25));
}

.error-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  color: var(--color-amber);
  margin-top: 1.5rem;
}

.error-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--color-gold-light);
  text-shadow: 0 0 12px var(--color-amber-glow);
  margin: 0.5rem 0 1rem;
}

.error-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 1.8rem;
}

.error-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

/* Dialog text should be selectable */
.glass-dialog {
  user-select: text;
}

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

/* --------------------------------------------------------------------------
   RESPONSIVE DESIGN
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .ui-container {
    padding: 1.2rem;
  }

  .logo-wrapper {
    width: min(200px, 75vw, 42vh);
    height: min(200px, 75vw, 42vh);
  }

  .bottom-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .info-nav {
    justify-content: center;
    flex-wrap: wrap;
  }

  .nav-btn {
    padding: 0.45rem 0.8rem;
    font-size: 0.65rem;
  }

  .dialog-content {
    padding: 1.6rem;
  }

  .dialog-close {
    margin: -0.6rem -0.6rem -0.4rem auto;
  }

  .release-card {
    gap: 0.9rem;
  }
}

/* --------------------------------------------------------------------------
   REDUCED MOTION
   The visual engine holds the composition still on its own (see js/motion.js);
   this covers the CSS-driven transitions and the audio pulse.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .audio-toggle.playing {
    animation: none;
    box-shadow: 0 0 14px var(--color-amber-glow);
  }

  .audio-toggle.pending {
    animation: none;
    opacity: 0.7;
  }

  .nav-btn:hover,
  .nav-btn:focus-visible,
  .social-link:hover,
  .social-link:focus-visible,
  .release-card:hover .release-art-img,
  .audio-toggle:hover {
    transform: none;
  }
}
