/* ============================================================
   CUSTOM UI — Clean & Minimal
   ============================================================ */

/* ----------------------------------------------------------
   1. DESIGN TOKENS
   ---------------------------------------------------------- */
:root {
  --accent:        #4361ee;
  --accent-dark:   #3451d1;
  --accent-light:  #eef0fd;
  --text-primary:  #111827;
  --text-secondary:#6b7280;
  --text-muted:    #9ca3af;
  --bg-primary:    #ffffff;
  --bg-secondary:  #f9fafb;
  --border:        #e5e7eb;
  --border-light:  #f3f4f6;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 16px rgba(0,0,0,.07);
  --radius-sm:     5px;
  --radius-md:     8px;
  --transition:    0.18s ease;
}

html[data-theme="dark"] {
  --accent:        #6b8cff;
  --accent-dark:   #4361ee;
  --accent-light:  #1c2040;
  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;
  --bg-primary:    #0f1117;
  --bg-secondary:  #181b27;
  --border:        #252a3a;
  --border-light:  #1e2230;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.25);
  --shadow-md:     0 4px 16px rgba(0,0,0,.35);
  /* override theme's bg variable so masthead matches page bg */
  --global-bg-color: #0f1117;
  --global-base-color: #0f1117;
  --global-footer-bg-color: #0f1117;
}

/* ----------------------------------------------------------
   2. TYPOGRAPHY
   ---------------------------------------------------------- */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}


h1, h2, h3, h4, h5, h6 {
  font-family: 'Sora', 'Inter', sans-serif;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.01em;
}

p, li {
  color: var(--text-secondary);
  line-height: 1.8;
}

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

/* ----------------------------------------------------------
   3. MASTHEAD
   ---------------------------------------------------------- */
.masthead {
  background: rgba(255,255,255,0.88) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

html[data-theme="dark"] .masthead {
  background: #0f1117 !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: var(--border);
}
html[data-theme="dark"] .masthead__menu-item {
  background-color: #0f1117 !important;
}

.masthead a,
.masthead__menu-item a {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-secondary) !important;
  transition: color var(--transition);
}
.masthead a:hover,
.masthead__menu-item a:hover {
  color: var(--accent) !important;
}

.masthead__menu-item--lg a {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 0.95rem !important;
  color: var(--text-primary) !important;
}

/* ----------------------------------------------------------
   4. PUBLICATION CARDS
   ---------------------------------------------------------- */
.list__item .archive__item,
.archive__item {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
  position: relative;
}
.archive__item:hover {
  box-shadow: var(--shadow-md);
  border-color: #c7d0f8;
}

html[data-theme="dark"] .archive__item {
  background: var(--bg-secondary);
  border-color: var(--border);
}
html[data-theme="dark"] .archive__item:hover {
  border-color: #3451d1;
}

.archive__item-title {
  font-family: 'Sora', sans-serif;
  font-size: 0.975rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
  line-height: 1.45;
}
.archive__item-title a {
  color: var(--text-primary) !important;
  text-decoration: none;
}
.archive__item-title a:hover {
  color: var(--accent) !important;
}

.archive__item-excerpt {
  font-size: 0.855rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

/* pub meta */
.pub-meta {
  font-size: 0.815rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0.5rem;
  line-height: 1.5;
}
.pub-authors {
  color: var(--text-secondary);
  font-style: italic;
}

/* ----------------------------------------------------------
   5. BUTTONS
   ---------------------------------------------------------- */
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.btn--primary {
  background: var(--accent);
  color: #fff !important;
  border: 1px solid transparent;
}
.btn--primary:hover {
  background: var(--accent-dark);
  color: #fff !important;
}

.btn--inverse {
  background: transparent;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border);
}
.btn--inverse:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
  background: var(--accent-light);
}

html[data-theme="dark"] .btn--inverse {
  border-color: var(--border);
}

/* ----------------------------------------------------------
   6. LAY SUMMARY BOX
   ---------------------------------------------------------- */
.pub-lay-summary {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  margin: 0.65rem 0;
  font-size: 0.875rem;
}
.pub-lay-summary p {
  margin: 0.35rem 0 0;
  color: var(--text-secondary);
  line-height: 1.75;
}

html[data-theme="dark"] .pub-lay-summary {
  background: var(--bg-secondary);
  border-color: var(--border);
  border-left-color: var(--accent);
}

/* ----------------------------------------------------------
   7. SIDEBAR
   ---------------------------------------------------------- */
.sidebar .author__name {
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.sidebar .author__bio {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.65;
}
.sidebar .author__avatar img {
  border-radius: 50%;
  border: 2px solid var(--border);
}
.sidebar .author__urls a {
  font-size: 0.82rem;
  color: var(--text-secondary) !important;
}
.sidebar .author__urls a:hover {
  color: var(--accent) !important;
}

/* ----------------------------------------------------------
   8. PAGE CONTENT
   ---------------------------------------------------------- */
.page__title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page__content h2 {
  font-size: 1.15rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.4rem;
  margin-top: 2rem;
}

.page__content p a,
.page__content li a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(67,97,238,.3);
  text-underline-offset: 2px;
}
.page__content p a:hover,
.page__content li a:hover {
  text-decoration-color: var(--accent);
}

/* ----------------------------------------------------------
   9. ANIMATIONS — subtle fade-in
   ---------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.archive__item {
  animation: fadeIn 0.3s ease both;
}
.list__item:nth-child(1)  .archive__item { animation-delay: 0.03s; }
.list__item:nth-child(2)  .archive__item { animation-delay: 0.06s; }
.list__item:nth-child(3)  .archive__item { animation-delay: 0.09s; }
.list__item:nth-child(4)  .archive__item { animation-delay: 0.12s; }
.list__item:nth-child(5)  .archive__item { animation-delay: 0.15s; }
.list__item:nth-child(6)  .archive__item { animation-delay: 0.18s; }
.list__item:nth-child(7)  .archive__item { animation-delay: 0.21s; }
.list__item:nth-child(8)  .archive__item { animation-delay: 0.24s; }
.list__item:nth-child(9)  .archive__item { animation-delay: 0.27s; }
.list__item:nth-child(10) .archive__item { animation-delay: 0.30s; }

/* ----------------------------------------------------------
   10. DARK MODE — global overrides
   ---------------------------------------------------------- */
html[data-theme="dark"] body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}
html[data-theme="dark"] .page__content,
html[data-theme="dark"] .page__inner-wrap {
  background: var(--bg-primary);
}
