/* ==========================================================================
   Alfu Laily, PhD | Postdoc | Health Informatics | Preventive Health
   Global Modular Design System (Maroon-ish & Rose Lady Theme)
   ========================================================================== */

:root {
  --font-sans: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-accent: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', Consolas, monospace;

  /* Light Theme (Maroon, Velvet Rose, Berry, Soft Blush) */
  --bg-page: #fdf8f9;
  --bg-surface: #ffffff;
  --bg-subtle: #faedf1;
  --bg-card: #ffffff;
  --bg-code: #fbf0f3;
  --bg-code-output: #fdf8f9;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --border-color: #f3d5dd;
  --border-strong: #e5b4c1;

  --text-main: #2b0b14;
  --text-secondary: #5c2a38;
  --text-muted: #8a4f61;

  /* Maroon & Berry Accent Scales */
  --accent-primary: #881337;         /* Deep Luxurious Maroon */
  --accent-primary-hover: #9f1239;   /* Vibrant Berry Maroon */
  --accent-primary-soft: #ffe4e6;    /* Petal Blush */
  --accent-primary-dark: #4c0519;

  --accent-rose: #be123c;
  --accent-rose-soft: #fff1f2;
  --accent-blush: #f43f5e;
  --accent-blush-soft: #fecdd3;

  --accent-gold: #b45309;            /* Warm Amber Gold */
  --accent-gold-soft: #fef3c7;
  --accent-emerald: #047857;         /* Health & Wellness Green */
  --accent-emerald-soft: #d1fae5;
  --accent-purple: #701a75;          /* Orchid Purple */
  --accent-purple-soft: #f5d0fe;

  --shadow-xs: 0 1px 3px rgba(136, 19, 55, 0.05);
  --shadow-sm: 0 2px 8px rgba(136, 19, 55, 0.08);
  --shadow-md: 0 8px 24px -4px rgba(136, 19, 55, 0.12);
  --shadow-lg: 0 16px 36px -6px rgba(136, 19, 55, 0.16);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --max-width: 1240px;
  --header-height: 72px;
}

[data-theme="dark"] {
  /* Dark Theme (Velvety Plum, Dark Blackberry, Rose Gold) */
  --bg-page: #120409;
  --bg-surface: #1e0912;
  --bg-subtle: #2d0e1b;
  --bg-card: #220b15;
  --bg-code: #2d0e1b;
  --bg-code-output: #18060e;
  --bg-glass: rgba(30, 9, 18, 0.92);
  --border-color: #421626;
  --border-strong: #612038;

  --text-main: #fdf2f4;
  --text-secondary: #ebd0d7;
  --text-muted: #b88696;

  --accent-primary: #fb7185;         /* Luminous Radiant Rose */
  --accent-primary-hover: #fda4af;
  --accent-primary-soft: rgba(251, 113, 133, 0.16);
  --accent-primary-dark: #fff1f2;

  --accent-rose: #f43f5e;
  --accent-rose-soft: rgba(244, 63, 94, 0.18);
  --accent-blush: #f43f5e;
  --accent-blush-soft: rgba(254, 205, 211, 0.18);

  --accent-gold: #f59e0b;
  --accent-gold-soft: rgba(245, 158, 11, 0.16);
  --accent-emerald: #34d399;
  --accent-emerald-soft: rgba(52, 211, 153, 0.16);
  --accent-purple: #c084fc;
  --accent-purple-soft: rgba(192, 132, 252, 0.16);

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 28px -4px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 42px -6px rgba(0, 0, 0, 0.75);
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  scroll-behavior: smooth;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-page);
  color: var(--text-main);
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

a:hover {
  color: var(--accent-primary-hover);
}

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

/* Typography */
h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  color: var(--text-main);
  line-height: 1.28;
  letter-spacing: -0.015em;
  font-weight: 700;
}

.font-accent {
  font-family: var(--font-accent);
}


/* ==========================================================================
   Code Blocks, Inline Code & Master Prompts
   ========================================================================== */
code, pre {
  font-family: var(--font-mono);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.35rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  font-size: 0.88rem;
  line-height: 1.62;
  color: var(--text-main);
  position: relative;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-code);
  padding: 0.15rem 0.38rem;
  border-radius: 4px;
  color: var(--accent-primary);
  border: 1px solid var(--border-color);
}

pre code {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  color: inherit;
  font-size: inherit;
}

pre.text {
  background: var(--bg-code-output);
  border-left: 4px solid var(--accent-primary);
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

div.sourceCode {
  margin: 1.25rem 0;
  position: relative;
}

div.sourceCode pre {
  margin: 0;
  padding: 1.15rem 1.35rem;
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

pre.sourceCode a {
  text-decoration: none;
  color: inherit;
  pointer-events: none;
}

/* ==========================================================================
   Syntax Highlighting (Skylighting / Pygments - Maroon & Rose Palette)
   ========================================================================== */
code span.kw { color: #881337; font-weight: 700; } /* Keyword */
code span.cf { color: #881337; font-weight: 700; } /* ControlFlow */
code span.dt { color: #9f1239; font-weight: 600; } /* DataType */
code span.dv { color: #b45309; }                   /* DecVal */
code span.bn { color: #b45309; }                   /* BaseN */
code span.fl { color: #b45309; }                   /* Float */
code span.ch { color: #047857; }                   /* Char */
code span.st { color: #047857; }                   /* String */
code span.co { color: #8a4f61; font-style: italic; } /* Comment */
code span.ot { color: #881337; }                   /* Other */
code span.al { color: #be123c; font-weight: 700; } /* Alert */
code span.fu { color: #be123c; font-weight: 600; } /* Function */
code span.er { color: #be123c; font-weight: 700; } /* Error */
code span.wa { color: #b45309; font-weight: 600; } /* Warning */
code span.cn { color: #881337; }                   /* Constant */
code span.sc { color: #047857; }                   /* SpecialChar */
code span.vs { color: #047857; }                   /* VerbatimString */
code span.ss { color: #047857; }                   /* SpecialString */
code span.im { color: #701a75; font-weight: 600; } /* Import */
code span.va { color: #2b0b14; }                   /* Variable */
code span.op { color: #5c2a38; }                   /* Operator */
code span.bu { color: #be123c; font-weight: 500; } /* BuiltIn */
code span.pp { color: #701a75; }                   /* Preprocessor */
code span.at { color: #b45309; }                   /* Attribute */
code span.do { color: #8a4f61; font-style: italic; } /* Documentation */
code span.an { color: #8a4f61; font-style: italic; } /* Annotation */
code span.cv { color: #8a4f61; font-style: italic; } /* CommentVar */
code span.in { color: #8a4f61; font-style: italic; } /* Information */

[data-theme="dark"] code span.kw { color: #fb7185; font-weight: 700; }
[data-theme="dark"] code span.cf { color: #fb7185; font-weight: 700; }
[data-theme="dark"] code span.dt { color: #fda4af; font-weight: 600; }
[data-theme="dark"] code span.dv { color: #fbbf24; }
[data-theme="dark"] code span.bn { color: #fbbf24; }
[data-theme="dark"] code span.fl { color: #fbbf24; }
[data-theme="dark"] code span.ch { color: #34d399; }
[data-theme="dark"] code span.st { color: #34d399; }
[data-theme="dark"] code span.co { color: #b88696; font-style: italic; }
[data-theme="dark"] code span.ot { color: #fb7185; }
[data-theme="dark"] code span.al { color: #f43f5e; font-weight: 700; }
[data-theme="dark"] code span.fu { color: #fda4af; font-weight: 600; }
[data-theme="dark"] code span.er { color: #f43f5e; font-weight: 700; }
[data-theme="dark"] code span.wa { color: #fbbf24; font-weight: 600; }
[data-theme="dark"] code span.cn { color: #fb7185; }
[data-theme="dark"] code span.sc { color: #34d399; }
[data-theme="dark"] code span.vs { color: #34d399; }
[data-theme="dark"] code span.ss { color: #34d399; }
[data-theme="dark"] code span.im { color: #e879f9; font-weight: 600; }
[data-theme="dark"] code span.va { color: #fdf2f4; }
[data-theme="dark"] code span.op { color: #ebd0d7; }
[data-theme="dark"] code span.bu { color: #fda4af; font-weight: 500; }
[data-theme="dark"] code span.pp { color: #e879f9; }
[data-theme="dark"] code span.at { color: #fbbf24; }
[data-theme="dark"] code span.do { color: #b88696; font-style: italic; }
[data-theme="dark"] code span.an { color: #b88696; font-style: italic; }
[data-theme="dark"] code span.cv { color: #b88696; font-style: italic; }
[data-theme="dark"] code span.in { color: #b88696; font-style: italic; }


.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Global Sticky Header & Multi-Level Dropdowns
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10000;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 20px -8px rgba(136, 19, 55, 0.08);
}

.nav-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--text-main);
  text-decoration: none;
}

.brand-logo:hover {
  color: var(--accent-primary);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #881337 0%, #be123c 60%, #fb7185 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-avatar-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--accent-primary);
  box-shadow: 0 2px 8px rgba(136, 19, 55, 0.2);
  flex-shrink: 0;
  display: inline-block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand-logo:hover .brand-avatar-img {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(136, 19, 55, 0.3);
}

.brand-sub {
  font-family: var(--font-accent);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item-dropdown {
  position: relative;
  margin: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.52rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.91rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-accent);
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover,
.nav-item-dropdown.open > .nav-link {
  color: var(--accent-primary);
  background: var(--bg-subtle);
  text-decoration: none;
}

.nav-link.active {
  color: var(--accent-primary);
  background: var(--accent-primary-soft);
}

.caret-icon {
  font-size: 0.68rem;
  opacity: 0.75;
  transition: transform 0.2s ease;
}

.nav-item-dropdown.open > .nav-link .caret-icon {
  transform: rotate(180deg);
}

/* Level 1 Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 280px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 10010;
}

.nav-item-dropdown:last-child > .dropdown-menu {
  left: auto;
  right: 0;
}

.nav-item-dropdown.open > .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (min-width: 861px) {
  .nav-item-dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

.dropdown-item,
.dropdown-sub-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  padding: 0.58rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--text-main);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-accent);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover,
.dropdown-sub-trigger:hover,
.dropdown-submenu.open > .dropdown-sub-trigger {
  background: var(--bg-subtle);
  color: var(--accent-primary);
  text-decoration: none;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.4rem 0.3rem;
}

/* Level 2 Sub-Sub-Menu (Flyout) */
.dropdown-submenu {
  position: relative;
  margin: 0;
}

.dropdown-submenu-list {
  position: absolute;
  top: -0.45rem;
  left: calc(100% + 4px);
  min-width: 300px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 10020;
}

.dropdown-submenu.open > .dropdown-submenu-list {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

@media (min-width: 861px) {
  .dropdown-submenu:hover > .dropdown-submenu-list {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  font-family: var(--font-accent);
  cursor: pointer;
  transition: all 0.18s ease;
}

.theme-toggle:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-subtle);
}

.mobile-menu-toggle {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.48rem 0.7rem;
  color: var(--text-main);
  font-size: 1.15rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    align-items: stretch;
    padding: 1.15rem 1.4rem;
    gap: 0.4rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.2s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 0.75rem 0.9rem;
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--accent-primary);
    border-radius: 0;
    padding: 0.35rem 0 0.35rem 0.85rem;
    margin: 0.3rem 0 0.3rem 0.5rem;
    display: none;
  }

  .nav-item-dropdown.open > .dropdown-menu {
    display: block;
  }

  .dropdown-submenu-list {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--border-strong);
    border-radius: 0;
    padding: 0.3rem 0 0.3rem 0.85rem;
    margin: 0.3rem 0 0.3rem 0.5rem;
    display: none;
  }

  .dropdown-submenu.open > .dropdown-submenu-list {
    display: block;
  }
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.68rem 1.35rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: 0.93rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #be123c 100%);
  color: #ffffff !important;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-primary-hover) 0%, #e11d48 100%);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-subtle);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-sm {
  padding: 0.44rem 0.9rem;
  font-size: 0.83rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.26rem 0.72rem;
  border-radius: var(--radius-full);
  font-family: var(--font-accent);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-primary {
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
  border: 1px solid rgba(136, 19, 55, 0.15);
}

.badge-rose {
  background: var(--accent-blush-soft);
  color: var(--accent-rose);
  border: 1px solid rgba(190, 18, 60, 0.15);
}

.badge-active {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
}

.badge-gold {
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
}

.badge-purple {
  background: var(--accent-purple-soft);
  color: var(--accent-purple);
}

.doi-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s ease;
  margin-top: 0.25rem;
  word-break: break-all;
}

.doi-link:hover {
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(136, 19, 55, 0.12);
}

/* ==========================================================================
   Hero & Academic Profile Section
   ========================================================================== */
.hero-section {
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid var(--border-color);
  background: radial-gradient(circle at 85% 15%, var(--accent-primary-soft) 0%, transparent 60%),
              radial-gradient(circle at 15% 90%, var(--accent-rose-soft) 0%, transparent 50%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 3.5rem;
  align-items: center;
}

@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 2.5rem;
  }
}

.hero-title {
  font-size: clamp(2.3rem, 4.2vw, 3.2rem);
  font-weight: 800;
  margin: 0.7rem 0 1rem;
  color: var(--text-main);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin-bottom: 1.6rem;
  line-height: 1.7;
}

.profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.6rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #881337, #be123c, #fb7185, #b45309);
}

.profile-avatar {
  width: 144px;
  height: 144px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  margin: 0 auto 1.1rem;
  border: 3.5px solid var(--accent-primary);
  box-shadow: 0 4px 14px rgba(136, 19, 55, 0.2);
}

.section {
  padding: 4.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2.25rem;
}

.section-title {
  font-size: 1.85rem;
  font-weight: 700;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.35rem;
  max-width: 740px;
}

/* ==========================================================================
   Cards & Grids
   ========================================================================== */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.6rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.6rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.35rem;
}

@media (max-width: 540px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  box-shadow: var(--shadow-xs);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.1rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.card-text {
  color: var(--text-secondary);
  font-size: 0.94rem;
  margin-bottom: 1.35rem;
  line-height: 1.65;
}

.card-footer {
  margin-top: auto;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Interactive CV Tabs & Timelines
   ========================================================================== */
.cv-tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.8rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.85rem;
  flex-wrap: wrap;
}

.cv-tab-btn {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.cv-tab-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.cv-tab-btn.active {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #be123c 100%);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-xs);
}

.cv-pane {
  display: none;
}

.cv-pane.active {
  display: block;
}

.cv-timeline-item {
  padding: 1.2rem 1.4rem;
  border-left: 3.5px solid var(--accent-primary);
  background: var(--bg-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow-xs);
}

.cv-timeline-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 152px;
  align-items: start;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.cv-timeline-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  font-family: var(--font-display);
  line-height: 1.35;
}

.cv-timeline-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 152px;
  min-width: 152px;
  min-height: 1.75rem;
  box-sizing: border-box;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  text-align: center;
  color: var(--accent-primary);
  background: var(--accent-primary-soft);
  border: 1px solid rgba(136, 19, 55, 0.16);
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
}

.cv-timeline-sub {
  font-size: 0.94rem;
  font-style: italic;
  font-family: var(--font-sans);
  letter-spacing: normal;
  word-spacing: normal;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
}

.cv-entry-note {
  font-size: 0.86rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 0.55rem;
  margin-bottom: 0;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border-color);
}

.cv-subentry {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border-color);
}

.cv-bullets {
  padding-left: 1.25rem;
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.58;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.cv-entry-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cv-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 152px;
  align-items: start;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.cv-entry-row:nth-child(even) {
  background: var(--bg-surface);
}

.cv-section-heading {
  font-size: 1.35rem;
  margin: 2.1rem 0 1rem;
  color: var(--accent-primary);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border-color);
}

.cv-section-heading:first-child {
  margin-top: 0.25rem;
}

@media (max-width: 560px) {
  .cv-timeline-header,
  .cv-entry-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
}

.pdf-embed-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pdf-embed-frame {
  width: 100%;
  height: 800px;
  border: none;
  display: block;
}

.pub-group-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin: 1.2rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.pub-group-heading:first-of-type {
  margin-top: 0.25rem;
}

.cv-accordion {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.cv-accordion[open] {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.cv-accordion > summary {
  padding: 0.9rem 1.2rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  user-select: none;
}

.cv-accordion > summary::-webkit-details-marker {
  display: none;
}

.cv-accordion > summary::after {
  content: "▸";
  font-size: 0.9rem;
  color: var(--accent-primary);
  transition: transform 0.2s ease;
}

.cv-accordion[open] > summary::after {
  transform: rotate(90deg);
}

.cv-accordion > summary:hover {
  background: var(--bg-subtle);
  color: var(--accent-primary);
}

.cv-accordion-body {
  padding: 0.75rem 1.2rem 1.15rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.89rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ==========================================================================
   Formulas, Syllabi & Callouts
   ========================================================================== */
.formula-showcase {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4.5px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.5rem;
  margin: 1.2rem 0;
  overflow-x: auto;
  box-shadow: var(--shadow-xs);
}

/* ==========================================================================
   Tables (Global Tables & Syllabus Table System)
   ========================================================================== */
table, .syllabus-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  font-size: 0.92rem;
  box-shadow: var(--shadow-xs);
}

table th,
table td,
.syllabus-table th,
.syllabus-table td {
  padding: 0.95rem 1.15rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

table th,
.syllabus-table th {
  background: var(--bg-subtle);
  font-family: var(--font-accent);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

table tr:last-child td,
.syllabus-table tr:last-child td {
  border-bottom: none;
}

table tbody tr:hover,
.syllabus-table tbody tr:hover {
  background: rgba(136, 19, 55, 0.025);
}

[data-theme="dark"] table tbody tr:hover,
[data-theme="dark"] .syllabus-table tbody tr:hover {
  background: rgba(251, 113, 133, 0.04);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-family: var(--font-accent);
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-secondary);
  font-weight: 500;
}

.breadcrumb a:hover {
  color: var(--accent-primary);
}

/* ==========================================================================
   Code Copy Button
   ========================================================================== */
pre, div.sourceCode {
  position: relative;
}

.global-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.global-copy-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: var(--accent-primary-soft);
}

.global-copy-btn.copied {
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
  background: var(--accent-emerald-soft);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0 2.2rem;
  font-size: 0.91rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.2rem;
  margin-bottom: 2.2rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.85rem;
  font-size: 1.05rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-bottom {
  padding-top: 1.6rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.86rem;
}
