/* Local fonts are copied to dist/assets/fonts by the build script. */
@font-face {
  font-family: "Favorit Extended";
  src: url("./assets/fonts/favorit-extended-trial-book.otf") format("opentype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Favorit Extended";
  src: url("./assets/fonts/favorit-extended-trial-regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Favorit Extended";
  src: url("./assets/fonts/favorit-extended-trial-medium.otf") format("opentype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Favorit Extended";
  src: url("./assets/fonts/favorit-extended-trial-bold.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url("./assets/fonts/inter-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url("./assets/fonts/inter-medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  --font-body: Inter, Arial, sans-serif;
  --font-heading: "Favorit Extended", Arial, sans-serif;
  --page-padding: 64px;
  --text: #000;
  --surface: #fff;
  --badge: #ccc;
  color: var(--text);
  background: var(--surface);
  font-family: var(--font-body);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-size: 17px;
  line-height: 1.4;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible, a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 5px;
}

.icon {
  display: block;
  width: 24px;
  height: 24px;
  flex: none;
}

/* The header remains visible while browsing the archive. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 42px;
  width: 100%;
  height: 90px;
  padding: 0 var(--page-padding);
  background: var(--surface);
  font-size: 16px;
  font-weight: 500;
  line-height: 2;
  letter-spacing: 1px;
}

.site-name {
  flex: 1;
  white-space: nowrap;
}

.site-nav, .nav-links, .social-links {
  display: flex;
  align-items: center;
  gap: 42px;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover, .footer-nav a:hover {
  text-decoration: underline;
}

.social-links a {
  display: block;
  line-height: 1;
}

.social-links .icon {
  width: 25px;
  height: 25px;
}

.social-links a:first-child .icon {
  width: 20px;
}

.nav-toggle {
  display: none;
}

/* A single hero layout rearranges for the smaller screens. */
.intro {
  display: flex;
  align-items: center;
  height: 50vh;
}

.intro-inner {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-content: center;
  align-items: start;
  column-gap: 24px;
  row-gap: 6px;
  width: 100%;
  padding: 0 var(--page-padding);
}

.portrait {
  grid-row: span 2;
  align-self: center;
  display: block;
  width: 150px;
  height: 150px;
  object-fit: cover;
}

.intro-heading {
  align-self: end;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

.mobile-title {
  display: none;
}

.intro-description {
  align-self: start;
  max-width: 619px;
}

.intro-description a {
  text-decoration: underline;
}

/* Research projects use a narrow text column beside the section label. */
.projects-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 0 var(--page-padding) 48px;
  scroll-margin-top: 100px;
}

.section-heading {
  position: sticky;
  top: 100px;
  border-bottom: 1px solid #222;
}

.section-heading h2 {
  height: 26px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 1px;
}

.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding-left: 32px;
  scroll-margin-top: 100px;
}

.project-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding-bottom: 24px;
}

.project-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.project-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
}

.project-badges {
  display: flex;
  align-items: center;
  flex: none;
  gap: 10px;
}

.badge, .work-tag {
  display: inline-flex;
  align-items: center;
  flex: none;
  width: max-content;
  padding: 3px 6px;
  border-radius: 12px;
  background: var(--badge);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0;
  white-space: nowrap;
}

.project-description {
  width: 65%;
}

.mobile-description {
  display: none;
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 24px;
  padding-top: 5px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration: none;
}

.project-link:hover {
  text-decoration: underline;
}

.project-link .icon {
  order: -1;
  width: 18px;
  height: 20px;
}

.project-link .icon-arrow {
  width: 24px;
  height: 24px;
  margin-right: -6px;
  transform: rotate(-40deg);
}

.project-link .icon-x {
  width: 15px;
}

/* The work previews retain the original large, cropped screenshots. */
.work-section {
  padding: 48px var(--page-padding);
  scroll-margin-top: 50px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 180px;
  gap: 48px;
}

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  grid-row: span 3;
  min-width: 0;
  overflow: hidden;
  border-radius: 25px;
  background: var(--card-color, #444);
  color: #fff;
  text-decoration: none;
}

.work-content {
  display: flex;
  flex-direction: column;
  flex: none;
  gap: 8px;
  padding: 28px 28px 36px;
}

.work-heading {
  display: flex;
  align-items: center;
  gap: 16px;
}

.work-title {
  flex: none;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.work-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.work-tags .badge, .work-tag {
  background: #fff6;
}

.work-description {
  color: #fffc;
  font-size: 16px;
  line-height: 1.2;
}

.work-media {
  position: relative;
  flex: 1;
  width: 100%;
}

.work-image {
  position: absolute;
  top: -1.07477%;
  right: -215px;
  display: block;
  width: 127%;
  height: 87%;
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
  object-fit: contain;
  object-position: center;
}

.card-arrow {
  position: absolute;
  right: 28px;
  bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  box-shadow: 0 1px 4px 1px #0004;
}

.card-arrow .icon {
  width: 32px;
  height: 32px;
  transform: rotate(-45deg);
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 64px var(--page-padding);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0;
}

.footer-rule {
  height: 4px;
  border-bottom: 1px solid #000;
}

.footer-content {
  display: flex;
  gap: 64px;
  padding-left: 32px;
}

.footer-nav, .footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.site-footer a {
  text-decoration: none;
}

.site-footer .social-links {
  gap: 18px;
}

@media (min-width: 810px) and (max-width: 1399.98px) {
  body {
    font-size: 16px;
    line-height: 1.3;
    letter-spacing: 0.03em;
  }

  .intro {
    height: 35vh;
  }

  .intro-inner {
    grid-template-columns: 120px minmax(0, 1fr);
    padding-right: 32px;
    padding-left: 32px;
  }

  .portrait {
    width: 120px;
    height: 120px;
  }

  .intro-heading {
    white-space: normal;
  }

  .intro-description {
    max-width: 574px;
  }

  .projects-section {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .section-heading {
    position: static;
  }

  .projects-grid {
    padding-top: 16px;
    padding-left: 0;
  }

  .project-description {
    width: 80%;
  }

  .project-title {
    letter-spacing: 0;
  }

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

  .work-description {
    font-size: 14px;
    letter-spacing: 0;
  }
}

@media (min-width: 810px) and (max-width: 1199.98px) {
  .project-title {
    font-size: 16px;
  }
}

@media (max-width: 809.98px) {
  :root {
    --page-padding: 16px;
  }

  body {
    font-size: 14px;
    line-height: 1.5;
  }

  .site-header {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0;
    height: auto;
    min-height: 56px;
    padding: 12px var(--page-padding);
  }

  .js .nav-toggle {
    position: relative;
    display: block;
    flex: none;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }

  .nav-toggle span {
    position: absolute;
    left: 4px;
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .nav-toggle span:nth-child(1) { top: 7px; }
  .nav-toggle span:nth-child(2) { top: 15px; }
  .nav-toggle span:nth-child(3) { top: 23px; }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .site-nav {
    flex-direction: column;
    width: 100%;
    padding: 42px 0 48px;
  }

  .js .site-nav {
    display: none;
  }

  .js .site-nav.is-open {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
  }

  .intro {
    height: 58vh;
  }

  .intro-inner {
    grid-template-columns: 80px minmax(0, 1fr);
    align-items: center;
    gap: 12px 10px;
  }

  .portrait {
    grid-row: auto;
    width: 80px;
    height: 80px;
  }

  .intro-heading {
    align-self: center;
    font-size: 22px;
    line-height: 1.2;
    white-space: normal;
  }

  .desktop-title {
    display: none;
  }

  .mobile-title {
    display: inline;
  }

  .intro-description {
    grid-column: 1 / -1;
    max-width: none;
  }

  .projects-section {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 32px;
    padding-bottom: 16px;
  }

  .section-heading {
    position: static;
  }

  .projects-grid {
    padding-top: 16px;
    padding-left: 0;
    scroll-margin-top: 72px;
  }

  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-bottom: 4px;
  }

  .project-title {
    font-size: 16px;
  }

  .project-description {
    width: 100%;
  }

  .desktop-description {
    display: none;
  }

  .mobile-description {
    display: inline;
  }

  .projects-section {
    scroll-margin-top: 72px;
  }

  .project-link {
    font-size: 14px;
  }

  .work-section {
    padding-top: 24px;
    padding-bottom: 48px;
  }

  .work-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 130px;
    gap: 16px;
  }

  .work-content {
    padding: 22px;
  }

  .work-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .work-tags {
    flex-wrap: wrap;
    gap: 3px;
  }

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

  .work-description {
    font-size: 14px;
  }

  .work-image {
    top: -0.980392%;
    right: -135px;
  }

  .card-arrow {
    right: 22px;
    bottom: 22px;
    width: 48px;
    height: 48px;
  }

  .card-arrow .icon {
    width: 24px;
    height: 24px;
  }

  .site-footer {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 32px;
    padding-bottom: 64px;
    font-size: 14px;
  }

  .footer-content {
    padding-top: 24px;
    padding-left: 0;
  }
}

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

  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
