:root {
  --header-h: 76px;
  --player-h: 104px;
  --chat-w: 410px;
  --bg: #101014;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.13);
  --text: #fff8ee;
  --muted: #c9c0b5;
  --line: rgba(255, 255, 255, 0.16);
  --hot: #ff4b3e;
  --sun: #ffb238;
  --mint: #39d6a3;
  --blue: #2071f3;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  display: grid;
  grid-template-rows: var(--header-h) 1fr var(--player-h);
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 75, 62, 0.24), transparent 28rem),
    radial-gradient(circle at 85% 8%, rgba(32, 113, 243, 0.22), transparent 26rem),
    linear-gradient(180deg, #101014 0%, #15131a 45%, #0f1014 100%);
  color: var(--text);
  font-family: Manrope, Arial, sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  background: var(--sun);
  color: #17120c;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

.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;
}

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 16, 20, 0.9);
  backdrop-filter: blur(18px);
}

.header-inner {
  --page-w: min(1180px, calc(100vw - 2rem));
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(from 140deg, var(--sun), var(--hot), var(--blue), var(--sun));
  color: #130f0c;
  font-size: 0.82rem;
  box-shadow: 0 12px 30px rgba(255, 75, 62, 0.28);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  min-width: 0;
}

.listen-button {
  width: 214px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.45rem 1rem;
  border: 1px solid rgba(93, 255, 169, 0.24);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(45, 202, 126, 0.92), rgba(12, 133, 82, 0.92));
  color: #062014;
  cursor: pointer;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 10px 26px rgba(23, 214, 121, 0.16);
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.listen-button:hover,
.listen-button:focus-visible {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 16px 38px rgba(23, 214, 121, 0.32);
}

.listen-button.is-playing {
  border-color: var(--line);
  background: rgba(23, 23, 32, 0.72);
  color: var(--text);
  box-shadow: none;
}

.listen-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: currentColor;
}

.listen-icon-live,
.listen-button.is-playing .listen-icon-play {
  display: none;
}

.listen-button.is-playing .listen-icon-live {
  display: block;
}

.chat-tab {
  min-width: 0;
  width: auto;
  min-height: 52px;
  display: grid;
  grid-template-columns: auto 28px;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.85rem 0.45rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(23, 23, 32, 0.72);
  color: var(--text);
  cursor: pointer;
  text-align: right;
  box-shadow: none;
}

.chat-tab.is-attached {
  border-bottom-color: var(--line);
  border-radius: 14px;
  background: rgba(23, 23, 32, 0.72);
}

.chat-tab svg {
  width: 24px;
  height: 24px;
  grid-column: 2;
  grid-row: 1;
  fill: var(--sun);
}

.chat-tab span {
  grid-column: 1;
  grid-row: 1;
  font-weight: 800;
}

.app-layout {
  --page-w: min(1180px, calc(100vw - 2rem));
  height: 100%;
  min-height: 0;
  overflow: hidden;
  width: 100%;
  margin: 0;
  display: block;
  padding: 1rem max(1rem, calc((100vw - 1180px) / 2));
  background:
    linear-gradient(90deg, rgba(16, 16, 20, 0.72) 0%, rgba(16, 16, 20, 0.58) 42%, rgba(16, 16, 20, 0.4) 100%),
    url("../img/batukada-hero.png") center / cover no-repeat;
}

.app-layout::before {
  content: "";
  position: fixed;
  inset: var(--header-h) 0 var(--player-h);
  z-index: -1;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.chat-panel,
.feature-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  box-shadow: var(--shadow);
}

.content-panel {
  position: relative;
  width: min(calc(100% - 426px), 760px);
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.8rem;
  overflow: hidden;
  padding: clamp(1rem, 3vw, 2rem);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.hero-pattern {
  display: none;
}

.content-copy,
.info-grid,
.page-footer-note {
  position: relative;
}

.content-copy {
  align-self: center;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--sun);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3rem, 7vw, 5.6rem);
  line-height: 0.92;
}

.hero-copy {
  max-width: 620px;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.24rem);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.social-icons {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding-top: 0.15rem;
}

.social-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease, background 0.2s ease;
}

.social-icon:hover,
.social-icon:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
  outline: 3px solid rgba(255, 178, 56, 0.16);
}

.social-icon svg {
  width: 30px;
  height: 30px;
  display: block;
}

.feature-card {
  min-height: 0;
  padding: 1rem;
  box-shadow: none;
}

.feature-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 0.65rem;
  border-radius: 50%;
  background: rgba(255, 178, 56, 0.14);
  color: var(--sun);
  font-size: 0.8rem;
  font-weight: 800;
}

.feature-card h2 {
  margin: 0;
  font-size: 1rem;
}

.feature-card p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.chat-widget {
  --page-w: min(1180px, calc(100vw - 2rem));
  position: fixed;
  right: max(1rem, calc((100vw - 1180px) / 2));
  top: calc(var(--header-h) + 1rem);
  bottom: calc(var(--player-h) + 1rem);
  z-index: 18;
  width: min(var(--chat-w), calc(100vw - 2rem));
  min-height: 0;
  display: none;
}

.chat-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  border-top: 1px solid var(--line);
  background: rgba(23, 23, 32, 0.76);
  backdrop-filter: blur(18px);
}

.chat-widget.is-open {
  display: block;
}

.chat-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.chat-header strong {
  display: block;
}

.chat-header span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.icon-button {
  min-width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.chat-header .chat-close {
  display: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  cursor: pointer;
}

.button-primary {
  background: linear-gradient(135deg, var(--sun), var(--hot));
  color: #170f0a;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: var(--line);
}

label {
  color: var(--text);
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(8, 8, 12, 0.55);
  color: var(--text);
  padding: 0.75rem 0.85rem;
  resize: vertical;
}

input:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--sun);
  outline: 3px solid rgba(255, 178, 56, 0.16);
}

.chat-name-panel {
  display: grid;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
}

.chat-name-panel.is-hidden {
  display: none;
}

.chat-name-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.pinned-message {
  margin: 0.8rem 1rem 0;
  padding: 0.75rem;
  border: 1px solid rgba(255, 178, 56, 0.45);
  border-radius: var(--radius);
  background: rgba(255, 178, 56, 0.13);
  color: #fff4d8;
}

.pinned-message strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--sun);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
  overflow: auto;
  list-style: none;
  padding: 0.85rem 1rem;
  margin: 0;
}

.chat-message {
  max-width: 84%;
  align-self: flex-start;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px 14px 14px 4px;
  background: rgba(0, 0, 0, 0.22);
}

.chat-message.is-own {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  background: linear-gradient(135deg, rgba(255, 178, 56, 0.28), rgba(255, 75, 62, 0.2));
}

.chat-message__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.chat-message__name {
  font-weight: 800;
}

.chat-message__time {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.chat-message p {
  margin: 0;
  color: #f1e8dd;
}

.empty-state {
  color: var(--muted);
  padding: 1rem 0;
}

.chat-composer {
  position: relative;
  padding: 0.75rem;
  border-top: 1px solid var(--line);
  background: rgba(10, 10, 14, 0.46);
}

.composer-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.composer-row textarea {
  min-height: 48px;
  max-height: 96px;
  display: block;
  resize: none;
}

.composer-row .icon-button,
.composer-row .button {
  height: 48px;
  min-height: 48px;
}

.emoji-button {
  font-size: 1.15rem;
  line-height: 1;
}

.composer-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.25rem;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.form-status.is-error {
  color: #ffb1a8;
}

.form-status.is-success {
  color: #a7f4d8;
}

.emoji-picker {
  position: absolute;
  left: 0.75rem;
  bottom: calc(100% - 0.35rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 23, 32, 0.98);
  box-shadow: var(--shadow);
}

.emoji-picker button {
  width: 38px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.player-footer {
  z-index: 25;
  display: grid;
  place-items: start center;
  overflow: hidden;
  padding: 0.7rem 1rem 0;
  border-top: 1px solid var(--line);
  background: rgba(16, 16, 20, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: none;
}

.player-footer iframe {
  width: min(720px, 100%);
}

@media (max-width: 920px) {
  :root {
    --header-h: 66px;
    --player-h: 89px;
  }

  .header-inner {
    width: min(100% - 1rem, 1180px);
  }

  .brand {
    font-size: 0.95rem;
    gap: 0.55rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .header-actions {
    gap: 0.45rem;
  }

  .listen-button {
    display: none;
  }

  .chat-tab {
    min-width: 0;
    width: auto;
    border-radius: 14px;
    padding-left: 0.8rem;
    padding-right: 0.7rem;
  }

  .app-layout {
    width: min(100% - 1rem, 1180px);
    width: 100%;
    padding: 0.25rem 0.5rem 0.75rem;
  }

  .content-panel {
    width: 100%;
    min-height: 0;
    gap: 0.75rem;
    padding-top: 0.35rem;
  }

  h1 {
    display: none;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .feature-card {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 0 0.75rem;
    padding: 0.8rem;
  }

  .feature-icon {
    grid-row: span 2;
    margin-bottom: 0;
  }

  .feature-card p {
    font-size: 0.82rem;
  }

  .social-icons {
    justify-content: flex-start;
    padding-left: 0.15rem;
  }

  .social-icon {
    width: 40px;
    height: 40px;
  }

  .social-icon svg {
    width: 27px;
    height: 27px;
  }

  .chat-widget {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-h);
    bottom: calc(var(--player-h) + 0.6rem);
    z-index: 19;
    display: none;
    padding: 0.5rem;
    background: rgba(10, 10, 14, 0.72);
    width: auto;
  }

  .chat-widget.is-open {
    display: block;
  }

  .chat-panel {
    border-radius: 16px;
    background: rgba(18, 19, 25, 0.98);
    border-top: 1px solid var(--line);
  }

  .chat-header .chat-close {
    display: inline-grid;
    width: auto;
    padding: 0 0.75rem;
  }

  .player-footer {
    padding: 8px 0.6rem 0;
  }
}

@media (max-width: 520px) {
  .header-inner {
    gap: 0.5rem;
  }

  .brand {
    font-size: 0.82rem;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .listen-button {
    display: none;
  }

  .listen-icon {
    width: 17px;
    height: 17px;
  }

  .chat-tab {
    grid-template-columns: auto 20px;
    gap: 0.35rem;
    min-height: 46px;
    padding: 0.4rem 0.55rem 0.4rem 0.65rem;
    font-size: 0.86rem;
  }

  .chat-tab svg {
    width: 20px;
    height: 20px;
  }

  .content-panel {
    padding: 0.9rem;
  }

  .composer-row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .chat-name-row {
    grid-template-columns: 1fr;
  }

  .chat-message {
    max-width: 92%;
  }
}
