/* ═══════════════════════════════════════════════════════════════
   LAUBSCHER INSTITUTE FOR RESEARCH — Shared Stylesheet
   tlir.org.za
   ═══════════════════════════════════════════════════════════════ */

/* ── FONTS ─────────────────────────────────────────────────────
   Include in <head> before this file:
   <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&display=swap" rel="stylesheet">
   ─────────────────────────────────────────────────────────────── */

/* ── TOKENS ──────────────────────────────────────────────────── */
:root {
  --navy: #303c51;
  --navy-dark: #212d3f;
  --navy-light: #3e4f68;
  --navy-faint: rgba(48,60,81,0.05);
  --navy-faint2: rgba(48,60,81,0.09);
  --white: #ffffff;
  --off-white: #f7f7f6;
  --paper: #f0ede7;
  --black: #0a0a0a;
  --mid: #8a8f98;
  --light: #b8bdc6;
  --border: #dcdfe4;
  --gold: #c9a96e;
  --gold-light: rgba(201,169,110,0.15);
  --success: #2e6e4e;
  --success-light: rgba(46,110,78,0.08);
  --error: #b04040;
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Montserrat', sans-serif; background: var(--off-white); color: var(--black); overflow-x: hidden; }

/* ── LOADER ──────────────────────────────────────────────────── */
#loader {
  position: fixed; inset: 0; background: var(--navy-dark); z-index: 2000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px;
  transition: opacity 1s ease, visibility 1s ease;
}
#loader.fade-out { opacity: 0; visibility: hidden; }
.loader-logo { opacity: 0; transform: translateY(14px); animation: fadeUp 0.9s ease 0.3s forwards; }
.loader-logo img { height: 62px; filter: brightness(0) invert(1); display: block; }
.loader-sub { opacity: 0; transform: translateY(8px); animation: fadeUp 0.7s ease 0.6s forwards; }
.loader-sub span { font-size: 10px; font-weight: 500; letter-spacing: 0.38em; color: rgba(255,255,255,0.3); text-transform: uppercase; }
.loader-bar-wrap { width: 160px; height: 1px; background: rgba(255,255,255,0.1); overflow: hidden; opacity: 0; animation: fadeUp 0.5s ease 0.85s forwards; }
.loader-bar { height: 1px; width: 0; background: var(--gold); animation: loadBar 1.8s cubic-bezier(0.4,0,0.2,1) 1s forwards; }
@keyframes loadBar { 0%{width:0} 60%{width:72%} 100%{width:100%} }
@keyframes fadeUp { to { opacity:1; transform:translateY(0); } }

/* ── APP VISIBILITY ──────────────────────────────────────────── */
#app { opacity: 0; transition: opacity 0.8s ease 0.2s; }
#app.visible { opacity: 1; }

/* ── REVEAL ON SCROLL ────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.75s ease, transform 0.75s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
.rd1 { transition-delay: 0.10s; }
.rd2 { transition-delay: 0.22s; }
.rd3 { transition-delay: 0.34s; }
.rd4 { transition-delay: 0.46s; }

/* ── NAVIGATION ──────────────────────────────────────────────── */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(33,45,63,0.97); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 52px;
}
.nav-left { display: flex; align-items: center; gap: 28px; }
.nav-logo img { height: 30px; filter: brightness(0) invert(1); display: block; }
.nav-divider { width: 1px; height: 18px; background: rgba(255,255,255,0.12); }
.nav-title { font-size: 9px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(255,255,255,0.35); }
.nav-right { display: flex; align-items: center; gap: 32px; }
.nav-link {
  font-size: 10px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.45); text-decoration: none; transition: color 0.2s; position: relative;
}
.nav-link::after {
  content: ''; position: absolute; bottom: -3px; left: 0; right: 0;
  height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.25s;
}
.nav-link:hover { color: rgba(255,255,255,0.9); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.nav-link.active { color: rgba(255,255,255,0.9); }
.nav-btn {
  height: 34px; padding: 0 20px; background: transparent;
  border: 1px solid rgba(201,169,110,0.45); color: var(--gold);
  font-family: 'Montserrat', sans-serif; font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase; cursor: pointer; text-decoration: none;
  display: flex; align-items: center; gap: 8px;
  transition: background 0.2s, border-color 0.2s, color 0.2s; white-space: nowrap;
}
.nav-btn:hover { background: var(--gold); border-color: var(--gold); color: var(--navy-dark); }
.nav-hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-hamburger span { display: block; width: 22px; height: 1.5px; background: rgba(255,255,255,0.7); transition: all 0.3s; }
.nav-drawer {
  display: none; position: fixed; top: 64px; left: 0; right: 0;
  background: var(--navy-dark); border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 24px 28px 28px; flex-direction: column; gap: 4px; z-index: 99;
}
.nav-drawer.open { display: flex; }
.nav-drawer .nav-link { font-size: 11px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.nav-drawer .nav-btn { margin-top: 12px; justify-content: center; height: 44px; }

/* ── PAGE HERO ───────────────────────────────────────────────── */
.page-hero { margin-top: 64px; background: var(--navy-dark); padding: 88px 52px 80px; position: relative; overflow: hidden; }
.page-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.22; pointer-events: none; }
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.35; z-index: 1; pointer-events: none;
}
.page-hero::after {
  content: ''; position: absolute; top: 64px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
  opacity: 0.25; z-index: 3;
}
.hero-inner { position: relative; z-index: 4; }
.hero-eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.hero-eyebrow-line { width: 32px; height: 1px; background: var(--gold); opacity: 0.7; }
.hero-eyebrow span { font-size: 9px; font-weight: 700; letter-spacing: 0.38em; text-transform: uppercase; color: var(--gold); opacity: 0.8; }
.page-hero h1 { font-family: 'Cormorant Garamond', serif; font-size: clamp(44px, 6vw, 82px); font-weight: 300; line-height: 1.05; color: var(--white); letter-spacing: -0.02em; margin-bottom: 20px; }
.page-hero h1 em { font-style: italic; color: rgba(255,255,255,0.35); }
.hero-desc { font-size: 13px; font-weight: 400; line-height: 1.9; color: rgba(255,255,255,0.38); max-width: 480px; }
.hero-right-text { padding-bottom: 8px; }
.hero-right-text p { font-size: 13px; font-weight: 300; line-height: 2; color: rgba(255,255,255,0.32); border-left: 2px solid rgba(201,169,110,0.3); padding-left: 24px; }
.hero-right-text p strong { color: rgba(255,255,255,0.65); font-weight: 500; }

/* ── SECTION LABEL ───────────────────────────────────────────── */
.section-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--mid); margin-bottom: 24px; display: flex; align-items: center; gap: 12px;
}
.section-label::before { content:''; display:block; width:20px; height:1px; background: var(--light); }

/* ── PULL QUOTE ──────────────────────────────────────────────── */
.pull-quote {
  background: var(--paper); padding: 88px 52px;
  display: flex; align-items: center; gap: 56px;
  border-bottom: 1px solid var(--border); position: relative; overflow: hidden;
}
.pull-quote::before {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,169,110,0.07) 0%, transparent 70%); pointer-events: none;
}
.pull-quote.dark { background: var(--navy-dark); border-bottom-color: rgba(255,255,255,0.06); }
.pq-mark { font-family: 'Cormorant Garamond', serif; font-size: 180px; font-weight: 300; line-height: 1; color: var(--gold); opacity: 0.15; flex-shrink: 0; align-self: flex-start; margin-top: -24px; user-select: none; }
.pull-quote.dark .pq-mark { opacity: 0.10; }
.pq-text { font-family: 'Cormorant Garamond', serif; font-size: clamp(22px, 3vw, 38px); font-weight: 300; font-style: italic; line-height: 1.45; color: var(--navy); margin-bottom: 24px; letter-spacing: -0.01em; }
.pull-quote.dark .pq-text { color: var(--white); }
.pq-attr { font-size: 9.5px; font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase; color: var(--light); display: flex; align-items: center; gap: 14px; }
.pq-attr::before { content:''; display:block; width:28px; height:1px; background: var(--gold); opacity: 0.5; }
.pull-quote.dark .pq-attr { color: rgba(255,255,255,0.25); }

/* ── FOOTER ──────────────────────────────────────────────────── */
.footer { background: var(--navy-dark); border-top: 1px solid rgba(255,255,255,0.06); }
.footer-top { display: grid; grid-template-columns: 1fr 1px 1fr 1px 1fr; }
.footer-col-divider { background: rgba(255,255,255,0.07); }
.footer-col { padding: 52px 44px; }
.footer-col:first-child { padding-left: 52px; }
.footer-col:last-child { padding-right: 52px; }
.footer-col-label { font-size: 8.5px; font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase; color: rgba(255,255,255,0.25); margin-bottom: 20px; }
.footer-logo img { height: 36px; filter: brightness(0) invert(1); opacity: 0.7; display: block; margin-bottom: 16px; }
.footer-tagline { font-size: 11px; font-weight: 400; line-height: 1.8; color: rgba(255,255,255,0.3); letter-spacing: 0.04em; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-link { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; color: rgba(255,255,255,0.38); text-decoration: none; transition: color 0.2s; display: flex; align-items: center; gap: 8px; }
.footer-link::before { content: '—'; color: var(--gold); opacity: 0.4; font-size: 9px; }
.footer-link:hover { color: rgba(255,255,255,0.8); }
.footer-contact { display: flex; flex-direction: column; gap: 16px; }
.footer-contact-item { font-size: 11px; font-weight: 400; line-height: 1.6; color: rgba(255,255,255,0.38); letter-spacing: 0.04em; }
.footer-contact-item strong { display: block; font-size: 9px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.2); margin-bottom: 3px; }
.footer-contact-item a { color: rgba(255,255,255,0.38); text-decoration: none; transition: color 0.2s; }
.footer-contact-item a:hover { color: var(--gold); }
.footer-bottom { padding: 18px 52px; border-top: 1px solid rgba(255,255,255,0.07); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-bottom-left { display: flex; flex-direction: column; gap: 7px; }
.footer-bottom-left p { font-size: 9.5px; font-weight: 400; letter-spacing: 0.08em; color: rgba(255,255,255,0.18); }
.footer-legal-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.footer-legal-link { font-size: 9px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.22); text-decoration: none; transition: color 0.2s; }
.footer-legal-link:hover { color: rgba(255,255,255,0.6); }
.footer-legal-sep { width: 1px; height: 10px; background: rgba(255,255,255,0.12); }
.footer-gold-line { display: flex; align-items: center; gap: 8px; font-size: 8.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); opacity: 0.4; }
.footer-gold-line::before { content: ''; display: block; width: 16px; height: 1px; background: var(--gold); }

/* ── LEGAL PAGE LAYOUT ───────────────────────────────────────── */
.legal-body { display: grid; grid-template-columns: 220px 1fr; gap: 0; }
.toc-sidebar {
  background: var(--white); border-right: 1px solid var(--border);
  padding: 48px 28px; position: sticky; top: 64px;
  height: calc(100vh - 64px); overflow-y: auto; align-self: start;
}
.toc-label { font-size: 8.5px; font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase; color: var(--light); margin-bottom: 16px; }
.toc-links { display: flex; flex-direction: column; gap: 2px; }
.toc-link {
  font-size: 11px; font-weight: 500; color: var(--mid); text-decoration: none;
  padding: 7px 10px; border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s; line-height: 1.4;
}
.toc-link:hover { color: var(--navy); border-left-color: var(--border); }
.toc-link.active { color: var(--navy); border-left-color: var(--gold); background: var(--navy-faint); }
.toc-back { display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--light); text-decoration: none; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); transition: color 0.2s; }
.toc-back:hover { color: var(--navy); }
.toc-back svg { flex-shrink: 0; }
.toc-siblings { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.toc-sibling { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--light); text-decoration: none; padding: 6px 10px; transition: color 0.2s; }
.toc-sibling:hover { color: var(--navy); }
.toc-sibling.current { color: var(--gold); }

.legal-content { padding: 64px 72px 96px 64px; max-width: 820px; }
.legal-section { margin-bottom: 56px; scroll-margin-top: 88px; }
.legal-section:last-child { margin-bottom: 0; }
.legal-section h2 {
  font-family: 'Cormorant Garamond', serif; font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 300; color: var(--navy); margin-bottom: 20px; line-height: 1.2;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.legal-section h2 em { font-style: italic; color: var(--mid); }
.legal-section h3 { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--navy); margin-bottom: 10px; margin-top: 28px; }
.legal-section p { font-size: 13px; font-weight: 400; line-height: 1.95; color: var(--mid); margin-bottom: 14px; }
.legal-section p:last-child { margin-bottom: 0; }
.legal-section p strong { color: var(--navy); font-weight: 600; }
.legal-section ul, .legal-section ol { padding-left: 20px; margin-bottom: 14px; }
.legal-section li { font-size: 13px; font-weight: 400; line-height: 1.95; color: var(--mid); margin-bottom: 6px; }
.legal-section li strong { color: var(--navy); font-weight: 600; }
.legal-section a { color: var(--navy); font-weight: 500; text-decoration: underline; text-decoration-color: var(--border); transition: text-decoration-color 0.2s, color 0.2s; }
.legal-section a:hover { color: var(--gold); text-decoration-color: var(--gold); }
.legal-notice {
  background: var(--navy-faint2); border: 1px solid var(--border); border-left: 3px solid var(--gold);
  padding: 18px 20px; margin-bottom: 40px;
}
.legal-notice p { font-size: 12px; font-weight: 400; line-height: 1.8; color: var(--mid); margin: 0; }
.legal-notice p strong { color: var(--navy); font-weight: 600; }
.legal-effective { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 20px 0 32px; border-bottom: 1px solid var(--border); margin-bottom: 48px; }
.legal-effective-item { font-size: 10px; font-weight: 500; letter-spacing: 0.1em; color: var(--mid); display: flex; align-items: center; gap: 8px; }
.legal-effective-item strong { color: var(--navy); font-weight: 700; font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; display: block; margin-bottom: 2px; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-col-divider { display: none; }
  .footer-col, .footer-col:first-child, .footer-col:last-child { border-bottom: 1px solid rgba(255,255,255,0.07); padding: 36px; }
  .legal-body { grid-template-columns: 1fr; }
  .toc-sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 28px 32px; }
  .toc-links { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .toc-link { border-left: none; border-bottom: 2px solid transparent; padding: 5px 10px; }
  .toc-link:hover { border-left-color: transparent; border-bottom-color: var(--border); }
  .toc-link.active { border-left-color: transparent; border-bottom-color: var(--gold); }
  .toc-siblings { flex-direction: row; flex-wrap: wrap; border-top: 1px solid var(--border); }
  .legal-content { padding: 48px 44px 72px; }
}

@media (max-width: 860px) {
  .top-nav { padding: 0 24px; }
  .nav-right { display: none; }
  .nav-hamburger { display: flex; }
  .page-hero { padding: 72px 24px 60px; }
  .pull-quote { padding: 64px 24px; flex-direction: column; gap: 0; }
  .pq-mark { font-size: 80px; margin-top: 0; margin-bottom: -12px; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-col, .footer-col:first-child, .footer-col:last-child { padding: 32px 24px; }
  .footer-bottom { padding: 18px 24px; flex-direction: column; align-items: flex-start; }
  .legal-content { padding: 36px 24px 60px; }
}

@media (max-width: 480px) {
  .page-hero h1 { font-size: 36px; }
}