/* ===========================================================
   THE EXPEDITION OF RAMAYANA — Shared Design System
   Gold-on-black cinematic styling, parchment texture, motion.
   =========================================================== */

:root {
  --obsidian: #0D0B08;
  --obsidian-2: #16130E;
  --obsidian-3: #1E1A13;
  --parchment: #EDE4CC;
  --parchment-dim: #C9BEA0;
  --amber: #C9922E;
  --amber-bright: #E0AC4C;
  --bronze: #8A7A5C;
  --ember: #8B2E1F;
  --ember-bright: #A83C29;
  --slate: #2E4A52;
  --slate-bright: #3F636D;
  --hairline: rgba(237, 228, 204, 0.12);
  --hairline-bright: rgba(201, 146, 46, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--obsidian);
  color: var(--parchment);
  font-family: 'Source Serif 4', serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Parchment grain overlay — subtle, fixed, non-interactive */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.79  0 0 0 0 0.72  0 0 0 0 0.55  0 0 0 0.02 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 { font-family: 'Fraunces', serif; font-weight: 500; letter-spacing: -0.01em; line-height: 1.08; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.container { max-width: 1180px; margin: 0 auto; position: relative; z-index: 2; }

.label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
}

/* ---------- NAV ---------- */
header.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.3rem clamp(1.5rem, 5vw, 4rem);
  background: linear-gradient(to bottom, rgba(13,11,8,0.95), rgba(13,11,8,0.7) 70%, transparent);
  backdrop-filter: blur(3px);
}
.nav-mark { font-family: 'Fraunces', serif; font-size: 1.05rem; font-weight: 500; text-decoration: none; }
nav.nav-links {
  display: flex; gap: clamp(0.9rem, 2.6vw, 1.9rem); align-items: center;
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
  letter-spacing: 0.09em; text-transform: uppercase;
}
nav.nav-links a {
  text-decoration: none; color: var(--parchment-dim);
  transition: color 0.25s ease; padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
nav.nav-links a:hover, nav.nav-links a.active { color: var(--amber); border-bottom-color: var(--amber); }
.nav-cta {
  background: var(--amber); color: var(--obsidian) !important;
  padding: 0.5rem 1rem; border-radius: 2px; border-bottom: none !important;
}
.nav-cta:hover { background: var(--amber-bright); }

.nav-toggle {
  display: none;
  background: none; border: none; color: var(--parchment);
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
  letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
}
@media (max-width: 780px) {
  .nav-toggle { display: block; }
  nav.nav-links {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(280px, 80vw);
    background: var(--obsidian-2); flex-direction: column; align-items: flex-start;
    padding: 6rem 2rem 2rem; gap: 1.6rem; font-size: 0.82rem;
    transform: translateX(100%); transition: transform 0.35s ease;
    border-left: 1px solid var(--hairline); z-index: 99;
  }
  nav.nav-links.open { transform: translateX(0); }
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace; font-size: 0.76rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; padding: 0.9rem 1.7rem;
  border-radius: 2px; transition: all 0.25s ease; border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--amber); color: var(--obsidian); }
.btn-primary:hover { background: var(--amber-bright); transform: translateY(-1px); }
.btn-ghost { border-color: var(--hairline); color: var(--parchment-dim); background: transparent; }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn-slate { background: var(--slate); color: var(--parchment); }
.btn-slate:hover { background: var(--slate-bright); transform: translateY(-1px); }

/* ---------- SECTION SCAFFOLD ---------- */
section { padding: 6.5rem clamp(1.5rem, 6vw, 4rem); position: relative; z-index: 2; }
.section-head { max-width: 640px; margin-bottom: 3.2rem; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-top: 0.6rem; }
.section-head p { color: var(--parchment-dim); margin-top: 1rem; font-size: 1.05rem; }
.section-alt { background: var(--obsidian-2); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }

/* ---------- SCROLL REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- PAGE HERO (non-home pages) ---------- */
.page-hero {
  padding: 9rem clamp(1.5rem, 6vw, 4rem) 4rem;
  text-align: center;
  position: relative;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(201,146,46,0.08), transparent 60%);
  pointer-events: none;
}
.page-hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); position: relative; z-index: 2; }
.page-hero p { color: var(--parchment-dim); max-width: 56ch; margin: 1.1rem auto 0; font-size: 1.05rem; position: relative; z-index: 2; }

/* ---------- FOOTER ---------- */
footer {
  padding: 2.6rem clamp(1.5rem, 6vw, 4rem) 3rem; border-top: 1px solid var(--hairline);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; letter-spacing: 0.06em;
  color: var(--bronze); text-transform: uppercase; text-align: center;
  position: relative; z-index: 2;
}
footer a { text-decoration: none; transition: color 0.25s ease; }
footer a:hover { color: var(--amber); }
.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; justify-content: center; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 2px;
}

/* ---------- 3D BOOK MOCKUP ---------- */
.book-3d-stage {
  perspective: 1800px;
  display: flex; align-items: center; justify-content: center;
}
.book-3d {
  position: relative;
  width: clamp(200px, 24vw, 300px);
  aspect-ratio: 5/7.75;
  transform-style: preserve-3d;
  transform: rotateY(-28deg) rotateX(2deg);
  transition: transform 0.6s ease;
  animation: book-float 6s ease-in-out infinite;
}
.book-3d:hover { transform: rotateY(-12deg) rotateX(1deg); }
@keyframes book-float {
  0%, 100% { transform: rotateY(-28deg) rotateX(2deg) translateY(0); }
  50% { transform: rotateY(-28deg) rotateX(2deg) translateY(-10px); }
}
.book-3d-face {
  position: absolute; inset: 0;
  border-radius: 2px;
  backface-visibility: hidden;
}
.book-3d-front {
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(139,46,31,0.4);
  box-shadow: 6px 30px 60px -12px rgba(0,0,0,0.7);
}
.book-3d-front-placeholder {
  background: radial-gradient(ellipse 90% 60% at 50% 0%, rgba(46,74,82,0.4), transparent 60%), linear-gradient(160deg, #10161A, #0D0B08 70%);
  border-color: rgba(46,74,82,0.5);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(1.2rem, 2.4vw, 1.8rem);
}
.book-3d-spine {
  position: absolute; left: 0; top: 0; bottom: 0; width: 26px;
  background: linear-gradient(90deg, #0A0806, #1A1512);
  transform: rotateY(-90deg) translateZ(-13px) translateX(-13px);
  border-left: 1px solid rgba(139,46,31,0.4);
  border-right: 1px solid rgba(139,46,31,0.4);
}
.book-3d-cover-eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ember-bright); }
.book-3d-cover-title { font-family: 'Fraunces', serif; font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 500; margin-top: 0.5rem; color: var(--parchment); }
.book-3d-cover-author { font-family: 'JetBrains Mono', monospace; font-size: 0.65rem; letter-spacing: 0.1em; color: var(--bronze); text-transform: uppercase; }

/* ---------- COUNTDOWN ---------- */
.countdown {
  display: flex; gap: clamp(0.8rem, 3vw, 1.8rem); justify-content: center; flex-wrap: wrap;
  margin: 2.4rem 0;
}
.countdown-unit { text-align: center; min-width: 72px; }
.countdown-num {
  font-family: 'Fraunces', serif; font-size: clamp(2rem, 5vw, 3rem); font-weight: 500;
  color: var(--amber-bright); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown-label {
  font-family: 'JetBrains Mono', monospace; font-size: 0.62rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--bronze); margin-top: 0.5rem;
}

/* ---------- FORMS ---------- */
.form-box {
  padding: 1.8rem; border: 1px solid var(--hairline); border-radius: 2px;
  background: rgba(46,74,82,0.06);
}
.form-row { display: flex; gap: 0.7rem; flex-wrap: wrap; }
input[type="email"], input[type="text"], textarea {
  flex: 1; min-width: 200px;
  background: var(--obsidian); border: 1px solid var(--hairline);
  color: var(--parchment); padding: 0.85rem 1rem;
  font-family: 'Source Serif 4', serif; font-size: 0.92rem; border-radius: 2px;
  width: 100%;
}
textarea { min-height: 130px; resize: vertical; font-family: inherit; }
input::placeholder, textarea::placeholder { color: var(--bronze); }
input:focus, textarea:focus { outline: none; border-color: var(--slate-bright); }
label { display: block; font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bronze); margin-bottom: 0.5rem; }
.field { margin-bottom: 1.2rem; }
.form-note { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--bronze); margin-top: 0.8rem; }

/* ---------- CARD GRID (used on World / Media pages) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.6rem; }
.card {
  border: 1px solid var(--hairline); border-radius: 2px; padding: 1.8rem;
  background: var(--obsidian-2); transition: border-color 0.25s ease, transform 0.25s ease;
}
.card:hover { border-color: var(--hairline-bright); transform: translateY(-3px); }
.card-icon { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--amber); display: flex; align-items: center; justify-content: center; font-family: 'Fraunces', serif; color: var(--amber-bright); margin-bottom: 1.2rem; }
.card h3 { font-size: 1.2rem; margin-bottom: 0.6rem; }
.card p { color: var(--parchment-dim); font-size: 0.95rem; }
