/* ==========================================================================
   URA E FSHAJT — 2.5D CINEMATIC SCROLL EXPERIENCE
   Design System & Motion Architecture v2
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  --color-ink: #0a110f;
  --color-ink-light: #162420;
  --color-paper: #f4efea;
  --color-paper-muted: #e4dcd3;
  --color-emerald: #0d4a3a;
  --color-emerald-light: #18775f;
  --color-emerald-glow: #24b08d;
  --color-turquoise: #1a8a8a;
  --color-ochre: #c8812c;
  --color-ochre-light: #e0a050;
  --color-sand: #dcd3c5;
  --color-slate-dark: #070c0b;

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-display: 'Cinzel', 'Playfair Display', serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  --text-xs: clamp(0.72rem, 0.68rem + 0.2vw, 0.82rem);
  --text-sm: clamp(0.85rem, 0.8rem + 0.3vw, 0.95rem);
  --text-base: clamp(1rem, 0.95rem + 0.4vw, 1.1rem);
  --text-lg: clamp(1.15rem, 1rem + 0.5vw, 1.35rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.6rem + 2vw, 3.5rem);
  --text-hero: clamp(2.5rem, 1.8rem + 4vw, 5.5rem);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-cinematic: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* --------------------------------------------------------------------------
   02. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--color-slate-dark);
  color: var(--color-paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
  background-color: var(--color-slate-dark);
}

/* --------------------------------------------------------------------------
   03. SITE HEADER & NAVIGATION
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: linear-gradient(to bottom, rgba(7, 12, 11, 0.9) 0%, rgba(7, 12, 11, 0) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-paper);
}

.brand-mark {
  color: var(--color-ochre);
  font-size: 1.1rem;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.15em;
}

.brand-sub {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: rgba(200, 129, 44, 0.2);
  color: var(--color-ochre);
  border-radius: var(--radius-sm);
  letter-spacing: 0.1em;
  font-weight: 600;
}

.timeline-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  background: none;
  border: none;
  color: rgba(244, 239, 234, 0.55);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 20px;
  transition: all 0.25s ease;
}

.nav-link:hover {
  color: var(--color-paper);
  background: rgba(244, 239, 234, 0.1);
}

.nav-link.active {
  color: var(--color-ochre);
  background: rgba(200, 129, 44, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.audio-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(13, 74, 58, 0.4);
  border: 1px solid rgba(24, 119, 97, 0.4);
  color: var(--color-paper);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.audio-btn:hover {
  background: var(--color-emerald-light);
}

.scroll-progress-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.progress-label {
  font-size: 0.55rem;
  color: rgba(244, 239, 234, 0.4);
  letter-spacing: 0.1em;
}

.progress-val {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-ochre);
}

/* -------------------------------------------------------------------------- */
   04. CINEMATIC STAGE & 2.5D WORLD LAYERS
   -------------------------------------------------------------------------- */
.cinematic-scroll {
  position: relative;
  height: 5000px;
  width: 100%;
}

/* position: fixed instead of sticky — bulletproof on desktop scroll */
.cinematic-stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(to bottom, #1a2a3a 0%, #0d1a20 40%, #0d3b2e 70%, #0a110f 100%);
  will-change: contents;
}

/* Hide stage when we've scrolled past the section */
.cinematic-stage.past {
  visibility: hidden;
  pointer-events: none;
}

.world {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  will-change: transform;
}

/* Layer Base — each is absolutely positioned and individually transformed by JS */
.layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  will-change: transform, opacity;
  overflow: hidden;
}

.layer-img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- LAYER 00: SKY --- */
/* Full-bleed background sky */
.layer-00 {
  z-index: 1;
}

.layer-00 .layer-img {
  object-position: center;
}

.sky-tint {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 50% 25%, rgba(200, 129, 44, 0.12) 0%, transparent 50%),
              linear-gradient(to bottom, transparent 30%, rgba(7, 12, 11, 0.4) 100%);
  z-index: 2;
}

/* --- LAYER 20: RIVER / MIDGROUND --- */
.layer-20 {
  z-index: 3;
}

.layer-20 .layer-img {
  object-position: center bottom;
  width: 110%;
  height: 110%;
  left: -5%;
  top: -5%;
}

/* --- LAYER 30: BRIDGE ARCH (HERO) --- */
.layer-30 {
  z-index: 4;
}

.layer-30 .layer-img {
  object-position: center;
  width: 100%;
  height: 100%;
}

/* --- LAYER 35: HIGH DIVER --- */
.layer-35 {
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.diver-img {
  width: 280px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.5));
}

/* --- LAYER 40: LEFT CANYON WALL --- */
.layer-40 {
  z-index: 6;
}

.layer-40 .layer-img {
  width: 65%;
  height: 100%;
  left: -8%;
  top: 0;
  object-position: right center;
}

/* --- LAYER 41: RIGHT CANYON WALL --- */
.layer-41 {
  z-index: 7;
}

.layer-41 .layer-img {
  width: 65%;
  height: 100%;
  right: -8%;
  left: auto;
  top: 0;
  object-position: left center;
}

/* --- LAYER 50: ATMOSPHERIC OVERLAYS --- */
.layer-50 {
  z-index: 8;
}

.gorge-mist {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(to top, rgba(13, 74, 58, 0.35) 0%, rgba(26, 138, 138, 0.1) 60%, transparent 100%);
  pointer-events: none;
}

.vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 200px rgba(7, 12, 11, 0.7);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   05. NARRATIVE PANELS
   -------------------------------------------------------------------------- */
.narrative-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.narrative-panel {
  position: absolute;
  max-width: 600px;
  width: 88%;
  padding: 2rem 2.5rem;
  background: rgba(10, 17, 15, 0.82);
  border: 1px solid rgba(220, 211, 197, 0.12);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-cinematic);
  opacity: 0;
  pointer-events: auto;
  will-change: transform, opacity;
}

.panel-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-ochre);
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-emerald-glow);
  box-shadow: 0 0 8px var(--color-emerald-glow);
}

.hero-title {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.title-sub {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--color-sand);
}

.title-main {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  background: linear-gradient(135deg, #ffffff 0%, var(--color-paper) 60%, var(--color-sand) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  font-size: var(--text-lg);
  color: var(--color-paper-muted);
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.scroll-cue {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.cue-mouse {
  width: 20px;
  height: 32px;
  border: 2px solid rgba(244, 239, 234, 0.35);
  border-radius: 10px;
  position: relative;
}

.cue-wheel {
  width: 3px;
  height: 7px;
  background: var(--color-ochre);
  border-radius: 2px;
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollPulse 1.8s infinite;
}

@keyframes scrollPulse {
  0% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 14px); }
}

.cue-text {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--color-sand);
}

.panel-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-paper);
  margin-bottom: 0.8rem;
}

.panel-text {
  font-size: var(--text-base);
  color: var(--color-paper-muted);
  margin-bottom: 1.2rem;
}

.panel-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(220, 211, 197, 0.1);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 900;
  color: var(--color-ochre);
}

.stat-lbl {
  font-size: 0.7rem;
  color: rgba(244, 239, 234, 0.5);
  letter-spacing: 0.04em;
}

.panel-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--color-sand);
  border-left: 3px solid var(--color-ochre);
  padding-left: 1rem;
  margin-top: 0.8rem;
}

.heritage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.tag {
  padding: 5px 12px;
  background: rgba(24, 119, 97, 0.18);
  border: 1px solid rgba(24, 119, 97, 0.35);
  color: var(--color-paper);
  font-size: 0.7rem;
  border-radius: 20px;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   06. CATALOG RAIL
   -------------------------------------------------------------------------- */
.catalog-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 30;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 3rem;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}

.catalog-stage.active {
  pointer-events: auto;
}

.catalog-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.catalog-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-ochre);
  letter-spacing: 0.1em;
  margin-bottom: 0.3rem;
}

.catalog-title {
  font-family: var(--font-mantle, var(--font-display));
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-paper);
}

.catalog-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.catalog-arrow-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(10, 17, 15, 0.8);
  border: 1px solid rgba(220, 211, 197, 0.18);
  color: var(--color-paper);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.catalog-arrow-btn:hover {
  background: var(--color-emerald-light);
  border-color: var(--color-emerald-light);
  transform: scale(1.06);
}

.catalog-counter {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-sand);
}

.catalog-viewport {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: grab;
}

.catalog-rail {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.catalog-rail.dragging {
  transition: none;
}

.catalog-card {
  flex: 0 0 340px;
  background: rgba(10, 17, 15, 0.85);
  border: 1px solid rgba(220, 211, 197, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.catalog-card:hover {
  transform: translateY(-6px);
  border-color: rgba(200, 129, 44, 0.4);
}

.card-image-wrap {
  position: relative;
  height: 180px;
  width: 100%;
  overflow: hidden;
}

.card-image-wrap img {
  width:  100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.catalog-card:hover .card-image-wrap img {
  transform: scale(1.06);
}

.card-category {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  padding: 3px 9px;
  background: rgba(7, 12, 11, 0.85);
  color: var(--color-ochre);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(200, 129, 44, 0.25);
}

.card-body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card-title {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-paper);
}

.card-desc {
  font-size: var(--text-sm);
  color: rgba(244, 239, 234, 0.65);
  line-height: 1.5;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.3rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(220, 211, 197, 0.06);
}

.card-meta {
  font-size: 0.7rem;
  color: var(--color-sand);
}

.card-btn {
  background: none;
  border: none;
  color: var(--color-ochre);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-btn:hover {
  color: var(--color-paper);
}

/* --------------------------------------------------------------------------
   07. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 40;
  background: var(--color-slate-dark);
  border-top: 1px solid rgba(220, 211, 197, 0.08);
  padding: 2rem 3rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
}

.footer-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--color-paper);
}

.footer-sub {
  font-size: var(--text-xs);
  color: rgba(244, 239, 234, 0.4);
  margin-top: 0.2rem;
}

.footer-credits {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: var(--text-xs);
  color: var(--color-sand);
}

.back-top {
  color: var(--color-ochre);
  text-decoration: none;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   08. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .site-header { padding: 0 1.5rem; }
  .timeline-nav { display: none; }
  .cinematic-scroll { height: 4200px; }
  .catalog-stage { padding: 3rem 2rem; }
  .catalog-card { flex: 0 0 300px; }
  .layer-40 .layer-img { width: 70%; }
  .layer-41 .layer-img { width: 70%; }
}

@media (max-width: 768px) {
  .cinematic-scroll { height: 3500px; }
  .site-header { padding: 0 1rem; height: 56px; }
  .brand-sub { display: none; }
  .narrative-panel { padding: 1.5rem 1.5rem; }
  .panel-stats { grid-template-columns: 1fr; gap: 0.5rem; }
  .catalog-header { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
  .catalog-card { flex: 0 0 260px; }
  .catalog-stage { padding: 2rem 1.5rem; }
  .diver-img { width: 180px; }
  .footer-content { flex-direction: column; gap: 1rem; align-items: flex-start; }
  .layer-40 .layer-img { width: 80%; }
  .layer-41 .layer-img { width: 80%; }
}

/* --------------------------------------------------------------------------
   09. PREFERS-REDUCED-MOTION
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .cinematic-scroll { height: auto; }
  .cinematic-stage { position: relative; height: auto; }
  .layer { transform: none !important; opacity: 1 !important; }
  .layer-35 { opacity: 1; }
  .narrative-panel { position: relative; opacity: 1; margin: 2rem auto; }
  .catalog-stage { position: relative; opacity: 1; pointer-events: auto; }
}
