.site-shell {
  display: grid;
  grid-template-columns: minmax(260px, 31%) minmax(0, 1fr);
  width: min(calc(100% - 3rem), 1060px);
  height: 100svh;
  margin-inline: auto;
}

.profile-header {
  display: flex;
  min-width: 0;
  min-height: 0;
  padding: clamp(2.5rem, 7vh, 4.5rem) clamp(2rem, 4vw, 3rem) 1.75rem 0;
  border-right: 1px solid var(--line);
  flex-direction: column;
}

.profile-portrait,
.profile-portrait img {
  display: block;
  width: 100%;
}

.profile-portrait {
  max-width: 230px;
}

.profile-portrait img {
  height: auto;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  object-fit: cover;
}

.profile-copy {
  margin-top: 1.5rem;
}

.profile-copy h1 {
  font-family: var(--heading);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.25;
}

.profile-copy p {
  color: var(--nav);
  font-size: 0.94rem;
  line-height: 1.55;
}

.profile-copy h1 + p {
  margin-top: 0.5rem;
}

.profile-links {
  display: grid;
  justify-items: start;
  gap: 0.45rem;
  margin-top: 1.5rem;
}

.profile-links a,
.profile-links .contact-address,
.site-credit {
  font-size: 0.84rem;
}

.profile-links a,
.profile-links .contact-address {
  color: var(--nav);
}

.profile-links a {
  text-decoration-color: var(--line-strong);
}

.profile-links a:hover,
.profile-links a:active {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

.site-credit {
  margin-top: auto;
  color: var(--faint);
}

.content-column {
  display: grid;
  min-width: 0;
  min-height: 0;
  padding-left: clamp(2.25rem, 5vw, 4.5rem);
  grid-template-rows: var(--nav-height) minmax(0, 1fr);
}

nav {
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.nav-links {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  height: 100%;
  list-style: none;
}

.nav-links li {
  display: flex;
  align-items: stretch;
}

.nav-links a,
#theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--nav);
  cursor: pointer;
  font: inherit;
  font-family: var(--heading);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:active,
#theme-toggle:hover,
#theme-toggle:active {
  color: var(--link-hover);
}

:root[data-view="home"] .nav-links [data-view-link="home"],
:root[data-view="work"] .nav-links [data-view-link="work"],
:root[data-view="about"] .nav-links [data-view-link="about"],
:root[data-view="contact"] .nav-links [data-view-link="contact"] {
  color: var(--link-hover);
}

:root[data-view="home"] .nav-links [data-view-link="home"]::after,
:root[data-view="work"] .nav-links [data-view-link="work"]::after,
:root[data-view="about"] .nav-links [data-view-link="about"]::after,
:root[data-view="contact"] .nav-links [data-view-link="contact"]::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: var(--link-hover);
  content: "";
}

#theme-toggle {
  justify-content: center;
  min-width: 1.5rem;
}

.theme-icon {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

:root[data-theme="dark"] .theme-icon--moon,
:root[data-theme="light"] .theme-icon--sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-icon--moon {
    display: none;
  }
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-icon--sun {
    display: none;
  }
}

main {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.view-panel {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--background);
  scrollbar-gutter: stable;
}

:root[data-view="home"] #home,
:root[data-view="work"] #work,
:root[data-view="about"] #about,
:root[data-view="contact"] #contact {
  display: block;
}

:root {
  view-transition-name: none;
}

.view-panel:not([hidden]) {
  view-transition-name: portfolio-content;
}

::view-transition-group(portfolio-content),
::view-transition-old(portfolio-content),
::view-transition-new(portfolio-content) {
  animation-duration: 170ms;
  animation-timing-function: ease-out;
}

::view-transition-old(portfolio-content),
::view-transition-new(portfolio-content) {
  mix-blend-mode: normal;
}

.panel-content {
  display: flex;
  width: 100%;
  min-height: 100%;
  padding-block: clamp(2.5rem, 8vh, 5.25rem);
  flex-direction: column;
  justify-content: flex-start;
}

.panel-content h2 {
  font-family: var(--heading);
  font-size: clamp(1.75rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.panel-content h2:focus-visible {
  outline: 0;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.prose {
  max-width: 620px;
}

.prose h2 {
  margin-bottom: 1.75rem;
}

.prose p {
  max-width: 60ch;
  font-size: 1rem;
  line-height: 1.68;
}

.prose p + p {
  margin-top: 0.9rem;
}

.prose a {
  text-decoration-color: var(--line-strong);
}

.prose a:hover,
.prose a:active,
.home-links a:hover,
.home-links a:active {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

.home-links {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.9rem;
}

.home-links a {
  font-size: 1rem;
  font-weight: 600;
}

.work-content {
  max-width: 670px;
}

.project-list {
  display: grid;
  gap: 1.6rem;
  margin-top: 1.75rem;
  list-style: none;
}

.project {
  max-width: 620px;
}

.project > a {
  font-size: 1rem;
  text-decoration-color: var(--line-strong);
}

.project > a:hover,
.project > a:active {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

.project strong {
  font-weight: 600;
}

.project p {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.about-content p:first-of-type {
  color: var(--text);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.75rem;
  list-style: none;
}

.contact-links a,
.contact-links .contact-address {
  color: var(--muted);
  font-size: 0.94rem;
}

.contact-links a:hover,
.contact-links a:active {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

@media (max-width: 760px) {
  :root {
    --nav-height: 50px;
  }

  .site-shell {
    width: min(calc(100% - 2rem), 1060px);
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .profile-header {
    display: grid;
    padding: 0.9rem 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    column-gap: 1rem;
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .profile-portrait {
    width: 84px;
    grid-column: 1;
    grid-row: 1;
  }

  .profile-copy {
    align-self: center;
    margin-top: 0;
    grid-column: 2;
    grid-row: 1;
  }

  .profile-copy h1 {
    font-size: 1.12rem;
  }

  .profile-copy p {
    font-size: 0.94rem;
  }

  .profile-copy h1 + p {
    margin-top: 0.3rem;
  }

  .profile-links,
  .site-credit {
    display: none;
  }

  .content-column {
    padding-left: 0;
  }

  .nav-links {
    justify-content: space-between;
    gap: 0;
  }

  .nav-links a,
  #theme-toggle {
    font-size: 0.875rem;
  }

  #theme-toggle {
    right: 1rem;
  }

  .panel-content {
    padding: 1.65rem 0.15rem;
    justify-content: flex-start;
  }

  .panel-content h2 {
    font-size: 1.625rem;
  }

  .prose h2 {
    margin-bottom: 1.25rem;
  }

  .prose p {
    font-size: 0.94rem;
    line-height: 1.58;
  }

  .project-list {
    gap: 1.15rem;
    margin-top: 1.25rem;
  }

  .project > a {
    font-size: 0.96rem;
  }

  .project p {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .home-links,
  .contact-links {
    margin-top: 1.45rem;
  }
}

@media (max-width: 360px) {
  .site-shell {
    width: min(calc(100% - 1.5rem), 1060px);
  }

  .nav-links a,
  #theme-toggle {
    font-size: 0.82rem;
  }
}

@media (max-height: 700px) {
  .panel-content {
    padding-block: 1.75rem;
    justify-content: flex-start;
  }
}

@media (max-height: 520px) and (min-width: 761px) {
  .site-shell {
    grid-template-columns: minmax(210px, 28%) minmax(0, 1fr);
  }

  .profile-header {
    padding: 1rem 1.5rem 1rem 0;
  }

  .profile-portrait {
    max-width: 128px;
  }

  .profile-copy {
    margin-top: 0.75rem;
  }

  .profile-copy h1 {
    font-size: 1.1rem;
  }

  .profile-copy p {
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .profile-copy h1 + p {
    margin-top: 0.3rem;
  }

  .profile-links {
    gap: 0.25rem;
    margin-top: 0.75rem;
  }

  .profile-links a,
  .profile-links .contact-address,
  .site-credit {
    font-size: 0.78rem;
  }

  .content-column {
    padding-left: clamp(1.5rem, 4vw, 2.5rem);
  }

  .panel-content {
    padding-block: 1rem;
  }

  .panel-content h2 {
    font-size: 1.6rem;
  }

  .prose h2 {
    margin-bottom: 1rem;
  }

  .prose p {
    line-height: 1.5;
  }

  .prose p + p {
    margin-top: 0.55rem;
  }

  .project-list {
    gap: 0.75rem;
    margin-top: 1rem;
  }

  .project p {
    margin-top: 0.2rem;
    line-height: 1.35;
  }

  .home-links,
  .contact-links {
    margin-top: 1.1rem;
  }
}
