:root {
  color-scheme: light dark;

  --font-sans: "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-2: #f1f3f4;
  --text: #202124;
  --muted: #5f6368;
  --border: #dadce0;
  --accent: #1a73e8;
  --accent-strong: #174ea6;
  --on-accent: #ffffff;

  --blue: #1a73e8;
  --red: #ea4335;
  --yellow: #fbbc04;
  --green: #34a853;

  --blob-1: rgba(66, 133, 244, 0.14);
  --blob-2: rgba(234, 67, 53, 0.1);
  --blob-3: rgba(251, 188, 5, 0.12);
  --blob-4: rgba(52, 168, 83, 0.12);

  --focus-ring: rgba(26, 115, 232, 0.3);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.12),
    0 1px 3px rgba(60, 64, 67, 0.1);
  --max-width: 1080px;
  --grid-gap: 32px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #202124;
    --surface: #292a2d;
    --surface-2: #303134;
    --text: #e8eaed;
    --muted: #9aa0a6;
    --border: #3c4043;
    --accent: #8ab4f8;
    --accent-strong: #aecbfa;
    --on-accent: #0f1113;

    --blue: #8ab4f8;
    --red: #f28b82;
    --yellow: #fdd663;
    --green: #81c995;

    --blob-1: rgba(138, 180, 248, 0.18);
    --blob-2: rgba(242, 139, 130, 0.16);
    --blob-3: rgba(253, 214, 99, 0.12);
    --blob-4: rgba(129, 201, 149, 0.14);

    --focus-ring: rgba(138, 180, 248, 0.4);
  }
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-2: #f1f3f4;
  --text: #202124;
  --muted: #5f6368;
  --border: #dadce0;
  --accent: #1a73e8;
  --accent-strong: #174ea6;
  --on-accent: #ffffff;

  --blue: #1a73e8;
  --red: #ea4335;
  --yellow: #fbbc04;
  --green: #34a853;

  --blob-1: rgba(66, 133, 244, 0.14);
  --blob-2: rgba(234, 67, 53, 0.1);
  --blob-3: rgba(251, 188, 5, 0.12);
  --blob-4: rgba(52, 168, 83, 0.12);

  --focus-ring: rgba(26, 115, 232, 0.3);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #202124;
  --surface: #292a2d;
  --surface-2: #303134;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --border: #3c4043;
  --accent: #8ab4f8;
  --accent-strong: #aecbfa;
  --on-accent: #0f1113;

  --blue: #8ab4f8;
  --red: #f28b82;
  --yellow: #fdd663;
  --green: #81c995;

  --blob-1: rgba(138, 180, 248, 0.18);
  --blob-2: rgba(242, 139, 130, 0.16);
  --blob-3: rgba(253, 214, 99, 0.12);
  --blob-4: rgba(129, 201, 149, 0.14);

  --focus-ring: rgba(138, 180, 248, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(620px 420px at 8% -10%, var(--blob-1), transparent 60%),
    radial-gradient(640px 440px at 92% -12%, var(--blob-2), transparent 60%),
    radial-gradient(520px 360px at 12% 115%, var(--blob-3), transparent 60%),
    radial-gradient(620px 420px at 90% 110%, var(--blob-4), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

section[id] {
  scroll-margin-top: 96px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transform: translateY(-160%);
  transition: transform 160ms ease;
  z-index: 100;
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  width: min(var(--max-width), calc(100% - 56px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

.site-nav a:hover {
  color: var(--text);
  border-color: var(--border);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.button-filled {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent);
}

.button-filled:hover {
  background: var(--accent-strong);
  color: var(--on-accent);
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--accent);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease,
    box-shadow 160ms ease;
}

.icon-button:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--accent-strong);
}

.theme-icon {
  width: 18px;
  height: 18px;
  position: relative;
  display: block;
}

.theme-icon .icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.theme-icon .icon-sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .theme-icon .icon-moon {
    display: none;
  }

  .theme-icon .icon-sun {
    display: block;
  }
}

:root[data-theme="light"] .theme-icon .icon-moon {
  display: block;
}

:root[data-theme="light"] .theme-icon .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-icon .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon .icon-sun {
  display: block;
}

.main {
  padding: 24px 0 80px;
}

.hero {
  padding: 56px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
  align-items: start;
}

.profile-photo-only {
  grid-column: 1 / span 4;
  display: grid;
  align-content: start;
}

.hero-photo {
  margin: 0;
  width: 280px;
  max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}


.about-compact {
  grid-column: 5 / -1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title {
  grid-column: 1 / span 2;
  margin: 4px 0 0;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin-top: 12px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--blue) 0 25%,
    var(--red) 25% 50%,
    var(--yellow) 50% 75%,
    var(--green) 75% 100%
  );
}

.section-title--compact {
  margin: 0;
  font-size: 0.9rem;
}

.section-title--compact::after {
  margin-top: 10px;
}

.icon-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.icon-link {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--accent);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease,
    box-shadow 160ms ease;
}

.icon-link:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--accent-strong);
  text-decoration: none;
}

.material-symbols-rounded {
  font-size: 20px;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
}

.icon-monogram {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.section {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
  align-items: start;
}

.section-body {
  grid-column: 3 / -1;
  display: grid;
  gap: 20px;
}

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 20px;
  box-shadow: var(--shadow);
}

.prose {
  max-width: none;
}

.prose p {
  margin: 0 0 18px;
}

.prose p:last-child {
  margin-bottom: 0;
}

.news-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.news-date {
  display: inline-flex;
  align-items: center;
  margin: 0 10px 0 0;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.news-digit {
  display: inline-block;
}

.g-blue {
  color: var(--blue);
}

.g-red {
  color: var(--red);
}

.g-yellow {
  color: var(--yellow);
}

.g-green {
  color: var(--green);
}

.news-item:last-child {
  border-bottom: 0;
}

.pub-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.pub-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.pub-item:last-child {
  border-bottom: 0;
}

.pub-authors {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.95rem;
}

.pub-title {
  margin-bottom: 4px;
  font-size: 1rem;
  font-weight: 500;
}

.pub-venue {
  font-size: 0.95rem;
  color: var(--text);
}

.note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.teaching-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
}

.teaching-card {
  padding: 0;
  border: 0;
  background: transparent;
}

.card-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
}

.teaching-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.teaching-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.teaching-item-main {
  min-width: 0;
}

.teaching-item-title {
  font-weight: 500;
}

.teaching-item-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.95rem;
}

.teaching-item-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.teaching-dl {
  margin: 0;
  display: grid;
  border-top: 1px solid var(--border);
}

.teaching-dl-row {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.teaching-dl dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.teaching-dl dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.footer {
  padding: 48px 0 12px;
  border-top: 1px solid var(--border);
}

.footer-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.main > section {
  opacity: 0;
  animation: rise 600ms ease forwards;
}

.main > section:nth-of-type(1) {
  animation-delay: 0.04s;
}

.main > section:nth-of-type(2) {
  animation-delay: 0.12s;
}

.main > section:nth-of-type(3) {
  animation-delay: 0.18s;
}

.main > section:nth-of-type(4) {
  animation-delay: 0.24s;
}

.main > section:nth-of-type(5) {
  animation-delay: 0.3s;
}

@media (max-width: 980px) {
  section[id] {
    scroll-margin-top: 120px;
  }

  .header-inner {
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
  }

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

  .profile-photo-only,
  .about-compact {
    grid-column: 1 / -1;
  }

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

  .section-title,
  .section-body {
    grid-column: 1 / -1;
  }

  .section-title {
    margin-bottom: 12px;
  }

  .teaching-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(var(--max-width), calc(100% - 32px));
  }

  .hero {
    padding-top: 36px;
  }

  .hero-photo {
    width: 200px;
  }

  .surface {
    padding: 8px 16px;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .site-header,
  .header-actions,
  .icon-button {
    display: none !important;
  }

  .surface,
  .news-item,
  .pub-item,
  .teaching-item,
  .teaching-dl-row {
    border-color: #bbb;
    box-shadow: none;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }

  .main > section {
    opacity: 1;
    animation: none;
  }
}
