:root {
  --bg: #f7f4ef;
  --bg-2: #ece7df;
  --ink: #1f2b2f;
  --muted: #5d6a6d;
  --panel: rgba(255, 255, 255, 0.72);
  --line: rgba(62, 82, 86, 0.2);
  --accent: #24535f;
  --accent-2: #f0d090;
  --accent-3: #4f8f84;
  --shadow: 0 14px 28px rgba(43, 54, 56, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}

body {
  font-family: "Source Sans 3", "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 17px;
  color: var(--ink);
  line-height: 1.64;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 14%, rgba(93, 140, 147, 0.12), transparent 38%),
    radial-gradient(circle at 86% 78%, rgba(133, 98, 52, 0.08), transparent 36%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

body.is-lightbox-open {
  overflow: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(61, 83, 87, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(61, 83, 87, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

.bg-flow {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    repeating-radial-gradient(circle at 24% 18%, rgba(46, 89, 99, 0.05) 0 1px, transparent 1px 20px),
    repeating-radial-gradient(circle at 82% 74%, rgba(133, 98, 52, 0.04) 0 1px, transparent 1px 22px);
  opacity: 0.22;
}

.bg-planet {
  position: fixed;
  width: min(42vw, 560px);
  aspect-ratio: 1 / 1;
  right: -150px;
  bottom: -230px;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.55), transparent 22%),
    radial-gradient(circle at 60% 42%, rgba(153, 191, 199, 0.42), transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(97, 146, 158, 0.28), rgba(52, 88, 98, 0.26) 64%, rgba(42, 70, 77, 0.22) 100%);
  box-shadow:
    0 0 0 1px rgba(62, 82, 86, 0.2),
    0 0 36px rgba(62, 82, 86, 0.17),
    0 0 120px rgba(95, 130, 139, 0.14);
  filter: saturate(0.96) contrast(1.02);
}

.bg-planet::before {
  content: "";
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 54% 52%, transparent 56%, rgba(140, 200, 210, 0.24) 57%, transparent 60%),
    radial-gradient(circle at 58% 52%, transparent 66%, rgba(140, 200, 210, 0.2) 67%, transparent 71%),
    radial-gradient(circle at 62% 50%, transparent 74%, rgba(240, 208, 144, 0.16) 75%, transparent 80%);
}

.bg-planet::after {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 48% 52%, rgba(144, 192, 192, 0.14) 0 1px, transparent 1px 14px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.25));
  mix-blend-mode: screen;
  opacity: 0.42;
}

.space-earth-canvas {
  position: fixed;
  inset: 0;
  z-index: -5;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 600ms ease, filter 600ms ease;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.14;
  z-index: -1;
  pointer-events: none;
}

.orb-a {
  width: 390px;
  height: 390px;
  left: -120px;
  top: -120px;
  background: #5d8c93;
}

.orb-b {
  width: 420px;
  height: 420px;
  right: -140px;
  bottom: -120px;
  background: #b89a6b;
}

.site-header {
  position: static;
  top: auto;
  z-index: 1;
  width: min(1080px, 92vw);
  margin: 8px auto 6px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.header-top {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.log-title {
  text-decoration: none;
  color: #1f2b2f;
  font-family: "Source Sans 3", "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}

.site-nav {
  margin-top: 6px;
  padding-top: 0;
  border-top: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(62, 82, 86, 0.26);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.site-nav a:hover {
  color: #22393e;
}

.site-nav a.is-active {
  color: var(--accent);
}

.theme-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: #294c53;
  border-radius: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle:hover {
  background: transparent;
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid rgba(46, 89, 99, 0.35);
  outline-offset: 2px;
}

main {
  width: min(1080px, 92vw);
  margin: 16px auto 56px;
}

section[id],
.gallery-year {
  scroll-margin-top: 16px;
}

.hero {
  padding: 34px 0 22px;
}

.hero-wrap {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  align-items: stretch;
}

.hero-main {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(133, 98, 52, 0.35);
  background: rgba(133, 98, 52, 0.12);
  color: #6d5028;
  font-size: 0.84rem;
  font-weight: 600;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: 0.015em;
}

h1 {
  font-size: clamp(2rem, 4.2vw, 3.75rem);
  line-height: 1.04;
}

.subtitle {
  margin: 14px 0 0;
  max-width: 670px;
  font-size: clamp(1.02rem, 2vw, 1.22rem);
  color: var(--muted);
}

.field-tags {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.field-tags span {
  border: 1px solid rgba(62, 82, 86, 0.28);
  background: rgba(88, 130, 140, 0.12);
  color: #35545b;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
}

.cta-row {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  text-decoration: none;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-icon-only {
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
  line-height: 0;
}

.social-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background-color: currentColor;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.social-icon--scholar {
  -webkit-mask-image: url("./assets/icons/google-scholar.svg?v=20260222-brand2");
  mask-image: url("./assets/icons/google-scholar.svg?v=20260222-brand2");
}

.social-icon--orcid {
  -webkit-mask-image: url("./assets/icons/orcid.svg?v=20260222-brand2");
  mask-image: url("./assets/icons/orcid.svg?v=20260222-brand2");
}

.social-icon--researchgate {
  -webkit-mask-image: url("./assets/icons/researchgate.svg?v=20260222-brand2");
  mask-image: url("./assets/icons/researchgate.svg?v=20260222-brand2");
}

.social-icon--mail {
  -webkit-mask-image: url("./assets/icons/mail.svg?v=20260222-brand2");
  mask-image: url("./assets/icons/mail.svg?v=20260222-brand2");
}

.btn-primary {
  color: #0a131a;
  background: linear-gradient(120deg, #f0d090, #dfb76f);
  box-shadow: 0 10px 24px rgba(240, 208, 144, 0.26);
}

.btn-ghost {
  color: #27474f;
  border: 1px solid rgba(62, 82, 86, 0.28);
  background: rgba(203, 222, 230, 0.5);
}

.btn-ghost:hover {
  border-color: rgba(133, 98, 52, 0.52);
  background: rgba(133, 98, 52, 0.12);
}

.portrait-card {
  margin: 0;
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(215, 228, 232, 0.72), rgba(237, 231, 219, 0.9));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 100%;
}

.portrait-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
  margin-top: 16px;
}

h2 {
  font-size: clamp(1.42rem, 2.7vw, 1.9rem);
  margin-bottom: 10px;
  color: #24383c;
}

h3 {
  font-size: 1.14rem;
  margin-bottom: 6px;
  color: #2a4247;
}

.card h3 {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.card-title-icon {
  display: inline-flex;
  width: 1.8em;
  height: 1.8em;
  color: #5f95a4;
  flex: 0 0 auto;
}

.card-title-icon svg,
.card-title-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.inline-icon-img {
  display: inline-block;
  margin-left: 0.2em;
  object-fit: contain;
}

.inline-icon-img--tag {
  width: 0.92em;
  height: 0.92em;
  vertical-align: -0.12em;
}

.inline-icon-img--text {
  width: 0.68em;
  height: 0.68em;
  margin-left: 0.12em;
  vertical-align: -0.03em;
}

.panel p,
.card p {
  margin: 0 0 10px;
  font-size: 1.02rem;
  color: var(--muted);
}

.about-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 14px;
}

.about-badges span {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(62, 82, 86, 0.28);
  background: rgba(88, 130, 140, 0.12);
  color: #35545b;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.about-badges strong {
  color: #24373b;
  margin-right: 4px;
}

.grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 15px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

ol {
  margin: 8px 0 0;
  padding-left: 22px;
}

ol li {
  margin-bottom: 10px;
}

em {
  font-style: italic;
}

#publications em,
#service em {
  color: #2f5c66;
  font-family: "Source Sans 3", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
  letter-spacing: 0.005em;
  font-size: 1.01em;
}

.contact-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.contact-list a {
  color: #2f5c66;
}

.contact-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.contact-label .social-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

footer {
  width: min(1080px, 92vw);
  margin: 0 auto 32px;
  color: #6d7f83;
  font-size: 0.9rem;
}

.reveal {
  opacity: 1;
  transform: translateY(0);
  animation: reveal-up 620ms ease forwards;
}

.reveal:nth-child(2) {
  animation-delay: 80ms;
}

.reveal:nth-child(3) {
  animation-delay: 120ms;
}

.reveal:nth-child(4) {
  animation-delay: 160ms;
}

.reveal:nth-child(5) {
  animation-delay: 200ms;
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    animation: none;
  }

  .btn,
  .theme-toggle,
  .gallery-index-chip {
    transition: none;
  }
}

@media (max-width: 900px) {
  .hero-wrap {
    grid-template-columns: 1fr;
  }

  .portrait-card {
    max-height: 430px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    gap: 14px;
  }

  .theme-toggle {
    width: 21px;
    height: 21px;
  }

  .bg-planet {
    width: min(58vw, 420px);
    right: -120px;
    bottom: -150px;
    opacity: 0.75;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .site-header {
    margin-top: 8px;
    padding: 0;
  }

  .site-nav {
    gap: 10px;
  }

  .site-nav a {
    font-size: 0.9rem;
  }

  .log-title {
    font-size: 20px;
  }

  .theme-toggle {
    width: 20px;
    height: 20px;
  }

  .header-brand {
    gap: 3px;
  }

  .hero-main,
  .panel {
    padding: 18px;
  }

  .hero {
    padding-top: 24px;
  }

  .bg-planet {
    width: 320px;
    right: -160px;
    bottom: -190px;
    opacity: 0.58;
  }
}

.gallery-main {
  width: min(1080px, 92vw);
  margin: 16px auto 56px;
}

.gallery-hero {
  margin-top: 0;
}

.gallery-index {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 16px;
}

.gallery-index-chip {
  text-decoration: none;
  color: #35545b;
  border: 1px solid rgba(62, 82, 86, 0.28);
  background: rgba(203, 222, 230, 0.54);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.84rem;
  font-weight: 600;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.gallery-index-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(240, 208, 144, 0.52);
  background: rgba(133, 98, 52, 0.12);
}

.gallery-groups {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.gallery-year {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  content-visibility: auto;
  contain-intrinsic-size: 1px 760px;
}

.gallery-year-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.gallery-year-title {
  margin: 0;
  font-size: 1.46rem;
  color: #2a4247;
}

.gallery-year-count {
  font-size: 0.84rem;
  color: #4e666a;
  border: 1px solid rgba(62, 82, 86, 0.28);
  background: rgba(88, 130, 140, 0.12);
  border-radius: 999px;
  padding: 4px 9px;
}

.gallery-year-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gallery-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  content-visibility: auto;
  contain-intrinsic-size: 1px 520px;
}

.gallery-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.gallery-group-title {
  margin: 0;
  font-size: 1.08rem;
  color: #2a4247;
}

.gallery-group-count {
  font-size: 0.82rem;
  color: #4e666a;
  border: 1px solid rgba(62, 82, 86, 0.28);
  background: rgba(88, 130, 140, 0.12);
  border-radius: 999px;
  padding: 4px 8px;
}

.gallery-group-shared {
  margin: -2px 0 10px;
}

.gallery-group-note {
  margin: -4px 0 8px;
  color: #6d7f83;
  font-size: 0.84rem;
}

.gallery-group-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.gallery-group-date {
  display: inline-block;
  margin-top: 3px;
  color: #6d7f83;
  font-size: 0.82rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: 14px;
}

.gallery-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
  contain: layout paint;
  content-visibility: auto;
  contain-intrinsic-size: 300px 260px;
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.gallery-card-link {
  display: block;
  color: inherit;
}

.gallery-card.is-panorama {
  grid-column: span 2;
  contain-intrinsic-size: 620px 250px;
}

.gallery-card.is-panorama img {
  aspect-ratio: 12 / 5;
}

.gallery-meta {
  padding: 12px;
}

.gallery-meta h3 {
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.gallery-meta p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.gallery-meta time {
  color: #6d7f83;
  font-size: 0.82rem;
}

.gallery-empty {
  margin: 6px 0 0;
  color: var(--muted);
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  background: rgba(11, 20, 24, 0.74);
  backdrop-filter: blur(4px);
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gallery-lightbox-figure img {
  width: auto;
  height: auto;
  max-width: min(90vw, 1240px);
  max-height: min(78vh, 920px);
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(202, 223, 229, 0.4);
  background: rgba(12, 20, 24, 0.74);
  box-shadow: 0 18px 44px rgba(5, 9, 13, 0.45);
}

.gallery-lightbox-figure figcaption {
  max-width: min(90vw, 1240px);
  text-align: center;
  color: #eef5f7;
  font-size: 0.95rem;
  line-height: 1.45;
}

.gallery-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(195, 216, 224, 0.55);
  border-radius: 10px;
  background: rgba(12, 20, 24, 0.7);
  color: #ecf4f7;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-lightbox-close:hover {
  background: rgba(20, 35, 42, 0.9);
}

.gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 1px solid rgba(195, 216, 224, 0.55);
  border-radius: 999px;
  background: rgba(12, 20, 24, 0.7);
  color: #ecf4f7;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0;
  line-height: 0;
  padding: 0;
}

.gallery-lightbox-nav > span {
  display: block;
  font-size: 2rem;
  line-height: 1;
  transform: translateY(-0.04em);
}

.gallery-lightbox-nav.is-prev {
  left: 16px;
}

.gallery-lightbox-nav.is-next {
  right: 16px;
}

.gallery-lightbox-nav:hover {
  background: rgba(20, 35, 42, 0.9);
}

.gallery-lightbox-nav:disabled {
  opacity: 0.38;
  cursor: default;
}

.gallery-lightbox-open {
  text-decoration: none;
  color: #ecf4f7;
  border: 1px solid rgba(195, 216, 224, 0.55);
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(12, 20, 24, 0.7);
  font-size: 0.84rem;
  font-weight: 600;
}

.gallery-lightbox-open:hover {
  background: rgba(20, 35, 42, 0.9);
}

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

@media (max-width: 560px) {
  .gallery-year {
    padding: 10px;
  }

  .gallery-year-head {
    align-items: flex-start;
  }

  .gallery-group {
    padding: 10px;
  }

  .gallery-group-head {
    align-items: flex-start;
    gap: 8px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-card.is-panorama {
    grid-column: span 1;
  }

  .gallery-card.is-panorama img {
    aspect-ratio: 16 / 9;
  }

  .gallery-lightbox {
    padding: 12px;
  }

  .gallery-lightbox-nav {
    width: 38px;
    height: 38px;
  }

  .gallery-lightbox-nav > span {
    font-size: 1.7rem;
  }

  .gallery-lightbox-nav.is-prev {
    left: 10px;
  }

  .gallery-lightbox-nav.is-next {
    right: 10px;
  }

  .gallery-lightbox-figure img {
    max-width: 96vw;
    max-height: 72vh;
  }

  .gallery-lightbox-figure figcaption {
    max-width: 96vw;
    font-size: 0.9rem;
  }
}

html[data-theme="dark"] {
  --bg: #0f1820;
  --bg-2: #12202a;
  --ink: #e4eef1;
  --muted: #aabdc3;
  --panel: rgba(16, 30, 39, 0.82);
  --line: rgba(129, 171, 180, 0.26);
  --accent: #91bcc6;
  --accent-2: #d4bc8c;
  --accent-3: #3b7281;
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 18% 12%, rgba(58, 112, 124, 0.2), transparent 34%),
    radial-gradient(circle at 84% 78%, rgba(133, 98, 52, 0.15), transparent 34%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

html[data-theme="dark"] .bg-grid {
  background-image:
    linear-gradient(to right, rgba(144, 192, 192, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(144, 192, 192, 0.05) 1px, transparent 1px);
}

html[data-theme="dark"] .bg-flow {
  background:
    radial-gradient(140% 90% at 20% 10%, transparent 58%, rgba(32, 96, 128, 0.22) 59%, transparent 62%),
    radial-gradient(170% 95% at 80% 70%, transparent 60%, rgba(144, 192, 192, 0.15) 61%, transparent 64%);
  opacity: 0.5;
}

html[data-theme="dark"] .bg-planet {
  background:
    radial-gradient(circle at 24% 22%, rgba(196, 232, 234, 0.64), transparent 20%),
    radial-gradient(circle at 60% 40%, rgba(108, 172, 179, 0.54), transparent 36%),
    radial-gradient(circle at 50% 50%, rgba(56, 115, 144, 0.64), rgba(20, 44, 61, 0.9) 62%, rgba(9, 20, 29, 0.95) 100%);
}

html[data-theme="dark"] .site-header {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

html[data-theme="dark"] .log-title {
  color: #dcecef;
}

html[data-theme="dark"] .site-nav a {
  color: #a9bfc6;
}

html[data-theme="dark"] .site-nav a:hover {
  color: #d2e3e8;
}

html[data-theme="dark"] .site-nav {
  border-top: 0;
  border-bottom: 1px solid rgba(129, 171, 180, 0.24);
}

html[data-theme="dark"] .hero-main,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .card,
html[data-theme="dark"] .gallery-year,
html[data-theme="dark"] .gallery-group,
html[data-theme="dark"] .gallery-card {
  background: var(--panel);
}

html[data-theme="dark"] .portrait-card {
  background: linear-gradient(170deg, rgba(40, 81, 94, 0.55), rgba(12, 27, 37, 0.86));
}

html[data-theme="dark"] .eyebrow {
  border-color: rgba(224, 196, 144, 0.4);
  background: rgba(224, 196, 144, 0.12);
  color: #e2c387;
}

html[data-theme="dark"] h2 {
  color: #dcecef;
}

html[data-theme="dark"] h3,
html[data-theme="dark"] .gallery-group-title,
html[data-theme="dark"] .gallery-year-title {
  color: #d6e8ed;
}

html[data-theme="dark"] .field-tags span,
html[data-theme="dark"] .about-badges span {
  border-color: rgba(146, 188, 197, 0.3);
  background: rgba(42, 90, 102, 0.2);
  color: #cbe2e8;
}

html[data-theme="dark"] .about-badges strong {
  color: #edf6f8;
}

html[data-theme="dark"] .btn-ghost {
  color: #a8ced8;
  border-color: rgba(146, 188, 197, 0.32);
  background: rgba(10, 25, 35, 0.62);
}

html[data-theme="dark"] #publications em,
html[data-theme="dark"] #service em {
  color: #d8e8ec;
  font-weight: 600;
}

html[data-theme="dark"] .theme-toggle {
  color: #c9e0e6;
  border: 0;
  background: transparent;
}

html[data-theme="dark"] .theme-toggle:hover {
  background: transparent;
}

html[data-theme="dark"] .gallery-index-chip {
  color: #cae0e6;
  border-color: rgba(146, 188, 197, 0.32);
  background: rgba(10, 25, 35, 0.62);
}

html[data-theme="dark"] .gallery-year-count,
html[data-theme="dark"] .gallery-group-count {
  color: #bdd5dc;
  border-color: rgba(146, 188, 197, 0.3);
  background: rgba(42, 90, 102, 0.2);
}

html[data-theme="dark"] .gallery-group-note,
html[data-theme="dark"] .gallery-meta time,
html[data-theme="dark"] .gallery-group-date,
html[data-theme="dark"] footer {
  color: #95afb7;
}

html[data-theme="dark"] .gallery-lightbox {
  background: rgba(4, 10, 14, 0.78);
}

html[data-theme="dark"] .gallery-lightbox-open,
html[data-theme="dark"] .gallery-lightbox-close,
html[data-theme="dark"] .gallery-lightbox-nav {
  border-color: rgba(150, 205, 221, 0.5);
  background: rgba(10, 25, 35, 0.72);
  color: #e8f3f8;
}

html[data-theme="dark"] .contact-list a {
  color: #a7d1dc;
}

html.has-cinematic-earth-bg .space-earth-canvas {
  opacity: 0.08;
  filter: saturate(0.28) brightness(1.55) contrast(0.66);
}

html[data-theme="light"].has-cinematic-earth-bg body {
  background: linear-gradient(180deg, #fbfbfa 0%, #f1f1ef 100%) !important;
}

html[data-theme="light"].has-cinematic-earth-bg .bg-planet {
  display: none !important;
}

html[data-theme="dark"].has-cinematic-earth-bg .space-earth-canvas {
  opacity: 1;
  filter: none;
}

html[data-theme="dark"].has-cinematic-earth-bg body {
  background:
    radial-gradient(circle at 18% 12%, rgba(5, 18, 38, 0.38), transparent 44%),
    radial-gradient(circle at 82% 84%, rgba(3, 12, 28, 0.34), transparent 46%),
    linear-gradient(180deg, #000000 0%, #01040a 56%, #000000 100%) !important;
}

html[data-theme="dark"].has-cinematic-earth-bg .bg-orb,
html[data-theme="dark"].has-cinematic-earth-bg .bg-grid,
html[data-theme="dark"].has-cinematic-earth-bg .bg-flow,
html[data-theme="dark"].has-cinematic-earth-bg .bg-planet {
  display: none !important;
}
