/* ============================================================
   AEVUM TRANSFORM — DESIGN SYSTEM
   DNA: #17 Academic Scholar | EB Garamond | Burgundy & Parchment
   Version: 2026.1
   ============================================================ */

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  /* Brand: Burgundy Scale */
  --brand-50:  #fdf0f3;
  --brand-100: #f9d4de;
  --brand-200: #f2a8bc;
  --brand-300: #e67898;
  --brand-400: #d44e74;
  --brand-500: #be2a55;
  --brand-600: #a01038;
  --brand-700: #800020;  /* PRIMARY — Burgundy */
  --brand-800: #650018;
  --brand-900: #4a0012;
  --brand-950: #2d000a;

  /* Brand accent + component tokens */
  --brand-accent:         #F5F5DC;   /* Parchment */
  --brand-nav-bg:         rgba(40,0,8,0.96);
  --brand-callout-border: #800020;
  --brand-callout-bg:     #fdf0f3;

  /* Parchment Scale (replaces stone) */
  --st-50:  #fdfdf7;
  --st-100: #fafaee;
  --st-200: #f5f5dc;   /* Parchment */
  --st-300: #ededc0;
  --st-400: #e2e2a0;

  /* Slate Scale (text/muted) */
  --sv-50:  #f8fafc;
  --sv-100: #f1f5f9;
  --sv-200: #e2e8f0;
  --sv-300: #cbd5e1;
  --sv-400: #94a3b8;
  --sv-500: #64748b;
  --sv-600: #475569;
  --sv-700: #334155;
  --sv-800: #1e293b;
  --sv-900: #0f172a;

  /* Color Aliases */
  --color-brand:       var(--brand-700);
  --color-brand-dark:  var(--brand-800);
  --color-brand-deep:  var(--brand-900);
  --color-parchment:   #F5F5DC;
  --color-white:       #ffffff;
  --color-text:        var(--sv-900);
  --color-text-muted:  var(--sv-600);
  --color-text-light:  var(--sv-400);
  --color-border:      var(--sv-200);
  --color-border-dark: var(--sv-300);

  /* Type Scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;
  --text-7xl:  4.5rem;
  --text-8xl:  6rem;

  /* Spacing (4px base) */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;
  --sp-32: 8rem;
  --sp-40: 10rem;

  /* Nav height */
  --nav-h: 68px;

  /* Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-full: 9999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.14);
  --shadow-xl: 0 16px 48px rgba(0,0,0,.18);

  /* Transitions */
  --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
  --ease-in:  cubic-bezier(0.55, 0.055, 0.675, 0.19);
  --dur-fast: 140ms;
  --dur-base: 220ms;
  --dur-slow: 380ms;

  /* Font families — Academic Scholar DNA */
  --font-serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-sans:  'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Container */
  --container-max: 1200px;
  --container-pad: var(--sp-6);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; }

/* ── Container ──────────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-serif); }

.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }
.text-4xl  { font-size: var(--text-4xl); }

.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-serif    { font-family: var(--font-serif); }

.text-muted { color: var(--color-text-muted); }
.text-light { color: var(--color-text-light); }
.text-brand { color: var(--color-brand); }
.text-white { color: var(--color-white); }

.uppercase     { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }
.tracking-wider{ letter-spacing: 0.1em; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: all var(--dur-base) var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.btn--primary {
  background: var(--brand-700);
  color: var(--color-white);
  border: 1.5px solid var(--brand-700);
}
.btn--primary:hover {
  background: var(--brand-800);
  border-color: var(--brand-800);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(128,0,32,.35);
}

.btn--primary-inv {
  background: var(--color-white);
  color: var(--brand-700);
  border: 1.5px solid var(--color-white);
}
.btn--primary-inv:hover {
  background: var(--st-100);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255,255,255,.25);
}

.btn--parchment {
  background: var(--color-parchment);
  color: var(--brand-700);
  border: 1.5px solid var(--st-300);
}
.btn--parchment:hover {
  background: var(--st-300);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--brand-700);
  border: 1.5px solid var(--brand-700);
}
.btn--ghost:hover {
  background: var(--brand-700);
  color: var(--color-white);
}

.btn--ghost-inv {
  background: transparent;
  color: var(--color-white);
  border: 1.5px solid rgba(255,255,255,.6);
}
.btn--ghost-inv:hover {
  background: rgba(255,255,255,.12);
  border-color: var(--color-white);
}

.btn--lg {
  padding: var(--sp-4) var(--sp-8);
  font-size: var(--text-base);
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-sans);
}
.badge--burgundy  { background: var(--brand-100); color: var(--brand-700); }
.badge--parchment { background: var(--st-200); color: var(--brand-800); }
.badge--slate     { background: var(--sv-100); color: var(--sv-700); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  transition: box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ── Data Table ─────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.data-table thead tr {
  background: var(--brand-700);
  color: var(--brand-100);
}
.data-table th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: var(--text-xs);
  text-transform: uppercase;
  font-family: var(--font-sans);
}
.data-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  line-height: 1.5;
  font-family: var(--font-sans);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) { background: var(--st-50); }
.data-table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--color-border); }

/* ── Grid Utilities ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-8); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }

/* ── Section Utilities ──────────────────────────────────────── */
.section    { padding-block: var(--sp-24); }
.section--sm { padding-block: var(--sp-16); }
.section--lg { padding-block: var(--sp-32); }

.section__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: var(--sp-3);
  font-family: var(--font-sans);
}
.section__title {
  font-family: var(--font-serif);
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-4);
}
.section__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 640px;
  line-height: 1.65;
  font-family: var(--font-sans);
}

/* ── Dividers ───────────────────────────────────────────────── */
.divider {
  width: 48px;
  height: 3px;
  background: var(--brand-700);
  margin-bottom: var(--sp-8);
}

/* ── Parchment Seal (GSAP-ready briefing block) ─────────────── */
.parchment-seal {
  background: var(--st-100);
  border: 2px solid var(--brand-700);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-8);
  position: relative;
}
.parchment-seal::before {
  content: '⚜';
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-4);
  font-size: var(--text-2xl);
  color: var(--brand-300);
  opacity: 0.5;
}

/* ── Glossary Tooltip ────────────────────────────────────────── */
.glossary-term {
  border-bottom: 1px dashed var(--brand-400);
  cursor: help;
  position: relative;
}

/* ── High-Contrast Toggle (Stealth Mode) ────────────────────── */
body.stealth-mode {
  filter: invert(1) hue-rotate(180deg);
}
body.stealth-mode img {
  filter: invert(1) hue-rotate(180deg);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --container-pad: var(--sp-4); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section    { padding-block: var(--sp-16); }
  .section--lg { padding-block: var(--sp-24); }
}

/* ── Utilities ──────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }
.mt-4  { margin-top: var(--sp-4); }
.mt-8  { margin-top: var(--sp-8); }
.mb-4  { margin-bottom: var(--sp-4); }
.mb-8  { margin-bottom: var(--sp-8); }
