@font-face {
  font-family: 'Tinvan';
  src: url('/fonts/TINVAN5-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

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

:root {
  --bg: #000;
  --fg: #fff;
  --dim: #666;
  --border: #333;
  --accent: #fff;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 70px;
  overflow-x: hidden;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

a {
  color: var(--fg);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* NAV */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: 'Tinvan', monospace;
  font-size: 24px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-link {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.nav-link:hover, .nav-link.active {
  opacity: 1;
  text-decoration: none;
}

/* MAIN */
.main {
  margin-top: 60px;
  padding: 24px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* HERO */
.hero {
  text-align: center;
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.hero-logo {
  width: 180px;
  height: auto;
  filter: invert(1);
  margin-bottom: 16px;
}

.hero-tagline {
  font-family: 'Tinvan', monospace;
  font-size: 14px;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* RADIO + CHAT CONTAINER */
.radio-chat-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* STREAM SECTION */
.stream-section {
  border: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stream-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pulse-on {
  background: #0f0;
  animation: pulse-live 1.5s ease-in-out infinite;
}

.pulse-off {
  background: var(--dim);
  animation: none;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px #0f0; }
  50% { opacity: 0.4; box-shadow: none; }
}

.now-playing {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.now-playing-art {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.now-playing-info h2 {
  font-family: 'Tinvan', monospace;
  font-size: 28px;
  letter-spacing: 3px;
  margin-bottom: 4px;
}

.now-playing-info p {
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 1px;
}

.show-desc {
  margin-top: 8px;
  line-height: 1.6;
  color: var(--dim);
}

.socials {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: auto;
}

.socials a {
  font-size: 11px;
  letter-spacing: 2px;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.socials a:hover {
  opacity: 1;
}

/* CHAT */
.chat-section {
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 3px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-date {
  font-size: 11px;
  letter-spacing: 2px;
  min-width: 90px;
  text-align: center;
}

.chat-nav-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg);
  width: 24px;
  height: 24px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.chat-nav-btn:hover {
  border-color: var(--fg);
}

.chat-nav-btn:disabled {
  opacity: 0.2;
  cursor: default;
}

.chat-live-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--fg);
  color: var(--fg);
  padding: 2px 10px;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-live-btn:hover, .chat-live-btn.active {
  background: var(--fg);
  color: var(--bg);
}

.chat-archive-notice {
  text-align: center;
  padding: 12px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--dim);
  border-bottom: 1px solid var(--border);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 300px;
  max-height: 400px;
}

/* CHAT BUBBLES */
.chat-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  word-break: break-word;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  margin-top: 2px;
}

.chat-bubble {
  background: #111;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 2px 12px 12px 12px;
  max-width: calc(100% - 44px);
  min-width: 0;
}

.chat-bubble-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.chat-msg-name {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg);
}

.chat-msg-time {
  font-size: 10px;
  color: var(--dim);
}

.chat-msg-text {
  font-size: 13px;
  line-height: 1.5;
  color: #ccc;
}

.chat-input-area {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
}

.chat-name-entry, .chat-message-entry {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input-area input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 1px;
  outline: none;
}

.chat-input-area input:focus {
  border-color: var(--fg);
}

.chat-input-area input::placeholder {
  color: var(--dim);
  letter-spacing: 2px;
}

.chat-input-area button {
  background: var(--fg);
  color: var(--bg);
  border: none;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.chat-input-area button:hover {
  opacity: 0.8;
}

.chat-user-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--dim);
  white-space: nowrap;
}

/* PLAYER BAR */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}

.player-art {
  display: none;
}

.player-btn {
  background: none;
  border: 1px solid var(--fg);
  color: var(--fg);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.player-btn:hover {
  background: var(--fg);
  color: var(--bg);
}

.player-btn.playing {
  background: var(--fg);
  color: var(--bg);
}

.play-icon {
  margin-left: 2px;
}

.player-info {
  flex: 1;
}

.player-title {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  display: block;
}

.player-now-playing {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.player-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.player-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
}

.player-visualizer span {
  width: 3px;
  background: var(--fg);
  opacity: 0.3;
  transition: height 0.1s;
}

.player-visualizer.active span {
  animation: bar 0.8s ease-in-out infinite;
}

.player-visualizer span:nth-child(1) { height: 8px; animation-delay: 0s; }
.player-visualizer span:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.player-visualizer span:nth-child(3) { height: 12px; animation-delay: 0.2s; }
.player-visualizer span:nth-child(4) { height: 20px; animation-delay: 0.3s; }
.player-visualizer span:nth-child(5) { height: 10px; animation-delay: 0.4s; }

@keyframes bar {
  0%, 100% { height: 4px; opacity: 0.3; }
  50% { height: 24px; opacity: 1; }
}

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
}

/* PAGE HEADER (archive, workshops) */
.page-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.page-header h1 {
  font-family: 'Tinvan', monospace;
  font-size: 42px;
  letter-spacing: 6px;
  text-transform: uppercase;
}

.page-header p {
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 2px;
  margin-top: 8px;
  text-transform: uppercase;
}

/* ARCHIVE */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.archive-item {
  border: 1px solid var(--border);
  padding: 20px;
  transition: border-color 0.2s;
}

.archive-item:hover {
  border-color: var(--fg);
}

.archive-item h3 {
  font-family: 'Tinvan', monospace;
  font-size: 18px;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.archive-item p {
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 12px;
}

.archive-item iframe {
  width: 100%;
  border: none;
}

/* WORKSHOPS */
.workshop-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

.workshop-poster {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
}

.workshop-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.workshop-info h2 {
  font-family: 'Tinvan', monospace;
  font-size: 36px;
  letter-spacing: 4px;
  margin-bottom: 16px;
}

.workshop-info .detail {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
}

.workshop-info .detail strong {
  color: var(--fg);
}

.workshop-info .description {
  margin-top: 16px;
  line-height: 1.8;
  color: var(--dim);
}

.ticket-btn {
  display: inline-block;
  margin-top: 24px;
  padding: 14px 32px;
  border: 1px solid var(--fg);
  color: var(--fg);
  font-family: 'Tinvan', monospace;
  font-size: 16px;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  background: transparent;
}

.ticket-btn:hover {
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
}

/* Invert Ticket Tailor widget to dark mode */
.tt-widget-wrapper {
  filter: invert(1) hue-rotate(180deg);
  border-radius: 4px;
  overflow: hidden;
  max-width: 600px;
  margin: 24px auto;
}

/* WORKSHOP DETAILS */
.workshop-details {
  border: 1px solid var(--border);
  padding: 32px;
  margin-bottom: 32px;
}

.workshop-details h3 {
  font-family: 'Tinvan', monospace;
  font-size: 22px;
  letter-spacing: 3px;
  margin-bottom: 20px;
}

.workshop-details ul {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.workshop-details li {
  font-size: 13px;
  padding-left: 16px;
  position: relative;
  color: var(--dim);
}

.workshop-details li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--fg);
}

/* FOOTER SECTION */
.footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--dim);
  text-transform: uppercase;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav {
    padding: 10px 16px;
  }

  .nav-logo {
    font-size: 16px;
    letter-spacing: 3px;
  }

  .nav-links {
    gap: 10px;
  }

  .nav-link {
    font-size: 9px;
    letter-spacing: 1.5px;
  }

  .main {
    padding: 0;
    margin-top: 44px;
    padding-top: 0;
  }

  /* Non-home pages need padding for nav + player */
  .main.page-main {
    padding: 16px;
    margin-top: 100px;
  }

  /* Prevent body scroll on home page */
  html:has(.chat-section) {
    overflow: hidden;
  }

  body:not(.page-body) {
    overflow: hidden;
  }

  /* Hide hero on mobile */
  .hero {
    display: none;
  }

  /* Hide stream section — player bar at top handles radio */
  .stream-section {
    display: none;
  }

  body {
    padding-bottom: 0;
  }

  .radio-chat-container {
    display: contents;
  }

  /* Player bar moves to top, right below nav */
  .player-bar {
    top: 44px;
    bottom: auto;
    border-top: none;
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
    gap: 8px;
  }

  .player-art {
    display: block;
    width: 44px;
    height: 44px;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
  }

  .player-btn {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }

  .player-title {
    font-size: 9px;
    letter-spacing: 2px;
  }

  .player-now-playing {
    font-size: 8px;
    letter-spacing: 1.5px;
  }

  /* Chat — fixed position full screen, like native chat apps */
  .chat-section {
    position: fixed;
    top: 108px; /* nav 44 + player ~64 */
    left: 0;
    right: 0;
    bottom: 0;
    border: none;
    display: flex;
    flex-direction: column;
    z-index: 50;
    background: var(--bg);
  }

  .chat-header {
    padding: 6px 12px;
    font-size: 10px;
    flex-shrink: 0;
  }

  .chat-messages {
    min-height: 0;
    max-height: none;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    gap: 10px;
  }

  .chat-input-area {
    flex-shrink: 0;
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    background: var(--bg);
  }

  .chat-input-area input {
    padding: 10px 12px;
    font-size: 16px;
  }

  .chat-input-area button {
    padding: 10px 14px;
  }

  .chat-avatar {
    width: 26px;
    height: 26px;
  }

  .chat-bubble {
    padding: 6px 10px;
  }

  .chat-msg-name {
    font-size: 10px;
  }

  .chat-msg-text {
    font-size: 12px;
  }

  /* Other pages */
  .workshop-hero {
    grid-template-columns: 1fr;
  }

  .workshop-details ul {
    grid-template-columns: 1fr;
  }

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

  .page-header {
    padding: 24px 16px 20px;
  }

  .page-header h1 {
    font-size: 28px;
  }
}
