/* =============================================================================
   Liquid-glass / visionOS-inspired personal site
   Minimal white background, frosted glass cards, cross-browser friendly.
   Most people won't need to edit this file — change content in data.js.
   You can tweak the colours in the :root variables just below.
   ============================================================================ */

:root {
  --bg: #f8f9fb;               /* page background (near-white) */
  --text: #1c1d21;             /* main text */
  --text-soft: #555860;        /* secondary text */
  --text-faint: #858991;       /* dates, captions */

  /* Quiet Frutiger Aero motif: sky blue + grass green + warm orange */
  --accent: #2f8f64;           /* green — icons, links, institution */
  --accent-soft: rgba(47, 143, 100, 0.10);
  --accent-blue: #3d7fd4;      /* sky blue — role */
  --accent-blue-soft: rgba(61, 127, 212, 0.10);
  --accent-orange: #c4783a;    /* muted orange — years, dates */
  --accent-orange-soft: rgba(196, 120, 58, 0.10);

  /* Liquid glass — present but quieter (closer to academic + Apple) */
  --glass-fill: rgba(255, 255, 255, 0.48);
  --glass-fill-solid: rgba(255, 255, 255, 0.96);
  --glass-edge: rgba(255, 255, 255, 0.70);
  --glass-radius: 20px;
  --glass-blur: blur(28px) saturate(150%);

  --maxw: 1040px;
  --gap: 26px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------- Backdrop --------------------------------- */
/* Very quiet Frutiger Aero washes — readable like an academic site first. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(100% 70% at 5% 0%, rgba(155, 200, 255, 0.12), transparent 50%),
    radial-gradient(80% 60% at 100% 20%, rgba(150, 220, 175, 0.10), transparent 48%),
    radial-gradient(70% 55% at 55% 100%, rgba(255, 195, 150, 0.08), transparent 52%),
    var(--bg);
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.14;
  will-change: transform;
}
.blob--1 {
  width: 44vw; height: 44vw; top: -12vw; left: -8vw;
  background: #a8c8ff;
  animation: blob-drift 26s ease-in-out infinite;
}
.blob--2 {
  width: 40vw; height: 40vw; top: 30vh; right: -12vw;
  background: #aee0c0;
  animation: blob-drift 32s ease-in-out infinite reverse;
}
.blob--3 {
  width: 38vw; height: 38vw; bottom: -12vw; left: 28vw;
  background: #ffc89a;
  animation: blob-drift 28s ease-in-out infinite 4s;
}

/* Gentle drift so the glass feels “alive” without costing much. */
@keyframes blob-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(2%, 3%, 0) scale(1.04); }
}

/* -------------------------------- Layout ---------------------------------- */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 56px);
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--gap);
  align-items: start;
}

/* ------------------------------ Liquid glass ------------------------------ */
/* Apple liquid glass, dialed quieter so content reads like a research CV. */
.glass,
.section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--glass-fill-solid);
  background:
    radial-gradient(
      120% 80% at 16% 0%,
      rgba(255, 255, 255, 0.42) 0%,
      rgba(255, 255, 255, 0.06) 45%,
      transparent 70%
    ),
    linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.58) 0%,
      rgba(255, 255, 255, 0.28) 45%,
      rgba(255, 255, 255, 0.18) 100%
    ),
    var(--glass-fill);
  border: 1px solid var(--glass-edge);
  border-radius: var(--glass-radius);
  box-shadow:
    0 1px 2px rgba(30, 40, 60, 0.04),
    0 10px 28px rgba(30, 40, 60, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.70),
    inset 0 -1px 0 rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
@supports ((-webkit-backdrop-filter: brightness(1)) or (backdrop-filter: brightness(1))) {
  .glass,
  .section {
    -webkit-backdrop-filter: blur(28px) saturate(150%) brightness(1.03);
    backdrop-filter: blur(28px) saturate(150%) brightness(1.03);
  }
}

.glass::before,
.section::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.48) 0%,
      rgba(255, 255, 255, 0.14) 10%,
      transparent 32%
    ),
    linear-gradient(
      118deg,
      rgba(255, 255, 255, 0.28) 0%,
      rgba(255, 255, 255, 0.08) 12%,
      transparent 28%
    );
  opacity: 0.85;
}

.glass::after,
.section::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    inset 8px 10px 22px rgba(140, 185, 255, 0.06),
    inset -8px 6px 20px rgba(150, 220, 180, 0.05),
    inset 0 -12px 22px rgba(255, 195, 150, 0.05);
  background:
    radial-gradient(
      ellipse 80% 45% at 50% 110%,
      rgba(255, 255, 255, 0.22),
      transparent 70%
    );
  mix-blend-mode: soft-light;
  opacity: 0.75;
}

.glass > *,
.section > * {
  position: relative;
  z-index: 1;
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass,
  .section {
    background: var(--glass-fill-solid);
    box-shadow:
      0 1px 2px rgba(30, 40, 60, 0.04),
      0 10px 24px rgba(30, 40, 60, 0.06);
  }
  .glass::before,
  .section::before,
  .glass::after,
  .section::after {
    opacity: 0.25;
    mix-blend-mode: normal;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .glass,
  .section {
    background: var(--glass-fill-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ------------------------------- Sidebar ---------------------------------- */
.sidebar {
  position: sticky;
  top: clamp(20px, 4vw, 56px);
}
.profile-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.profile-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  background: #eef1f6;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 6px 18px rgba(30, 40, 60, 0.08);
  display: block;
}
.profile-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profile-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.93rem;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.22)),
    rgba(255, 255, 255, 0.30);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 3px 10px rgba(30, 40, 60, 0.05);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
@supports ((-webkit-backdrop-filter: brightness(1)) or (backdrop-filter: brightness(1))) {
  .profile-link {
    -webkit-backdrop-filter: blur(14px) saturate(150%) brightness(1.03);
    backdrop-filter: blur(14px) saturate(150%) brightness(1.03);
  }
}
.profile-link:hover,
.profile-link:focus-visible {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.35)),
    rgba(255, 255, 255, 0.42);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 6px 16px rgba(30, 40, 60, 0.08);
  outline: none;
}
.profile-link svg { width: 17px; height: 17px; flex: none; color: var(--accent); }

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .profile-link { background: rgba(255, 255, 255, 0.94); }
}

/* -------------------------------- Content --------------------------------- */
.content { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

.intro { padding: 2px 2px 0; }
.intro-name {
  margin: 0;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: clamp(1.85rem, 3.6vw, 2.55rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.intro-role {
  margin: 8px 0 0;
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 1rem;
}
.intro-bio { margin-top: 14px; }
.intro-bio p { margin: 0 0 12px; color: var(--text-soft); font-size: 1.01rem; }
.intro-bio p:last-child { margin-bottom: 0; }

.section {
  padding: clamp(18px, 2.6vw, 26px);
}
.section-title {
  margin: 0 0 14px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(30, 40, 60, 0.08);
}
.section-title svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--accent);
  opacity: 0.9;
}

/* --------------------------------- News ----------------------------------- */
.news-list { display: flex; flex-direction: column; }
.news-item {
  padding: 14px 0;
  border-top: 1px solid rgba(30, 40, 60, 0.07);
}
.news-item:first-child { padding-top: 2px; border-top: none; }
.news-date { color: var(--accent-orange); font-size: 0.82rem; font-weight: 500; margin: 3px 0 5px; }
.news-title { margin: 0; font-weight: 600; font-size: 1rem; line-height: 1.4; }
.news-desc { margin: 0; color: var(--text-soft); font-size: 0.95rem; }

/* ----------------------------- Publications ------------------------------- */
.pubs-list { display: flex; flex-direction: column; gap: 18px; }
.pub-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
}
.pub-year {
  font-weight: 600;
  color: var(--accent-orange);
  font-size: 0.9rem;
  padding-top: 2px;
}
.pub-title { margin: 0 0 3px; font-weight: 600; font-size: 1rem; line-height: 1.4; }
.pub-authors { margin: 0 0 2px; color: var(--text-soft); font-size: 0.93rem; }
.pub-authors .me { color: var(--text); font-weight: 700; }
.pub-venue { margin: 0 0 8px; color: var(--text-faint); font-style: italic; font-size: 0.9rem; }
.pub-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pub-link {
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(47, 143, 100, 0.18);
  padding: 3px 9px;
  border-radius: 6px;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pub-link:hover, .pub-link:focus-visible {
  background: rgba(47, 143, 100, 0.16);
  border-color: rgba(47, 143, 100, 0.28);
  box-shadow: none;
  outline: none;
}

/* ------------------------------ Education --------------------------------- */
.edu-list { display: flex; flex-direction: column; gap: 18px; }
.edu-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 16px;
  align-items: baseline;
}
.edu-degree { margin: 0; font-weight: 600; font-size: 1.02rem; }
.edu-period { color: var(--text-faint); font-size: 0.9rem; font-weight: 500; white-space: nowrap; }
.edu-inst { margin: 2px 0 0; color: var(--accent); font-weight: 500; font-size: 0.97rem; grid-column: 1 / -1; }
.edu-details { margin: 4px 0 0; color: var(--text-soft); font-size: 0.95rem; grid-column: 1 / -1; }

/* -------------------------------- Footer ---------------------------------- */
.footer {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
  padding: 8px 0 4px;
}

/* ------------------------------ Responsive -------------------------------- */
/* Tablet & mobile: single column, profile card on top.
   Photo ~50% width on the left; Email / LinkedIn / CV stay on the right.
   The glass panel wraps both so it fits the photo height. */
@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .sidebar { position: static; top: auto; }

  .profile-card {
    flex-direction: row;
    align-items: stretch;
    gap: 14px;
    padding: 14px;
  }
  .profile-photo {
    width: 50%;
    height: auto;
    aspect-ratio: 1 / 1;
    flex: 0 0 50%;
    /* Let aspect-ratio set the height; don't stretch down to the buttons. */
    align-self: auto;
  }
  .profile-links {
    flex: 1 1 0;
    min-width: 0;
    align-self: stretch;
    gap: 8px;
  }
  .profile-link {
    flex: 1 1 0;
    justify-content: flex-start;
    align-items: center;
    padding: 10px 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 420px) {
  .profile-card { padding: 12px; gap: 10px; }
  .profile-link { padding: 9px 10px; font-size: 0.85rem; gap: 8px; }
  .pub-item { grid-template-columns: 1fr; gap: 4px; }
  .pub-year { padding-top: 0; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .blob { animation: none !important; }
}
