/* Square work cards in one mobile column or two desktop columns. Detail images keep their own ratio. */
.work-layout,
.work-content {
  min-width: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.work-content .project-grid,
.work-content .explorations .project-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--mobile-feed-gap, 12px);
}

.work-content .explorations {
  margin-top: 36px;
}

.catalog-heading {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
}

.work-content .card-image {
  aspect-ratio: var(--card-ratio, 1 / 1);
}

.work-content .explorations .card-image {
  aspect-ratio: var(--exploration-ratio, 1 / 1);
}

.work-content .card-image img {
  height: 100%;
  object-fit: var(--thumbnail-fit, contain);
  object-position: var(--thumbnail-position, 50% 50%);
}

.home-profile-intro {
  min-width: 0;
  width: 100%;
}

.home-profile-header > * {
  min-width: 0;
}

.profile-resume {
  margin-top: 40px;
}

.profile-resume:empty {
  display: none;
}

.profile-resume-section + .profile-resume-section {
  margin-top: 32px;
}

.profile-resume-section h3 {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11px;
}

.profile-resume-list {
  display: grid;
  gap: 24px;
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
}

.profile-resume-list > div {
  display: grid;
  grid-template-columns: var(--resume-date-width) minmax(0, 1fr);
  column-gap: var(--resume-column-gap);
  align-items: baseline;
  min-width: 0;
}

.profile-resume-list dt {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.profile-resume-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-resume-list dd p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}

.resume-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.resume-item-title {
  display: block;
  font-size: 14px;
  line-height: 1.6;
}

.home-profile {
  min-width: 0;
  padding: 24px 0 32px;
}

.home-profile-title {
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: -1px;
  overflow-wrap: anywhere;
}

.home-profile-role {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.8;
}

.home-profile-location {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}

.home-profile-bio {
  max-width: none;
  margin-top: 32px;
  font-size: 14px;
  line-height: 1.9;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.home-about-link {
  display: inline-block;
  margin-top: 25px;
  font-size: 11px;
  color: var(--muted);
}

.home-about-link:hover,
.home-profile-contact a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.home-profile-contact {
  margin-top: 40px;
}

.home-email {
  display: inline-block;
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.home-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 13px;
  font-size: 11px;
  color: var(--muted);
}

.work-content:focus-visible {
  outline: 1px solid #c6c6bd;
  outline-offset: 4px;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-left: auto;
  min-width: 0;
}

.language-switch {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.language-switch button {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.language-switch button[aria-pressed="true"] {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 5px;
}

html[lang="en"] .home-profile-bio,
html[lang="en"] .about-copy,
html[lang="en"] .project-detail .project-summary {
  word-break: normal;
}

@media (min-width: 1000px) {
  :root {
    --page-gutter: var(--desktop-page-gutter, clamp(20px, 3.2vw, 64px));
  }

  .work-content .project-grid {
    grid-template-columns: repeat(var(--selected-columns), minmax(0, 1fr));
    gap: var(--feed-gap, 8px);
  }

  .work-content .explorations .project-grid {
    grid-template-columns: repeat(var(--exploration-columns), minmax(0, 1fr));
    gap: var(--feed-gap, 8px);
  }

  body {
    height: 100dvh;
    padding: var(--frame-inset, 18px);
    overflow: hidden;
    background: #eeefeb;
  }

  .site-shell {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--frame-inset, 18px) * 2);
    margin: 0;
    border: 1px solid #dedfd9;
    background: var(--background);
    overflow: hidden;
  }

  .site-header {
    height: 82px;
    flex: 0 0 82px;
  }

  .site-shell main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding-bottom: 32px;
    scrollbar-width: thin;
    scrollbar-color: #c6c8c0 transparent;
  }

  .site-shell > .site-footer {
    display: none;
  }

  .is-work main {
    overflow: hidden;
    padding-bottom: 0;
  }

  .work-layout {
    display: grid;
    grid-template-columns: var(--profile-width, minmax(0, 1fr)) minmax(0, 1fr);
    gap: var(--profile-gap, 40px);
    height: 100%;
    min-height: 0;
  }

  .home-profile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
    padding-right: clamp(24px, 3.2vw, 64px);
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .home-profile .profile-resume {
    display: grid;
    gap: 24px;
    margin-top: 28px;
  }

  .home-profile .profile-resume-section {
    margin-top: 0;
  }

  .home-profile .profile-resume-section h3 {
    margin-bottom: 12px;
  }

  .home-profile .profile-resume-list {
    gap: 16px;
  }

  .home-profile .profile-resume-list dt {
    white-space: nowrap;
  }

  .home-profile .profile-resume-list dd p {
    margin-top: 4px;
    line-height: 1.65;
  }

  .home-profile .resume-item-title {
    line-height: 1.5;
  }

  .home-profile-contact {
    flex-shrink: 0;
  }

  .work-content {
    min-height: 0;
    height: 100%;
    padding: 24px 0 32px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: #c6c8c0 transparent;
    scroll-padding-block: 24px;
  }

  .site-shell .text-page {
    padding-top: 24px;
    min-height: 100%;
  }
}

@media (max-width: 999px) {
  .site-header {
    height: 72px;
    gap: 12px;
  }

  .site-header nav {
    gap: 16px;
  }

  .site-header nav a,
  .home-about-link,
  .contact-links a,
  .site-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .site-header nav a {
    position: relative;
  }

  .site-header nav a[aria-current="page"]::after {
    position: absolute;
    left: calc(50% - 1.5px);
    bottom: 3px;
    margin: 0;
  }

  .home-profile .profile-resume,
  .home-profile-location {
    display: none;
  }

  .home-profile {
    padding: 8px 0 24px;
  }

  .home-profile-contact {
    margin-top: 12px;
  }

  .home-socials {
    margin-top: 4px;
  }

  .home-socials a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .home-profile-title {
    font-size: 25px;
  }

  .home-profile-bio {
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.85;
  }

  .home-about-link {
    margin-top: 8px;
  }

  .site-footer {
    margin-top: 48px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

}

@media (max-width: 600px) {
  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 0 12px;
  }

  .header-tools { display: contents; }
  .language-switch { grid-column: 2; grid-row: 1; }
  .site-header nav {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }
}
