:root {
  color-scheme: dark;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #242322;
  color: #f5f2eb;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100svh;
}

.site-shell {
  position: relative;
  display: grid;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  grid-template-columns: 1fr minmax(0, min(54vw, 740px)) 1fr;
  grid-template-rows: minmax(96px, 16fr) minmax(58px, 10fr) minmax(300px, 54fr) minmax(96px, 20fr);
}

.site-shell::before,
.site-shell::after {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px solid var(--accent);
  content: "";
  pointer-events: none;
}

.site-shell::before {
  left: calc((100% - min(54vw, 740px)) / 2);
}

.site-shell::after {
  right: calc((100% - min(54vw, 740px)) / 2);
}

.site-header,
.tagline {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  border-bottom: 1px solid var(--accent);
  text-align: center;
}

.site-header {
  align-items: end;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(2rem, 3.8vw, 3.5rem);
  font-weight: 500;
  letter-spacing: 0.035em;
  line-height: 1;
}

.tagline {
  align-items: start;
  font-size: clamp(0.9rem, 1.7vw, 1.35rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.25;
}

.art-panel {
  position: relative;
  display: grid;
  min-width: 0;
  grid-column: 1 / -1;
  place-items: center;
  border-bottom: 1px solid var(--accent);
}

.art-canvas {
  display: grid;
  width: 100%;
  height: 100%;
  overflow: hidden;
  place-items: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.art-canvas:active {
  cursor: grabbing;
}

.art-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.art-canvas[data-error="true"]::after {
  position: absolute;
  inset: 0;
  display: grid;
  padding: 1rem;
  place-items: center;
  color: #f5f2eb;
  content: "WebGPU is unavailable in this browser";
  font-size: 1rem;
  text-align: center;
}

.content-panel {
  display: flex;
  grid-column: 2;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.85rem, 2vw, 1.5rem);
  padding: 2rem 0;
}

.page-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.content-panel h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.content-panel > p:not(.page-label) {
  max-width: 38rem;
  margin: 0;
  font-size: clamp(1rem, 1.45vw, 1.2rem);
  line-height: 1.7;
  opacity: 0.78;
}

.projects-shell {
  height: auto;
  grid-template-rows: minmax(96px, 16vh) minmax(58px, 10vh) auto minmax(96px, 20vh);
}

.about-shell {
  height: auto;
  grid-template-rows: minmax(96px, 16vh) minmax(58px, 10vh) auto minmax(96px, 20vh);
}

.projects-panel {
  justify-content: flex-start;
  gap: clamp(2rem, 4vh, 3rem);
}

.project-section {
  display: grid;
  gap: 1rem;
}

.project-section h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem 2rem;
}

.project-item {
  padding-top: 1rem;
  border-top: 1px solid rgba(245, 242, 235, 0.2);
}

.project-item h3 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  font-weight: 500;
}

.project-item p {
  margin: 0;
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  line-height: 1.6;
  opacity: 0.78;
}

.project-item-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.project-item-link > span {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  opacity: 0.72;
}

.project-item-link:hover h3,
.project-item-link:focus-visible h3 {
  opacity: 0.72;
}

.project-item-link:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 0.35rem;
}

.project-detail-shell {
  height: auto;
  grid-template-rows: minmax(0, 1fr) minmax(96px, 20vh);
}

.project-detail-panel {
  grid-row: 1;
  justify-content: flex-start;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  padding: clamp(2rem, 6vh, 5rem) 0;
}

.project-detail-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.project-description {
  max-width: 38rem;
  margin: 0;
  font-size: clamp(1rem, 1.45vw, 1.2rem);
  line-height: 1.7;
  opacity: 0.78;
}

.project-info {
  display: grid;
  margin-top: clamp(0.5rem, 2vh, 1.25rem);
}

.project-info-section {
  display: grid;
  grid-template-columns: minmax(8.5rem, 0.42fr) minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid rgba(245, 242, 235, 0.2);
}

.project-info-section h2 {
  margin: 0;
  font-size: clamp(1.05rem, 1.55vw, 1.25rem);
  font-weight: 500;
  line-height: 1.4;
}

.project-info-section > p {
  margin: 0;
  font-size: clamp(1rem, 1.35vw, 1.1rem);
  line-height: 1.7;
  opacity: 0.78;
}

.project-material-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: clamp(1rem, 1.35vw, 1.1rem);
  line-height: 1.7;
  opacity: 0.78;
}

.project-info-fields {
  display: grid;
  gap: 0.9rem;
  margin: 0;
}

.project-info-fields > div {
  display: grid;
  grid-template-columns: minmax(6.5rem, 0.4fr) minmax(0, 1fr);
  gap: 1rem;
}

.project-info-fields dt {
  font-size: 0.9rem;
  opacity: 0.72;
}

.project-info-fields dd {
  margin: 0;
  font-size: clamp(1rem, 1.35vw, 1.1rem);
  line-height: 1.6;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1.5rem 1rem;
  margin-top: clamp(0.5rem, 2vh, 1.25rem);
}

.project-gallery-item {
  min-width: 0;
  margin: 0;
}

.project-image-placeholder,
.project-gallery-item img {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 3;
  place-items: center;
  border: 1px solid rgba(245, 242, 235, 0.2);
  background: rgba(245, 242, 235, 0.035);
  color: rgba(245, 242, 235, 0.55);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  object-fit: cover;
  text-align: center;
}

.project-photo-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: inherit;
}

.project-photo-trigger:focus-visible {
  outline: 2px solid #f5f2eb;
  outline-offset: 0.25rem;
}

.photo-viewer {
  width: min(94vw, 1200px);
  height: min(90vh, 900px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 4rem 1rem 1rem;
  border: 1px solid rgba(245, 242, 235, 0.24);
  background: #242322;
  color: #f5f2eb;
}

.photo-viewer::backdrop {
  background: rgba(0, 0, 0, 0.86);
}

.photo-viewer[open] {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 3rem;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
}

.photo-viewer button {
  display: grid;
  width: 3rem;
  height: 3rem;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(245, 242, 235, 0.24);
  background: rgba(245, 242, 235, 0.06);
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 2rem;
  line-height: 1;
}

.photo-viewer button:hover,
.photo-viewer button:focus-visible {
  background: rgba(245, 242, 235, 0.16);
}

.photo-viewer .photo-viewer-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 1.75rem;
}

.photo-viewer-previous {
  grid-column: 1;
  grid-row: 1;
}

.photo-viewer-next {
  grid-column: 3;
  grid-row: 1;
}

.photo-viewer-figure {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-column: 2;
  grid-row: 1;
  grid-template-rows: minmax(0, 1fr) auto auto;
  justify-items: center;
  gap: 0.75rem;
  margin: 0;
}

.photo-viewer-image {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 8rem);
  width: auto;
  height: auto;
  object-fit: contain;
}

.photo-viewer-caption {
  text-align: center;
}

.photo-viewer-counter {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.7;
}

.project-gallery-item figcaption {
  margin-top: 0.65rem;
  font-size: 0.85rem;
  opacity: 0.7;
}

.site-nav {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr minmax(0, min(54vw, 740px)) 1fr;
  align-items: center;
}

.site-nav a {
  justify-self: center;
  color: inherit;
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1;
  text-decoration: none;
}

.site-nav a:first-child {
  grid-column: 1;
}

.site-nav a:last-child {
  grid-column: 3;
}

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

@media (max-width: 600px) {
  .site-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(96px, 15fr) minmax(62px, 10fr) minmax(300px, 55fr) minmax(96px, 20fr);
  }

  .projects-shell {
    grid-template-rows: minmax(96px, 15vh) minmax(62px, 10vh) auto minmax(96px, 20vh);
  }

  .about-shell {
    grid-template-rows: minmax(96px, 15vh) minmax(62px, 10vh) auto minmax(96px, 20vh);
  }

  .project-detail-shell {
    grid-template-rows: minmax(0, 1fr) minmax(96px, 20vh);
  }

  .project-info-section {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .photo-viewer {
    width: 96vw;
    height: 90vh;
    padding: 3.75rem 0.5rem 0.75rem;
  }

  .photo-viewer[open] {
    grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
    gap: 0.5rem;
  }

  .photo-viewer button {
    width: 2.5rem;
    height: 2.5rem;
  }

  .photo-viewer-image {
    max-height: calc(90vh - 7rem);
  }

  .site-shell::before {
    left: 10%;
  }

  .site-shell::after {
    right: 10%;
  }

  .art-panel {
    grid-column: 1;
    margin: 0 10%;
  }

  .content-panel {
    grid-column: 1;
    margin: 0 10%;
  }

  .site-nav {
    grid-column: 1;
    grid-template-columns: 1fr 1fr;
  }

  .site-nav a:last-child {
    grid-column: 2;
  }

  .site-nav a {
    font-size: clamp(1.1rem, 5vw, 1.5rem);
  }
}
