:root {
  --bg: #ffffff;
  --text: #222222;
  --muted: #5f6368;
  --border: #dddddd;
  --soft: #f5f5f5;
  --link: #1a73e8;
  --link-hover: #174ea6;
  --max-width: 980px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--link);
  text-decoration: none;
}

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

/* Header */

.site-header {
  border-bottom: 2px solid var(--border);
  background: #ffffff;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
}

.brand {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 500;
}

.brand:hover {
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 0.95rem;
}

.nav a,
.nav-trigger {
  color: var(--muted);
}

.nav a:hover,
.nav-trigger:hover {
  color: var(--text);
}

.nav-dropdown {
  position: relative;
}

.nav-trigger {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: default;
}

.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  min-width: 185px;
  display: none;
  padding: 8px 0;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.nav-menu a {
  display: block;
  padding: 6px 12px;
  white-space: nowrap;
}

.nav-dropdown:hover .nav-menu,
.nav-dropdown:focus-within .nav-menu {
  display: block;
}

/* Main layout */

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 22px 20px;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 34px;
  align-items: start;
  margin-bottom: 26px;
}

.profile-hero {
  grid-template-columns: minmax(0, 1fr) 192px;
  padding-right: 40px;
  margin-bottom: 26px;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(1.6rem, 3.6vw, 2.56rem);
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.h1-subline {
  font-size: 0.82em;
}

.intro {
  max-width: 720px;
  margin: 0 0 20px;
  font-size: 1.05rem;
  line-height: 1.5;
}

.profile-links {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  font-size: 0.98rem;
}

.profile-links span,
.links span {
  color: var(--muted);
}

.hero-image {
  width: 100%;
}

.profile-caption {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.image-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, #eeeeee, #fafafa);
}

.image-placeholder span {
  font-size: 3rem;
  font-weight: 700;
  color: #9aa0a6;
  letter-spacing: -0.08em;
}

/* Sections */

.section {
  border-top: 2px solid var(--border);
  padding-top: 17px;
  margin-top: 23px;
}

.section h2 {
  margin: 0 0 22px;
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 400;
}

/* Tutorials */

.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 280px));
  gap: 28px;
}

.tutorial-card {
  color: var(--text);
  display: block;
  text-align: center;
}

.tutorial-card:hover {
  text-decoration: none;
}

.tutorial-card:hover h3 {
  color: var(--link);
  text-decoration: underline;
}

.tutorial-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, #e8f0fe, #f8f9fa);
  margin-bottom: 7px;
}

.tutorial-card h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.tutorial-card p {
  margin: 2px 0 0;
  color: var(--muted);
}

/* Research list */

.research-list {
  display: grid;
  gap: 22px;
}

.research-row {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.research-thumb {
  width: 145px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, #f1f3f4, #e8f0fe);
}

.research-content h3 {
  margin: 0 0 4px;
  font-size: 1.08rem;
  font-weight: 500;
}

.research-content p {
  margin: 0 0 6px;
  color: var(--muted);
  line-height: 1.45;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  font-size: 0.98rem;
}

/* Experience carousel */

.experience-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 32%);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 10px;
}

.experience-carousel figure {
  margin: 0;
  scroll-snap-align: start;
}

.experience-carousel img {
  width: 100%;
  aspect-ratio: 8 / 5;
  display: block;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--soft);
}

.experience-carousel figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

.experience-summary {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
}

/* Tutorial steps */

.tutorial-step {
  margin-bottom: 30px;
}

.tutorial-step h3 {
  margin: 0 0 8px;
  font-size: 1.18rem;
  line-height: 1.25;
  font-weight: 700;
}

.tutorial-step p {
  margin: 0 0 12px;
  color: var(--muted);
}

.tutorial-step pre {
  margin: 0 0 14px;
  padding: 10px 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
  background: var(--soft);
  font-size: 0.92rem;
}

.step-images {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
}

.step-images figure {
  margin: 0;
  flex: 0 1 auto;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.step-images a {
  display: block;
  max-width: 100%;
}

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

.step-placeholder {
  width: 100%;
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, #eeeeee, #fafafa);
  color: #9aa0a6;
  font-size: 1rem;
  font-weight: 700;
}

.step-images figcaption {
  width: 100%;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: left;
}

/* Publications */

.publications-page h1 {
  margin-bottom: 14px;
}

.publication-group {
  border-top: 2px solid var(--border);
  margin-top: 34px;
  padding-top: 24px;
}

.publication-group h2 {
  margin: 0 0 18px;
  font-size: 1.35rem;
  line-height: 1.25;
  font-weight: 400;
}

.publication-list {
  margin: 0;
  padding-left: 24px;
}

.publication-item {
  margin-bottom: 13px;
  padding-left: 4px;
}

.publication-citation {
  color: var(--text);
}

.publication-award {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid #0000FF;
  color: #0000FF;
  background: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

/* Images */

.hero-image img,
.tutorial-thumb img,
.research-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-image img {
  height: auto;
}

.footer {
  max-width: var(--max-width);
  margin: 48px auto 0;
  padding: 24px 22px 34px;
  border-top: 2px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Mobile */

@media (max-width: 760px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .page {
    padding-top: 30px;
  }

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

  .profile-hero {
    padding-right: 0;
  }

  .hero-image {
    max-width: 280px;
  }

  .tutorial-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
  }

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

  .research-thumb {
    width: 100%;
    max-width: 420px;
  }

  .experience-carousel {
    grid-auto-columns: minmax(220px, 82%);
  }

}
