/* css/style.css — Mahābhāṣya Research Archive */

/* ── RESET ─────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.75;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ── NOISE OVERLAY ──────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 9997; opacity: 0.25;
}

/* ── CURSOR ─────────────────────────────────────── */
.cursor-dot {
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%,-50%);
  transition: transform 0.08s ease;
}
.cursor-ring {
  width: 30px; height: 30px;
  border: 1.5px solid var(--accent-mid);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%,-50%);
  transition: transform 0.18s ease, width 0.2s, height 0.2s, border-color 0.2s;
}
.cursor-ring.hovered { width: 46px; height: 46px; border-color: var(--accent); }

/* ── TYPOGRAPHY UTILITIES ───────────────────────── */
.label {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 400;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-muted);
}
.label--accent { color: var(--accent); }

/* ── NAV ────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 500;
  padding: 0 60px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(250,249,246,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
nav.scrolled { border-color: var(--line); }

.nav-logo {
  font-family: var(--font-serif);
  font-weight: 800; font-size: 15px;
  font-style: italic;
  letter-spacing: 0.01em; color: var(--ink);
}
.nav-logo span { color: var(--accent); font-style: normal; }

.nav-header { display: flex; align-items: center; justify-content: space-between; }

.nav-toggle {
  display: none; background: transparent; border: none;
  cursor: pointer; flex-direction: column; gap: 5px; padding: 4px;
}
.nav-toggle span {
  display: block; width: 20px; height: 1.5px;
  background: var(--ink); transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-links { display: flex; gap: 36px; }
.nav-links a {
  font-family: var(--font-mono); font-size: 11px; font-weight: 300;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted);
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-links a.active { font-weight: 400; }

/* ── DIVIDER ────────────────────────────────────── */
.divider {
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

/* ── REVEAL ─────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── ANIMATIONS ─────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes pulse  { 0%,100% { opacity:0.35; } 50% { opacity:1; } }

/* ── PAGE BASE ──────────────────────────────────── */
.page-section { padding-top: 130px; min-height: 100vh; }

.page-header {
  max-width: var(--max-width); margin: 0 auto;
  padding: 0 60px 48px;
  border-bottom: 1px solid var(--line);
}
.page-content {
  max-width: var(--max-width); margin: 0 auto;
  padding: 52px 60px 100px;
}

.section-title {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(32px,4vw,50px);
  letter-spacing: -0.02em; line-height: 1.08; color: var(--ink);
}
.section-title em {
  font-style: italic; font-weight: 300; color: var(--accent);
}

/* ── BUTTONS ─────────────────────────────────────── */
.btn {
  font-family: var(--font-mono); font-size: 11px; font-weight: 400;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 11px 24px; border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  color: var(--ink-soft); background: var(--bg-card);
  cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn--primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn--primary:hover { background: var(--bg-dark); border-color: var(--bg-dark); color: #fff; }

/* ── HERO ────────────────────────────────────────── */
#hero {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; padding: 130px 60px 80px;
  position: relative; overflow: hidden;
}

/* Subtle green gradient wash in background */
#hero::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 50%; height: 100%;
  background: linear-gradient(135deg, transparent 40%, rgba(64,145,108,0.04) 100%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 24px;
  opacity: 0; animation: fadeUp 0.7s 0.15s forwards;
}

.hero-title {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(44px,5.5vw,78px);
  line-height: 1.0; letter-spacing: -0.025em; color: var(--ink);
  max-width: 760px;
  opacity: 0; animation: fadeUp 0.8s 0.3s forwards;
}
.hero-title em {
  font-style: italic; font-weight: 300; color: var(--accent);
}

.hero-sub {
  font-family: var(--font-serif); font-size: 19px;
  font-weight: 300; font-style: italic; color: var(--ink-soft);
  margin-top: 24px; max-width: 500px; line-height: 1.8;
  opacity: 0; animation: fadeUp 0.8s 0.45s forwards;
}

.hero-meta {
  display: flex; gap: 40px; margin-top: 52px; flex-wrap: wrap;
  opacity: 0; animation: fadeUp 0.8s 0.6s forwards;
}
.hero-stat { display: flex; flex-direction: column; gap: 4px; }
.hero-stat-num {
  font-family: var(--font-serif); font-weight: 700;
  font-size: 32px; color: var(--ink); letter-spacing: -0.02em;
}
.hero-stat-label {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-muted);
}

.hero-cta {
  display: flex; gap: 12px; margin-top: 44px; flex-wrap: wrap;
  opacity: 0; animation: fadeUp 0.8s 0.75s forwards;
}

.hero-scroll-cue {
  position: absolute; bottom: 44px; left: 60px;
  display: flex; align-items: center; gap: 12px;
  opacity: 0; animation: fadeUp 0.8s 1.0s forwards;
}
.hero-scroll-cue span {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-muted);
}
.scroll-line {
  width: 44px; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  animation: pulse 2.2s infinite;
}

/* Layer rule decoration */
.hero-layer-rules {
  position: absolute; right: 80px; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 18px;
  opacity: 0; animation: fadeIn 1s 0.8s forwards;
}
.layer-rule { display: flex; align-items: center; gap: 14px; }
.layer-rule-bar { width: 3px; height: 44px; border-radius: 2px; }
.layer-rule-bar--mb { background: var(--layer-mb); }
.layer-rule-bar--pr { background: var(--layer-pr); }
.layer-rule-bar--ud { background: var(--layer-ud); }
.layer-rule-bar--ch { background: var(--layer-ch); }
.layer-rule-label {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted);
}

/* ── INTRO SECTION ───────────────────────────────── */
#intro {
  padding: 96px 60px;
  max-width: var(--max-width); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start;
}
.intro-heading {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(26px,2.8vw,38px);
  letter-spacing: -0.02em; line-height: 1.15; color: var(--ink); margin-bottom: 22px;
}
.intro-heading em { font-style: italic; font-weight: 300; color: var(--accent); }
.intro-body {
  font-family: var(--font-serif); font-size: 17px;
  font-weight: 300; line-height: 1.85; color: var(--ink-soft);
}
.intro-body p + p { margin-top: 16px; }

.corpus-list { display: flex; flex-direction: column; gap: 0; }
.corpus-item {
  background: transparent; border-bottom: 1px solid var(--line);
  padding: 16px 0;
  display: flex; align-items: center; gap: 14px;
  transition: all 0.2s; border-radius: 0;
}
.corpus-item:first-child { border-top: 1px solid var(--line); }
.corpus-item:hover { padding-left: 8px; background: var(--accent-soft); }
.corpus-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}
.corpus-name {
  font-family: var(--font-serif); font-size: 16px;
  font-weight: 400; font-style: italic; color: var(--ink);
}
.corpus-role {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted);
  margin-left: auto;
}

/* ── FOOTER ─────────────────────────────────────── */
footer {
  background: var(--bg-dark); color: rgba(255,255,255,0.45);
  padding: 24px 60px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.06);
}
footer span, footer a {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.35);
}
footer a:hover { color: var(--accent-soft); }

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 900px) {
  nav { padding: 0 24px; flex-direction: column; align-items: stretch; height: auto; padding-top: 16px; padding-bottom: 0; }
  .nav-header { width: 100%; padding-bottom: 16px; }
  .nav-toggle { display: flex; }
  .nav-links {
    flex-direction: column; align-items: center; gap: 18px;
    overflow: hidden; max-height: 0; opacity: 0; margin-top: 0;
    transition: max-height 0.4s ease, opacity 0.4s, margin-top 0.4s;
  }
  .nav-links.nav-open { max-height: 500px; opacity: 1; margin-top: 8px; padding-bottom: 16px; }

  #hero { padding: 110px 24px 80px; }
  .hero-layer-rules { display: none; }
  #intro { grid-template-columns: 1fr; gap: 48px; padding: 60px 24px; }
  .page-header { padding: 0 24px 40px; }
  .page-content { padding: 40px 24px 80px; }
  footer { padding: 20px 24px; flex-direction: column; gap: 8px; text-align: center; }
  .hero-scroll-cue { left: 24px; }
}
@media (max-width: 600px) {
  .hero-cta { flex-direction: column; }
  .btn { justify-content: center; }
  .hero-meta { gap: 24px; }
}
