/* Global styles */
:root {
  color-scheme: dark;
  color: #f5f6f7;
  background: #080d14;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: linear-gradient(180deg, #06111f 0%, #02060f 45%, #040813 100%);
}

.background {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.85;
  transform: translate(0, 0);
  transition: transform 0.35s ease;
}

.background canvas {
  width: 100%;
  height: 100%;
  display: block;
}

a {
  color: #86b9ff;
  text-decoration: none;
}

a:hover,
button:hover {
  color: #c8e1ff;
}

img {
  max-width: 100%;
}

.container {
  width: min(1140px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  background: rgba(8, 13, 20, 0.96);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, #8fb6ff, #d4e5ff, #9fd7ff);
  -webkit-background-clip: text;
  color: transparent;
}

nav a {
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

nav a.active,
nav a:hover {
  color: #f7fbff;
  text-shadow: 0 0 10px rgba(135, 195, 255, 0.45);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

main {
  padding: 2rem 0 3rem;
}

.hero {
  padding: 2.5rem 0;
  margin-bottom: 1rem;
  position: relative;
}

.page-cv .hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 2rem;
}

.page-cv .profile-photo {
  width: min(250px, 100%);
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
  display: block;
}

.page-cv .hero h1 {
  max-width: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 20% 10%, rgba(134, 185, 255, 0.12), transparent 18%),
              radial-gradient(circle at 80% 25%, rgba(174, 226, 255, 0.08), transparent 18%);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  color: #8fa6c1;
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 4vw, 4rem);
  margin: 0;
  max-width: 12ch;
}

.intro {
  max-width: 52rem;
  margin: 1.5rem 0 0;
  color: #c5d2e1;
}

.panel {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.panel + .panel {
  margin-top: 2rem;
}

.publication-section {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 22px;
  padding: 1.75rem 1.75rem 1.5rem;
}

.publication-section + .publication-section {
  margin-top: 1.5rem;
}

.publication-section h2 {
  margin-top: 0;
  font-size: 1.85rem;
}

.panel h2 {
  margin-top: 0;
  font-size: 1.85rem;
}

.topic-list,
.publication-list,
.cv-grid {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.topic-list,
.cv-grid {
  display: grid;
  gap: 0.85rem;
}

.publication-list {
  display: block;
}

.topic-list li,
.cv-card,
.personal-list li {
  padding: 1rem 1rem 0.95rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  background: rgba(9, 16, 27, 0.88);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* layout for topic items: left content + right photo */
.topic-list li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0;
  border: none;
  background: transparent;
}

.topic-list li a {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1rem 0.95rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  background: rgba(9, 16, 27, 0.88);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  color: inherit;
  text-decoration: none;
}

.topic-list li a:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 45px rgba(20, 85, 160, 0.18);
  border-color: rgba(122, 182, 255, 0.35);
}

.topic-content {
  flex: 1 1 auto;
}

.topic-photo {
  width: 360px;
  height: 240px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(134,185,255,0.06), rgba(169,209,255,0.02));
  border: 1px dashed rgba(255,255,255,0.06);
}

.publication-list li {
  padding: 0.75rem 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.publication-list li + li {
  border-top: 1px solid rgba(255,255,255,0.12);
}

.topic-list li:hover,
.cv-card:hover,
.personal-list li:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 45px rgba(20, 85, 160, 0.18);
  border-color: rgba(122, 182, 255, 0.35);
}

.publication-list li:hover {
  transform: none;
  box-shadow: none;
}

.topic-list li p,
.publication-list li p,
.cv-card p,
.personal-list li p {
  margin: 0.45rem 0 0;
  color: #b8c6d7;
}

footer.site-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 1.5rem 0;
  color: #7f8da5;
}

footer p {
  margin: 0;
}

.section-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

.cv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.cv-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 1.4rem;
}

.cv-card h3,
.publication-list h3,
.profile-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.profile-link {
  margin: 1rem 0 0;
}

.profile-link a {
  color: #a9d1ff;
  border-bottom: 1px solid rgba(169, 209, 255, 0.45);
}

.profile-link a:hover {
  color: #fff;
}

.cv-card p,
.profile-panel p,
.personal-list li p {
  margin: 0.5rem 0 0;
  color: #c5d2e1;
}

.profile-panel {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 1.6rem;
}

.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.82s ease, transform 0.82s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.personal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.2rem;
}

.personal-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 1.4rem;
}

.personal-item-photo {
  width: 210px;
  height: 210px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.1);
}

.personal-item-content {
  display: flex;
  flex-direction: column;
}

@media (max-width: 680px) {
  .header-inner,
  .section-split {
    flex-direction: column;
  }

  .topic-list li,
  .topic-list li a {
    flex-direction: column;
  }

  .topic-list li a {
    align-items: stretch;
  }

  .topic-photo {
    width: 100%;
    height: 240px;
    margin-top: 0.6rem;
  }

  .personal-list li {
    grid-template-columns: 1fr;
  }

  .personal-item-photo {
    width: 100%;
    height: 330px;
  }

  nav {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto;
    transition-duration: 0s !important;
    animation-duration: 0s !important;
  }
}
