/* THE PROPHETS' TRIBE — style */

@font-face {
  font-family: 'Earth';
  src: url('../POLICE Earth/earth.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0a0806;
  --bg-alt: #14100c;
  --panel: #1c1712;
  --gold: #c99a4b;
  --gold-light: #eccb8a;
  --purple: #6b3fa0;
  --text: #ece4d6;
  --text-dim: #a99d8b;
  --danger: #c9584b;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(ellipse at top, #1a140d 0%, #0a0806 60%);
  color: var(--text);
  font-family: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

h1, h2, h3, .brand {
  font-family: 'Earth', 'Trebuchet MS', sans-serif;
  letter-spacing: 1px;
  color: var(--gold-light);
  text-shadow: 0 0 18px rgba(201,154,75,.35);
}

a { color: var(--gold-light); }

/* ---------- Star Wars-style crawl banner ---------- */
.crawl-banner {
  width: 100%;
  font-size: 2.8rem;
  line-height: 1.6;
  height: calc(6 * 1.6em);
  overflow: hidden;
  background: linear-gradient(180deg, #000 0%, #050302 100%);
  position: relative;
}
.crawl-viewport {
  position: absolute;
  inset: 0;
  perspective: 320px;
  perspective-origin: 50% 100%;
  overflow: hidden;
}
.crawl-text {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 100%;
  padding: 0 3%;
  text-align: center;
  font-family: 'Earth', 'Trebuchet MS', sans-serif;
  font-size: 1em;
  line-height: 1.6;
  letter-spacing: .5px;
  color: var(--gold-light);
  text-shadow: 0 0 14px rgba(201,154,75,.55);
  transform-origin: 50% 100%;
  animation-name: crawlScroll;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: 46s; /* fallback; JS retunes this to the actual content length */
  animation-play-state: paused; /* JS starts it the instant it has measured the real content, no default/guess frame is ever shown moving */
  will-change: transform;
}
.crawl-text p { margin: 0 0 1.1em; }
.crawl-text p:last-child { margin-bottom: 0; }
.crawl-text .crawl-gap { margin: 0; height: 1.1em; }
.crawl-text .crawl-heading {
  text-transform: uppercase;
  letter-spacing: 2px;
}
@keyframes crawlScroll {
  0%   { transform: rotateX(28deg) translateY(var(--crawl-start, 160px)); }
  100% { transform: rotateX(28deg) translateY(var(--crawl-end, -680px)); }
}
@media (max-width: 640px) {
  .crawl-banner { font-size: 2rem; }
  .crawl-text { padding: 0 5%; }
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,0));
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Centered variant used on the home page, so the title sits centered
   with the admin actions pinned to the right rather than crowding it. */
.topbar-center {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.topbar-center .brand-block {
  grid-column: 2;
  justify-self: center;
  text-align: center;
}
.topbar-center .topbar-actions {
  grid-column: 3;
  justify-self: end;
}
@media (max-width: 760px) {
  .topbar-center {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }
  .topbar-center .brand-block,
  .topbar-center .topbar-actions {
    grid-column: 1;
    justify-self: center;
  }
}

.brand-logo {
  height: 56px;
  width: 56px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--gold);
  box-shadow: 0 0 20px rgba(201,154,75,.4);
}

.brand-title {
  font-size: 1.8rem;
  margin: 0;
  line-height: 1.1;
}

.brand-tagline {
  margin: 2px 0 0;
  font-size: .78rem;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-light);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: .85rem;
  letter-spacing: .5px;
  transition: background .2s, color .2s, transform .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { background: var(--gold); color: #1a1208; transform: translateY(-1px); }
.btn-solid {
  background: var(--gold);
  color: #1a1208;
}
.btn-solid:hover { background: var(--gold-light); }
.btn-ghost {
  border-color: rgba(236,203,138,.3);
  color: var(--text-dim);
}
.btn-ghost:hover { background: rgba(236,203,138,.12); color: var(--gold-light); }
.btn-danger { border-color: var(--danger); color: #f0a99f; }
.btn-danger:hover { background: var(--danger); color: #1a1208; }

.btn-lang {
  font-weight: 600;
  min-width: 42px;
  justify-content: center;
  border-color: rgba(236,203,138,.5);
}

.admin-pill {
  font-size: .72rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(107,63,160,.25);
  border: 1px solid var(--purple);
  color: #d9c6f0;
  letter-spacing: .5px;
}

/* ---------- Home hero ---------- */
.hero {
  text-align: center;
  padding: 26px 20px 10px;
}
.hero h1 { display:none; }
.hero p {
  color: var(--text-dim);
  max-width: 640px;
  margin: 10px auto 0;
  font-size: .95rem;
}

/* ---------- Folder grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  padding: 28px;
  max-width: 1400px;
  margin: 0 auto;
}

.tile {
  position: relative;
  height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(201,154,75,.25);
  background: var(--panel) center 30% / cover no-repeat;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.tile:hover { transform: translateY(-4px) scale(1.015); box-shadow: 0 16px 40px rgba(0,0,0,.65); }
.tile::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,8,6,.15) 0%, rgba(10,8,6,.9) 100%);
}
.tile-empty { background-color: var(--bg-alt); }
.tile-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px;
  z-index: 1;
}
.tile-label h3 { margin: 0; font-size: 1.15rem; }
.tile-count { font-size: .75rem; color: var(--text-dim); margin-top: 4px; }

/* ---------- Gallery page ---------- */
.gallery-header {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 28px 0;
}
.gallery-header h2 { font-size: 1.7rem; margin: 6px 0 2px; }
.gallery-sub { color: var(--text-dim); font-size: .85rem; margin: 0 0 18px; }

.section-label {
  max-width: 1400px;
  margin: 26px auto 12px;
  padding: 0 28px;
  color: var(--gold);
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-top: 1px solid rgba(201,154,75,.2);
  padding-top: 18px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
}

.thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  background: var(--bg-alt);
  border: 1px solid rgba(201,154,75,.15);
}
.thumb img, .thumb video {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
.thumb .play-badge {
  position: absolute;
  bottom: 6px; right: 6px;
  background: rgba(0,0,0,.6);
  border: 1px solid var(--gold);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  color: var(--gold-light);
}
.thumb:hover { outline: 2px solid var(--gold); }

.audio-list {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.audio-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 16px;
  border: 1px solid rgba(201,154,75,.2);
  border-radius: 8px;
  background: var(--panel);
}
.audio-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--text);
  flex: 1 1 220px;
  min-width: 0;
}
.audio-title span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audio-row audio {
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 100%;
  height: 36px;
}

.team-credits {
  max-width: 900px;
  margin: 20px auto 60px;
  padding: 0 28px;
  text-align: center;
}
.team-credits-title {
  font-size: 1.9rem;
  letter-spacing: 2px;
  margin: 0 0 18px;
}
.team-credits-line {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 0 8px;
}
.team-credits-heading {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 1.1rem;
  margin: 34px 0 14px;
  padding-top: 20px;
  border-top: 1px solid rgba(201,154,75,.2);
}
.team-credits-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
}
.team-credits-list li {
  color: var(--text);
  font-size: .95rem;
}

.doc-list {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.doc-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(201,154,75,.25);
  border-radius: 8px;
  background: var(--panel);
  font-size: .82rem;
  text-decoration: none;
  color: var(--text);
}
.doc-chip:hover { border-color: var(--gold); color: var(--gold-light); }

.empty-state {
  max-width: 700px;
  margin: 60px auto;
  text-align: center;
  color: var(--text-dim);
  padding: 0 20px;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(4,3,2,.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  flex-direction: column;
}
.lightbox.open { display: flex; }
.lightbox-stage {
  max-width: 90vw;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-stage img, .lightbox-stage video {
  max-width: 90vw;
  max-height: 78vh;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
}
.lightbox-caption {
  color: var(--text-dim);
  font-size: .8rem;
  margin-top: 14px;
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 28px;
  font-size: 1.8rem;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(201,154,75,.35);
  color: var(--gold-light);
  font-size: 1.6rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  cursor: pointer;
}
.lightbox-nav.prev { left: 18px; }
.lightbox-nav.next { right: 18px; }

/* ---------- Modal (login / add) ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(4,3,2,.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--panel);
  border: 1px solid rgba(201,154,75,.3);
  border-radius: var(--radius);
  padding: 28px 26px;
  width: 340px;
  max-width: 90vw;
  box-shadow: var(--shadow);
}
.modal-box h3 { margin: 0 0 4px; }
.modal-box p.hint { color: var(--text-dim); font-size: .8rem; margin: 0 0 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .78rem; color: var(--text-dim); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(201,154,75,.3);
  background: #0e0b08;
  color: var(--text);
  font-size: .9rem;
}
.field input:focus { outline: none; border-color: var(--gold); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-error { color: #f0a99f; font-size: .8rem; margin-top: 8px; min-height: 1em; }

.toast {
  position: fixed;
  bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gold);
  color: #1a1208;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: .85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 300;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

footer {
  text-align: center;
  color: var(--text-dim);
  font-size: .75rem;
  padding: 40px 20px 30px;
  letter-spacing: 1px;
}
footer p { margin: 0; }
.footer-contact {
  margin-top: 8px !important;
  font-size: .72rem;
  letter-spacing: .5px;
}
.footer-contact a {
  color: var(--gold-light);
  text-decoration: none;
}
.footer-contact a:hover { text-decoration: underline; }

.track-list-intro {
  max-width: 1400px;
  margin: 0 auto 16px;
  padding: 0 28px;
  color: var(--text-dim);
  font-size: .88rem;
}
.track-link-list {
  max-width: 1400px;
  margin: 0 auto 24px;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.track-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(201,154,75,.25);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-size: .85rem;
  transition: border-color .2s, color .2s, transform .15s;
}
.track-link-row:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  transform: translateX(3px);
}
.track-link-row .track-icon { flex: 0 0 auto; }
.track-link-row .track-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drive-link-card {
  display: block;
  max-width: 1400px;
  margin: 0 auto 24px;
  padding: 16px 28px;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: rgba(201,154,75,.1);
  color: var(--gold-light);
  text-decoration: none;
  font-size: .92rem;
  text-align: center;
  transition: background .2s, transform .15s;
}
.drive-link-card:hover {
  background: rgba(201,154,75,.2);
  transform: translateY(-2px);
}
