:root {
  color-scheme: light;
  --paper: #e8ede2;
  --ink: #293326;
  --secondary: #465743;
  --accent: #3a6431;
  --line: #adbea5;
  --board: #dbe4d2;
  --sans: Inter, system-ui, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--sans); }
h1, h2, p, figure, dl, dd, ul { margin: 0; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .25em; }
a:focus-visible, video:focus-visible, summary:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
img { display: block; max-width: 100%; }

.skip-link {
  position: absolute;
  z-index: 2;
  inset: 1rem auto auto 1rem;
  padding: .5rem .8rem;
  background: var(--paper);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.page-shell { max-width: 94rem; margin-inline: auto; padding: 1.45rem clamp(1.1rem, 4vw, 4.5rem) 2rem; }
.masthead {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: .4rem 1.3rem;
  align-items: center;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font: 600 1rem/1.25 var(--mono);
  text-transform: uppercase;
  letter-spacing: .055em;
}
.professional-title { min-width: 0; color: var(--secondary); font: 400 .83rem/1.5 var(--mono); }
.language-nav { display: flex; gap: .75rem; font: 500 .875rem/1.25 var(--mono); }
.language-nav a[aria-current], .section-nav a[aria-current] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: .28em;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(9rem, 13.25rem) minmax(0, 1fr);
  column-gap: clamp(1.5rem, 4.2vw, 5.25rem);
  padding-top: 1.35rem;
}
.sidebar { min-width: 0; }
.section-nav { display: grid; position: sticky; top: 1rem; }
.section-nav a { display: block; padding: .7rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.section-nav a:last-child { border-bottom: 1px solid var(--line); }
main { min-width: 0; }

.intro { padding-block: .15rem clamp(2rem, 4vw, 4.25rem); }
.intro h1 {
  font: 500 clamp(2.35rem, 6.5vw, 6.5rem)/.95 var(--mono);
  letter-spacing: -.083em;
  overflow-wrap: break-word;
}
.intro h1 span { color: var(--accent); }
.intro p { color: var(--secondary); margin-top: 1.12rem; }

.work-section { scroll-margin-top: 1.25rem; margin-bottom: clamp(2.5rem, 5vw, 5rem); }
.work-section h2, .process-section h2 {
  font: 500 clamp(1.45rem, 3vw, 2.45rem)/1.15 var(--mono);
  letter-spacing: -.056em;
}
.work-section h2 { padding: .9rem 0 1rem; border-top: 1px solid var(--line); }
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 1.2rem clamp(.75rem, 2.1vw, 1.8rem);
  list-style: none;
  padding: 0;
}
.project-grid-four { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.project-grid-four li:nth-child(4n + 1),
.project-grid-four li:nth-child(4n + 4) { grid-column: span 7; }
.project-grid-four li:nth-child(4n + 2),
.project-grid-four li:nth-child(4n + 3) { grid-column: span 5; }
.project-grid-single { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
.project-card { display: block; }
.project-media, .video-poster { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--board); }
.project-media img, .video-poster img { width: 100%; height: 100%; object-fit: cover; }
.project-caption {
  display: block;
  border-bottom: 1px solid var(--line);
  padding-block: .48rem .58rem;
  font-weight: 600;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.project-card:hover { text-decoration: none; }
.project-card:hover .project-caption { color: var(--accent); text-decoration: underline; text-underline-offset: .25em; }

.project-detail { padding-bottom: 2.65rem; }
.back-link, .next-project span {
  color: var(--accent);
  font: 500 .875rem/1.4 var(--mono);
}
.project-detail h1 {
  font: 500 clamp(2rem, 5.3vw, 5.1rem)/.98 var(--mono);
  letter-spacing: -.073em;
  margin: .75rem 0 1.1rem;
  overflow-wrap: anywhere;
}
.video-player {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: contain;
  background: #162016;
}
iframe.video-player { border: 0; }
.video figcaption {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.35rem;
  padding-block: .55rem;
  border-bottom: 1px solid var(--line);
  color: var(--secondary);
  font: 400 .84rem/1.4 var(--mono);
}
.video figcaption a { text-decoration: underline; text-underline-offset: .25em; }

.project-credits { margin-top: 1.6rem; }
.credits-pair dt, .project-technical h2, .project-summary h2 {
  color: var(--secondary);
  font: 400 .875rem/1.5 var(--mono);
  text-transform: uppercase;
  letter-spacing: .025em;
}
.credits-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1.25rem 1.75rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.credits-pair > div:only-child { grid-column: 1/-1; }
.credits-pair dd { margin-top: .5rem; overflow-wrap: anywhere; }
.credits-pair a { text-decoration: underline; text-underline-offset: .25em; }
.project-technical { margin-top: 1.35rem; }
.project-technical h2 { margin: 0 0 1rem; }
.technology-groups { display: grid; gap: 1rem; }
.technology-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1.35rem; }
.technology-group dt { flex: 0 0 9rem; color: var(--secondary); font: 400 .875rem/1.5 var(--mono); }
.technology-group dd { flex: 1 1 20rem; min-width: 0; line-height: 1.65; overflow-wrap: anywhere; }
.project-summary { margin-top: 1.6rem; }
.project-summary h2 { margin: 0 0 .45rem; }
.project-summary p { max-width: 72ch; line-height: 1.65; white-space: pre-line; }
.process-section { margin-top: 2.3rem; }
.process-section h2 { margin-bottom: 1rem; }
.process-intro { color: var(--secondary); max-width: 68ch; margin-bottom: 1.6rem; }
.process-timeline {
  list-style: none;
  margin: 0 0 0 .3rem;
  padding: 0 0 0 1.55rem;
  border-left: 1px solid var(--line);
}
.process-stage { position: relative; padding-bottom: 1.8rem; }
.process-stage:last-child { padding-bottom: 0; }
.process-stage::before {
  content: '';
  position: absolute;
  top: .53rem;
  left: calc(-1.55rem - .28rem);
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--accent);
}
.process-stage-heading { margin-bottom: .5rem; }
.process-stage h3 { margin: 0; font: 500 1.075rem/1.4 var(--mono); letter-spacing: -.025em; }
.process-text { max-width: 72ch; line-height: 1.7; white-space: pre-line; }
.process-gallery { margin-top: 2rem; border-block: 1px solid var(--line); scroll-margin-top: 1rem; }
.process-gallery summary { display: flex; align-items: center; gap: .7rem; padding: 1rem 0; list-style: none; cursor: pointer; font: 500 1.1rem/1.4 var(--mono); }
.process-gallery summary::-webkit-details-marker { display: none; }
.gallery-count { margin-left: auto; color: var(--secondary); font-size: .875rem; font-weight: 400; white-space: nowrap; }
.gallery-toggle { display: grid; place-items: center; width: 1.2rem; flex: 0 0 1.2rem; }
.gallery-toggle::before { content: '+'; }
.process-gallery[open] .gallery-toggle::before { content: '−'; }
.process-image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .75rem; padding: .25rem 0 1rem; }
.process-image { display: block; aspect-ratio: 16/9; background: var(--board); cursor: zoom-in; }
.process-image img { width: 100%; height: 100%; object-fit: contain; }
.image-viewer-open { overflow: hidden; }
.image-viewer { width: calc(100vw - 2rem); height: calc(100dvh - 2rem); max-width: 100rem; max-height: none; padding: 0; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.image-viewer::backdrop { background: rgb(15 24 14 / .85); }
.image-viewer-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.image-viewer-toolbar, .image-viewer-footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem 1rem; }
.image-viewer-toolbar { border-bottom: 1px solid var(--line); }
.image-viewer-footer { border-top: 1px solid var(--line); }
.image-viewer-actions { display: flex; gap: .5rem; }
.image-viewer button { padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 0; font: 500 .875rem/1.4 var(--mono); background: var(--paper); color: var(--ink); cursor: pointer; min-height: 2.75rem; }
.image-viewer button:hover { background: var(--board); }
.image-viewer-status { font: 400 .875rem/1.4 var(--mono); white-space: nowrap; }
.image-viewer-caption { color: var(--secondary); font-size: .875rem; text-align: center; }
.image-viewer-stage { display: flex; align-items: center; justify-content: center; min-height: 0; overflow: auto; padding: .75rem; }
.image-viewer-image { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }
.image-viewer.is-zoomed .image-viewer-stage { display: block; }
.image-viewer.is-zoomed .image-viewer-image { max-width: none; max-height: none; }
.next-project {
  display: grid;
  gap: .22rem;
  margin-top: 1.5rem;
  padding-top: .72rem;
  border-top: 1px solid var(--line);
}
.footer {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  grid-column: 1/-1;
  justify-content: space-between;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
  color: var(--secondary);
  font: 400 .875rem/1.4 var(--mono);
}

@media (max-width: 760px) {
  .masthead { grid-template-columns: minmax(0, 1fr) auto; }
  .professional-title { grid-column: 1/-1; grid-row: 2; }
  .language-nav { grid-column: 2; grid-row: 1; }
}
@media (max-width: 680px) {
  .page-grid { grid-template-columns: minmax(0, 1fr); row-gap: 1.2rem; padding-top: .8rem; }
  .section-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; border-bottom: 1px solid var(--line); }
  .section-nav a { padding: .58rem 0; }
  .section-nav a:last-child { border-bottom: 0; }
  .project-grid-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-grid-four li:nth-child(n) { grid-column: auto; }
}
@media (max-width: 420px) {
  .project-grid-single { grid-template-columns: minmax(0, 1fr); }
  .process-gallery summary { flex-wrap: wrap; }
  .process-gallery summary > span:first-child { flex: 1 1 12rem; }
  .gallery-count { margin-left: 0; }
  .gallery-toggle { margin-left: auto; }
  .image-viewer { width: calc(100vw - 1rem); height: calc(100dvh - 1rem); }
  .image-viewer-toolbar, .image-viewer-footer { padding: .6rem; gap: .5rem; }
  .image-viewer button { padding-inline: .5rem; }
  .image-viewer-footer { flex-wrap: wrap; }
  .image-viewer-caption { order: -1; flex-basis: 100%; }
}
@media (pointer: coarse) {
  .language-nav a { display: grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; }
  .section-nav a { display: flex; align-items: center; min-height: 2.75rem; }
  .language-nav { gap: .15rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .work-section.is-entering { animation: arrive 420ms ease-out; }
  @keyframes arrive {
    from { opacity: .76; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
