:root { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body { font-family: "Inter", sans-serif; scroll-behavior: smooth; transition: background-color .25s ease, color .25s ease; }
.serif-title { font-family: "Playfair Display", serif; }
.glass-nav { background: rgba(255, 255, 255, .8); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(0, 0, 0, .05); }
.card-hover:hover { transform: translateY(-2px); transition: transform .2s ease; }
.tabbar-shell {
  position: fixed;
  left: 50%;
  bottom: 72px;
  z-index: 95;
  width: auto;
  transform: translateX(-50%);
  pointer-events: none;
}
.tabbar__dock {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  width: auto;
  padding: 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .88), rgba(244, 247, 255, .94)),
    rgba(255, 255, 255, .76);
  box-shadow:
    0 22px 50px rgba(15, 23, 42, .16),
    inset 0 1px 0 rgba(255, 255, 255, .85);
  backdrop-filter: blur(22px);
  overflow-x: auto;
  scrollbar-width: none;
  pointer-events: auto;
}
.tabbar__dock::-webkit-scrollbar { display: none; }
.tabbar__active {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(79, 70, 229, .18), rgba(14, 165, 233, .2)),
    rgba(255, 255, 255, .72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .72),
    0 12px 28px rgba(79, 70, 229, .18);
  opacity: 0;
  transition: transform .32s ease, width .32s ease, height .32s ease, opacity .18s ease;
  pointer-events: none;
}
.tabbar__active.is-visible { opacity: 1; }
.tabbar__item {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  font: 700 13px/1 "Manrope", sans-serif;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: color .22s ease, transform .22s ease;
}
.tabbar__item:hover { color: #1e293b; transform: translateY(-1px); }
.tabbar__item.is-active { color: #1f2a6b; }
.tabbar__item:focus-visible {
  outline: 2px solid rgba(79, 70, 229, .35);
  outline-offset: 3px;
}
.tabbar__icon {
  width: 18px;
  height: 18px;
  color: currentColor;
  flex-shrink: 0;
}
.tabbar__label { transform: translateY(1px); }
.admin-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 80; }
.section-edit-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .18);
  background: rgba(255, 255, 255, .82);
  color: #4f46e5;
  font: 700 12px/1 "Manrope", sans-serif;
  letter-spacing: .02em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .92),
    0 6px 16px rgba(15, 23, 42, .06);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, color .2s ease, background-color .2s ease;
}
.section-edit-btn i {
  color: #4f46e5;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.section-edit-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, .32);
  background: rgba(238, 242, 255, .92);
  color: #3730a3;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .96),
    0 10px 22px rgba(99, 102, 241, .14);
}
.section-edit-btn i { color: currentColor; }
.section-edit-btn.is-visible { display: inline-flex; }
.hero-cta-primary { box-shadow: 0 12px 28px rgba(79, 70, 229, .28); }
.hero-cta-primary:hover { box-shadow: 0 16px 34px rgba(79, 70, 229, .34); }
.hero-cta-secondary { background: #fff; color: #334155; }
.service-card--accent { background: #eef2ff; border-color: #c7d2fe; }
.service-card--neutral { background: #f8fafc; border-color: #e2e8f0; }
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: block;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s ease, visibility 0s .32s;
}
.admin-modal[data-open="1"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .28s ease, visibility 0s 0s;
}
.admin-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(99, 102, 241, .12), transparent 34%),
    rgba(15, 23, 42, .72);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity .28s ease;
}
.admin-modal[data-open="1"] .admin-modal__backdrop { opacity: 1; }
.admin-modal__sheet {
  position: relative;
  margin: min(48px, 4vh) auto;
  width: min(1040px, 92vw);
  max-height: min(880px, 90vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, .95), rgba(255, 255, 255, .78) 36%, rgba(244, 247, 255, .92) 100%),
    linear-gradient(140deg, #f8f5ef 0%, #ffffff 46%, #f5f7ff 100%);
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, .22);
  box-shadow: 0 36px 90px rgba(15, 23, 42, .28);
  transform: translateY(24px) scale(.985);
  opacity: 0;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), opacity .24s ease;
}
.admin-modal[data-open="1"] .admin-modal__sheet {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.admin-modal__sheet,
.admin-modal__sheet *,
.admin-modal__sheet input,
.admin-modal__sheet textarea,
.admin-modal__sheet button { font-family: "Manrope", sans-serif !important; }
.admin-modal__header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
  background: linear-gradient(135deg, rgba(255, 255, 255, .72), rgba(236, 242, 255, .88));
}
.admin-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(79, 70, 229, .08);
  color: #4f46e5;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.admin-modal__title {
  margin: 0;
  color: #0f172a;
  font-family: "Playfair Display", serif !important;
  font-size: clamp(1.75rem, 2.2vw, 2.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.admin-modal__content {
  overflow: auto;
  padding: 22px 28px 10px;
}
.admin-modal__intro {
  margin: 0 0 20px;
  max-width: 60ch;
  color: #64748b;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.75;
}
.admin-modal__footer {
  padding: 16px 28px 20px;
  border-top: 1px solid rgba(148, 163, 184, .16);
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .92) 24%);
}
.admin-modal__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-modal__status {
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.admin-modal__hint {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}
.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px !important;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.admin-btn--ghost {
  background: transparent;
  border-color: rgba(148, 163, 184, .2);
  color: #64748b;
}
.admin-btn--ghost:hover {
  background: rgba(148, 163, 184, .08);
  border-color: rgba(148, 163, 184, .3);
  color: #475569;
}
.admin-btn--primary {
  min-height: 36px;
  padding: 0 20px;
  color: #fff;
  font-weight: 600;
  background: #4f46e5;
  border-color: #4f46e5;
}
.admin-btn--primary:hover {
  background: #4338ca;
  border-color: #4338ca;
}
.admin-btn--danger {
  background: rgba(244, 63, 94, .06);
  border-color: rgba(244, 63, 94, .15);
  color: #f87171;
  font-size: 12px;
  font-weight: 500;
}
.admin-btn--danger:hover {
  color: #fca5a5;
  background: rgba(244, 63, 94, .12);
  border-color: rgba(244, 63, 94, .25);
}
.admin-field {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .5);
  color: #0f172a;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  box-shadow: none;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.admin-field:focus {
  outline: none;
  border-color: rgba(99, 102, 241, .48);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
  background: rgba(255, 255, 255, .7);
}
.admin-list-row {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(248, 250, 252, .9));
  box-shadow: none;
}
.admin-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 6px;
}
.admin-list-row textarea { min-height: 80px; resize: vertical; }
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
  align-items: start;
}
.admin-field-wrap { display: flex; flex-direction: column; }
.admin-field-wrap .admin-field,
.admin-field-wrap textarea { min-height: 44px; }
.admin-field-wrap[data-field="authors"],
.admin-field-wrap[data-field="description"] { grid-column: 1 / -1; }

/* — publications / conferences layout — */

.publications-grid { display: grid; gap: 4rem; }
@media (min-width: 768px) {
  .publications-grid--two-col { grid-template-columns: 1fr 1fr; }
}
.pub-card-compact {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
  transition: transform .2s ease;
}
.pub-card-compact:hover { transform: translateY(-2px); }
.conf-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  transition: transform .2s ease;
}
.conf-card:hover { transform: translateY(-2px); }
.conf-empty-state {
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  color: #94a3b8;
}

/* — dark theme — */

html[data-theme="dark"] body { background-color: #020617; color: #e2e8f0; }
html[data-theme="dark"] .glass-nav { background: rgba(15, 23, 42, .82); border-bottom: 1px solid rgba(148, 163, 184, .2); }
html[data-theme="dark"] .tabbar__dock {
  border-color: rgba(99, 102, 241, .2);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .88), rgba(30, 41, 59, .94)),
    rgba(15, 23, 42, .84);
  box-shadow:
    0 24px 52px rgba(2, 6, 23, .42),
    inset 0 1px 0 rgba(255, 255, 255, .06);
}
html[data-theme="dark"] .tabbar__active {
  background:
    linear-gradient(135deg, rgba(99, 102, 241, .34), rgba(14, 165, 233, .24)),
    rgba(30, 41, 59, .9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 12px 28px rgba(15, 23, 42, .34);
}
html[data-theme="dark"] .tabbar__item { color: rgba(226, 232, 240, .72); }
html[data-theme="dark"] .tabbar__item:hover,
html[data-theme="dark"] .tabbar__item.is-active { color: #f8fafc; }
html[data-theme="dark"] .bg-white { background-color: #0f172a !important; }
html[data-theme="dark"] .bg-slate-50 { background-color: #020617 !important; }
html[data-theme="dark"] .bg-slate-100 { background-color: #1e293b !important; }
html[data-theme="dark"] .bg-slate-800 { background-color: #1e293b !important; }
html[data-theme="dark"] .bg-slate-600 { background-color: #334155 !important; }
html[data-theme="dark"] .text-slate-900, html[data-theme="dark"] .text-slate-800, html[data-theme="dark"] .text-slate-700 { color: #e2e8f0 !important; }
html[data-theme="dark"] .text-slate-600, html[data-theme="dark"] .text-slate-500, html[data-theme="dark"] .text-slate-400 { color: #94a3b8 !important; }
html[data-theme="dark"] .text-indigo-600 { color: #818cf8 !important; }
html[data-theme="dark"] .text-indigo-900 { color: #c7d2fe !important; }
html[data-theme="dark"] .border-slate-100, html[data-theme="dark"] .border-slate-200 { border-color: #1e293b !important; }
html[data-theme="dark"] .border-white { border-color: #0f172a !important; }
html[data-theme="dark"] .shadow-sm { box-shadow: 0 1px 4px rgba(0,0,0,.4) !important; }

/* nav buttons */
html[data-theme="dark"] .glass-nav a.bg-white,
html[data-theme="dark"] .glass-nav button.bg-white {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

/* hero badge */
html[data-theme="dark"] #hero-badge {
  background-color: #1e293b !important;
  color: #c7d2fe !important;
}

/* publication cards */
html[data-theme="dark"] #publications-list article {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}
html[data-theme="dark"] #publications-list .bg-slate-100 {
  background-color: #1e293b !important;
  color: #a5b4fc !important;
}

/* stat boxes */
html[data-theme="dark"] #publications .bg-white {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}

/* timeline dots */
html[data-theme="dark"] #education-list .border-white,
html[data-theme="dark"] #experience-list .border-white { border-color: #0f172a !important; }
html[data-theme="dark"] .hero-cta-primary {
  background: #4f46e5 !important;
  border: 1px solid #6366f1;
  box-shadow: 0 8px 18px rgba(2, 6, 23, .5);
}
html[data-theme="dark"] .hero-cta-primary:hover {
  background: #6366f1 !important;
  box-shadow: 0 12px 24px rgba(30, 41, 59, .5);
}
html[data-theme="dark"] .hero-cta-secondary {
  background: rgba(15, 23, 42, .56);
  border-color: #334155;
  color: #cbd5e1;
}
html[data-theme="dark"] .hero-cta-secondary:hover {
  background: rgba(30, 41, 59, .72);
  border-color: #475569;
}
html[data-theme="dark"] .service-card--accent {
  background: linear-gradient(160deg, rgba(49, 46, 129, .45), rgba(15, 23, 42, .95));
  border-color: rgba(99, 102, 241, .45);
}
html[data-theme="dark"] .service-card--neutral {
  background: linear-gradient(160deg, rgba(15, 23, 42, .92), rgba(2, 6, 23, .96));
  border-color: #334155;
}
html[data-theme="dark"] .service-card .text-slate-900 { color: #f1f5f9 !important; }
html[data-theme="dark"] .service-card .text-slate-700 { color: #cbd5e1 !important; }
html[data-theme="dark"] .section-edit-btn {
  background: rgba(15, 23, 42, .78);
  border-color: rgba(99, 102, 241, .2);
  color: #a5b4fc;
  box-shadow:
    inset 0 1px 0 rgba(148, 163, 184, .06),
    0 6px 16px rgba(2, 6, 23, .3);
}
html[data-theme="dark"] .section-edit-btn i { color: currentColor; }
html[data-theme="dark"] .section-edit-btn:hover {
  border-color: rgba(129, 140, 248, .4);
  color: #c7d2fe;
  background: rgba(49, 46, 129, .3);
  box-shadow:
    inset 0 1px 0 rgba(148, 163, 184, .08),
    0 10px 22px rgba(79, 70, 229, .18);
}
html[data-theme="dark"] .admin-modal__sheet {
  background:
    radial-gradient(circle at top left, rgba(49, 46, 129, .35), rgba(15, 23, 42, .97) 46%),
    linear-gradient(145deg, #0f172a 0%, #020617 100%);
  border-color: rgba(148, 163, 184, .14);
}
html[data-theme="dark"] .admin-modal__header {
  border-color: rgba(148, 163, 184, .1);
  background: linear-gradient(135deg, rgba(30, 41, 59, .7), rgba(49, 46, 129, .18));
}
html[data-theme="dark"] .admin-modal__eyebrow { background: rgba(129, 140, 248, .12); color: #a5b4fc; }
html[data-theme="dark"] .admin-modal__title { color: #f1f5f9; }
html[data-theme="dark"] .admin-modal__intro { color: #94a3b8; }
html[data-theme="dark"] .admin-modal__footer {
  border-color: rgba(148, 163, 184, .1);
  background: linear-gradient(180deg, rgba(2, 6, 23, .05), rgba(2, 6, 23, .88) 22%);
}
html[data-theme="dark"] .admin-modal__status { color: #cbd5e1; }
html[data-theme="dark"] .admin-modal__hint { color: #64748b; }
html[data-theme="dark"] .admin-btn--ghost {
  background: transparent;
  border-color: rgba(148, 163, 184, .12);
  color: #94a3b8;
}
html[data-theme="dark"] .admin-btn--ghost:hover {
  background: rgba(148, 163, 184, .08);
  border-color: rgba(148, 163, 184, .2);
  color: #cbd5e1;
}
html[data-theme="dark"] .admin-btn--primary {
  background: #6366f1;
  border-color: #6366f1;
}
html[data-theme="dark"] .admin-btn--primary:hover {
  background: #818cf8;
  border-color: #818cf8;
}
html[data-theme="dark"] .admin-btn--danger {
  background: rgba(244, 63, 94, .06);
  border-color: rgba(244, 63, 94, .12);
  color: #fb7185;
}
html[data-theme="dark"] .admin-btn--danger:hover {
  color: #fca5a5;
  background: rgba(244, 63, 94, .12);
  border-color: rgba(244, 63, 94, .22);
}
html[data-theme="dark"] .admin-label { color: #64748b; }
html[data-theme="dark"] .admin-field {
  background: rgba(17, 32, 46, .42);
  border-color: rgba(140, 176, 200, .22);
  color: #e2e8f0;
}
html[data-theme="dark"] .admin-list-row {
  background: rgba(15, 23, 42, .5);
  border-color: rgba(71, 85, 105, .4);
  box-shadow: none;
}
html[data-theme="dark"] .admin-field:focus {
  border-color: rgba(129, 140, 248, .45);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
  background: rgba(17, 32, 46, .6);
}

html[data-theme="dark"] .pub-card-compact {
  background: #0f172a !important;
  border-color: #1e293b !important;
}
html[data-theme="dark"] .conf-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
}
html[data-theme="dark"] .conf-empty-state {
  border-color: #334155;
  color: #475569;
}

/* — responsive — */

@media (max-width: 900px) {
  .admin-modal__sheet { width: min(96vw, 760px); }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-grid .admin-field,
  .admin-grid textarea { grid-column: auto; }
}
@media (max-width: 640px) {
  body { padding-bottom: 140px; }
  .tabbar-shell {
    width: auto;
    bottom: max(72px, calc(env(safe-area-inset-bottom) + 56px));
  }
  .tabbar__dock {
    gap: 1px;
    padding: 6px;
    border-radius: 999px;
  }
  .tabbar__item {
    min-width: auto;
    min-height: 34px;
    padding: 0 10px;
    gap: 6px;
    font-size: 12px;
  }
  .tabbar__icon {
    width: 15px;
    height: 15px;
  }
  .tabbar__label { transform: translateY(0); }
  .admin-modal__sheet {
    margin: 14px auto;
    width: calc(100vw - 16px);
    max-height: calc(100vh - 28px);
    border-radius: 24px;
  }
  .admin-modal__header,
  .admin-modal__content,
  .admin-modal__footer { padding-left: 18px; padding-right: 18px; }
  .admin-modal__footer {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-modal__footer > div {
    width: 100%;
    justify-content: stretch;
  }
  .admin-modal__footer .admin-btn { flex: 1 1 auto; }
  .admin-modal__title { font-size: 1.8rem; }
  .admin-list-row { padding: 16px; border-radius: 16px; }
}
@media (min-width: 641px) {
  .tabbar-shell {
    bottom: 72px;
  }
}
