html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f5ef;
  --bg2: #edf1f2;
  --panel: rgba(255, 255, 255, 0.82);
  --line: rgba(20, 50, 66, 0.14);
  --text: #071f2d;
  --muted: #405966;
  --cyan: #0e607c;
  --sand: #a96527;
  --copper: #b7653f;
}

html[data-theme="light"] body {
  background: radial-gradient(circle at 85% 5%, rgba(82, 160, 184, 0.14), transparent 32%), radial-gradient(circle at 5% 45%, rgba(215, 154, 85, 0.09), transparent 28%), var(--bg);
  font-weight: 500;
}

html[data-theme="light"] .nav,
html[data-theme="light"] .mail-icon,
html[data-theme="light"] .menu-toggle {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 35px rgba(25, 49, 62, 0.08);
}

html[data-theme="light"] .monogram { background: #fff; box-shadow: 0 8px 28px rgba(25, 49, 62, 0.12); }
html[data-theme="light"] .intro,
html[data-theme="light"] .expanded .role-detail > p { color: #354f5d; font-weight: 500; }

html[data-theme="light"] .panel {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(242, 246, 246, 0.84));
  box-shadow: none;
}

html[data-theme="light"] .panel:hover { border-color: rgba(24, 115, 145, 0.28); box-shadow: none; }
html[data-theme="light"] .button.primary,
html[data-theme="light"] .quick-contact > *:first-child,
html[data-theme="light"] .hero-contact > div a:first-child { color: #fff; }
html[data-theme="light"] .quick-contact > *:first-child svg { color: #fff; }
html[data-theme="light"] .quick-contact > a,
html[data-theme="light"] .quick-contact > button { background: rgba(255, 255, 255, 0.8); }
html[data-theme="light"] .hero-contact { background: rgba(255, 255, 255, 0.9); box-shadow: none; }
html[data-theme="light"] .hero-contact:hover { box-shadow: none; }
html[data-theme="light"] .role-row { background: rgba(221, 231, 234, 0.58); }
html[data-theme="light"] .role-row.expanded { background: rgba(207, 224, 230, 0.72); }
html[data-theme="light"] .role-row:before { background: #82949c; }
html[data-theme="light"] .role-row:hover { border-color: rgba(24, 115, 145, 0.25); box-shadow: 0 12px 34px rgba(31, 57, 70, 0.1); }
html[data-theme="light"] .expertise-item:hover,
html[data-theme="light"] .credential:hover,
html[data-theme="light"] .education > div:not(.section-heading):hover { background: rgba(215, 229, 233, 0.34); }
html[data-theme="light"] blockquote { background: radial-gradient(circle at 80% 50%, rgba(82, 160, 184, 0.15), transparent 44%); }
html[data-theme="light"] .publication:hover { background: rgba(219, 232, 235, 0.52); border-color: rgba(24, 115, 145, 0.32); }
html[data-theme="light"] .publication:after { background: linear-gradient(115deg, transparent 35%, rgba(24, 115, 145, 0.07), transparent 65%); }
html[data-theme="light"] .credential-badge { box-shadow: 0 0 0 1px rgba(16, 43, 59, 0.08), 0 8px 22px rgba(31, 57, 70, 0.12); }
html[data-theme="light"] .hero-visual { opacity: 0.9; mix-blend-mode: multiply; }
#hero-particles { opacity: 0; }
.theme-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
html[data-theme="light"] .particle-focus { box-shadow: 0 0 10px 2px rgba(183, 101, 63, 0.5), 0 0 52px 16px rgba(24, 115, 145, 0.16); }
html[data-theme="light"] footer { color: #71848d; }
html[data-theme="light"] p,
html[data-theme="light"] .nav button,
html[data-theme="light"] .role-row button span,
html[data-theme="light"] .role-row button small,
html[data-theme="light"] .publication > span,
html[data-theme="light"] .contact-actions > a:not(.button) { font-weight: 500; }
html[data-theme="light"] .eyebrow,
html[data-theme="light"] .section-heading p,
html[data-theme="light"] .nav button { font-weight: 700; }

.theme-toggle {
  position: fixed;
  left: 22px;
  top: 32px;
  z-index: 80;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--sand);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover { transform: translateY(-3px) rotate(8deg); }
.theme-toggle svg { width: 21px; height: 21px; }
html[data-theme="light"] .theme-toggle { background: rgba(255, 255, 255, 0.9); box-shadow: 0 12px 32px rgba(31, 57, 70, 0.15); }

.topbar { padding-left: 70px; }

@media (max-width: 1000px) {
  html[data-theme="light"] .nav { background: rgba(255, 255, 255, 0.96); }
}

@media (max-width: 680px) {
  .theme-toggle { left: 14px; top: 22px; width: 44px; height: 44px; }
  .topbar { padding-left: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}

.hero-contact footer .resume-link { color: var(--sand); }
.hero-contact footer .resume-link svg { width: 16px; height: 16px; color: var(--cyan); }
html[data-theme="light"] .hero-contact footer .resume-link { color: var(--text); }

.ask-me {
  position: absolute;
  top: 2px;
  left: 0;
  right: 0;
  margin-inline: auto;
  z-index: 12;
  width: min(620px, calc(100% - 220px));
}

.ask-me-form label {
  display: block;
  margin: 0 0 8px 3px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ask-me-field {
  height: 52px;
  display: flex;
  align-items: center;
  padding: 5px 6px 5px 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(8, 26, 43, 0.82);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.17);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.ask-me-field:focus-within { border-color: rgba(143, 207, 229, 0.55); }
.ask-me-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.ask-me-field input::placeholder { color: var(--muted); opacity: 0.9; }
.ask-me-field button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  background: var(--sand);
  color: #092033;
  cursor: pointer;
}
.ask-me-field button:disabled { cursor: wait; opacity: 0.65; }
.ask-me-field button svg { width: 19px; height: 19px; }
.ask-me.loading .ask-me-field button svg { animation: ask-pulse 0.8s ease-in-out infinite alternate; }

.ask-me-answer {
  position: absolute;
  top: calc(100% + 28px);
  left: 0;
  z-index: 13;
  width: 100%;
  max-height: min(48vh, 440px);
  overflow: auto;
  margin: 0;
  padding: 28px 28px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #081a2b;
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.7;
  white-space: pre-wrap;
}
.ask-me-close {
  position: sticky;
  top: 0;
  float: right;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin: -14px -14px 8px 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg2);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.ask-me-answer.error { color: #e6a68c; }
.ask-me-sources {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.ask-me-sources a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }

html[data-theme="light"] .ask-me-field,
html[data-theme="light"] .ask-me-answer {
  background: #fff;
  box-shadow: 0 14px 40px rgba(31, 57, 70, 0.12);
}
html[data-theme="light"] .ask-me-field:focus-within { border-color: rgba(14, 96, 124, 0.5); }
html[data-theme="light"] .ask-me-field button { color: #fff; }
html[data-theme="light"] .ask-me-answer.error { color: #8f382f; }

@keyframes ask-pulse { to { transform: scale(0.82); opacity: 0.6; } }

@media (max-width: 1000px) {
  .ask-me { top: 2px; width: min(620px, calc(100% - 120px)); }
}

@media (max-width: 680px) {
  .ask-me { top: 76px; width: calc(100% - 20px); }
  .ask-me-form label { font-size: 10px; }
  .ask-me-field { height: 48px; padding-left: 14px; }
  .ask-me-answer { top: calc(100% + 22px); width: 100%; max-height: 54vh; padding: 24px 20px 20px; font-size: 14px; }
}
