@import url('https://fonts.googleapis.com/css2?family=Cardo:ital,wght@0,400;1,400&family=IM+Fell+English+SC&family=Outfit:wght@300&display=swap');

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

:root {
  --amber: rgba(255,140,0,0.8);
  --amber-dim: rgba(255,140,0,0.5);
  --amber-faint: rgba(255,140,0,0.2);
  --grey: rgba(180,180,180,0.75);
  --grey-dim: rgba(180,180,180,0.45);
  --grey-faint: rgba(180,180,180,0.3);
  --base: #0b0b0b;
}

html, body {
  width: 100%; height: 100%;
  background: var(--base);
  color: var(--grey);
  overflow: hidden;
}

/* ── Background video ── */
#bg-video {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100vw; min-height: 100vh;
  width: auto; height: auto;
  z-index: 0;
  object-fit: cover;
  pointer-events: none;
}

/* ── Background flash images (above video, below everything) ── */
#flash-1, #flash-2 {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

#vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  background: radial-gradient(ellipse at center,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.45) 60%,
    rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}

/* ── Dayang / Victim ── */
#dayang, #victim {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50%;
  max-width: 500px;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

@media (max-width: 767px) {
  #dayang, #victim {
    width: 85%;
    max-width: none;
    top: 58%;
  }
}

/* ── Loader ── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--base);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.9s ease;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 240px;
}

#loader-message {
  font-family: 'Cardo', serif;
  font-style: italic;
  font-size: 18px;
  color: rgba(255,140,0,0.55);
  text-align: center;
  letter-spacing: 0.03em;
  min-height: 28px;
  transition: opacity 0.5s ease;
  animation: textPulse 3s ease-in-out infinite;
}

#loader-message.fade-out {
  opacity: 0;
  animation: none;
}

@keyframes textPulse {
  0%, 100% { opacity: 0.45; letter-spacing: 0.03em; }
  50%       { opacity: 0.85; letter-spacing: 0.06em; }
}

.loader-track {
  width: 100%;
  height: 1px;
  background: rgba(255,140,0,0.1);
  position: relative;
}

#loader-bar-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: 0%;
  background: rgba(255,140,0,0.55);
  transition: width 0.4s ease;
  box-shadow: 0 0 6px rgba(255,140,0,0.4);
}

#loader-pct {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(255,140,0,0.3);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ── SPA States ──────────────────────────────────────
   Each state is a full-screen transparent layer.
   Only .is-active is visible and interactive.
────────────────────────────────────────────────── */
.state {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.state.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Close button (top-right of each sub-state) ── */
.close-btn {
  position: absolute;
  top: 28px;
  right: 28px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  color: rgba(180,180,180,0.25);
  padding: 8px;
  transition: color 0.3s ease;
  z-index: 50;
}

.close-btn:hover { color: rgba(255,140,0,0.6); }

/* ── Nav label clone (holds on screen during nav→section transition) ── */
.nav-label-clone {
  position: fixed;
  transform: translate(-50%, -50%);
  z-index: 200;
  font-family: 'IM Fell English SC', serif;
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(180,180,180,0.65);
  opacity: 1;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

/* ── Sound notification ── */
#sound-notif {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -60%);
  z-index: 50;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

#sound-notif.visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.notif-main {
  font-family: 'Cardo', serif;
  font-style: italic;
  font-size: clamp(16px, 2.5vw, 22px);
  color: rgba(255,140,0,0.75);
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.notif-sub {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(180,180,180,0.35);
}

/* ── Audio bar ── */
#audio-bar {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  right: 24px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeIn 1s ease 1s forwards;
}

#audio-bar button {
  background: transparent; border: none;
  cursor: pointer; padding: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.4s ease;
}

#speaker-btn { color: rgba(100,100,100,0.5); }
#speaker-btn svg { width: 26px; height: 26px; }
#speaker-btn .wave { transition: opacity 0.4s ease; }
#speaker-btn.off .wave { opacity: 0.15; }
#speaker-btn.on  { color: rgba(255,140,0,0.8); }
#speaker-btn.on .wave { opacity: 1; }
#speaker-btn:hover { color: rgba(255,140,0,0.9); }

#gear-btn { color: rgba(130,130,130,0.35); }
#gear-btn svg { width: 22px; height: 22px; }
#gear-btn:hover { color: rgba(255,140,0,0.55); }

/* ── Bounce arrow ── */
#sound-arrow {
  position: fixed;
  z-index: 25;
  font-size: 22px;
  color: rgba(255,140,0,0.9);
  animation: bounceDown 1s ease-in-out infinite;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  text-shadow: 0 0 8px rgba(255,140,0,0.5);
}

#sound-arrow.visible { opacity: 1; }

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(6px); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Gear panel ── */
#gear-panel {
  position: fixed;
  bottom: 72px; right: 20px;
  z-index: 20;
  background: rgba(10, 6, 2, 0.95);
  border: 1px solid rgba(255,140,0,0.12);
  padding: 18px 20px;
  min-width: 230px;
  display: none;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(10px);
}

#gear-panel.visible { display: flex; }

.panel-title {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,140,0,0.45);
  margin-bottom: 2px;
}

.panel-row { display: flex; align-items: center; gap: 10px; }

.panel-row span {
  font-size: 11px; font-weight: 300;
  color: rgba(180,180,180,0.65);
  flex: 1; white-space: nowrap;
}

.panel-row input[type="range"] {
  flex: 1.5;
  -webkit-appearance: none; appearance: none;
  height: 1px; background: rgba(255,140,0,0.2);
  border: none; outline: none; cursor: pointer; padding: 0;
}

.panel-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,140,0,0.6); cursor: pointer;
}

.mute-btn {
  background: transparent; border: none;
  cursor: pointer; padding: 2px; line-height: 1;
  transition: color 0.3s ease;
}

.mute-btn.on  { color: rgba(255,140,0,0.6); }
.mute-btn.off { color: rgba(80,80,80,0.4); }

/* ── Opening text (world narration — inside state-world) ── */
#opening-text {
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: min(760px, 84vw);
  text-align: center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}

.opening-line {
  display: block;
  font-family: 'IM Fell English SC', serif;
  font-size: clamp(32px, 5vw, 48px);
  color: rgba(180,180,180,0.75);
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* ── World narration text ── */
#narration-text {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: min(680px, 80vw);
  text-align: center;
  font-family: 'Cardo', serif;
  font-style: italic;
  font-size: clamp(16px, 2.5vw, 22px);
  color: var(--grey);
  line-height: 1.7;
  opacity: 0;
  transition: opacity 0.6s ease;
  white-space: pre-line;
  pointer-events: none;
}

/* ── Skip narration button ── */
#skip-narration-btn {
  position: absolute;
  top: calc(50% + clamp(110px, 14vw, 170px));
  left: 50%;
  transform: translateX(-50%);
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(180,180,180,0.22);
  padding: 8px 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease, color 0.35s ease;
  z-index: 30;
}

#skip-narration-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

#skip-narration-btn:hover { color: rgba(255,140,0,0.45); }

@media (max-width: 640px) {
  #skip-narration-btn { top: calc(58% + clamp(90px, 12vw, 130px)); }
}

/* ── World logo (above menu) ── */
#world-logo {
  width: clamp(100px, 20vw, 500px);
  opacity: 0.85;
  margin-bottom: 16px;
}

/* ── World nav (menu) ── */
#world-nav {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

#world-nav.visible {
  opacity: 1;
  pointer-events: auto;
}

.nav-node {
  opacity: 0;
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey-dim);
  cursor: pointer;
  padding: 8px 0;
  transition: opacity 0.6s ease, color 0.4s ease;
  user-select: none;
}

.nav-node.visible { opacity: 1; }
.nav-node:hover   { color: var(--amber); }

/* ── Landing: main content ── */
#main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  position: relative;
  z-index: 5;
  opacity: 0;
  transition: opacity 1.2s ease;
}

#main-content.visible { opacity: 1; }

#logo-img {
  width: clamp(200px, 20vw, 500px);
  margin-bottom: 32px;
  opacity: 0.9;
}

#tagline {
  font-family: 'Cardo', serif;
  font-size: clamp(13px, 2vw, 18px);
  color: var(--grey-dim);
  letter-spacing: 0.05em;
  margin-bottom: 48px;
  line-height: 1.6;
}

#in-development {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 8px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(180,180,180,0.25);
  margin-bottom: 56px;
}

#enter-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--amber-dim);
  padding: 10px 0;
  transition: color 0.4s ease, opacity 0.4s ease;
  position: relative;
}

#enter-btn::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 0; right: 0;
  height: 1px;
  background: var(--amber-faint);
  transition: background 0.4s ease;
}

#enter-btn:hover { color: var(--amber); }
#enter-btn:hover::after { background: rgba(255,140,0,0.5); }

#credit-line {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(180,180,180,0.18);
  white-space: nowrap;
  z-index: 5;
}

/* ── Film ── */
#film-content {
  position: relative;
  z-index: 5;
  width: min(640px, 84vw);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  max-height: 90vh;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 40px 0;
}

#film-content::-webkit-scrollbar { display: none; }

.film-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 28px;
}

.film-synopsis {
  font-family: 'Cardo', serif;
  font-style: italic;
  font-size: clamp(17px, 2.5vw, 22px);
  color: var(--grey);
  line-height: 1.75;
  margin-bottom: 36px;
}

.film-dev-label {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey-dim);
  margin-bottom: 20px;
}

.film-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
}

.film-list li {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--grey-dim);
  padding-left: 1.2em;
  position: relative;
  line-height: 1.6;
}

.film-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: rgba(255,140,0,0.3);
}

.film-closing {
  font-family: 'IM Fell English SC', serif;
  font-size: clamp(17px, 2.5vw, 22px);
  color: var(--amber);
  line-height: 1.75;
}

/* ── Filmmaker ── */
#filmmaker-content {
  position: relative;
  z-index: 5;
  width: min(820px, 88vw);
  display: flex;
  align-items: flex-start;
  gap: 48px;
  overflow-y: auto;
  max-height: 90vh;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 40px 0;
}

#filmmaker-content::-webkit-scrollbar { display: none; }

#armen-photo {
  width: clamp(140px, 20vw, 240px);
  flex-shrink: 0;
  opacity: 0.85;
  filter: grayscale(20%);
  object-fit: cover;
  align-self: flex-start;
}

.filmmaker-bio {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filmmaker-bio p {
  font-family: 'Cardo', serif;
  font-style: italic;
  font-size: clamp(15px, 2vw, 19px);
  color: var(--grey);
  line-height: 1.8;
}

.filmmaker-bio .closing {
  color: var(--amber);
  margin-top: 8px;
}

/* ── Contact ── */
#contact-content {
  position: relative;
  z-index: 5;
  width: min(480px, 84vw);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey-dim);
}

.form-field input,
.form-field select,
.form-field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,140,0,0.2);
  padding: 8px 0;
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 13px;
  color: rgba(180,180,180,0.8);
  outline: none;
  transition: border-color 0.25s ease;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  width: 100%;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-bottom-color: rgba(255,140,0,0.5);
}

.form-field select option {
  background: #0d0a06;
  color: rgba(180,180,180,0.8);
}

.form-field textarea {
  resize: vertical;
  min-height: 100px;
}

.form-submit {
  background: none;
  border: 1px solid rgba(255,140,0,0.25);
  padding: 12px 24px;
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--amber-dim);
  cursor: pointer;
  transition: border-color 0.4s ease, color 0.4s ease;
  align-self: flex-start;
}

.form-submit:hover {
  border-color: rgba(255,140,0,0.6);
  color: var(--amber);
}

#form-success {
  display: none;
  text-align: center;
  padding: 24px 0;
}

#form-success p {
  font-family: 'Cardo', serif;
  font-style: italic;
  font-size: clamp(15px, 2vw, 19px);
  color: var(--grey);
  line-height: 1.7;
  margin-bottom: 16px;
}

/* ── Mobile ── */
/* ── Characters ── */
#characters-content {
  position: relative;
  z-index: 5;
  width: min(960px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 56px 0 80px;
}

#characters-content::-webkit-scrollbar { display: none; }

.character-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px 24px;
}

.character-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.character-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.character-name {
  font-family: 'IM Fell English SC', serif;
  font-size: clamp(15px, 1.8vw, 19px);
  color: var(--amber);
  line-height: 1.3;
}

.character-desc {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.75;
  color: rgba(180,180,180,0.6);
}

/* ── World return link (bottom of each subsection) ── */
.world-return-link {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey-faint);
  padding: 8px 0;
  white-space: nowrap;
  transition: color 0.35s ease;
  z-index: 30;
}

.world-return-link:hover { color: rgba(255,140,0,0.5); }

/* ── Mobile ── */
@media (max-width: 640px) {
  #filmmaker-content {
    flex-direction: column;
    align-items: center;
  }

  #armen-photo {
    width: clamp(120px, 50vw, 200px);
  }

  .close-btn {
    top: 16px;
    right: 16px;
  }

  #audio-bar { bottom: 56px; right: 16px; }
  #gear-panel { right: 16px; bottom: 100px; min-width: 190px; }

  #logo-img   { width: 80vw; }
  #world-logo { width: 80vw; }

  .character-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 16px;
  }

  .world-return-link { bottom: 16px; }
}
