/* =====================================================
   Adam's Cinema — Shared Stylesheet
   style.css
   ===================================================== */

/* ── GOOGLE FONTS ──────────────────────────────────── */
/* ── CSS VARIABLES ─────────────────────────────────── */
:root {
  --black:          #080608;
  --deep:           #0f0a0c;
  --velvet:         #1a0a10;
  --velvet-mid:     #2a1018;
  --velvet-light:   #3d1822;
  --crimson:        #6b0f1a;
  --crimson-bright: #8b1a28;
  --gold:           #c9a84c;
  --gold-bright:    #e8c86a;
  --gold-dim:       #7a6130;
  --gold-pale:      #3d3018;
  --cream:          #f0e8d8;
  --cream-dim:      #c8b898;
  --cream-muted:    #7a6a58;
  --cream-ghost:    #1e1810;
  --code-bg:        #0e0a0c;
  --code-border:    #2a1a20;
}

/* ── RESET & BASE ──────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--cream);
  font-family: 'EB Garamond', Georgia, serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Velvet texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.008) 2px, rgba(255,255,255,0.008) 4px);
  pointer-events: none;
  z-index: 500;
}

/* ── AMBIENT LIGHTING ──────────────────────────────── */
/* Slow-drifting colour pools — visible through glass cards */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 22% 28%, rgba(201,168,76,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 55% 65% at 78% 62%, rgba(107,15,26,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 52% 88%, rgba(139,26,40,0.06) 0%, transparent 55%);
  animation: ambientDrift 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

@keyframes ambientDrift {
  0%,  100% { transform: translate(0,    0);    }
  25%        { transform: translate(2.5%, -1.5%); }
  50%        { transform: translate(-1.5%, 2.5%); }
  75%        { transform: translate(1.5%,  1.5%); }
}

/* ── CEILING & FLOOR ───────────────────────────────── */
.ceiling {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), var(--gold), var(--gold-dim), transparent);
  z-index: 10;
}

.ceiling-glow {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(to bottom, rgba(201,168,76,0.05), transparent);
  pointer-events: none;
  z-index: 1;
}

.floor {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--crimson) 0px, var(--crimson) 80px, var(--gold-pale) 80px, var(--gold-pale) 84px, var(--crimson) 84px);
  z-index: 10;
}

.floor-glow {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(to top, rgba(107,15,26,0.1), transparent);
  pointer-events: none;
  z-index: 1;
}

/* ── CURTAIN ANIMATION (index.html, adams-oracle.html) */
.curtain-left, .curtain-right {
  position: fixed;
  top: 0; width: 50%; height: 100%;
  z-index: 900;
  transition: transform 1.8s cubic-bezier(0.7,0,0.3,1);
}
.curtain-left {
  left: 0;
  background: linear-gradient(to right, #0f0508 0%, #2d0f1a 30%, #1a0810 60%, #2a0e18 80%, #1f0a12 100%);
}
.curtain-right {
  right: 0;
  background: linear-gradient(to left, #0f0508 0%, #2d0f1a 30%, #1a0810 60%, #2a0e18 80%, #1f0a12 100%);
}
.curtain-left::before, .curtain-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0px, transparent 18px, rgba(0,0,0,0.2) 18px, rgba(0,0,0,0.2) 20px, transparent 20px, transparent 38px, rgba(255,255,255,0.02) 38px, rgba(255,255,255,0.02) 40px);
}
.curtain-left.open  { transform: translateX(-100%); }
.curtain-right.open { transform: translateX(100%); }

/* ── NAVIGATION ────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,6,8,0.96);
  border-bottom: 1px solid var(--gold-pale);
  padding: 14px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(8px);
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold-dim);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.3s;
}
.nav-back:hover { color: var(--gold); }

.nav-back-line {
  width: 24px;
  height: 1px;
  background: currentColor;
  transition: width 0.3s;
}
.nav-back:hover .nav-back-line { width: 36px; }

.nav-title {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--cream-muted);
  text-transform: uppercase;
}

/* ── HEADER ────────────────────────────────────────── */
header {
  text-align: center;
  padding: 80px 20px 64px;
  position: relative;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 0.95;
  color: var(--cream);
}

h1 em {
  font-style: italic;
  color: var(--gold);
  display: block;
}

.header-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 28px auto;
  max-width: 400px;
}

.orn-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim));
}
.orn-line.r { background: linear-gradient(270deg, transparent, var(--gold-dim)); }

.orn-diamond {
  width: 5px;
  height: 5px;
  background: var(--gold);
  transform: rotate(45deg);
}

.header-sub {
  font-style: italic;
  font-size: 18px;
  color: var(--cream-muted);
}

/* ── FOOTER ────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 48px 20px 80px;
  border-top: 1px solid var(--cream-ghost);
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 1px;
  background: var(--gold-dim);
}

.footer-mark {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 22px;
  color: var(--gold-dim);
  margin-bottom: 10px;
}

.footer-sub {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 4px;
  color: var(--cream-muted);
  opacity: 0.5;
}

/* ── LOADING BULBS (list.html, adams-oracle.html) ──── */
.loading-lights {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.loading-bulb {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold), 0 0 24px rgba(201,168,76,0.3);
  animation: loadPulse 1.2s ease infinite;
}
.loading-bulb:nth-child(2) { animation-delay: 0.2s; }
.loading-bulb:nth-child(3) { animation-delay: 0.4s; }
.loading-bulb:nth-child(4) { animation-delay: 0.6s; }
.loading-bulb:nth-child(5) { animation-delay: 0.8s; }

.loading-text {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 5px;
  color: var(--gold-dim);
  text-transform: uppercase;
}

/* ── ANIMATIONS ────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes loadPulse {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50%       { opacity: 1;    transform: scale(1); }
}

@keyframes bulbFlicker {
  0%, 88%, 100% { opacity: 1; }
  91%  { opacity: 0.5; }
  94%  { opacity: 1; }
  97%  { opacity: 0.3; }
}

/* ── RESPONSIVE BASE ───────────────────────────────── */
@media (max-width: 700px) {
  .nav { padding: 12px 24px; }
}

/* ── THEATRE RAILS ─────────────────────────────────── */
/* Three effects unified: scroll rope + parallax glow + section pulse */
.theatre-rail {
  position: fixed;
  top: 0; bottom: 0;
  width: 18px;
  z-index: 6;
  pointer-events: none;
}
.rail-l { left: 3px; }
.rail-r { right: 3px; }

/* Rope track (faint vertical line) */
.rail-track {
  position: absolute;
  top: 80px; bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: rgba(201,168,76,0.06);
}

/* Scroll fill (grows as you scroll) */
.rail-fill {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0%;
  background: linear-gradient(180deg, rgba(201,168,76,0.45), rgba(201,168,76,0.08));
  transition: height 0.12s linear;
}

/* Diamond scroll marker */
.rail-marker {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-50%) rotate(45deg);
  width: 5px; height: 5px;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(201,168,76,0.8), 0 0 12px rgba(201,168,76,0.25);
  top: 80px;
  transition: top 0.12s linear, box-shadow 0.25s ease, transform 0.25s ease;
}

/* Section pulse: diamond brightens when a section scrolls into view */
.rail-marker.pulsing {
  box-shadow: 0 0 14px rgba(201,168,76,1), 0 0 28px rgba(201,168,76,0.55);
  transform: translateX(-50%) translateY(-50%) rotate(45deg) scale(1.9);
}

/* Parallax spotlight glow (drifts behind the rope at different speed) */
.rail-glow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 300px;
  background: radial-gradient(ellipse at center, rgba(201,168,76,0.042) 0%, transparent 60%);
  top: 20%;
  transition: top 0.4s ease;
}

@media (max-width: 900px) {
  .theatre-rail { display: none; }
}

/* ── REDUCED MOTION ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .curtain-left  { transform: translateX(-100%) !important; }
  .curtain-right { transform: translateX(100%)  !important; }
  .filmstrip-scroll { animation: none !important; }
}

/* ── FOCUS VISIBLE ────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

:focus:not(:focus-visible) { outline: none; }

/* Override explicit outline:none on form elements */
.range-input:focus-visible,
.text-input:focus-visible,
.era-select:focus-visible {
  outline: 2px solid var(--gold) !important;
  outline-offset: 2px;
}
