:root {
  --bg: #050505;
  --fg: #f4f1ec;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#gl {
  position: fixed;
  inset: 0;
  cursor: grab;
  touch-action: none;
}
#gl.dragging { cursor: grabbing; }
#gl.hovering { cursor: pointer; }
#gl canvas { display: block; }

.vignette {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, 0.6) 100%);
}

/* ---------- Loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
.loader-logo {
  width: min(440px, 70vw);
  height: auto;
  filter: brightness(0) invert(1);
}
.loader-bar {
  width: min(280px, 60vw);
  height: 1px;
  background: rgba(244, 241, 236, 0.15);
  overflow: hidden;
}
.loader-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--fg);
}

/* ---------- UI chrome ---------- */
.ui {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  mix-blend-mode: difference;
  color: #fff;
}
.ui a { pointer-events: auto; }

.ui-top {
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 28px;
}
.brand {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.1em;
}
.nav { display: flex; gap: 26px; }
.nav a {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
  transition: opacity 0.25s;
}
.nav a:hover { opacity: 1; }

.ui-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  line-height: 0;
  user-select: none;
}
.ui-center img {
  width: clamp(570px, 78vw, 1470px);
  height: auto;
  /* strip the brand blue to pure white so the difference blend
     reacts to the posters exactly like the old text logo did */
  filter: brightness(0) invert(1);
  -webkit-user-drag: none;
}

.ui-bottom {
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 28px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* ---------- hover tooltip ---------- */
#tooltip {
  position: fixed;
  z-index: 12;
  top: 0;
  left: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  background: rgba(8, 8, 8, 0.78);
  border: 1px solid rgba(244, 241, 236, 0.16);
  backdrop-filter: blur(12px);
  opacity: 0;
  white-space: nowrap;
}
#tooltipTitle {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#tooltipMeta {
  font-size: 11px;
  opacity: 0.65;
  letter-spacing: 0.05em;
}

/* ---------- Detail page ---------- */
#detail {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #0a0a0a;
  clip-path: inset(100% 0 0 0);
  visibility: hidden;
  overflow-y: auto;
}
.detail-inner {
  min-height: 100%;
  padding: clamp(20px, 4vw, 56px);
  display: flex;
  flex-direction: column;
}
#detailClose {
  align-self: flex-start;
  background: none;
  border: 1px solid rgba(244, 241, 236, 0.3);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 22px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
#detailClose:hover { background: var(--fg); color: #0a0a0a; }
#detailClose span { margin-right: 6px; }

.detail-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  padding-top: clamp(24px, 4vh, 48px);
}
.detail-poster img {
  width: 100%;
  border-radius: 6px;
  display: block;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}
.detail-kicker {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 18px;
}
.detail-info h1 {
  font-size: clamp(36px, 5.5vw, 84px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}
.detail-meta {
  display: flex;
  gap: 10px;
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 28px;
}
.detail-meta .dot { opacity: 0.5; }
.detail-body {
  max-width: 52ch;
  font-size: 16px;
  line-height: 1.65;
  opacity: 0.85;
  margin-bottom: 32px;
}
.detail-imdb {
  display: inline-block;
  color: var(--fg);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(244, 241, 236, 0.4);
  padding-bottom: 4px;
  margin-bottom: 36px;
  transition: border-color 0.25s, opacity 0.25s;
}
.detail-imdb:hover { border-color: var(--fg); }
.detail-imdb[hidden] { display: none; }

.detail-services {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.detail-services li {
  border: 1px solid rgba(244, 241, 236, 0.25);
  border-radius: 100px;
  padding: 8px 18px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

@media (max-width: 760px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-poster { max-width: 300px; }
  .ui-bottom .hint { display: none; }
  #tooltip { display: none; }
}
