/* ─── Learning page theme variables ───────────────────────────────────────── */
/* CSS custom properties consumed by the learning dashboard module.
   Both the light defaults (:root) and dark overrides live in one place so the
   rendered HTML adapts to theme without hardcoded hex values bleeding in. */

:root {
  --lp-panel-bg: #ffffff;
  --lp-panel-soft: #f9fafb;
  --lp-panel-muted: #f8fafc;
  --lp-border: #e5e7eb;
  --lp-border-soft: #f3f4f6;
  --lp-text: #111827;
  --lp-text-soft: #374151;
  --lp-text-muted: #6b7280;
  --lp-text-faint: #9ca3af;
  --lp-status-empty: #d1d5db;
  --lp-progress-bg: #e5e7eb;
  --lp-accent: #059669;
  --lp-accent-soft: #34d399;
  --lp-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ─── Base typography ─────────────────────────────────────────────────────── */

body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  color: #1e293b;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
}

/* ─── Navbar ──────────────────────────────────────────────────────────────── */

.navbar {
  --bs-navbar-padding-y: 0.5rem;
  border-bottom: 2px solid #059669;
}

.navbar-brand {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Hide the title block only on the homepage, which uses the custom hero */
.page-home .quarto-title-block {
  display: none;
}

/* ─── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  border-bottom: 1px solid #e2e8f0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Atmospheric gradient mesh — blurred radial layers that sit behind all
   hero content (z-index:-1). Uses brand emerald + sky-blue at low alpha so
   the section gains depth without fighting the text. */
.hero::before {
  content: "";
  position: absolute;
  inset: -10% -5%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(55% 45% at 18% 28%, rgba(5, 150, 105, 0.16), transparent 70%),
    radial-gradient(45% 40% at 88% 72%, rgba(14, 165, 233, 0.13), transparent 68%),
    radial-gradient(35% 30% at 62% 8%,  rgba(5, 150, 105, 0.09), transparent 65%);
  filter: blur(8px);
}

/* Flexbox two-column layout — avoids Quarto's section-wrapping issue */
.hero-inner {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 4rem 0 3rem;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-photo {
  flex-shrink: 0;
  text-align: center;
}

.hero-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  background: linear-gradient(110deg, #059669 0%, #0ea5e9 45%, #059669 90%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #059669;
  animation: hero-gradient-drift 10s ease-in-out infinite;
}

@keyframes hero-gradient-drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero .subtitle {
  font-size: 1.2rem;
  color: #059669;
  font-weight: 500;
  margin-bottom: 1rem;
  letter-spacing: -0.005em;
}

.hero .location {
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #374151;
}

.hero-open-to {
  margin-top: 0.4rem;
}

/* ─── Profile photo ───────────────────────────────────────────────────────── */

.profile-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #059669;
  box-shadow: 0 0 0 6px rgba(5, 150, 105, 0.12), 0 8px 24px rgba(0,0,0,0.1);
  display: block;
  margin: 0 auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-photo:hover {
  transform: scale(1.04);
  box-shadow: 0 0 0 8px rgba(5, 150, 105, 0.2), 0 12px 32px rgba(0,0,0,0.15);
}

/* ─── CTA buttons (pill shape) ────────────────────────────────────────────── */

.cta-buttons {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-primary-custom {
  background-color: #059669;
  color: white;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border: 2px solid #059669;
  transition: all 0.2s ease;
  display: inline-block;
}

.btn-primary-custom:hover {
  background-color: #047857;
  border-color: #047857;
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}

.btn-secondary-custom {
  background-color: transparent;
  color: #059669;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border: 2px solid #059669;
  transition: all 0.2s ease;
  display: inline-block;
}

.btn-secondary-custom:hover {
  background-color: #059669;
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}

.hero-links {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.hero-icon-link {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 2px solid rgba(5, 150, 105, 0.35);
  color: #059669;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: rgba(5, 150, 105, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.hero-icon-link i {
  font-size: 1.2rem;
  line-height: 1;
}

.hero-icon-link svg {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}

.hero-icon-link:hover {
  color: white;
  background-color: #059669;
  border-color: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.28);
  text-decoration: none;
}

/* ─── Shared page modules ─────────────────────────────────────────────────── */

.site-shell {
  width: 100%;
}

.section-stack {
  display: grid;
  gap: 2rem;
}

.page-section {
  padding: 2.2rem 0 0;
}

.section-heading {
  margin: 0 0 1.4rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1e293b;
}

.loading-state,
.error-state {
  margin: 0;
  padding: 1rem 0;
  color: #64748b;
  font-size: 0.98rem;
}

.resume-links,
.record-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

.resume-links {
  margin-bottom: 0.25rem;
}

.record-taxonomy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.8rem 0 0.35rem;
}

.topic-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid rgba(5, 150, 105, 0.18);
  padding: 0.18rem 0.58rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.record-tech {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #475569;
}

/* ─── Section cards ───────────────────────────────────────────────────────── */

.section-card {
  background: #f8fafc;
  border-left: 4px solid #059669;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.section-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.section-card h3 {
  margin-top: 0;
  font-size: 1.05rem;
  color: #059669;
}

/* Icon badge sitting above the card title. Uses currentColor on the SVG so
   the stroke inherits the accent, and a tinted square background for weight. */
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
  margin-bottom: 0.85rem;
  transition: transform 0.35s ease, background 0.3s ease;
}

.card-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

.section-card:hover .card-icon {
  transform: rotate(-6deg) scale(1.06);
  background: rgba(5, 150, 105, 0.18);
}

/* ─── Skill badges ────────────────────────────────────────────────────────── */

.skill-badge {
  display: inline-block;
  background: #d1fae5;
  color: #065f46;
  border-radius: 6px;
  padding: 0.2rem 0.65rem;
  font-size: 0.82rem;
  font-family: 'Roboto Mono', monospace;
  font-weight: 500;
  margin: 0.2rem;
}

/* ─── Skill groups (labeled rows of badges) ──────────────────────────────── */

.skill-group {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin: 0.55rem 0;
  flex-wrap: wrap;
}

.skill-group-label {
  flex-shrink: 0;
  min-width: 140px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #64748b;
  position: relative;
  padding-left: 0.75rem;
}

.skill-group-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  background: #059669;
  border-radius: 2px;
}

.skill-group-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

/* ─── Small button modifier ──────────────────────────────────────────────── */
/* Promotes the repeated inline style="font-size:0.85rem;padding:0.25rem 0.75rem"
   on project links to a reusable class. */

.btn-primary-custom.btn-sm,
.btn-secondary-custom.btn-sm {
  font-size: 0.82rem;
  padding: 0.3rem 0.85rem;
  border-width: 1.5px;
}

/* ─── Publication type tags ──────────────────────────────────────────────── */
/* Small colored pill at the start of each .pub-venue so the list becomes
   scannable: journal / conference / review / workshop have distinct hues. */

.pub-type {
  display: inline-block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  margin-right: 0.55rem;
  vertical-align: 1px;
  line-height: 1.4;
  border: 1px solid transparent;
}

.pub-type-journal {
  background: #d1fae5;
  color: #065f46;
  border-color: rgba(5, 150, 105, 0.22);
}

.pub-type-conference {
  background: #e0f2fe;
  color: #075985;
  border-color: rgba(14, 165, 233, 0.25);
}

/* Outline modifier — pairs with a primary venue tag (e.g. [Journal][Review]).
   Distinguishes article type (review, preprint, …) from venue type. */
.pub-type-review {
  background: transparent;
  color: #475569;
  border: 1.5px solid #cbd5e1;
  font-size: 0.62rem;
  padding: 0.08rem 0.5rem;
  letter-spacing: 0.08em;
}

.pub-type-workshop {
  background: #ede9fe;
  color: #5b21b6;
  border-color: rgba(124, 58, 237, 0.25);
}

/* ─── Publication / project entries ──────────────────────────────────────── */

.pub-entry {
  border-bottom: 1px solid #e2e8f0;
  padding: 1.25rem 0;
}

.pub-entry:last-child {
  border-bottom: none;
}

.pub-venue {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pub-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0.3rem 0;
  color: #1e293b;
}

.pub-meta {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.6;
}

/* ─── Author line + summary (two-row layout) ─────────────────────────────── */

.pub-authors {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.55;
  margin: 0.3rem 0 0.25rem;
}

.pub-authors p { margin: 0; }

.pub-summary {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
}

.pub-summary p { margin: 0 0 0.35rem; }
.pub-summary p:last-child { margin-bottom: 0; }

.pub-meta p {
  margin: 0 0 0.7rem;
}

.pub-meta p:last-child {
  margin-bottom: 0;
}

/* ─── CV page ─────────────────────────────────────────────────────────────── */
/* Timeline layout: any .cv-section containing .cv-entry rows gets a vertical
   rail on the left with circular markers at each entry. Sections without
   entries (e.g. the Skills table) are untouched by the :has() selector. */

.cv-section {
  margin-bottom: 2.5rem;
  position: relative;
}

.cv-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #059669;
  border-bottom: 2px solid #059669;
  padding-bottom: 0.3rem;
  margin-bottom: 1.25rem;
}

.cv-section:has(.cv-entry) {
  padding-left: 1.75rem;
}

.cv-section:has(.cv-entry) > h2 {
  margin-left: -1.75rem;
}

.cv-section:has(.cv-entry)::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 2.9rem;
  bottom: 0.4rem;
  width: 2px;
  background: linear-gradient(to bottom, #059669 0%, rgba(5, 150, 105, 0.15) 100%);
  border-radius: 1px;
}

.cv-entry {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1.6rem;
  position: relative;
}

.cv-entry::before {
  content: "";
  position: absolute;
  left: -1.63rem;
  top: 0.45rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.18), 0 0 0 6px rgba(5, 150, 105, 0.06);
  transition: box-shadow 0.25s ease;
}

.cv-entry:hover::before {
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.28), 0 0 0 9px rgba(5, 150, 105, 0.1);
}

.cv-date {
  min-width: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #059669;
  padding-top: 0;
  flex-shrink: 0;
}

.cv-content {
  margin-top: 0.15rem;
}

.cv-content strong {
  display: block;
  font-weight: 600;
}

.cv-content p {
  margin: 0.35rem 0 0;
}

.cv-content ul {
  margin: 0.6rem 0 0;
  padding-left: 1.15rem;
}

.cv-content em {
  color: #475569;
  font-size: 0.93rem;
}

.cv-focus-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.7rem 0 0.2rem;
}

.cv-skills-table {
  margin-bottom: 0;
}

.cv-project-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.95rem;
}

.cv-project-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 1rem 1.1rem;
}

.cv-project-item strong {
  display: block;
  margin-bottom: 0.35rem;
}

.cv-project-item p,
.cv-note {
  margin: 0;
  color: #475569;
  line-height: 1.65;
}

/* ─── Learning dashboard ─────────────────────────────────────────────────── */

.learning-shell {
  max-width: 860px;
  margin: 0 auto;
}

.learning-panel {
  background: var(--lp-panel-bg);
  border: 1px solid var(--lp-border);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--lp-shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.learning-panel-title {
  margin: 0 0 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--lp-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.learning-progress-row {
  margin-bottom: 1.1rem;
}

.learning-progress-row:last-child {
  margin-bottom: 0;
}

.learning-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 5px;
}

.learning-progress-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--lp-text);
}

.learning-progress-meta {
  color: var(--lp-text-muted);
  font-size: 0.85rem;
}

.learning-progress-track {
  background: var(--lp-progress-bg);
  border-radius: 999px;
  height: 13px;
  overflow: hidden;
}

.learning-progress-fill {
  background: linear-gradient(90deg, var(--lp-accent), var(--lp-accent-soft));
  height: 100%;
  border-radius: 999px;
  min-width: 0;
  transition: width 0.6s ease;
}

.learning-year summary,
.learning-month summary,
.learning-week-summary {
  cursor: pointer;
  list-style: none;
}

.learning-year > summary {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.4rem 0;
}

.learning-year-body {
  padding-left: 1.25rem;
  margin-top: 0.5rem;
}

.learning-month > summary {
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.35rem 0;
  color: var(--lp-text-soft);
}

.learning-month-body {
  padding-left: 1rem;
  margin-top: 0.5rem;
}

.learning-week {
  margin-bottom: 1rem;
  border: 1px solid var(--lp-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--lp-panel-bg);
}

.learning-week-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--lp-panel-soft);
  color: var(--lp-text);
  font-size: 0.97rem;
  font-weight: 600;
}

.learning-week-meta {
  margin-left: auto;
  color: var(--lp-text-muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.learning-week-body {
  padding: 1rem 1.25rem;
}

.learning-section-label {
  margin: 0 0 0.45rem;
  color: var(--lp-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.78rem;
  font-weight: 700;
}

.learning-section-label + .learning-table-wrap,
.learning-section-label + .learning-copy {
  margin-bottom: 1.1rem;
}

.learning-copy {
  margin: 0;
  color: var(--lp-text-soft);
  font-size: 0.86rem;
  line-height: 1.6;
}

.learning-table-wrap {
  overflow-x: auto;
}

.learning-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  color: var(--lp-text-soft);
}

.learning-table thead tr {
  border-bottom: 2px solid var(--lp-border);
  color: var(--lp-text-muted);
  font-size: 0.8rem;
}

.learning-table th,
.learning-table td {
  padding: 8px;
  vertical-align: top;
}

.learning-table th {
  font-weight: 600;
  text-align: left;
}

.learning-table tbody tr {
  border-bottom: 1px solid var(--lp-border-soft);
}

.learning-table a {
  color: var(--lp-accent);
  font-weight: 500;
  text-decoration: none;
}

.learning-status-cell {
  text-align: center;
}

.learning-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  font-size: 1rem;
}

.learning-status-icon--done {
  color: #22c55e;
}

.learning-status-icon--pending {
  color: var(--lp-status-empty);
}

.learning-difficulty {
  display: inline-block;
  border-radius: 999px;
  color: white;
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.learning-difficulty--easy {
  background: #22c55e;
}

.learning-difficulty--medium {
  background: #f59e0b;
}

.learning-difficulty--hard {
  background: #ef4444;
}

.learning-takeaway {
  margin-top: 4px;
  color: var(--lp-text-muted);
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.4;
}

.learning-grade {
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
  border-radius: 6px;
  background: var(--lp-accent);
  color: white;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DARK MODE  —  Triggered by data-bs-theme="dark" on <html> (Bootstrap 5.3)
   ═══════════════════════════════════════════════════════════════════════════ */

[data-bs-theme="dark"] {
  /* Override darkly's flat #222 with richer slate-900 */
  --bs-body-bg: #0f172a;
  --bs-body-color: #f1f5f9;

  /* Learning page variables in dark context */
  --lp-panel-bg: rgba(30, 41, 59, 0.55);
  --lp-panel-soft: rgba(30, 41, 59, 0.7);
  --lp-panel-muted: rgba(15, 23, 42, 0.6);
  --lp-border: rgba(52, 211, 153, 0.18);
  --lp-border-soft: rgba(148, 163, 184, 0.1);
  --lp-text: #f1f5f9;
  --lp-text-soft: #cbd5e1;
  --lp-text-muted: #94a3b8;
  --lp-text-faint: #64748b;
  --lp-status-empty: rgba(148, 163, 184, 0.25);
  --lp-progress-bg: rgba(148, 163, 184, 0.2);
  --lp-accent: #34d399;
  --lp-accent-soft: #6ee7b7;
  --lp-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

[data-bs-theme="dark"] body {
  background-color: #0f172a;
  color: #f1f5f9;
}

[data-bs-theme="dark"] .navbar {
  border-bottom-color: #34d399;
}

[data-bs-theme="dark"] .hero {
  border-bottom-color: #1e293b;
}

[data-bs-theme="dark"] .hero::before {
  background:
    radial-gradient(55% 45% at 18% 28%, rgba(52, 211, 153, 0.14), transparent 70%),
    radial-gradient(45% 40% at 88% 72%, rgba(56, 189, 248, 0.11), transparent 68%),
    radial-gradient(35% 30% at 62% 8%,  rgba(52, 211, 153, 0.07), transparent 65%);
}

[data-bs-theme="dark"] .hero-name {
  background: linear-gradient(110deg, #34d399 0%, #38bdf8 45%, #34d399 90%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #34d399;
}

[data-bs-theme="dark"] .hero .subtitle {
  color: #34d399;
}

[data-bs-theme="dark"] .hero .location {
  color: #94a3b8;
}

[data-bs-theme="dark"] .hero p {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .section-heading,
[data-bs-theme="dark"] .loading-state,
[data-bs-theme="dark"] .error-state {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .profile-photo {
  border-color: #34d399;
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.15), 0 8px 24px rgba(0,0,0,0.4);
}

[data-bs-theme="dark"] .profile-photo:hover {
  box-shadow: 0 0 0 8px rgba(52, 211, 153, 0.22), 0 12px 32px rgba(0,0,0,0.5);
}

[data-bs-theme="dark"] .btn-primary-custom {
  background-color: #34d399;
  border-color: #34d399;
  color: #0f172a;
}

[data-bs-theme="dark"] .btn-primary-custom:hover {
  background-color: #10b981;
  border-color: #10b981;
  color: #0f172a;
  box-shadow: 0 6px 16px rgba(52, 211, 153, 0.4);
}

[data-bs-theme="dark"] .btn-secondary-custom {
  color: #34d399;
  border-color: #34d399;
  background-color: transparent;
}

[data-bs-theme="dark"] .btn-secondary-custom:hover {
  background-color: #34d399;
  color: #0f172a;
  box-shadow: 0 6px 16px rgba(52, 211, 153, 0.4);
}

[data-bs-theme="dark"] .hero-icon-link {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.08);
}

[data-bs-theme="dark"] .hero-icon-link:hover {
  color: #0f172a;
  background-color: #34d399;
  border-color: #34d399;
  box-shadow: 0 6px 16px rgba(52, 211, 153, 0.3);
}

/* Glassmorphism cards */
[data-bs-theme="dark"] .section-card {
  background: rgba(30, 41, 59, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-left: 4px solid #34d399;
  border-top: 1px solid rgba(52, 211, 153, 0.12);
  border-right: 1px solid rgba(52, 211, 153, 0.08);
  border-bottom: 1px solid rgba(52, 211, 153, 0.08);
  border-radius: 10px;
}

[data-bs-theme="dark"] .section-card:hover {
  background: rgba(30, 41, 59, 0.75);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

[data-bs-theme="dark"] .section-card h3 {
  color: #34d399;
}

[data-bs-theme="dark"] .card-icon {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
}

[data-bs-theme="dark"] .section-card:hover .card-icon {
  background: rgba(52, 211, 153, 0.22);
}

[data-bs-theme="dark"] .skill-badge {
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.2);
}

[data-bs-theme="dark"] .topic-badge {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.28);
}

[data-bs-theme="dark"] .pub-entry {
  border-bottom-color: #1e293b;
}

[data-bs-theme="dark"] .pub-venue {
  color: #94a3b8;
}

[data-bs-theme="dark"] .pub-title {
  color: #f1f5f9;
}

[data-bs-theme="dark"] .pub-meta {
  color: #94a3b8;
}

[data-bs-theme="dark"] .record-tech,
[data-bs-theme="dark"] .cv-note,
[data-bs-theme="dark"] .cv-project-item p {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .pub-authors { color: #94a3b8; }
[data-bs-theme="dark"] .pub-summary { color: #cbd5e1; }

[data-bs-theme="dark"] .cv-section h2 {
  color: #34d399;
  border-bottom-color: #34d399;
}

[data-bs-theme="dark"] .cv-section:has(.cv-entry)::before {
  background: linear-gradient(to bottom, #34d399 0%, rgba(52, 211, 153, 0.15) 100%);
}

[data-bs-theme="dark"] .cv-entry::before {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22), 0 0 0 6px rgba(52, 211, 153, 0.08);
}

[data-bs-theme="dark"] .cv-entry:hover::before {
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.3), 0 0 0 9px rgba(52, 211, 153, 0.12);
}

[data-bs-theme="dark"] .cv-date {
  color: #34d399;
}

[data-bs-theme="dark"] .cv-content {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .cv-content em {
  color: #94a3b8;
}

[data-bs-theme="dark"] .cv-project-item {
  background: rgba(30, 41, 59, 0.55);
  border-color: rgba(52, 211, 153, 0.14);
}

[data-bs-theme="dark"] .skill-group-label {
  color: #94a3b8;
}

[data-bs-theme="dark"] .skill-group-label::before {
  background: #34d399;
}

[data-bs-theme="dark"] .pub-type-journal {
  background: rgba(52, 211, 153, 0.13);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.3);
}

[data-bs-theme="dark"] .pub-type-conference {
  background: rgba(56, 189, 248, 0.13);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.32);
}

[data-bs-theme="dark"] .pub-type-review {
  background: transparent;
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.35);
}

[data-bs-theme="dark"] .pub-type-workshop {
  background: rgba(167, 139, 250, 0.14);
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.35);
}

[data-bs-theme="dark"] .learning-year > summary,
[data-bs-theme="dark"] .learning-month > summary,
[data-bs-theme="dark"] .learning-week-summary {
  color: var(--lp-text);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLL REVEAL  —  CSS-only via scroll-driven animations (Chromium 115+).
   Firefox/Safari fall back gracefully to fully-visible elements.
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .section-card,
    .pub-entry {
      animation: reveal-rise linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 25%;
    }
  }
}

@keyframes reveal-rise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   REDUCED MOTION  —  Honor the user's OS setting for all motion additions.
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .hero-name { animation: none; }
  .profile-photo,
  .btn-primary-custom,
  .btn-secondary-custom,
  .section-card {
    transition: none;
  }
  .profile-photo:hover,
  .btn-primary-custom:hover,
  .btn-secondary-custom:hover,
  .section-card:hover {
    transform: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 991px) {
  .hero-name { font-size: 2.75rem; }
  .cv-date { min-width: 130px; }
}

@media (max-width: 767px) {
  body { overflow-x: hidden; }

  .hero-inner {
    flex-direction: column;
    padding: 2rem 0 1.5rem;
    gap: 1.5rem;
    text-align: center;
  }

  /* Photo first on mobile */
  .hero-photo { order: -1; }

  .cta-buttons { justify-content: center; }
  .hero-links { justify-content: center; }

  .hero-name { font-size: 2.2rem; }
  .hero .subtitle { font-size: 1.05rem; }

  .profile-photo { width: 140px; height: 140px; }

  .section-card { margin-bottom: 1rem; }

  .cv-date { font-size: 0.7rem; }
  .cv-section:has(.cv-entry) { padding-left: 1.4rem; }
  .cv-section:has(.cv-entry) > h2 { margin-left: -1.4rem; }
  .cv-entry::before { left: -1.28rem; width: 9px; height: 9px; top: 0.5rem; }

  .pub-title { font-size: 0.98rem; }

  .btn-primary-custom,
  .btn-secondary-custom {
    font-size: 0.88rem;
    padding: 0.45rem 1rem;
  }

  .hero-links {
    width: 100%;
    justify-content: center;
  }

  .learning-progress-copy,
  .learning-week-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .learning-week-meta {
    margin-left: 0;
  }

  .skill-badge { font-size: 0.78rem; padding: 0.15rem 0.5rem; }

  .skill-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin: 0.75rem 0;
  }
  .skill-group-label { min-width: 0; }

  .pub-type {
    font-size: 0.62rem;
    padding: 0.1rem 0.45rem;
    margin-right: 0.4rem;
  }
}

@media (max-width: 480px) {
  .hero-name { font-size: 1.8rem; }
  .hero .subtitle { font-size: 0.95rem; }
  .hero .location { font-size: 0.85rem; }
  .profile-photo { width: 120px; height: 120px; }
  .pub-venue { font-size: 0.78rem; }
  .pub-meta { font-size: 0.85rem; }
  .navbar-brand { font-size: 0.95rem; }
  .learning-panel {
    padding: 1.1rem 1rem;
  }
}
