/*
  GLOBAL STYLES
  Base reset, typography, navigation, footer, responsive utilities.
  All pages include this — no inline duplication.
*/

/* === RESET === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === BASE === */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--color-bg);
  font-family: 'Cormorant Garamond', serif;
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 100px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  max-width: 100%;
  display: block;
}

/* === TYPOGRAPHY === */
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--fluid-eyebrow);
  color: var(--color-accent);
  letter-spacing: var(--fluid-tracking-md);
  text-transform: uppercase;
}

.section-title {
  font-size: var(--fluid-title-lg);
  font-weight: 300;
  letter-spacing: var(--fluid-tracking-lg);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: var(--fluid-space-md);
  color: var(--color-text);
}

/* === CONTAINER === */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--fluid-space-md) var(--fluid-space);
}

/* === DIVIDER === */
.divider {
  width: 200px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-accent), transparent);
  margin: var(--fluid-space-md) auto;
}

/* === HOME BUTTON === */
.home-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 48px;
  height: 48px;
  background: var(--color-accent-dim);
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  font-size: 20px;
  line-height: 1;
  color: var(--color-accent);
}

.home-btn:hover {
  background: rgba(212, 184, 150, 0.2);
  transform: scale(1.05);
}

.home-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* === HAMBURGER NAVIGATION === */
.hamburger-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: var(--color-accent-dim);
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  cursor: pointer;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 12px;
  transition: all var(--transition-base);
}

.hamburger-btn:hover {
  background: rgba(212, 184, 150, 0.2);
  transform: scale(1.05);
}

.hamburger-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 999;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(350px, 85vw);
  height: 100%;
  background: var(--color-bg-elevated);
  border-left: 1px solid var(--color-accent);
  transform: translateX(100%);
  transition: transform var(--transition-base);
  z-index: 1000;
  overflow-y: auto;
  padding: 24px;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.nav-drawer.active {
  transform: translateX(0);
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--color-accent);
  font-size: 24px;
  line-height: 1;
  transition: all var(--transition-base);
}

.close-btn:hover {
  background: var(--color-accent-dim);
  transform: rotate(90deg);
}

.close-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.nav-content {
  margin-top: 60px;
}

.nav-title {
  font-size: 24px;
  color: var(--color-accent);
  margin-bottom: 32px;
  font-weight: 600;
}

.nav-section {
  margin-bottom: 28px;
}

.nav-section-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-accent);
  opacity: 0.7;
  margin-bottom: 12px;
  font-weight: 600;
}

.nav-links {
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  min-height: 44px;
  color: var(--color-text);
  text-decoration: none;
  border-radius: 6px;
  transition: all var(--transition-fast);
  margin-bottom: 4px;
  font-size: 15px;
}

.nav-link:hover {
  background: var(--color-accent-dim);
  color: var(--color-accent);
  padding-left: 24px;
}

.nav-link.active {
  background: var(--color-accent-dim);
  color: var(--color-accent);
}

.nav-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

/* Scrollbar */
.nav-drawer::-webkit-scrollbar { width: 6px; }
.nav-drawer::-webkit-scrollbar-track { background: var(--color-bg-elevated); }
.nav-drawer::-webkit-scrollbar-thumb { background: var(--color-accent); border-radius: 3px; }

/* === CONTACT FOOTER === */
.contact-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: rgba(8, 8, 8, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--color-border-strong);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-inner {
  max-width: 1200px;
  width: 100%;
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  min-height: 44px;
  min-width: 44px;
  color: var(--color-accent);
  text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--fluid-small);
  border-radius: 8px;
  transition: all var(--transition-base);
  position: relative;
}

.footer-link:hover {
  background: var(--color-accent-dim);
  transform: translateY(-2px);
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition-base);
}

.footer-link:hover::after {
  width: 80%;
}

.footer-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.footer-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.footer-text {
  display: inline;
}

/* === FOOTER ACTIVE STATE === */
.footer-link.active {
  background: rgba(212, 184, 150, 0.15);
}

/* === SCROLL REVEAL === */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0, 0, 0.2, 1);
}

.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* === TAG === */
.tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--fluid-tiny);
  color: var(--color-accent);
  background: var(--color-accent-dim);
  border: 1px solid var(--color-accent-border);
  padding: 6px 12px;
  border-radius: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* === RESPONSIVE === */

/* Tablet */
@media (max-width: 1024px) {
  .section-title {
    font-size: var(--fluid-title-md);
  }
}

/* Mobile */
@media (max-width: 768px) {
  body {
    padding-bottom: 90px;
  }

  .contact-footer {
    height: auto;
    min-height: 70px;
    padding: 0.5rem 0;
  }

  .footer-inner {
    gap: 0.5rem;
  }

  .footer-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }

}

/* Small mobile */
@media (max-width: 480px) {
  .footer-text {
    display: none;
  }

  .footer-link {
    padding: 0.75rem;
    justify-content: center;
  }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

@media (prefers-contrast: high) {
  .contact-footer {
    border-top: 2px solid #fff;
  }

  .footer-link {
    color: #fff;
  }
}

/* Touch enhancements */
@media (hover: none) and (pointer: coarse) {
  .hamburger-btn:active {
    transform: scale(0.95);
  }

  .footer-link:active {
    background: var(--color-accent-dim);
    transform: none;
  }
}

/* === FOCUS VISIBLE === */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* =============================================
   HOTEL KRAT PLAYER — Persistent Music Widget
   ============================================= */
.krat-player {
  position: fixed;
  top: 78px;
  left: 20px;
  z-index: 500;
  font-family: 'IBM Plex Mono', monospace;
}

/* --- Toggle Button (collapsed state) --- */
.krat-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-accent-border);
  background: var(--color-bg-card);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  position: relative;
  z-index: 2;
}

.krat-toggle:hover {
  transform: scale(1.08);
  border-color: var(--color-accent);
  box-shadow: 0 2px 12px rgba(212, 184, 150, 0.2);
}

/* Mini vinyl inside the toggle */
.krat-mini-vinyl {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1a1a1a;
  position: relative;
  overflow: hidden;
}

.krat-mini-groove {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0px,
    transparent 1px,
    rgba(255,255,255,0.04) 1.5px,
    transparent 2px
  );
}

.krat-mini-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-accent) 30%, #8b6914 100%);
}

/* Spinning mini vinyl when playing */
.krat-player.playing .krat-mini-vinyl {
  animation: krat-spin 2s linear infinite;
}

/* Hide toggle when expanded */
.krat-player.expanded .krat-toggle {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

/* --- Expanded Panel --- */
.krat-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 200px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-accent-border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  opacity: 0;
  transform: scale(0.9) translateY(-8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.krat-player.expanded .krat-panel {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* --- Turntable --- */
.krat-turntable {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 12px;
}

/* Brass bezel ring */
.krat-bezel {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #c9a84c, #f0d77e, #b8922a, #dfc25e,
    #a07818, #e8cf6a, #c9a84c
  );
  padding: 2px;
}

.krat-bezel-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--color-bg-card);
}

/* Vinyl record */
.krat-vinyl {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #111;
  cursor: pointer;
  overflow: hidden;
}

.krat-vinyl-surface {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0px,
    transparent 2px,
    rgba(255,255,255,0.03) 2.5px,
    transparent 3px
  );
}

/* Center label */
.krat-vinyl-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #d4a44c, #8b6914);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
}

.krat-lbl-studio {
  font-size: 4px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #1a1a1a;
  line-height: 1;
}

.krat-lbl-track {
  font-size: 5.5px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
}

.krat-lbl-artist {
  font-size: 3.5px;
  color: #2a2a2a;
  line-height: 1;
}

/* Iridescent shimmer */
.krat-shine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    transparent 30%,
    rgba(212, 184, 150, 0.06) 45%,
    rgba(150, 180, 212, 0.04) 55%,
    transparent 70%
  );
  pointer-events: none;
}

/* Spinning vinyl */
.krat-player.playing .krat-vinyl {
  animation: krat-spin 3s linear infinite;
}

@keyframes krat-spin {
  to { transform: rotate(360deg); }
}

/* --- Tonearm --- */
.krat-arm {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 50px;
  height: 10px;
  transform-origin: 42px 5px;
  transform: rotate(-30deg);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  pointer-events: none;
}

.krat-player.playing .krat-arm {
  transform: rotate(-12deg);
}

.krat-arm-bar {
  position: relative;
  width: 100%;
  height: 100%;
}

.krat-arm-head {
  position: absolute;
  left: 0;
  top: 2px;
  width: 12px;
  height: 6px;
  background: linear-gradient(to right, #888, #aaa);
  border-radius: 1px;
}

.krat-arm-pivot {
  position: absolute;
  right: 0;
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #d4a44c, #8b6914);
  border: 1px solid rgba(212, 184, 150, 0.4);
}

/* --- Song Info --- */
.krat-info {
  text-align: center;
  margin-bottom: 10px;
}

.krat-song-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 1px;
}

.krat-song-artist {
  font-size: 9px;
  color: var(--color-text-secondary);
  margin-top: 1px;
}

.krat-song-game {
  font-size: 8px;
  color: var(--color-text-subtle);
  font-style: italic;
  margin-top: 1px;
}

/* --- Controls --- */
.krat-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* Play/Pause button */
.krat-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-accent-border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.krat-play:hover {
  background: var(--color-accent-dim);
  border-color: var(--color-accent);
}

/* Play triangle */
.krat-icon-play {
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent var(--color-accent);
  margin-left: 2px;
}

/* Pause bars */
.krat-icon-pause {
  display: none;
  gap: 3px;
}

.krat-icon-pause i {
  display: block;
  width: 3px;
  height: 12px;
  background: var(--color-accent);
  border-radius: 1px;
}

.krat-player.playing .krat-icon-play { display: none; }
.krat-player.playing .krat-icon-pause { display: flex; }

/* --- Progress Bar --- */
.krat-progress {
  width: 100%;
}

.krat-progress-track {
  width: 100%;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.krat-progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.krat-times {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: var(--color-text-subtle);
  margin-top: 3px;
}

/* --- Volume --- */
.krat-volume {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.krat-vol-icon {
  width: 14px;
  height: 14px;
  fill: var(--color-text-secondary);
  flex-shrink: 0;
}

.krat-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: var(--color-border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.krat-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  border: none;
}

.krat-vol-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  border: none;
}

/* Playing glow on panel */
.krat-player.playing.expanded .krat-panel {
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 20px rgba(212, 184, 150, 0.08);
}

/* Playing glow on toggle */
.krat-player.playing:not(.expanded) .krat-toggle {
  box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 12px rgba(212, 184, 150, 0.15);
  border-color: var(--color-accent);
}

/* Spotify fallback (hidden by default, shown when YouTube embed fails) */
.krat-spotify { display: none; margin-top: 8px; }
.krat-spotify iframe { border: none; }

/* Fallback mode — hide YouTube controls, show Spotify player */
.krat-player.krat-fallback-mode .krat-controls { display: none; }
.krat-player.krat-fallback-mode .krat-spotify { display: block; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .krat-player.playing .krat-vinyl,
  .krat-player.playing .krat-mini-vinyl {
    animation: none;
  }
  .krat-panel {
    transition: opacity 0.1s ease;
    transform: none !important;
  }
  .krat-toggle {
    transition: none;
  }
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .krat-player {
    top: auto;
    bottom: 80px;
    left: 12px;
  }
  .krat-panel {
    width: 180px;
    bottom: 0;
    top: auto;
    transform-origin: bottom left;
  }
  .krat-player.expanded .krat-panel {
    transform: scale(1) translateY(0);
  }
  .krat-turntable {
    width: 80px;
    height: 80px;
  }
  .krat-vinyl-label {
    width: 28px;
    height: 28px;
  }
  .krat-lbl-studio { font-size: 3px; }
  .krat-lbl-track { font-size: 4.5px; }
  .krat-lbl-artist { font-size: 3px; }
}
