
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --black:    #0a0f0c;
  --charcoal: #141b17;
  --surface:  #1a231e;
  --border:   #2b3830;
  --text:     #e6e8e2;
  --muted:    #7d837b;
  --gold:     #c9a35b;
  --gold-lt:  #dcb96e;
  --white:    #f2f4ec;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── FILM GRAIN ──────────────────────── */
.grain {
  position: fixed;
  inset: -100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
  z-index: 2000;
  animation: grainShift 1.2s steps(6) infinite;
}

@keyframes grainShift {
  0%, 100% { transform: translate(0, 0); }
  17% { transform: translate(-2%, -3%); }
  34% { transform: translate(1%, -2%); }
  51% { transform: translate(-1%, 2%); }
  68% { transform: translate(3%, 1%); }
  85% { transform: translate(-3%, 3%); }
}

/* ── STUDIO IDENT ────────────────────── */
.ident {
  position: fixed;
  inset: 0;
  background: #0c1310;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: identOut 0.8s cubic-bezier(0.65, 0, 0.35, 1) 2.7s forwards;
}

.ident-inner { text-align: center; }

.ident-logo {
  height: 72px;
  width: auto;
  max-width: 76vw;
  object-fit: contain;
  opacity: 0;
  animation: identIn 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

.ident-line {
  width: 0;
  height: 1px;
  background: var(--gold);
  margin: 28px auto 20px;
  animation: identLine 1s cubic-bezier(0.65, 0, 0.35, 1) 0.9s forwards;
}

.ident-tag {
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: identIn 1s ease 1.4s forwards;
}

@keyframes identIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes identLine {
  from { width: 0; }
  to   { width: 180px; }
}

@keyframes identOut {
  to { opacity: 0; visibility: hidden; }
}

html.no-ident .ident { display: none; }

/* ── NAV ─────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 24px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* No backdrop-filter here: it would become the containing block for the
     fixed-position mobile .nav-links panel and shrink it to the nav bar. */
  /* Solid band the full height of the bar — a gradient here runs out before
     the bar does, and scrolled text collides with the logo. The fade lives
     in nav::after, below the bar. */
  background: rgba(10,15,12,0.96);
}

nav::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 28px;
  background: linear-gradient(to bottom, rgba(10,15,12,0.96), transparent);
  pointer-events: none;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.nav-logo .logo-icon {
  height: clamp(44px, 3vw + 32px, 58px);
  width: auto;
  border-radius: 12px;
  display: block;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  border-left: 1px solid var(--gold);
  padding-left: 14px;
}

.logo-cantera {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(20px, 1.4vw + 14px, 26px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--white);
}

.logo-media {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(10px, 0.5vw + 8px, 12px);
  letter-spacing: 0.6em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 6px;
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--gold); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 10px 16px;
  cursor: pointer;
  position: relative;
  z-index: 120;
  transition: border-color 0.3s, color 0.3s;
}

.nav-toggle:hover { border-color: var(--gold); color: var(--gold); }

/* ── EYEBROW LABELS ──────────────────── */
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  display: block;
  margin-bottom: 20px;
}

/* ── GOLD DIVIDER ────────────────────── */
.gold-line {
  width: 60px;
  height: 1px;
  background: var(--gold);
  margin: 32px 0;
}

.gold-line-full {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin: 0;
}

/* ── SECTION ─────────────────────────── */
section {
  padding: 120px 48px;
  max-width: 1200px;
  margin: 0 auto;
}

section.full-width {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* ── DISPLAY HEADINGS ────────────────── */
h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(52px, 7vw, 96px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--white);
}

h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--white);
}

h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 400;
  color: var(--white);
  line-height: 1.2;
}

h4 {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 12px;
}

p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
  max-width: 560px;
}

/* ── CTA BUTTONS ─────────────────────── */
.btn-primary {
  display: inline-block;
  padding: 14px 36px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s;
  margin-top: 40px;
}

.btn-primary:hover {
  background: var(--gold);
  color: var(--black);
}

.btn-ghost {
  display: inline-block;
  padding: 14px 36px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s;
  margin-top: 40px;
  margin-left: 16px;
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ── SCROLL REVEALS ──────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.in { opacity: 1; transform: translateY(0); }

.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.25s; }
.reveal-d3 { transition-delay: 0.45s; }
.reveal-d4 { transition-delay: 0.65s; }

/* ── TITLE-CARD WORD REVEAL ──────────── */
.title-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 120ms);
}

.title-stage.in .title-word { opacity: 1; transform: translateY(0); }

/* ── KEN BURNS ───────────────────────── */
.kenburns { animation: kb 26s ease-in-out infinite alternate; will-change: transform; }

@keyframes kb {
  from { transform: scale(1) translateX(0); }
  to   { transform: scale(1.08) translateX(-1.5%); }
}

/* ── 9:16 FRAME ──────────────────────── */
.frame-916 {
  aspect-ratio: 9 / 16;
  border: 1px solid rgba(184, 148, 96, 0.25);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.55);
  position: relative;
  background: var(--charcoal);
}

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

.tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.25s ease-out;
  will-change: transform;
}

/* ── EPISODE RAIL ────────────────────── */
.rail {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px 48px 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.rail-card {
  flex: 0 0 auto;
  width: min(240px, 62vw);
  scroll-snap-align: start;
}

.rail-card .frame-916 { border-radius: 14px; box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5); }

.rail-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 44px;
  font-weight: 300;
  color: var(--gold);
  line-height: 1;
  position: absolute;
  top: 16px;
  left: 18px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.rail-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 21px;
  color: var(--white);
  margin-top: 16px;
  line-height: 1.2;
}

.rail-syn {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 6px;
}

.card-locked .frame-916 {
  opacity: 0.4;
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
}

.lock-mark {
  text-align: center;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0 18px;
  line-height: 2.2;
}

.lock-mark::before {
  content: "✦";
  display: block;
  font-size: 22px;
  margin-bottom: 10px;
}

/* ── FOOTER ──────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

footer .footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

footer .footer-logo .logo-icon {
  height: 44px;
  width: auto;
  border-radius: 9px;
  display: block;
}

footer .logo-cantera { font-size: 18px; }
footer .logo-media { font-size: 10px; margin-top: 5px; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  list-style: none;
}

.footer-links a,
.footer-links .soon {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover { color: var(--gold); }

.footer-links .soon { opacity: 0.55; cursor: default; }

.footer-copy {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
  opacity: 0.5;
}

/* ── LEGACY FADE (kept for reuse) ────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up {
  opacity: 0;
  animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.25s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.65s; }

/* ── RESPONSIVE ──────────────────────── */
@media (max-width: 768px) {
  nav { padding: 16px 24px; }

  .nav-toggle { display: block; }

  .nav-links {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 8, 0.97);
    backdrop-filter: blur(8px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    transform: translateY(-102%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }

  nav.open .nav-links { transform: translateY(0); }

  .nav-links a { font-size: 15px; letter-spacing: 0.25em; }

  section { padding: 80px 24px; }
  .rail { padding: 8px 24px 28px; }
  footer { padding: 40px 24px; flex-direction: column; align-items: flex-start; }
  .footer-links { gap: 12px 20px; }
}

/* ── REDUCED MOTION ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ident { display: none; }
  .grain, .kenburns { animation: none; }
  .tilt { transform: none; transition: none; }
  .reveal, .title-word { opacity: 1; transform: none; transition: none; }
  .fade-up { animation-duration: 0.01s; }
  .nav-links { transition: none; }
}
