/* ============================================================
   Dr. B.R. Ambedkar — Tribute Site
   Editorial · Indigo & Parchment · Serif Display
   ============================================================ */

/* ---------- DESIGN TOKENS ---------- */
:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 7.5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Fonts — Latin */
  --font-display: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --font-serif: 'EB Garamond', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* Fonts — Devanagari (Marathi/Hindi) */
  --font-deva-display: 'Tiro Devanagari Marathi', 'Tiro Devanagari Hindi', 'Noto Sans Devanagari', 'Cormorant Garamond', Georgia, serif;
  --font-deva-body: 'Noto Sans Devanagari', 'Inter', sans-serif;

  /* Content widths */
  --content-narrow: 680px;
  --content-default: 1080px;
  --content-wide: 1240px;

  --transition: 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- LIGHT (default) — PARCHMENT + INDIGO ---------- */
:root,
[data-theme='light'] {
  --color-bg: #f4ede0;
  --color-surface: #efe6d3;
  --color-surface-2: #f7f0e2;
  --color-surface-offset: #e8dec9;
  --color-border: #d8c9a8;
  --color-divider: #cdbe9c;

  --color-text: #1c1a17;
  --color-text-muted: #5e574a;
  --color-text-faint: #8c8471;

  /* Deep constitutional indigo */
  --color-primary: #1a2c5b;
  --color-primary-hover: #24397b;
  --color-primary-active: #12204a;
  --color-primary-highlight: #dfe2ec;

  /* Warm gold accent — used sparingly */
  --color-accent: #b58825;
  --color-accent-hover: #966d15;

  --shadow-sm: 0 1px 2px rgba(28, 26, 23, 0.08);
  --shadow-md: 0 6px 20px rgba(28, 26, 23, 0.1);
  --shadow-lg: 0 18px 48px rgba(28, 26, 23, 0.14);

  --paper-noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.11 0 0 0 0 0.09 0 0 0 0.05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- DARK — MIDNIGHT LIBRARY ---------- */
[data-theme='dark'] {
  --color-bg: #10131c;
  --color-surface: #171b26;
  --color-surface-2: #1c2130;
  --color-surface-offset: #232a3c;
  --color-border: #2f3852;
  --color-divider: #262d40;

  --color-text: #ece4d1;
  --color-text-muted: #a49b83;
  --color-text-faint: #6d6754;

  --color-primary: #a9b8e2;
  --color-primary-hover: #c1cdec;
  --color-primary-active: #8fa0d1;
  --color-primary-highlight: #29314a;

  --color-accent: #e0b74a;
  --color-accent-hover: #f0c559;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.55);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  background-image: var(--paper-noise);
  background-repeat: repeat;
  min-height: 100dvh;
  overflow-x: hidden;
}

[data-theme='dark'] body {
  background-image: none;
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--color-primary-hover);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  text-wrap: balance;
  letter-spacing: -0.01em;
}

/* Devanagari font-stack override when the lang attribute is set */
html[lang='mr'] body,
html[lang='hi'] body {
  font-family: var(--font-deva-body);
  letter-spacing: 0;
}
html[lang='mr'] h1, html[lang='mr'] h2, html[lang='mr'] h3, html[lang='mr'] h4,
html[lang='mr'] h5, html[lang='mr'] h6,
html[lang='hi'] h1, html[lang='hi'] h2, html[lang='hi'] h3, html[lang='hi'] h4,
html[lang='hi'] h5, html[lang='hi'] h6 {
  font-family: var(--font-deva-display);
  letter-spacing: 0;
  line-height: 1.25;
}
html[lang='mr'] em, html[lang='hi'] em {
  font-family: var(--font-deva-display);
  font-style: italic;
}
/* Devanagari has taller baseline glyphs — restore comfortable rhythm */
html[lang='mr'] .hero-title, html[lang='hi'] .hero-title { line-height: 1.05; }
html[lang='mr'] .hero-name, html[lang='hi'] .hero-name { font-size: clamp(2rem, 0.9rem + 3.2vw, 3.75rem); font-style: normal; }
html[lang='mr'] .hero-surname, html[lang='hi'] .hero-surname {
  font-size: clamp(2.5rem, 0.5rem + 6vw, 6rem);
  margin-top: 0;
}
html[lang='mr'] .hero-lede, html[lang='hi'] .hero-lede {
  font-family: var(--font-deva-body);
  font-size: var(--text-base);
  line-height: 1.65;
}
html[lang='mr'] .intro p, html[lang='hi'] .intro p {
  font-family: var(--font-deva-body);
  font-size: var(--text-base);
  line-height: 1.7;
}
html[lang='mr'] .drop, html[lang='hi'] .drop {
  font-family: var(--font-deva-display);
  font-size: 3.75rem;
}
html[lang='mr'] .quote-card blockquote, html[lang='hi'] .quote-card blockquote {
  font-family: var(--font-deva-display);
  font-style: normal;
  line-height: 1.5;
}
html[lang='mr'] .quote-card.large blockquote, html[lang='hi'] .quote-card.large blockquote,
html[lang='mr'] .quote-card.wide blockquote, html[lang='hi'] .quote-card.wide blockquote {
  font-size: clamp(1.35rem, 0.9rem + 1vw, 1.75rem);
}
html[lang='mr'] .pull-quote blockquote, html[lang='hi'] .pull-quote blockquote {
  font-family: var(--font-deva-display);
  font-style: normal;
  font-size: clamp(1.35rem, 0.9rem + 1.4vw, 2.15rem);
  line-height: 1.5;
}
html[lang='mr'] .doc-open, html[lang='hi'] .doc-open {
  font-family: var(--font-deva-display);
  font-style: normal;
}
html[lang='mr'] .doc-text, html[lang='hi'] .doc-text,
html[lang='mr'] .doc-list, html[lang='hi'] .doc-list {
  font-family: var(--font-deva-body);
}
html[lang='mr'] .brand-name, html[lang='hi'] .brand-name {
  font-family: var(--font-deva-display);
  font-size: 1.15rem;
}
html[lang='mr'] .pillar-num, html[lang='hi'] .pillar-num {
  font-family: var(--font-deva-display);
  font-size: 1.55rem;
  line-height: 1.15;
}
html[lang='mr'] .tl-year, html[lang='hi'] .tl-year,
html[lang='mr'] .work-year, html[lang='hi'] .work-year {
  font-family: var(--font-deva-display);
}
html[lang='mr'] .closing-signoff, html[lang='hi'] .closing-signoff {
  font-family: var(--font-deva-display);
}

p {
  text-wrap: pretty;
  max-width: 68ch;
}

em {
  font-family: var(--font-serif);
  font-style: italic;
}

::selection {
  background: rgba(26, 44, 91, 0.25);
  color: var(--color-text);
}
[data-theme='dark'] ::selection {
  background: rgba(224, 183, 74, 0.28);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 clamp(var(--space-5), 5vw, var(--space-12));
}
.container.narrow {
  max-width: var(--content-narrow);
}

.section {
  padding-block: clamp(var(--space-16), 10vw, var(--space-32));
}

.section-head {
  margin-bottom: clamp(var(--space-10), 6vw, var(--space-16));
  max-width: 720px;
}
.section-head.centered {
  margin-inline: auto;
  text-align: center;
}

.kicker {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: var(--text-2xl);
  color: var(--color-text);
  font-weight: 500;
}
.section-title.alt em {
  color: var(--color-primary);
}

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.site-header.scrolled {
  border-bottom-color: var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding-block: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-primary);
}
.brand:hover { color: var(--color-primary-hover); }

.brand-mark { flex-shrink: 0; }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand-sub {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 3px;
}

.nav-list {
  display: flex;
  gap: var(--space-8);
  list-style: none;
}
.nav-list a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
}
.nav-list a:hover {
  color: var(--color-primary);
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.nav-list a:hover::after {
  transform: scaleX(1);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.lang-switcher {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface-2);
}
.lang-btn {
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  border: none;
  background: transparent;
  transition: all var(--transition);
  line-height: 1;
  min-width: 34px;
}
.lang-btn + .lang-btn {
  border-left: 1px solid var(--color-border);
}
.lang-btn:hover {
  color: var(--color-primary);
  background: color-mix(in oklab, var(--color-primary) 6%, transparent);
}
.lang-btn.active {
  background: var(--color-primary);
  color: #f4ede0;
}
[data-theme='dark'] .lang-btn.active { color: var(--color-bg); }

.theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

@media (max-width: 900px) {
  .nav-list { display: none; }
}
@media (max-width: 480px) {
  .lang-btn { padding: 5px 7px; font-size: 0.72rem; min-width: 30px; }
  .brand-sub { display: none; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  padding-block: clamp(var(--space-16), 10vw, var(--space-24)) clamp(var(--space-16), 8vw, var(--space-24));
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 85% 15%, rgba(181, 136, 37, 0.14), transparent 55%),
    radial-gradient(ellipse at 10% 85%, rgba(26, 44, 91, 0.10), transparent 60%),
    linear-gradient(180deg, var(--color-bg) 0%, var(--color-surface) 100%);
}
[data-theme='dark'] .hero-bg {
  background:
    radial-gradient(ellipse at 85% 15%, rgba(224, 183, 74, 0.10), transparent 55%),
    radial-gradient(ellipse at 10% 85%, rgba(169, 184, 226, 0.10), transparent 60%),
    linear-gradient(180deg, var(--color-bg) 0%, var(--color-surface) 100%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(var(--space-10), 6vw, var(--space-20));
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: var(--space-6);
}
.eyebrow-line {
  display: inline-block;
  width: 48px;
  height: 1px;
  background: var(--color-accent);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-8);
}
.hero-name {
  display: block;
  font-size: clamp(2.5rem, 1rem + 4vw, 4.5rem);
  color: var(--color-text-muted);
  font-style: italic;
  font-weight: 400;
}
.hero-surname {
  display: block;
  font-size: var(--text-hero);
  color: var(--color-primary);
  font-weight: 600;
  margin-top: -0.1em;
}

.hero-lede {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--color-text);
  max-width: 46ch;
  margin-bottom: var(--space-10);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  padding-block: var(--space-6);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-8);
}
.meta-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.meta-label {
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}
.meta-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-text);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.btn-primary {
  background: var(--color-primary);
  color: #f4ede0;
}
[data-theme='dark'] .btn-primary { color: var(--color-bg); }
.btn-primary:hover {
  background: var(--color-primary-hover);
  color: #f4ede0;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
[data-theme='dark'] .btn-primary:hover { color: var(--color-bg); }

.btn-ghost {
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-hover);
  background: color-mix(in oklab, var(--color-primary) 6%, transparent);
}

/* Portrait frame */
.hero-figure {
  margin: 0;
  position: relative;
}
.portrait-frame {
  position: relative;
  padding: var(--space-4);
  background: var(--color-surface-2);
  box-shadow: var(--shadow-lg);
  transform: rotate(-1deg);
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.portrait-frame::before {
  content: "";
  position: absolute;
  inset: var(--space-2);
  border: 1px solid var(--color-border);
  pointer-events: none;
}
.portrait-frame:hover {
  transform: rotate(0deg) scale(1.01);
}
.portrait-frame img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: contrast(1.02) saturate(0.98);
}
.portrait-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--color-accent);
  z-index: 2;
}
.portrait-corner.top-left { top: -8px; left: -8px; border-right: none; border-bottom: none; }
.portrait-corner.top-right { top: -8px; right: -8px; border-left: none; border-bottom: none; }
.portrait-corner.bottom-left { bottom: -8px; left: -8px; border-right: none; border-top: none; }
.portrait-corner.bottom-right { bottom: -8px; right: -8px; border-left: none; border-top: none; }

.hero-figure figcaption {
  margin-top: var(--space-6);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
}

.hero-motto {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-3);
  align-items: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hero-motto .dot {
  color: var(--color-accent);
  font-weight: 700;
}

@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .hero-figure { max-width: 420px; margin: 0 auto; }
  .hero-motto { display: none; }
}

/* ---------- INTRO ---------- */
.intro {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.intro p {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--color-text);
  max-width: 60ch;
  margin: 0 auto var(--space-6);
}
.intro p:last-child { margin-bottom: 0; }

.drop-cap .drop {
  float: left;
  font-family: var(--font-display);
  font-size: 4.5rem;
  line-height: 0.85;
  font-weight: 600;
  color: var(--color-primary);
  padding: 6px 10px 0 0;
  margin-top: 4px;
}

/* ---------- TIMELINE ---------- */
.timeline {
  list-style: none;
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding-left: var(--space-8);
}
.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--color-border) 8%,
    var(--color-border) 92%,
    transparent 100%
  );
}

.tl-item {
  position: relative;
  padding-bottom: var(--space-10);
  padding-left: var(--space-8);
}
.tl-item::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  z-index: 1;
}
.tl-item.featured::before {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--color-accent) 25%, transparent);
}
.tl-item:last-child { padding-bottom: 0; }

.tl-year {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-2);
}
.tl-item.featured .tl-year { color: var(--color-accent); }

.tl-body h3 {
  font-size: 1.35rem;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  font-weight: 600;
}
.tl-body p {
  color: var(--color-text-muted);
  max-width: 60ch;
}

@media (max-width: 600px) {
  .timeline { padding-left: var(--space-4); }
  .tl-item { padding-left: var(--space-6); }
  .tl-item::before { left: -19px; }
}

/* ---------- CONSTITUTION ---------- */
.constitution {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}
.constitution::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(26, 44, 91, 0.06), transparent 55%);
  pointer-events: none;
}
[data-theme='dark'] .constitution::before {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(169, 184, 226, 0.06), transparent 55%);
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(var(--space-10), 6vw, var(--space-16));
  align-items: center;
  position: relative;
}
.split-copy p {
  color: var(--color-text-muted);
  margin-top: var(--space-5);
}

.pillars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}
.pillar-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--space-2);
}
.pillar-label {
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Doc card */
.doc-card {
  position: relative;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  padding: var(--space-10) var(--space-8) var(--space-8);
  box-shadow: var(--shadow-md);
  transform: rotate(0.4deg);
  transition: transform var(--transition);
}
.doc-card:hover { transform: rotate(0); }
.doc-card::before {
  content: "";
  position: absolute;
  inset: var(--space-3);
  border: 1px double var(--color-border);
  pointer-events: none;
}
.doc-ribbon {
  position: absolute;
  top: -14px;
  left: var(--space-8);
  background: var(--color-primary);
  color: #f4ede0;
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
}
.doc-text {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}
.doc-open {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--color-primary);
  display: block;
  margin-bottom: var(--space-2);
}
.doc-list {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0 var(--space-6);
  font-family: var(--font-serif);
  color: var(--color-text);
}
.doc-list li {
  padding: var(--space-2) 0;
  border-bottom: 1px dashed var(--color-border);
  line-height: 1.6;
}
.doc-list li:last-child { border-bottom: none; }
.doc-list span {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-primary);
  margin-right: var(--space-1);
}
.doc-seal {
  position: absolute;
  right: var(--space-6);
  bottom: var(--space-6);
  color: var(--color-accent);
  opacity: 0.7;
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr 1fr; }
}

/* ---------- WORKS ---------- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.work-card {
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  position: relative;
  transition: all var(--transition);
}
.work-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}
.work-card.feature {
  grid-column: span 2;
  background: linear-gradient(180deg, var(--color-surface-2), var(--color-surface));
  border-color: var(--color-accent);
}
.work-year {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: var(--space-3);
  line-height: 1;
}
.work-card h3 {
  font-size: 1.5rem;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  font-weight: 600;
}
.work-card.feature h3 {
  font-size: 1.85rem;
}
.work-meta {
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}
.work-card p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  line-height: 1.6;
}
.work-card blockquote {
  margin-top: var(--space-4);
  padding-left: var(--space-4);
  border-left: 2px solid var(--color-accent);
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-text);
  font-size: var(--text-base);
}

@media (max-width: 900px) {
  .works-grid { grid-template-columns: 1fr 1fr; }
  .work-card.feature { grid-column: span 2; }
}
@media (max-width: 640px) {
  .works-grid { grid-template-columns: 1fr; }
  .work-card.feature { grid-column: span 1; }
}

/* ---------- QUOTES ---------- */
.quotes {
  background: linear-gradient(180deg, var(--color-primary) 0%, #12204a 100%);
  color: #f4ede0;
  position: relative;
  overflow: hidden;
}
[data-theme='dark'] .quotes {
  background: linear-gradient(180deg, #0a0d16 0%, #12162a 100%);
  color: var(--color-text);
}
.quotes::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(224, 183, 74, 0.12), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(224, 183, 74, 0.08), transparent 50%);
  pointer-events: none;
}
.quotes .kicker { color: var(--color-accent); }
.quotes .section-title { color: #f4ede0; }
[data-theme='dark'] .quotes .section-title { color: var(--color-text); }

.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-16);
}
.quote-card {
  margin: 0;
  padding: var(--space-8);
  background: rgba(244, 237, 224, 0.04);
  border: 1px solid rgba(244, 237, 224, 0.14);
  border-radius: var(--radius-sm);
  position: relative;
  transition: all var(--transition);
}
[data-theme='dark'] .quote-card {
  background: rgba(236, 228, 209, 0.03);
  border-color: rgba(236, 228, 209, 0.1);
}
.quote-card:hover {
  background: rgba(244, 237, 224, 0.08);
  border-color: rgba(224, 183, 74, 0.4);
  transform: translateY(-2px);
}
.quote-card.large { grid-column: span 2; }
.quote-card.wide { grid-column: 1 / -1; }
.quote-card blockquote {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.35;
  font-style: italic;
  color: #f4ede0;
  font-weight: 400;
  position: relative;
  padding-left: var(--space-6);
}
[data-theme='dark'] .quote-card blockquote { color: var(--color-text); }
.quote-card.large blockquote,
.quote-card.wide blockquote {
  font-size: clamp(1.5rem, 1rem + 1vw, 2rem);
}
.quote-card blockquote::before {
  content: "\201C";
  position: absolute;
  top: -0.5rem;
  left: -0.2rem;
  font-size: 3.5rem;
  color: var(--color-accent);
  line-height: 1;
  font-family: var(--font-display);
}
.quote-card figcaption {
  margin-top: var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 237, 224, 0.6);
}
[data-theme='dark'] .quote-card figcaption { color: var(--color-text-muted); }

.pull-quote {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-8);
  border-top: 1px solid rgba(224, 183, 74, 0.4);
  border-bottom: 1px solid rgba(224, 183, 74, 0.4);
  text-align: center;
  position: relative;
}
.pull-quote blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2.5rem);
  line-height: 1.3;
  font-style: italic;
  color: #f4ede0;
}
[data-theme='dark'] .pull-quote blockquote { color: var(--color-text); }
.pull-quote blockquote span {
  display: block;
  margin-top: var(--space-4);
  color: var(--color-accent);
  font-weight: 600;
}
.pull-quote figcaption {
  margin-top: var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 237, 224, 0.65);
}
[data-theme='dark'] .pull-quote figcaption { color: var(--color-text-muted); }

@media (max-width: 900px) {
  .quote-grid { grid-template-columns: 1fr 1fr; }
  .quote-card.large,
  .quote-card.wide { grid-column: span 2; }
}
@media (max-width: 640px) {
  .quote-grid { grid-template-columns: 1fr; }
  .quote-card.large,
  .quote-card.wide { grid-column: span 1; }
}

/* ---------- LEGACY ---------- */
.legacy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  margin-bottom: var(--space-16);
}
.legacy-item {
  padding: var(--space-10) var(--space-8);
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition);
}
.legacy-item:hover {
  background: var(--color-surface);
}
.legacy-num {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.16em;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: var(--space-6);
}
.legacy-item h3 {
  font-size: 1.5rem;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  font-weight: 600;
}
.legacy-item p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .legacy-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .legacy-grid { grid-template-columns: 1fr; }
}

.closing {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding-top: var(--space-10);
}
.closing-lede {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: 1.6;
  font-style: italic;
  color: var(--color-text);
  margin: 0 auto var(--space-8);
}
.closing-signoff {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1rem + 2.5vw, 3.5rem);
  color: var(--color-primary);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-16);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-6);
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}
.footer-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 640px;
  line-height: 1.6;
}
.footer-note a {
  color: var(--color-primary);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.footer-note a:hover {
  border-bottom-color: var(--color-primary);
}
.footer-copy {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  letter-spacing: 0.06em;
}

/* ---------- REVEAL ANIMATIONS ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

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

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
