@import url("https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@300;400;500;600;700&display=swap");

:root {
  --bg: #fbfaf7;
  --text: #1d1c1a;
  --muted: #7d7972;
  --line: #dfdad0;
  --soft: #f0ede7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Josefin Sans", Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  display: block;
  width: 100%;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(18px, 4vw, 56px) 26px;
}

.site-name {
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.site-nav {
  display: flex;
  gap: clamp(16px, 3vw, 34px);
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav .is-active {
  color: var(--text);
}

.page {
  padding: 0 clamp(18px, 4vw, 56px);
}

.page-heading {
  max-width: 780px;
  padding: 42px 0 46px;
}

.work-page .page-heading {
  max-width: 560px;
}

.page-heading h1 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
}

.page-heading p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px 24px;
  width: min(72vw, 960px);
  padding-bottom: 90px;
}

.work-card {
  display: block;
  min-width: 0;
}

.work-card img,
.work-card.no-image {
  aspect-ratio: 1.32 / 1;
  background: var(--soft);
}

.work-card img {
  object-fit: cover;
  transition: opacity 160ms ease;
}

.work-card:hover img {
  opacity: 0.78;
}

.work-card.no-image {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  border: 1px solid var(--line);
}

.work-card.no-image img {
  display: none;
}

.work-title {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 600;
}

.work-card.no-image .work-title {
  margin-top: 0;
}

.work-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.text-page {
  min-height: calc(100vh - 136px);
}

.about-page {
  max-width: 1180px;
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(320px, 680px);
  gap: clamp(28px, 7vw, 96px);
  align-items: start;
  padding: 48px 0 72px;
}

.about-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 500;
  line-height: 1.08;
}

.about-kicker {
  margin: 0 0 30px;
  color: var(--muted);
}

.about-hero p:not(.about-kicker) {
  max-width: 660px;
  margin: 0 0 18px;
  font-size: 15px;
}

.split-text {
  display: grid;
  grid-template-columns: minmax(180px, 260px) repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 5vw, 70px);
  max-width: 1080px;
  padding: 8px 0 54px;
}

.portrait-block {
  margin: 0;
}

.portrait-block img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.resume-section {
  display: grid;
  grid-template-columns: minmax(120px, 0.22fr) minmax(0, 0.78fr);
  gap: clamp(24px, 6vw, 88px);
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.resume-section h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.resume-list {
  display: grid;
  gap: 0;
}

.resume-list article {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 22px;
  padding: 0 0 24px;
}

.resume-list article:last-child {
  padding-bottom: 0;
}

.resume-list span,
.career-panel span {
  color: var(--muted);
  font-size: 12px;
}

.resume-list h3,
.skill-grid h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.resume-list p,
.skill-grid p,
.career-panel p {
  margin: 0;
}

.resume-list.compact article {
  padding-bottom: 12px;
}

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

.career-panel {
  display: grid;
  gap: 12px;
  max-width: 680px;
}

.career-panel span {
  display: inline-block;
  min-width: 120px;
}

.split-text p {
  margin: 0;
}

.cv-table,
.research-index {
  max-width: 920px;
  border-top: 1px solid var(--line);
}

.cv-table div,
.research-index article {
  display: grid;
  grid-template-columns: minmax(120px, 0.24fr) minmax(240px, 0.76fr);
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.cv-table span,
.project-meta {
  color: var(--muted);
  font-size: 12px;
}

.cv-table p,
.research-index p {
  margin: 0;
}

.research-index h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.contact-page {
  min-height: calc(100vh - 136px);
}

.large-mail {
  display: inline-block;
  margin-top: 12px;
  border-bottom: 1px solid currentColor;
  color: var(--muted);
  font-size: clamp(22px, 5vw, 48px);
  line-height: 1.1;
}

.project-page {
  max-width: 1320px;
  margin: 0 auto;
}

.back-link {
  display: inline-block;
  margin-top: 34px;
  color: var(--muted);
  font-size: 12px;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--text);
}

.project-heading {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding: clamp(26px, 3.4vw, 48px) 0 30px;
}

.project-heading h1 {
  max-width: 620px;
  margin: 0 0 8px;
  font-size: clamp(24px, 2.8vw, 36px);
  font-weight: 600;
  line-height: 1.12;
}

.project-description {
  max-width: 620px;
  margin: 22px 0 0;
}

.project-title-block {
  max-width: 680px;
}

.project-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(26px, 4.5vw, 76px);
  align-items: start;
  max-width: 1160px;
  padding-top: 6px;
}

.project-info-grid article {
  display: grid;
  gap: 14px;
  min-height: 118px;
  padding-right: clamp(12px, 2vw, 28px);
  border-right: 1px solid var(--line);
}

.project-info-grid article:last-child {
  border-right: 0;
  padding-right: 0;
}

.project-info-grid h2 {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.project-info-grid p {
  margin: 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 300;
  line-height: 1.52;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: -8px;
  color: var(--muted);
  font-size: 12px;
}

.project-links a {
  border-bottom: 1px solid currentColor;
}

.project-links a:hover,
.project-links a:focus-visible {
  color: var(--text);
}

.project-carousel {
  padding: 0 0 72px;
  width: min(47vw, 640px);
}

.carousel-stage {
  position: relative;
}

.carousel-main {
  margin: 0;
  background: transparent;
}

.carousel-main img {
  width: 100%;
  height: min(34vw, 430px);
  object-fit: contain;
  background: transparent;
}

.carousel-main figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.carousel-arrow {
  position: absolute;
  top: calc(50% - 20px);
  z-index: 3;
  width: 28px;
  height: 40px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.42);
}

.carousel-arrow:focus {
  outline: none;
}

.carousel-arrow:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.carousel-arrow.prev {
  left: 6px;
}

.carousel-arrow.next {
  right: 6px;
}

.carousel-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 140px;
  gap: 8px;
  margin-top: 28px;
  overflow-x: auto;
}

.carousel-thumbs.is-hidden {
  display: none;
}

.thumb {
  height: 78px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  opacity: 0.42;
}

.thumb.is-active,
.thumb:hover,
.thumb:focus-visible {
  border-bottom-color: var(--text);
  opacity: 1;
}

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

.video-wrap {
  margin-top: 54px;
  background: #111;
}

.video-wrap video {
  max-height: 78vh;
  object-fit: contain;
}

.empty-project {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1000px) {
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(88vw, 720px);
  }
}

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

  .site-name {
    font-size: 19px;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    overflow-x: auto;
    font-size: 13px;
  }

  .page {
    padding: 0 18px;
  }

  .page-heading {
    padding: 34px 0;
  }

  .page-heading h1 {
    font-size: 22px;
  }

  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 26px 14px;
  }

  .work-title {
    font-size: 13px;
  }

  .work-meta {
    font-size: 11px;
  }

  .split-text,
  .about-hero,
  .resume-section,
  .project-heading,
  .cv-table div,
  .research-index article {
    grid-template-columns: 1fr;
  }

  .project-heading {
    gap: 22px;
    padding: 26px 0 24px;
  }

  .project-heading h1 {
    font-size: 24px;
  }

  .project-info-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .project-info-grid article {
    min-height: 0;
    padding: 0 0 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-info-grid article:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .carousel-main img {
    height: 56vw;
  }

  .project-carousel {
    width: 100%;
    padding-bottom: 58px;
  }

  .carousel-thumbs {
    grid-auto-columns: 92px;
    gap: 6px;
    margin-top: 18px;
  }

  .thumb {
    height: 58px;
  }

  .carousel-arrow {
    width: 30px;
    height: 42px;
    font-size: 32px;
  }

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

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