:root {
  --ink: #1f2428;
  --muted: #606a70;
  --line: #d9dee2;
  --paper: #ffffff;
  --wash: #f6f7f8;
  --accent: #245b57;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

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

a:hover {
  text-decoration: underline;
}

.page {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 40px;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 560px);
  gap: 28px;
  align-items: start;
  padding-bottom: 34px;
  border-bottom: 2px solid var(--ink);
}

.kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(2.55rem, 6vw, 4.25rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h3 {
  margin-bottom: 4px;
  font-size: 1rem;
  line-height: 1.35;
}

p {
  margin-bottom: 6px;
  color: var(--muted);
}

.summary {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1.08rem;
}

.sidebar {
  display: grid;
  grid-template-columns: 175px max-content;
  gap: 18px;
  align-items: center;
  justify-content: end;
}

.profile-photo {
  width: 175px;
  aspect-ratio: 4 / 5;
  margin: 0;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo figcaption {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.contact-card {
  display: grid;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  justify-items: start;
  color: var(--muted);
  font-style: normal;
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.contact-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  justify-self: start;
  color: var(--muted);
  white-space: nowrap;
}

.contact-item:hover {
  color: var(--accent);
}

.contact-item svg {
  width: 16px;
  height: 16px;
  margin-top: 4px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 18px 0 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.tab {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: 0;
  font-weight: 600;
}

.tab:hover {
  text-decoration: none;
  color: var(--ink);
}

.tab.is-active {
  position: relative;
  top: 1px;
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
}

.tab-panel[hidden] {
  display: none;
}

.projects-section {
  min-height: 360px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.projects-intro {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 34px;
  margin-bottom: 24px;
}

.projects-intro p {
  max-width: 640px;
}

.project-grid {
  display: grid;
  gap: 16px;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(420px, 48%) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  min-height: 190px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.project-media {
  display: grid;
  height: 280px;
  place-items: center;
  background: var(--wash);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-media-single img {
  object-fit: contain;
}

.project-media-gallery {
  position: relative;
  display: block;
  height: 280px;
  place-items: initial;
}

.gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-track img {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  scroll-snap-align: start;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(31, 36, 40, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.42rem;
  line-height: 1;
  transform: translateY(-50%);
}

.gallery-arrow-prev {
  padding-right: 1px;
  padding-bottom: 2px;
}

.gallery-arrow-next {
  padding-left: 1px;
  padding-bottom: 2px;
}

.gallery-arrow:hover {
  background: rgba(255, 255, 255, 0.72);
}

.gallery-arrow-prev {
  left: 8px;
}

.gallery-arrow-next {
  right: 8px;
}

.gallery-dots {
  position: absolute;
  right: 0;
  bottom: 10px;
  left: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 7px;
  pointer-events: none;
}

.gallery-dot {
  width: 7px;
  height: 7px;
  border: 1px solid rgba(31, 36, 40, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
}

.gallery-dot.is-active {
  background: var(--accent);
  border-color: var(--accent);
}

.project-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 2px 4px 2px 0;
}

.project-card h3 {
  margin: 8px 0 7px;
  font-size: 1.12rem;
}

.project-card p {
  margin-bottom: 10px;
}

.project-result {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
}

.project-status {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.award-star {
  display: inline-block;
  margin-right: 5px;
  color: #d6a100;
  font-size: 1.28rem;
  line-height: 1;
  vertical-align: -3px;
}

.mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 12px;
  padding: 0;
  list-style: none;
}

.mini-tags li {
  padding: 3px 8px;
  background: var(--wash);
  color: var(--muted);
  font-size: 0.78rem;
}

.project-links {
  display: flex;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 700;
}

.cv-section {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 34px;
  min-height: 360px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

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

.cv-item {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 22px;
}

.date {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.plain-list {
  margin: 0;
  padding-left: 19px;
  color: var(--muted);
}

.plain-list li + li {
  margin-top: 8px;
}

.compact-list {
  margin-top: 10px;
  font-size: 0.94rem;
}

.publication-authors,
.publication-venue {
  margin-bottom: 2px;
}

.publication-authors {
  color: var(--ink);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 5px 10px;
  background: var(--wash);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.9rem;
}

.skill-groups {
  display: grid;
  gap: 24px;
}

.skill-groups article {
  display: grid;
  gap: 10px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 22px;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 32px, 1100px);
    padding-top: 34px;
  }

  .masthead,
  .projects-intro,
  .cv-section,
  .cv-item {
    grid-template-columns: 1fr;
  }

  .masthead {
    gap: 20px;
  }

  .sidebar {
    grid-template-columns: 150px max-content;
    justify-content: start;
  }

  .profile-photo {
    width: 150px;
  }

  .cv-section {
    gap: 14px;
    padding: 26px 0;
  }

  .projects-section {
    padding: 26px 0;
  }

  .projects-intro {
    gap: 10px;
  }

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

  .project-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-media {
    height: 220px;
  }

  .cv-item {
    gap: 2px;
  }

  .footer {
    flex-direction: column;
    gap: 4px;
  }
}

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