/* Lastes direkte fra /layout.css (ikke gjennom Tailwind).
   #site-layout er 800px; Work-media bryter ut til opptil 1500px. */

@property --page-surface {
  syntax: '<color>';
  inherits: true;
  initial-value: #fafafa;
}

:root {
  --site-radius: 8px;
  --text-secondary: #666670;
  --viewport-height: 100dvh;
}

.text-secondary { color: var(--text-secondary); }

/* One inherited surface keeps case intros, image gaps and footers in sync. */
body[data-case-theme="houeland"],
body[data-case-theme="boligmappa"],
body[data-case-theme="nettavisen"],
body[data-case-theme="uber"] {
  transition-duration: 900ms;
  transition-timing-function: cubic-bezier(.4, 0, .2, 1);
}
body[data-case-theme="houeland"], body[data-case-theme="uber"] { --page-surface: #e9e9e9; }
body[data-case-theme="boligmappa"] { --page-surface: #dadada; }
body[data-case-theme="nettavisen"] { --page-surface: #dadada; }
@media (prefers-reduced-motion: reduce) {
  body:not([data-case-theme]), body[data-case-theme] { transition: none; }
}

/* Unngå default body-margin før Tailwind base laster — kan gi «hopp» i bredde/layout. */
body {
  margin: 0;
  --page-surface: #fafafa;
  background-color: var(--page-surface);
  transition: --page-surface 300ms ease-out;
  color: #3f3f46;
  /* Plantin (grunnfonten) settes -4 % tettere, som i Figma. Sans-øyene
     (Maison/Supply) nullstiller eller setter egen sporing selv. */
  letter-spacing: -0.04em;
}

/* Skip-link må ikke avhenge av Tailwind (som lastes async via Vite) — unngår FOUC/blink ved navigasjon. */
.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skip-link:focus,
.skip-link:focus-visible {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 9999;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border-radius: var(--site-radius);
  background-color: #18181b;
  padding: 0.5rem 0.75rem;
  font: inherit;
  line-height: inherit;
  color: #fafafa;
  text-decoration: none;
  outline: 2px solid #fafafa;
  outline-offset: 2px;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

/* Inline-SVG uten width/height får ofte 0×0 med width:auto i flex — fiks eksplisitt størrelse. */
.site-header__brand svg,
.site-header__brand img {
  display: block;
  flex-shrink: 0;
  width: 32px;
  height: 24px;
  max-height: 24px;
  object-fit: contain;
}

/* Klikk på dragen når man allerede er på forsiden: dempet jiggle med avtagende
   utslag (~700ms — rask nok til å føles kvikk, lang nok til å registreres). */
.site-header__brand.is-jiggling :is(svg, img) {
  animation: brand-jiggle 700ms cubic-bezier(0.28, 0.84, 0.42, 1);
  transform-origin: 50% 55%;
}

@keyframes brand-jiggle {
  0% {
    transform: rotate(0deg) scale(1);
  }
  12% {
    transform: rotate(-9deg) scale(1.08);
  }
  28% {
    transform: rotate(7deg) scale(1.05);
  }
  44% {
    transform: rotate(-5deg) scale(1.02);
  }
  60% {
    transform: rotate(3deg) scale(1.01);
  }
  76% {
    transform: rotate(-1.5deg) scale(1);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header__brand.is-jiggling :is(svg, img) {
    animation: none;
  }
}

/* Flytende header: Work til venstre, logo i midten, meny til høyre.
   Full-bleed ut av 800px-kolonnen; frostet bakgrunn kun når siden er scrollet. */
.site-header {
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background-color: transparent;
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.page-case .site-header.is-scrolled {
  background-color: var(--page-surface);
  transition: box-shadow 180ms ease;
}

.site-header.is-scrolled {
  background-color: rgba(250, 250, 250, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 24px rgba(24, 24, 27, 0.06);
}

/* Kritisk header-layout ligger her også, så headeren er stabil før øvrig CSS/JS er klar. */
.site-header > div {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  /* Chrome ligger i den øverste stripen som blottlegges når sidene skalerer til
     90 % under reisen — logo/meny skal sveve OVER kortene, ikke overlappe dem. */
  min-height: 48px;
  box-sizing: border-box;
  padding: 12px 30px;
}

.site-header__work { justify-self: start; }
.site-header > div > nav:not(.site-header__work) { justify-self: end; }

@media (max-width: 600px) {
  .site-header > div { padding-inline: 16px; gap: 0.5rem; }
  .site-header > div > nav { gap: 0.5rem; }
  .site-header > div > nav a { padding-inline: 0.25rem; }
}

/* Forsiden: headeren tar ikke plass i flyten — tidslinjen sentreres i hele viewporten.
   Logo/lenker hører til oversikten og zoomer ut av bildet sammen med den. */
.page-home .site-header {
  position: fixed;
  top: 0;
  left: 0;
  margin-left: 0;
}

/* ---- Verden: index | About | Praise side om side, kamera panorerer ---- */

/* Clip at both levels: body overflow alone propagates to the viewport and
   mobile browsers can include the entire off-screen world in innerWidth. */
html:has(body.world-mode) { overflow: hidden; }

body.world-mode {
  height: var(--viewport-height);
  min-height: 0;
  overflow: hidden;
}

.world-mode .site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  margin-left: 0;
  z-index: 40;
}

/* 2D-verden: rad 1 = forside | About | Praise, arkivet ligger under forsiden. */
.world {
  display: grid;
  /* Proportional tracks shrink with the overview. WebKit leaves viewport-unit
     grid tracks full-sized under CSS zoom, placing five map cards off-screen. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  width: 300vw;
  height: calc(var(--viewport-height) * 3);
  /* Bakteppet som kommer til syne bak kortene når sidene skalerer ned. */
  background: #e9e6e0;
}

.world-map-camera {
  width: 100vw;
  height: var(--viewport-height);
  transform-origin: 0 0;
  will-change: transform;
}

.world-page[data-path='/timeline/'] {
  grid-column: 1;
  grid-row: 2;
}

.world-page[data-path='/people/'] {
  grid-column: 2;
  grid-row: 2;
}

/* Kjelleren: arkivert arbeid en etasje under arkivet. */
.world-page[data-path='/archived-work/'] {
  grid-column: 1;
  grid-row: 3;
}

/* will-change KUN under reisen: en permanent 300vw-bred compositor-layer koster
   GPU-minne og gjør Safari mer tilbøyelig til å droppe view transitions. */
.world.is-travelling {
  will-change: transform;
}

.world-page {
  flex: none;
  width: 100vw;
  height: var(--viewport-height);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--page-surface);
}

/* Under reisen er sidene kort: avrundede hjørner mens de står nedskalert. */
.world.is-travelling .world-page {
  border-radius: var(--site-radius);
}

/* Hver side beholder 800px-kolonnen sin inne i sin egen viewport-brede seksjon. */
.world-column {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: 100%;
}

.world-column > main {
  position: relative;
  z-index: 2;
  min-width: 0;
}

/* Navigation and skip links focus the main landmark, not a visible control. */
.world-column > main[tabindex='-1']:focus,
.page-case main.case-main[tabindex='-1']:focus {
  outline: none;
}

/* Full-width page surface behind the content column. */
.world-column > main::before {
  position: absolute;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  top: 0;
  bottom: 0;
  z-index: -1;
  background: var(--page-surface);
  clip-path: inset(0 -4rem -4rem -4rem);
  content: '';
  pointer-events: none;
}

.world-page .timeline-main {
  flex: 1;
  min-height: 0;
}

/* Nav-etikettene: PP Supply Mono, versaler — lastes direkte fra /fonts/. */
@font-face {
  font-family: PPSupplyMono;
  src: url('/fonts/PPSupplyMono-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  padding: 0;
  position: relative;
  transform: translateY(2px);
}

.site-header nav a {
  color: #18181b;
  font-family: PPSupplyMono, ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 400;
  padding: 0.375rem 0.625rem;
  position: relative;
  text-decoration: none;
  transition: color 220ms ease;
  transform: translateY(2px);
  z-index: 1;
}

.site-header nav a:hover {
  color: #18181b;
}

.site-header nav a:active {
  transform: translateY(3px);
}

/* Active navigation changes text color without an underline. */
.site-header nav a[aria-current='page'] {
  color: #c9363e;
}

@supports (position-anchor: --nav-item) {
  .site-header nav a:not([aria-current='page']):focus-visible {
    anchor-name: --nav-item;
  }

  .site-header nav::before {
    position: absolute;
    position-anchor: --nav-item;
    top: anchor(top);
    left: anchor(left);
    width: anchor-size(width);
    height: anchor-size(height);
    border-radius: var(--site-radius);
    background-color: rgba(228, 228, 231, 0.7);
    content: '';
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 160ms ease,
      top 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
      left 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
      width 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
      height 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .site-header nav:has(a:not([aria-current='page']):focus-visible)::before {
    opacity: 1;
  }

  @media (hover: hover) and (pointer: fine) {
    .site-header nav a:not([aria-current='page']):hover {
      anchor-name: --nav-item;
    }

    .site-header nav:has(a:not([aria-current='page']):hover)::before {
      opacity: 1;
    }
  }

  /* Under kamera-reisen: hover-pillen ankres i layoutboksen (som allerede står
     på destinasjonen) og skyter i forveien mens etiketten flyr — skjul den til
     etiketten har landet, så dukker den opp rundt lenken der cursoren står. */
  .site-header.nav-travelling nav::before {
    opacity: 0 !important;
    transition: none;
  }
}

.project-audio {
  position: fixed;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(360px, calc(100vw - 32px));
}

.project-audio__title {
  margin: 0 0 -1px;
  padding: 6px 22px 7px;
  border-radius: var(--site-radius) var(--site-radius) 0 0;
  background: #e0862b;
  color: #18181b;
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Leave room for footer links above the always-visible story controls. */
.page-case:has(> .project-audio) .site-footer {
  padding-bottom: max(7rem, calc(112px + env(safe-area-inset-bottom)));
}

.project-audio__actions {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  border: 1px solid #dedee2;
  border-radius: var(--site-radius);
  background: #f4f4f5;
}

.project-audio--text-only { width: min(180px, calc(100vw - 32px)); }
.project-audio--text-only .project-audio__actions { grid-template-columns: minmax(0, 1fr); }
.project-audio--text-only .project-audio__transcript-trigger { border-radius: var(--site-radius); }

.project-audio__action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 10px;
  border: 0;
  border-radius: var(--site-radius);
  background: transparent;
  color: #18181b;
  font: inherit;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.project-audio__player {
  position: relative;
  border-radius: var(--site-radius) 0 0 var(--site-radius);
}

.project-audio__player::after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  border-right: 1px solid #d4d4d8;
}

.project-audio__transcript-trigger {
  border-radius: 0 var(--site-radius) var(--site-radius) 0;
}

@media (hover: hover) and (pointer: fine) {
  .project-audio__action:hover { background: #e8e8eb; }
}

.project-audio__action:focus-visible {
  outline: 2px solid #18181b;
  outline-offset: 3px;
}

.project-audio__action:active { transform: scale(0.97); }

.project-audio__label {
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0;
}

.project-audio__duration {
  color: var(--text-secondary);
  font-family: PPSupplyMono, ui-monospace, monospace;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.project-audio__toggle,
.project-audio__icon {
  display: block;
  position: relative;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

.project-audio__toggle-icon {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.project-audio__toggle-icon--pause { display: none; }
.project-audio__player.is-playing .project-audio__toggle-icon--play { display: none; }
.project-audio__player.is-playing .project-audio__toggle-icon--pause { display: block; }

.project-audio__status {
  position: absolute;
  bottom: calc(100% + 8px);
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #dedee2;
  border-radius: var(--site-radius);
  background: #fafafa;
  margin: 0;
  color: #52525b;
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.8125rem;
  letter-spacing: normal;
  text-align: center;
}
.project-audio__status:empty { display: none; }
.project-audio__player:disabled { cursor: wait; }

.project-transcript-modal {
  background: #fafafa;
  border: 1px solid rgba(212, 212, 216, 0.95);
  border-radius: var(--site-radius);
  box-shadow: 0 24px 80px rgba(24, 24, 27, 0.22);
  color: #3f3f46;
  margin: auto;
  max-height: min(78svh, 760px);
  max-width: min(720px, calc(100vw - 2rem));
  overflow: auto;
  padding: 2rem;
}

.project-transcript-modal::backdrop {
  background: rgba(24, 24, 27, 0.35);
  transition: background-color 220ms cubic-bezier(0.32, 0.08, 0.24, 1);
}

@starting-style {
  .project-transcript-modal[open]::backdrop { background: transparent; }
}

.project-transcript-modal.is-closing::backdrop {
  background: transparent;
  transition-duration: 160ms;
}

.project-transcript-modal.is-instant::backdrop { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .project-transcript-modal::backdrop { transition: none; }
}

.project-transcript-modal__close {
  align-items: center;
  background: #18181b;
  border: 0;
  border-radius: var(--site-radius);
  cursor: pointer;
  display: grid;
  height: 2.25rem;
  justify-content: center;
  margin-left: auto;
  padding: 0;
  place-items: center;
  position: sticky;
  top: 0;
  width: 2.25rem;
  z-index: 1;
}

.project-transcript-modal__close-icon {
  display: block;
  filter: invert(1);
  height: 1.25rem;
  width: 1.25rem;
}

.project-transcript-modal__content {
  width: 70%;
  margin-inline: auto;
}

.project-transcript-modal__heading {
  margin: 1.5rem 0;
}

.project-transcript-modal__heading img {
  display: block;
  width: 225px;
  max-width: none;
  height: auto;
  margin-left: -28px;
}

.project-transcript-modal__body {
  display: grid;
  gap: 1rem;
  line-height: 1.65;
  text-align: left;
}

.project-transcript-modal__body p {
  margin: 0;
}

@media (max-width: 767px) {
  .project-transcript-modal {
    padding: 1.25rem;
  }
}

#site-layout {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  min-height: 100svh;
}

.content-page {
  width: 100%;
  max-width: 526.4px;
  margin-inline: auto;
}

@media screen {
  .content-page--top-space { margin-top: 250px; }
  .content-page--about { margin-top: 80px; }
}

@media (max-width: 767px) {
  .content-page--top-space { --content-top-gap: 50px; }
  .content-page--top-space:not(.content-page--about) { margin-top: 150px; }
  .content-page--spacious { padding-top: var(--content-top-gap, 150px); }
  /* Account for the fixed 56px mobile header in the world layout. */
  .world-column > .content-page--spacious { padding-top: calc(56px + var(--content-top-gap, 150px)); }
  .content-page--spacious > header > div:first-child { margin-top: 0; }
}

.about-portrait {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  margin-bottom: 2rem;
}

.people-thanks { white-space: nowrap; }

.praise-invitation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  padding-block: 2rem;
  border-bottom: 1px solid #e4e4e7;
  color: #52525b;
  text-decoration: none;
  transition: color 180ms ease;
}
.praise-invitation__copy { display: block; }
.praise-invitation__chevron {
  flex-shrink: 0;
  color: #18181b;
  transition: transform 180ms ease;
}
.praise-invitation:focus-visible {
  outline: 2px solid #c9363e;
  outline-offset: 6px;
}
@media (hover: hover) and (pointer: fine) {
  .praise-invitation:hover { color: #18181b; }
  .praise-invitation:hover .praise-invitation__chevron { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .praise-invitation__chevron { transition: none; }
}

/* Tekst, titler, bildetekster, seksjonsskille — 800px (header/intro/footer + #work). */
#site-layout:has(#work) .work-narrow {
  box-sizing: border-box;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* Portfolio-media (grid, enkeltbilder, video) — bredere enn brødtekst. */
#work .work-media {
  box-sizing: border-box;
  width: min(1500px, calc(100vw - 3rem));
  max-width: none;
  margin-left: 50%;
  margin-right: 0;
  transform: translateX(-50%);
}

/* Ekstra luft etter siste bilde/video før neste seksjon (MICROMILSPEC → Off Market → Selected work). */
#work section:not(:last-child) .work-media {
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
}

#site-layout > header,
#site-layout > main,
#site-layout > footer {
  min-width: 0;
}

#site-layout > main {
  position: relative;
  z-index: 2;
}

#site-layout > main::before {
  position: absolute;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  top: 0;
  bottom: 0;
  z-index: -1;
  background: var(--page-surface);
  clip-path: inset(0 -4rem -4rem -4rem);
  content: '';
  pointer-events: none;
}

.site-footer {
  box-sizing: border-box;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: 0;
  padding: clamp(4rem, 8vw, 7rem) 1.5rem clamp(4rem, 9vw, 7rem);
  position: relative;
  z-index: 0;
  background: var(--page-surface);
  color: #3f3f46;
}

.site-footer__inner {
  width: min(800px, 100%);
  margin: 0 auto;
  text-align: center;
}

.site-footer__story,
.page-state__story {
  max-width: 34rem;
  margin: 2rem auto 0;
  color: #d4d4d8;
  font-family: DragePlantin, Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.55;
  text-wrap: pretty;
}

/* Hver av de tre lenkene er sin egen pille-knapp: avrundet omriss, ingen fyll. */
.site-footer__contact {
  --pill-color: #52525b;
  --pill-border: #b4b4ba;
  --pill-hover-color: #18181b;
  --pill-hover-border: #52525b;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin: 2rem 0 0;
  color: #52525b;
}

.site-footer__contact,
.page-state__action {
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  /* Én felles lenkestørrelse i footeren — samme som Archive/People-hjørnene. */
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.site-footer__contact a,
.page-state__action {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  color: var(--pill-color);
  text-decoration: none;
  border: 1px solid var(--pill-border);
  border-radius: var(--site-radius);
  transition:
    color 160ms ease,
    border-color 160ms ease;
}

.site-footer__contact a:focus-visible,
.page-state__action:focus-visible {
  color: var(--pill-hover-color);
  border-color: var(--pill-hover-border);
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

@media (max-width: 767px) {
  .site-footer,
  .page-case:has(> .project-audio) .site-footer {
    padding-bottom: calc(160px + env(safe-area-inset-bottom));
  }

  .site-footer__contact {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .site-footer__contact a {
    box-sizing: border-box;
    width: min(224px, 100%);
  }
}

@media (hover: hover) and (pointer: fine) {
  .site-footer__contact a:hover,
  .page-state__action:hover {
    color: var(--pill-hover-color);
    border-color: var(--pill-hover-border);
  }
}

/* Media dimensions reserve each image's real responsive height; lazy loading
   defers its bytes without substituting a generic 500px layout placeholder. */

.case-comparison {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.case-comparison__image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.case-comparison__before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 50% 0 0);
}

.case-comparison__label {
  position: absolute;
  top: clamp(12px, 2vw, 24px);
  padding: 6px 9px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  background: rgba(250, 250, 250, 0.94);
  color: #18181b;
  font: 10px MaisonNeueBook, 'Helvetica Neue', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.case-comparison__label--before { left: clamp(12px, 2vw, 24px); }
.case-comparison__label--after { right: clamp(12px, 2vw, 24px); }

.case-comparison__slider {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: pan-y;
}

.case-comparison__divider {
  position: absolute;
  inset: 0;
  transform: translateX(50%);
  pointer-events: none;
}

.case-comparison__divider::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 -1px;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.case-comparison__handle {
  position: absolute;
  top: 50%;
  left: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: #18181b;
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.case-comparison__slider:focus-visible ~ .case-comparison__divider .case-comparison__handle {
  outline: 3px solid #18181b;
  outline-offset: 4px;
}

.case-comparison__caption {
  margin: 10px 0 0;
  color: #52525b;
  text-align: center;
  font: 11px MaisonNeueBook, 'Helvetica Neue', sans-serif;
}

.portfolio-asset {
  border-radius: var(--site-radius);
  overflow: hidden;
  background-color: #f4f4f5;
}

/* Shared breathing room between case media rows and columns. */
.case-media-stack,
.case-media-grid {
  gap: clamp(24px, 3.34vw, 48px);
}

.case-story {
  padding-block: clamp(1.5rem, 4vw, 3.5rem);
  font-size: clamp(18.2px, 2.1vw, 28px);
  line-height: 1.35;
  text-align: left;
  color: #18181b;
}

.case-story p { margin: 0; }

.case-gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  row-gap: clamp(32px, 3.34vw, 48px);
  column-gap: clamp(36px, 6vw, 84px);
  align-items: start;
}

.case-gallery__item {
  min-width: 0;
  text-align: left;
  cursor: zoom-in;
}

.case-gallery__item > img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--site-radius);
  box-shadow: 0 0 0 1px #18181b0d;
}

.case-gallery__item > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

.case-gallery__item:focus-visible { outline: 2px solid #18181b; outline-offset: 6px; }
.case-gallery__item:active { transform: scale(0.99); }

.case-image-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fafafa;
  color: #18181b;
  overflow: hidden;
}

.case-image-viewer[open] { display: flex; flex-direction: column; }
.case-image-viewer::backdrop { background: #fafafa; }

.case-image-viewer__toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid #e4e4e7;
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
}

.case-image-viewer__toolbar p { flex: 1; text-align: center; margin: 0; }
.case-image-viewer__toolbar button { width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 22px; }
.case-image-viewer__toolbar button:focus-visible { outline: 2px solid #18181b; outline-offset: -2px; }
.case-image-viewer__toolbar button:active { transform: scale(0.97); }
@media (hover: hover) {
  .case-image-viewer__toolbar button:hover { background: #e4e4e7; }
}

.case-image-viewer__scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 24px; }
.case-image-viewer__scroll > img { display: block; width: 100%; max-width: 1260px; height: auto; margin-inline: auto; }

@media (max-width: 767px) {
  .case-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .case-image-viewer__scroll { padding: 12px; }
}

.case-tabs {
  --tabs-dur: 250ms;
  --tabs-ease: cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
  margin-inline: auto;
}

.case-tabs__scroll {
  position: relative;
  overflow-x: auto;
  padding: 6px;
  margin-bottom: 14px;
  scrollbar-width: thin;
}

.case-tabs--framed {
  padding: clamp(20px, 4vw, 64px);
  background: #eeece6;
  border-radius: var(--site-radius);
}
.case-tabs__intro {
  max-width: 760px;
  margin: 0 auto 24px;
  text-align: center;
}
.case-tabs__heading,
.case-tabs__description {
  margin: 0;
  font-family: DragePlantin, Georgia, serif;
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: #18181b;
}
.case-tabs__description {
  margin-top: 4px;
  color: #71717a;
}
.case-tabs--framed .case-tabs__scroll { margin-bottom: 24px; }
.case-tabs--framed .t-tabs { background: rgba(255, 255, 255, .55); }

.t-tabs {
  position: relative;
  display: flex;
  width: max-content;
  align-items: center;
  gap: 3px;
  padding: 3px;
  margin-inline: auto;
  border-radius: var(--site-radius);
  background: #f1f1f1;
}

.t-tab {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  height: 30px;
  padding: 4px 12px;
  color: rgba(15, 15, 15, 0.8);
  font-family: PPSupplyMono, ui-monospace, monospace;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  border-radius: var(--site-radius);
  z-index: 1;
  transition: color var(--tabs-dur) var(--tabs-ease);
}

.t-tab[aria-selected="true"] { color: #0f0f0f; }
.case-tabs .t-tab { text-transform: uppercase; }
@media (hover: hover) and (pointer: fine) {
  .t-tab:hover { color: #0f0f0f; }
}

.t-tab:focus-visible,
.case-tabs [role="tabpanel"]:focus-visible {
  outline: 2px solid #0f0f0f;
  outline-offset: 3px;
}

.t-tabs-pill {
  position: absolute;
  top: 3px;
  left: 0;
  height: 30px;
  width: 0;
  background: #fff;
  border-radius: var(--site-radius);
  transform: translateX(0);
  transition: transform var(--tabs-dur) var(--tabs-ease), width var(--tabs-dur) var(--tabs-ease);
  pointer-events: none;
  z-index: 0;
}

@media (prefers-reduced-motion: reduce) {
  .t-tabs-pill, .t-tab { transition: none !important; }
}

.finn-logo-morph {
  --tabs-dur: 250ms;
  --tabs-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--site-radius);
  background: #4195f7;
}
.finn-logo-morph [role="tabpanel"],
.finn-logo-morph__art { width: 100%; height: 100%; }
.finn-logo-morph__art { display: block; }
.finn-logo-morph__controls {
  position: absolute;
  bottom: 12%;
  inset-inline: 0;
  display: flex;
  justify-content: center;
}
.finn-logo-morph .t-tabs { background: rgba(255, 255, 255, .35); }
.finn-logo-morph .t-tab { text-transform: uppercase; }
.finn-logo-morph .t-tab:active { transform: scale(.97); }
@media (max-width: 600px) {
  .finn-logo-morph__controls { bottom: 8%; }
  .finn-logo-morph .t-tabs { gap: 0; }
  .finn-logo-morph .t-tab { padding-inline: 8px; font-size: 10px; }
}

/* Covers fit the viewport; case content keeps one width and its natural height. */
#work .case-cover-hero.work-media > .portfolio-item .portfolio-asset {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

#work .case-cover-hero.work-media > .portfolio-item .portfolio-asset img,
#work .case-cover-hero.work-media > .portfolio-item .portfolio-asset video {
  max-height: 90svh;
  width: auto;
  max-width: 100%;
}

.portfolio-asset img,
.portfolio-asset video {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

@media print {
  #site-layout {
    max-width: none;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ---- Horisontal tidslinje (forsiden) ---- */

/* Forsiden scroller kun horisontalt — vertikal scroll er skrudd av. */
.page-home {
  height: var(--viewport-height);
  overflow: hidden;
}

.page-home #site-layout {
  height: 100%;
  min-height: 0;
}

.timeline-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Full-bleed scroller: bryter ut av 800px-kolonnen til hele viewport-bredden. */
.timeline-scroller {
  --intro-width: min(320px, 62vw);
  --intro-edge-gap: 84px;
  position: relative; /* ankerpunkt for .timeline-intro (absolutt i innholdet) */
  flex: 1;
  min-height: 0;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  /* Wrap-hoppene (± kopibredde) må være instant — smooth ville animert over hele loopen. */
  scroll-behavior: auto;
  overscroll-behavior-x: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.timeline-scroller::-webkit-scrollbar {
  display: none;
}

.timeline-scroller:focus-visible {
  outline: 2px solid #18181b;
  outline-offset: -2px;
  border-radius: var(--site-radius);
}

/* Intro-tekst til venstre for første prosjekt — kun første gjennomgang
   (fjernes av JS når man har passert den). Scroller med innholdet. */
@font-face {
  font-family: MaisonNeueBook;
  src: url('/fonts/MaisonNeueBook.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Gjenbrukbare fontklasser (brukes bl.a. på praise-attribusjoner). */
.font-maison {
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
}

.font-supply {
  font-family: PPSupplyMono, ui-monospace, 'SF Mono', Menlo, monospace;
}

/* Nullstiller Plantin-sporingen (-4 % på body) for sans-øyene — i et lag med
   LAVERE prioritet enn Tailwinds utilities, så tracking-widest o.l. fortsatt
   vinner. (Ulagdelt hadde denne slått utility-klassene.) */
@layer components {
  .font-maison,
  .font-supply {
    letter-spacing: normal;
  }
}

.timeline-intro {
  letter-spacing: -0.04em;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--intro-width);
  margin: 0;
  color: #3f3f46;
  font-family: DragePlantin, Georgia, 'Times New Roman', serif;
  font-size: 24px;
  line-height: 29px;
  text-wrap: pretty;
}

.timeline-intro__paragraph { display: block; }
.timeline-intro__paragraph + .timeline-intro__paragraph { margin-top: 29px; }

.timeline-intro__chevrons {
  display: inline-flex;
  gap: 3px;
  margin-left: 4px;
  white-space: nowrap;
  letter-spacing: 0;
}
.timeline-intro__chevrons > span { opacity: 0.5; }
@media (prefers-reduced-motion: no-preference) {
  .timeline-intro__chevrons > span {
    animation: intro-chevron-pulse 2.4s cubic-bezier(0.65, 0, 0.35, 1) infinite;
    animation-delay: calc(1.2s + var(--chevron) * 120ms);
  }
}
@keyframes intro-chevron-pulse {
  0%, 45%, 100% { opacity: 0.5; transform: translateX(0); }
  22% { opacity: 1; transform: translateX(2px); }
}

/* ── Entré-koreografi (kun frisk last av forsiden; JS setter .is-entering-home) ──
   Fase 1: introteksten linje for linje (90ms mellom linjene).
   Fase 2: tilene i stigende rekkefølge fra ~480ms.
   Fase 3: chromen — logo, nav, hjørnelenker — fra ~1s.
   Alt med `both`-fill: elementene står usynlige til sin tur kommer. */
@keyframes entrance-rise {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes entrance-fade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Ord-spans (JS grupperer dem per rendret linje via --line). inline-block
   alltid — transform virker ikke på rene inline-bokser. */
.timeline-intro__word {
  display: inline-block;
}

.is-entering-home .timeline-intro__word {
  animation: entrance-rise 0.5s ease both;
  animation-delay: calc(var(--line, 0) * 90ms);
}

/* Tilene: animasjonen ligger på BILDET, ikke tilen — elastikk-scrollen skriver
   transform på tilene per frame (samme regel som hover-skaleringen). */
.is-entering-home .timeline-tile__image {
  animation: entrance-rise 0.55s ease both;
  animation-delay: 840ms;
}

.is-entering-home .timeline-copy .timeline-tile:nth-child(1) .timeline-tile__image {
  animation-delay: 480ms;
}

.is-entering-home .timeline-copy .timeline-tile:nth-child(2) .timeline-tile__image {
  animation-delay: 570ms;
}

.is-entering-home .timeline-copy .timeline-tile:nth-child(3) .timeline-tile__image {
  animation-delay: 660ms;
}

.is-entering-home .timeline-copy .timeline-tile:nth-child(4) .timeline-tile__image {
  animation-delay: 750ms;
}

/* Hover-etikettene ligger BAK bildet og skinner gjennom mens det fader inn —
   hold dem usynlige til entréen er over. */
.is-entering-home .timeline-tile__hover-label {
  opacity: 0;
}

.is-entering-home [data-copy="1"] .timeline-tile:first-child .timeline-tile__hover-label {
  animation: entrance-fade 0.4s ease both;
  animation-delay: 900ms;
}

/* Chromen sist — kun opacity (nav-en har en statisk translateY(2px) som en
   transform-animasjon ville overskrevet). */
.is-entering-home .site-header__brand {
  animation: entrance-fade 0.5s ease both;
  animation-delay: 980ms;
}

.is-entering-home .site-header nav {
  animation: entrance-fade 0.5s ease both;
  animation-delay: 1060ms;
}

.is-entering-home .corner-links {
  animation: entrance-fade 0.5s ease both;
  animation-delay: 1140ms;
}

/* Hver kopi bærer sømgapet som padding-right: et markert større mellomrom mellom
   siste og første tile, så det er tydelig at man har nådd slutten og loopen starter på nytt. */
.timeline-copy {
  flex: none;
  display: flex;
  align-items: center;
  gap: calc(clamp(2.5rem, 5.5vw, 5.5rem) + 100px);
  /* Text width, entrance inset and a seam cushion keep the preceding enlarged
     thumbnail clear of the intro at narrow widths too. */
  padding-right: max(clamp(240px, 45vw, 600px), calc(var(--intro-width) + 160px));
}

.timeline-tile {
  flex: none;
}

.timeline-tile {
  position: relative;
  display: block;
  scale: var(--tile-magnification, 1);
  height: var(--tile-h, 38svh);
  aspect-ratio: var(--tile-ratio, 1);
  border-radius: var(--site-radius);
  background: var(--tile-bg, #e4e4e7);
  overflow: hidden;
}

.timeline-tile__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 600px) {
  .timeline-scroller {
    --intro-width: min(260px, 55vw);
    --intro-edge-gap: 54px;
  }
  .timeline-copy { gap: 64px; }
  .timeline-tile {
    /* Include the full 20% centre enlargement in the available phone width. */
    height: min(50svh, calc((100vw - 48px) / .9));
    aspect-ratio: 3 / 4;
  }
  /* Give the wide FINN mark breathing room instead of cropping its lettering. */
  [data-tile-id='finn'] .timeline-tile__image {
    object-fit: contain;
    background: rgb(8, 191, 254);
  }
}

/* Bildet er tilen — ingen bakgrunnsflate bak (unngår svart rektangel i snapshots).
   overflow: visible + radius på selve bildet, så hover-etiketten kan skyves UT
   under bildekanten. Bildet ligger på z 1 og dekker etiketten i hvileposisjon. */
.timeline-tile--image {
  background: none;
  overflow: visible;
}

.timeline-tile--image .timeline-tile__image {
  border-radius: inherit;
  z-index: 1;
  /* Scroll magnification belongs to the tile; focus must not resize the image. */
}

/* Preserve the image's current transform while the destination loads. */
a.timeline-tile.is-navigating .timeline-tile__image {
  transition: none;
  transform: var(--project-click-transform, none);
}

@media (prefers-reduced-motion: reduce) {
  .timeline-tile--image .timeline-tile__image {
    transition: none;
  }
}

/* Project names emerge with centre magnification, then continue down and fade. */
.timeline-tile__hover-label {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 0;
  padding-top: 24px;
  color: #52525b;
  font-family: PPSupplyMono, ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(var(--tile-label-travel, -1) * (100% + 24px)));
  opacity: var(--tile-label-opacity, 0);
  transition: none;
}

a.timeline-tile:focus-visible:not(.is-pointer-return) .timeline-tile__hover-label {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* Ved klikk: etiketten skal ikke inn i morph-snapshotet. */
a.timeline-tile.is-navigating .timeline-tile__hover-label {
  transition: none;
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .timeline-tile__hover-label {
    transition: none;
  }
}

.timeline-tile__title {
  z-index: 1;
}

/* NB: ingen transition/hover-transform på tilene — elastisk scroll skriver
   transform per frame (rAF), og en alltid-på transition ville retargetet
   hvert frame og flimret i WebKit. Hover-løftet er derfor fjernet. */
a.timeline-tile:focus-visible:not(.is-pointer-return):not(.is-returning) {
  outline: 2px solid #18181b;
  outline-offset: 4px;
}

a.timeline-tile.is-pointer-return:focus,
a.timeline-tile.is-returning:focus { outline: none; }

.timeline-tile__title {
  position: absolute;
  left: 1.1rem;
  bottom: 1rem;
  color: #fafafa;
  font-family: DrageEurostile, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Project pages use only the close control; overview navigation stays hidden. */
.page-case .site-header {
  display: none;
}

/* An opaque surface keeps the close control legible over any case image. */
.case-close {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--page-surface);
  cursor: pointer;
  transition: transform 160ms ease;
}

.case-close:active {
  transform: scale(0.96);
}

.case-close:focus-visible {
  outline: 2px solid #18181b;
  outline-offset: 2px;
}

.case-close img {
  display: block;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .case-close {
    transition: none;
  }
}

/* Hjørnelenkene bruker samme aktive tekstfarge og hover-flate som toppmenyen. */
/* Hjørnelenkene: fullskjerms fixed lag med absolutte barn — Archive nede til
   venstre, People nede til høyre. (Laget, ikke lenkene, er fixed: entré-fade
   på containeren ville ellers gjort den til containing block for fixed barn.) */
.corner-links {
  position: fixed;
  inset: 0 0 auto;
  height: var(--viewport-height);
  z-index: 60;
  pointer-events: none;
}

.corner-links a {
  position: absolute;
  bottom: 30px;
  pointer-events: auto;
}

.corner-links a[href='/timeline/'] {
  left: 30px;
}

.corner-links a[href='/people/'] {
  right: 30px;
}

.corner-links a {
  isolation: isolate;
  color: #18181b;
  font-family: PPSupplyMono, ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 220ms ease;
}

.corner-links a:hover {
  color: #18181b;
}

.corner-links a::before {
  content: '';
  position: absolute;
  inset: -0.375rem -0.625rem;
  z-index: -1;
  border-radius: var(--site-radius);
  background-color: rgba(228, 228, 231, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.corner-links a:not([aria-current='page']):focus-visible::before { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .corner-links a:not([aria-current='page']):hover::before { opacity: 1; }
}

.corner-links a[aria-current='page'] { color: #c9363e; }

@media (max-width: 767px) {
  .corner-links::before {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 104px;
    background: linear-gradient(to bottom, transparent, var(--page-surface));
    pointer-events: none;
  }

  .corner-links a { z-index: 1; }
}

/* Arkivlista: år | prosjekt | type. Nytt år får ekstra luft over —
   det binder gruppen til året sitt. */
.archive-list {
  margin: 0;
  padding: 2.5rem 0 0;
  list-style: none;
}

.archive-list li {
  position: relative;
  display: grid;
  grid-template-columns: 4.5rem 1fr 1fr;
  gap: 0 1.5rem;
  padding: 0.55rem 0;
}

/* Hairline mellom radene — indentert forbi venstre-gutteren, som hos credits. */
.archive-list li::after {
  content: '';
  position: absolute;
  left: 6rem;
  right: 0;
  bottom: 0;
  border-bottom: 1px solid #ececee;
}

.archive-list li:last-child::after {
  display: none;
}

.archive-list--press li::after {
  left: 9.5rem;
}

/* Keep inactive rows readable; the hovered or focused row keeps its hierarchy. */
.archive-list li > span {
  transition: color 140ms ease;
}

@media (hover: hover) {
  .archive-list:hover li:not(:hover):not(:focus-within) > span {
    color: var(--text-secondary);
  }
}

.archive-list li.is-year-start:not(:first-child) {
  margin-top: 1.75rem;
}

/* Press-lista: bredere venstre kolonne (gruppenavn i stedet for årstall). */
.archive-list--press li {
  grid-template-columns: 8rem 1fr 1fr;
}

.archive-name a {
  color: inherit;
  text-decoration: none;
}

/* Venstre kolonne (årstall/gruppe) i Maison — meta-stemmen ved siden av serif-navnene. */
.archive-year {
  color: var(--text-secondary);
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.875rem;
  letter-spacing: normal;
}

.archive-name {
  color: #18181b;
}

.archive-type {
  color: var(--text-secondary);
}

/* Names can use the affiliation column when there is no affiliation. */
.archive-list--people li:has(> .archive-type:empty) > .archive-name {
  grid-column: 2 / -1;
}
.archive-list--people .archive-type:empty { display: none; }

/* People-lista: gjennomstreket = møtt. */
.archive-name.is-met {
  color: var(--text-secondary);
  text-decoration: line-through;
  text-decoration-color: var(--text-secondary);
}

@media (max-width: 640px) {
  .archive-list li {
    grid-template-columns: 3.25rem 1fr;
  }

  .archive-list li::after,
  .archive-list--press li::after {
    left: 0;
  }

  .archive-type {
    grid-column: 2;
    margin-top: -0.15rem;
    font-size: 0.875rem;
  }
}

/* Timeline sections share one compact Maison table. */
.timeline-meta-section {
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
}
.timeline-meta-section + .timeline-meta-section { margin-top: 8rem; }
.timeline-meta-section > h2 {
  padding-bottom: .5rem;
  border-bottom: 1px solid #e4e4e7;
}
.timeline-meta-section .archive-list { padding-top: .75rem; }
.timeline-meta-section .archive-list li {
  grid-template-columns: 8rem minmax(0, 1fr) fit-content(40%);
  padding: .5rem 0;
  line-height: 1.5;
}
.timeline-meta-section .archive-list li::after { left: 9.5rem; }
.timeline-meta-section .archive-list li.is-year-start:not(:first-child) { margin-top: .75rem; }
.timeline-meta-section .archive-list--speaking li.is-year-start:not(:first-child) { margin-top: 0; }
.timeline-meta-section .archive-list li > span {
  min-width: 0;
  font-family: inherit;
  font-size: 1rem;
}
.timeline-meta-section .archive-type { text-align: right; }
@media (max-width: 640px) {
  .timeline-meta-section .archive-list li {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: .25rem 1rem;
  }
  .timeline-meta-section .archive-list li::after { left: 0; }
  .timeline-meta-section .archive-year { grid-column: 1 / -1; }
  .timeline-meta-section .archive-year:empty { display: none; }
  .timeline-meta-section .archive-type { grid-column: 2; margin-top: 0; }
}

/* Frame statistics live inside the animation inspector. */
.fps-meter {
  margin-top: 10px;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 400;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.fps-meter.is-dropping {
  color: #e5484d;
}

/* Animation inspector: S shows or hides the panel and frame statistics. */
/* A site-wide preview override; restoring the setting restores each component's radius. */
html[data-rounded-corners="false"],
html[data-rounded-corners="false"] *,
html[data-rounded-corners="false"] *::before,
html[data-rounded-corners="false"] *::after {
  border-radius: 0 !important;
}

.debug-panel {
  position: fixed;
  bottom: 56px;
  left: 30px;
  z-index: 100;
  padding: 14px 16px;
  border: 1px solid rgba(228, 228, 231, 0.9);
  border-radius: var(--site-radius);
  background: rgba(250, 250, 250, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #3f3f46;
  max-width: calc(100vw - 60px);
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.debug-panel__title {
  margin: 0 0 10px;
  color: #18181b;
  font-weight: 700;
}

.debug-panel__row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.debug-panel__row input {
  accent-color: #18181b;
}

.debug-panel__row + .debug-panel__row { margin-top: 8px; }

.debug-panel__hint {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0;
}

/* Case layout iteration: copy to the left of the cover, stacked on phones. */
.case-lead {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 6vw, 7rem);
  align-items: center;
  padding-top: 2rem;
}

/* Keep the notes player's fixed dock relative to the viewport. */
#work .work-media.case-lead {
  margin-left: calc((100% - min(1500px, calc(100vw - 3rem))) / 2);
  transform: none;
}

.case-lead__copy {
  min-width: 0;
  text-align: left;
  color: #18181b;
}

.case-lead__title {
  margin: 0 0 1.25rem;
  font-family: DragePlantin, Georgia, serif;
  font-size: clamp(1.75rem, 2.5vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 1.15;
  text-transform: none;
}

.case-lead__intro {
  margin: 0;
  text-wrap: pretty;
}

.case-lead__intro {
  font-size: 17px;
  line-height: 1.625;
  color: var(--color-zinc-600, #52525b);
}

.case-lead .case-cover-hero {
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  justify-self: center;
}

.case-lead .case-cover-hero img {
  width: auto;
  max-width: 100%;
  max-height: 82svh;
  height: auto;
}

@media (max-width: 767px) {
  .case-lead {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding-top: 1.5rem;
  }

  .case-lead .case-cover-hero img { max-height: 75svh; }
}

/* Credits på case-sider — à la Writing-lista på benji.org: grå etikett øverst,
   rolle i venstre gutter, navn som hovedtekst, hairlines mellom radene som
   starter ETTER gutteren. Hover dimmer alle rader unntatt den man står på. */
.case-credits {
  position: relative;
  container-type: inline-size;
  --credit-role-width: clamp(5.5rem, 20vw, 7.5rem);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  margin: 2rem auto 0;
  text-align: left;
}

.case-lead .case-credits { margin-inline: 0; }

.case-credits dl {
  margin: 0;
}

.case-credits__label {
  margin: 0;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #ececee;
  color: var(--text-secondary);
  font-family: PPSupplyMono, ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.case-credits__row {
  position: relative;
  display: grid;
  grid-template-columns: var(--credit-role-width) minmax(0, 1fr);
  gap: 0 1rem;
  align-items: baseline;
  padding: 0.45rem 0;
}

/* Hairline mellom radene — indentert forbi rolle-gutteren, som hos Benji. */
.case-credits__row::after {
  content: '';
  position: absolute;
  left: calc(var(--credit-role-width) + 1rem);
  right: 0;
  bottom: 0;
  border-bottom: 1px solid #ececee;
}

.case-credits__row:last-child::after {
  display: none;
}

.case-credits__role {
  color: var(--text-secondary);
  font-family: PPSupplyMono, ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.625rem;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 140ms ease;
}

.case-credits__names {
  margin: 0;
  color: #18181b;
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.4;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  transition: color 140ms ease;
}

/* Mute other rows with a readable color instead of lowering text opacity. */
@media (hover: hover) {
  .case-credits[data-layout="original"]:hover .case-credits__row:not(:hover):not(:focus-within) > * {
    color: var(--text-secondary);
  }
}

.case-credits[data-layout="columns"] { max-width: none; }

.case-credits[data-layout="columns"] .case-credits__label {
  padding-bottom: 1.25rem;
  border: 0;
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
}

.case-credits[data-layout="columns"] dl {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  grid-template-rows: repeat(var(--credits-rows), auto);
  gap: 1rem 1.25rem;
}

.case-credits[data-layout="columns"] .case-credits__row {
  display: block;
  padding: 0;
}

.case-credits[data-layout="columns"] .case-credits__row::after {
  display: none;
}

/* A continuous, quiet divider between columns, including the row gap. */
.case-credits[data-layout="columns"] .case-credits__row::before {
  content: '';
  position: absolute;
  left: -0.625rem;
  top: 0;
  bottom: -1rem;
  border-left: 1px solid #e4e4e7;
}

.case-credits[data-layout="columns"] dl { overflow: hidden; }

.case-credits[data-layout="columns"] .case-credits__role,
.case-credits[data-layout="columns"] .case-credits__names {
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}

.case-credits[data-layout="columns"] .case-credits__names { font-weight: 700; }

@container (max-width: 430px) {
  .case-credits[data-layout="columns"] dl {
    grid-template-rows: repeat(var(--credits-mobile-rows), auto);
  }
}

@container (max-width: 280px) {
  .case-credits[data-layout="columns"] dl {
    grid-auto-flow: row;
    grid-template-rows: none;
  }
}

.case-legacy-lead { display: contents; }

/* Third case variant: cover first, followed by description and a credit sidebar. */
#work :is(.case-lead, .case-legacy-lead)[data-layout="below"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 3.5vw, 3.5rem);
  margin-left: calc((100% - min(1500px, calc(100vw - 3rem))) / 2);
  padding-top: 2rem;
  transform: none;
}

#work [data-layout="below"] > .case-cover-hero {
  width: 100%;
  max-width: none;
  margin: 0;
  transform: none;
}

#work [data-layout="below"] > .case-cover-hero .portfolio-asset {
  width: 100%;
  border-radius: var(--site-radius);
  overflow: hidden;
}

#work [data-layout="below"] > .case-cover-hero .portfolio-asset :is(img, video) {
  width: 100%;
  max-height: none;
}

#work [data-layout="below"] > :is(.case-lead__copy, .case-legacy-copy) {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.5rem clamp(2rem, 4vw, 4rem);
  width: 100%;
  max-width: none;
  margin: 0 0 clamp(3rem, 7vw, 7rem);
  text-align: left;
}

[data-layout="below"] :is(.case-lead__title, .case-legacy-title) {
  grid-column: 1 / -1;
  margin: 0;
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(1.75rem, 2.4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.04em;
  text-align: left;
  text-transform: none;
}

[data-layout="below"] :is(.case-lead__intro, .case-legacy-intro) {
  margin: 0;
  font-family: DragePlantin, Georgia, serif;
  font-size: clamp(1.625rem, 2.5vw, 2.625rem);
  line-height: 1.35;
  letter-spacing: -0.035em;
  color: #303030;
  text-align: left;
}

.case-credits[data-layout="below"] {
  align-self: stretch;
  max-width: none;
  margin: 0;
  padding: 0.25rem 0 0.25rem clamp(2rem, 4vw, 4rem);
  border-left: 1px solid #e4e4e7;
}

.case-credits[data-layout="below"] .case-credits__label { display: none; }
.case-credits[data-layout="below"] dl {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(var(--credits-mobile-rows), auto);
  align-content: start;
  gap: 1rem 1.5rem;
}
.case-credits[data-layout="below"] .case-credits__row { display: block; padding: 0; }
.case-credits[data-layout="below"] .case-credits__row::after { display: none; }
.case-credits[data-layout="below"] :is(.case-credits__role, .case-credits__names) {
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(0.8125rem, 1vw, 1rem);
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
}
.case-credits[data-layout="below"] .case-credits__names { font-weight: 700; }

#work [data-layout="below"] > :is(.case-lead__copy, .case-legacy-copy):not(:has(.case-credits)) {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 1023px) {
  #work [data-layout="below"] > :is(.case-lead__copy, .case-legacy-copy) {
    grid-template-columns: minmax(0, 1fr);
  }
  .case-credits[data-layout="below"] {
    padding: 1.5rem 0 0;
    border-left: 0;
    border-top: 1px solid #e4e4e7;
  }
}

/* Hero 40% mindre enn full media-bredde, fortsatt sentrert. */
#work .work-media.case-cover-hero {
  width: min(900px, calc((100vw - 3rem) * 0.6));
}

@media (max-width: 767px) {
  #work .work-media.case-cover-hero {
    width: calc(100vw - 4rem);
  }
}

/* ── PROTOTYP: kart-intro (revert: slett denne blokka + playMapIntro i
   world.js + map-intro-grenen i timeline.js) ──────────────────────────────
   Under kartet: chrome og index-innholdet holdes skjult (kortene skal stå
   som tomme skjeletter, entréen spiller etter landing). Kortene har rundere
   hjørner i kart-skala; radiusen glir til reise-radiusen idet zoomen starter. */
/* Bakteppet skal fylle HELE viewporten under kartet — ikke bare stripen bak
   kortene. (Verden dekker skjermen igjen når zoomen lander, så byttet synes ikke.) */
body.world-map-intro {
  background-color: #e9e6e0;
}

body.world-map-intro .site-header,
body.world-map-intro .corner-links {
  opacity: 0;
  pointer-events: none;
}

body.world-map-intro .timeline-intro,
body.world-map-intro .timeline-tile__image,
body.world-map-intro .timeline-tile__hover-label {
  opacity: 0;
}

.world.is-map .world-page {
  border-radius: var(--site-radius);
  animation: map-card-in 0.6s cubic-bezier(0.32, 0.08, 0.24, 1) both;
  animation-delay: 200ms;
}

/* Kortene stiger inn ett og ett når kartet vises. Slutter i scale(0.85) —
   samme verdi som inline-transformen JS setter, så overleveringen er sømløs.
   Verdiene er i verdens-koordinater (skalert 0.25 på skjerm). */
@keyframes map-card-in {
  0% {
    opacity: 0;
    transform: scale(0.78) translateY(90px);
  }
  100% {
    opacity: 1;
    transform: scale(0.85) translateY(0);
  }
}

.world.is-map .world-page:nth-child(2) {
  animation-delay: 280ms;
}

.world.is-map .world-page:nth-child(3) {
  animation-delay: 360ms;
}

.world.is-map .world-page:nth-child(4) {
  animation-delay: 440ms;
}

.world.is-map .world-page:nth-child(5) {
  animation-delay: 520ms;
}

.world.is-map .world-page:nth-child(6) {
  animation-delay: 600ms;
}

body.world-map-intro .world-page {
  /* Keep the clip stable while six viewport-sized cards scale. Animating
     their radius forces Safari to repaint the cards throughout the zoom. */
  border-radius: var(--site-radius);
  scrollbar-width: none;
}
/* Safari can paint each card's native scrollbar during the camera zoom. */
body.world-map-intro .world-page::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
/* Kart-viewet skal ikke avsløre kjellerens innhold: bilder/video/kort vises
   som grå skjelettflater til zoomen har landet. */
body.world-map-intro .archived-grid .archived-grid__item {
  background: #eeeeee;
  border-radius: var(--site-radius);
}

body.world-map-intro .archived-grid img,
body.world-map-intro .archived-grid video {
  opacity: 0;
}

body.world-map-intro .archived-card {
  background: #eeeeee;
  color: transparent;
}
/* ── slutt PROTOTYP ── */

/* ── Design-revisjon (D): overlay-panelet. Dev-verktøy. ── */
#design-audit-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow-y: auto;
  background: rgba(24, 24, 27, 0.55);
  padding: 4vh 0;
}

#design-audit-panel {
  letter-spacing: normal;
}

#design-audit-panel .da-inner {
  width: min(860px, 92vw);
  margin: 0 auto;
  background: #18181b;
  color: #d4d4d8;
  border-radius: var(--site-radius);
  padding: 1.5rem 1.75rem 2rem;
  font-family: PPSupplyMono, ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11px;
  line-height: 1.6;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

#design-audit-panel .da-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #3f3f46;
  letter-spacing: 0.08em;
}

#design-audit-panel .da-section {
  margin: 1.5rem 0 0.5rem;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fafafa;
  border-bottom: 1px solid #3f3f46;
  padding-bottom: 0.35rem;
}

#design-audit-panel .da-family {
  margin: 0.9rem 0 0.2rem;
  font-size: 11px;
  font-weight: 400;
  color: #e8862b;
}

#design-audit-panel .da-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.15rem 0;
}

#design-audit-panel .da-swatch {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: var(--site-radius);
  border: 1px solid #52525b;
  align-self: center;
}

#design-audit-panel .da-value {
  min-width: 0;
  white-space: nowrap;
}

#design-audit-panel .da-value.da-wrap {
  white-space: normal;
  word-break: break-all;
}

#design-audit-panel .da-sample {
  color: #71717a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

#design-audit-panel .da-count {
  color: #a1a1aa;
  flex: none;
}

#design-audit-panel .da-dim {
  color: #71717a;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

/* Employments-lista (About): samme dim-hover som credits — alt dempes når
   pekeren er over lista, raden man står på beholder full styrke. */
.employments-table td {
  transition: color 140ms ease;
}

@media (hover: hover) {
  .employments-table:hover tr:not(:hover):not(:focus-within) td {
    color: var(--text-secondary);
  }
}

/* Each archived project has a separate block, with 4 masonry columns inside. */
.archived-grid {
  margin: 0;
  padding: 2.5rem 0 0;
  list-style: none;
  width: 90vw;
  margin-left: calc(50% - 45vw);
  display: grid;
  gap: clamp(4rem, 8vw, 8rem);
}

.archived-project {
  min-width: 0;
}

.archived-project__header {
  margin-bottom: 1.5rem;
}

.archived-project__grid {
  display: flex;
  gap: 1.25rem;
}

/* Kolonnene fylles rundgang-vis av JS — leserekkefølgen går venstre → høyre. */
.archived-grid__col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.archived-grid__item {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.archived-grid img,
.archived-grid video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--site-radius);
  transition: transform 260ms cubic-bezier(0.32, 0.08, 0.24, 1);
}

.archived-grid__item:hover img,
.archived-grid__item:focus-visible img,
.archived-grid__item:hover video,
.archived-grid__item:focus-visible video {
  transform: scale(1.02);
}

/* Oransje intro-kort (kopiert fra Figma-framen): serif-tittel øverst,
   uppercase meta nederst, luft imellom. */
.archived-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 870 / 1000;
  border-radius: var(--site-radius);
  background: #ff5c00;
  color: #fff;
  padding: clamp(1.4rem, 2.4vw, 2.5rem);
}

.archived-card__title {
  margin: 0;
  font-family: DragePlantin, Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: clamp(1.7rem, 2.8vw, 2.75rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.archived-card__meta {
  color: #18181b;
  margin: 0;
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(0.72rem, 1vw, 0.95rem);
  letter-spacing: 0.03em;
  line-height: 1.4;
  text-transform: uppercase;
}

.archived-card__dates { display: block; white-space: nowrap; }

.archived-grid__name {
  display: block;
  margin: 0.6rem 0 0;
  color: #18181b;
  font-size: 0.875rem;
}

.archived-project__header .archived-grid__name {
  margin-top: 0;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
}

.archived-grid__meta {
  display: block;
  margin: 0.4rem 0 0;
  color: #71717a;
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.75rem;
  letter-spacing: normal;
}

/* Mobil: JS re-distribuerer til 2 kolonner (media-query-lytter). */

@media (prefers-reduced-motion: reduce) {
  .archived-grid img {
    transition: none;
  }
}

/* Lightbox: klikk på et bilde → stor visning med ‹ ›-navigasjon. */
.archived-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 250, 250, 0.96);
}

.archived-lightbox:not([open]) {
  display: none;
}

.archived-lightbox::backdrop {
  background: transparent;
}

.page-state {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 100svh;
  padding: 100px 0;
  text-align: center;
}

.world-column > .world-page-state::before {
  content: none;
}

/* Loading neighbours stay plain in the overview; an opened page shows its status. */
.world-page[inert][data-load-state="loading"] .page-state__content {
  visibility: hidden;
}

.page-state__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 600px;
}

.page-state__mark {
  position: relative;
  width: 150px;
  aspect-ratio: 77 / 57;
  margin-bottom: 24px;
}

.page-state__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}


.page-state__message {
  margin: 0;
  color: #3f3f46;
  font-family: DragePlantin, Georgia, 'Times New Roman', serif;
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 400;
  line-height: 1.4;
}

.page-state__story {
  margin: 0 0 24px;
  color: #3f3f46;
}

.page-state__action {
  --pill-color: #71717a;
  --pill-border: #a1a1aa;
  --pill-hover-color: #18181b;
  --pill-hover-border: #18181b;
  margin-top: 28px;
  background: transparent;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .site-footer__contact a,
  .page-state__action {
    transition: none;
  }
}

.page-not-found .page-state {
  padding-right: 24px;
  padding-left: 24px;
}

.archived-lightbox__media img,
.archived-lightbox__media video {
  max-width: min(1400px, 86vw);
  max-height: 86svh;
  border-radius: var(--site-radius);
  box-shadow: 0 30px 80px rgba(24, 24, 27, 0.18);
}

.archived-lightbox__caption {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  margin: 0;
  color: var(--text-secondary);
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.archived-lightbox__close {
  font-size: 1.1rem;
  color: #18181b;
}

/* Image navigation belongs to the archive lightbox, not the project pages. */
.archived-lightbox .case-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(228, 228, 231, 0.9);
  border-radius: var(--site-radius);
  background: rgba(250, 250, 250, 0.92);
  color: #18181b;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.archived-lightbox .case-nav--prev { left: 30px; }
.archived-lightbox .case-nav--next { right: 30px; }
.archived-lightbox .case-nav:focus-visible { outline: 2px solid #18181b; outline-offset: 3px; }

@media (hover: hover) and (pointer: fine) {
  .archived-lightbox .case-nav:hover { background: #ececef; }
}

@media (max-width: 767px) {
  .archived-lightbox .case-nav--prev { left: 8px; }
  .archived-lightbox .case-nav--next { right: 8px; }
}

/* Keep a small, keyboard-accessible playback control clear of the image. */
.portfolio-asset:has([data-media-controls]),
.archived-lightbox__media:has([data-media-controls]) { position: relative; }
.media-playback {
  position: absolute;
  left: 16px;
  bottom: 16px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #666670;
  border-radius: var(--site-radius);
  background: #fafafa;
  color: #18181b;
  font: 12px/1.4 MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.media-playback:hover { background: #e4e4e7; }
.media-playback:focus-visible { outline: 2px solid #18181b; outline-offset: 3px; }

#work .work-media > .portfolio-item .portfolio-asset video { width: 100%; }

/* P: a quiet, text-first project opening. C layouts stay available underneath. */
#work :is(.case-lead, .case-legacy-lead)[data-layout="presentation"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  min-height: calc(100svh - 2rem - clamp(64px, 12svh, 120px));
  padding: clamp(24px, 6svh, 64px) 0;
  margin-left: calc((100% - min(1500px, calc(100vw - 3rem))) / 2);
  transform: none;
}
#work [data-layout="presentation"] > .case-cover-hero { display: none; }
#work [data-layout="presentation"] + .case-below { margin-top: 0; }
#work [data-layout="presentation"] > :is(.case-lead__copy, .case-legacy-copy) {
  display: block;
  width: min(100%, 1080px);
  max-width: none;
  margin: 0 auto;
  text-align: center;
  opacity: 1;
  transform: none;
  animation: none;
}
/* Override the legacy work-narrow container without changing its scroll fade. */
#site-layout #work [data-layout="presentation"] > .case-legacy-copy {
  width: min(100%, 1080px);
  max-width: none;
}
[data-layout="presentation"] :is(.case-lead__title, .case-legacy-title) {
  margin: 0 0 clamp(2rem, 3.4vw, 3.25rem);
  font-family: MaisonNeueBook, 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(0.8125rem, 1.15vw, 1.125rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #18181b;
}
[data-layout="presentation"] :is(.case-lead__intro, .case-legacy-intro) {
  margin: 0;
  font-family: DragePlantin, Georgia, serif;
  font-size: clamp(1.75rem, 2.85vw, 3rem);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -0.025em;
  text-align: center;
  text-wrap: balance;
  color: #18181b;
}
#work .case-credits[data-layout="presentation"] {
  max-width: 840px;
  margin: clamp(3rem, 5vw, 5rem) auto 0;
  padding: 0;
  border: 0;
  container-type: normal;
}
.case-credits[data-layout="presentation"] .case-credits__label { display: none; }
.case-credits[data-layout="presentation"] dl {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 2.25rem;
}
.case-credits[data-layout="presentation"] .case-credits__row {
  display: block;
  max-width: 100%;
  padding: 0;
}
.case-credits[data-layout="presentation"] .case-credits__row::after { display: none; }
/* Keep roles available to screen readers while the visual credits show names only. */
.case-credits[data-layout="presentation"] .case-credits__role {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.case-credits[data-layout="presentation"] .case-credits__names {
  font-size: clamp(0.8125rem, 1.15vw, 1.125rem);
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
}
@media (max-width: 767px) {
  #work :is(.case-lead, .case-legacy-lead)[data-layout="presentation"] { padding: 24px 0; }
  .case-credits[data-layout="presentation"] dl { gap: 1rem 1.5rem; }
}

/* Media scrolls over the pinned opening as one opaque layer, including its gaps. */
.case-presentation-sticky { isolation: isolate; }
#work .case-presentation-sticky > [data-layout="presentation"] {
  position: sticky;
  top: var(--intro-sticky-top, 2rem);
  z-index: 0;
}
#work .case-presentation-sticky [data-layout="presentation"] > :is(.case-lead__copy, .case-legacy-copy) {
  opacity: var(--intro-opacity, 1);
}
#work .case-presentation-sticky > [data-layout="presentation"] + .case-below {
  position: relative;
  z-index: 1;
  background: var(--page-surface);
}

/* Project title blocks: fixed label insets, flexible space for every team. */
.case-title-block { display: none; }
#work :is(.case-lead__title, .case-legacy-title) {
  font-family: PPSupplyMono, ui-monospace, monospace;
}
[data-layout="presentation"] .case-credits { display: none; }
/* The title block names the project visually; retain the heading for navigation. */
#work [data-layout="presentation"] :is(.case-lead__title, .case-legacy-title) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  animation: none;
}
[data-layout="presentation"] .case-title-block {
  --detail-row-height: 48px;
  --detail-header-height: calc(var(--detail-row-height) * 1.25);
  display: block;
  width: min(640px, 100%);
  margin: clamp(24px, 4svh, 48px) auto 0;
  overflow: hidden;
  border: 1px solid #aaa;
  border-radius: var(--site-radius);
  text-align: left;
}
.case-title-block dl, .case-title-block dd { margin: 0; }
.title-block__header {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.15fr) var(--detail-header-height);
}
.title-block__cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: var(--detail-row-height);
  padding: 9px 8px;
  border-right: 1px solid #aaa;
}
.title-block__header > .title-block__cell { min-height: var(--detail-header-height); }
.case-title-block dt {
  flex: none;
  text-align: left;
  font-family: PPSupplyMono, ui-monospace, monospace;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #18181b;
}
.case-title-block dd {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: center;
  align-items: center;
  column-gap: 12px;
  padding-top: 2px;
  font-family: DragePlantin, Georgia, serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #18181b;
  overflow-wrap: anywhere;
}
.title-block__signature {
  display: grid;
  place-items: center;
  width: var(--detail-header-height);
  height: var(--detail-header-height);
  aspect-ratio: 1;
}
.title-block__signature img { width: 28px; height: auto; }
.title-block__contributors {
  display: flex;
  flex-wrap: wrap;
  margin-right: -1px !important;
}
.title-block__credit {
  flex: 1 1 max(190px, calc(100% / var(--credit-columns) - 1px));
  border-top: 1px solid #aaa;
}
.title-block__credit--wide { flex-basis: 100%; }
.title-block__credit dd span { max-width: 100%; }
@media (max-width: 600px) {
  [data-layout="presentation"] :is(.case-lead__intro, .case-legacy-intro) { font-size: 26px; }
  [data-layout="presentation"] .case-title-block {
    --detail-row-height: 56px;
    /* Scale the entire drawing together; compensate percentage width for zoom. */
    zoom: .75;
    width: 75%;
  }
  .title-block__header { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) var(--detail-header-height); }
  .case-title-block .title-block__cell { padding-block: 2px; }
  .title-block__project { grid-column: 1 / 3; }
  .title-block__signature { grid-column: 3; grid-row: 1; }
  .title-block__header > :is(.title-block__year, .title-block__role) {
    min-height: var(--detail-row-height);
    border-top: 1px solid #aaa;
  }
  .title-block__year { grid-row: 2; }
  .title-block__role { grid-row: 2; grid-column: 2 / 4; border-right: 0; }
  .title-block__credit { flex-basis: calc(50% - 1px); }
  .title-block__credit--wide { flex-basis: 100%; }
}

/* Compact openings still leave a clear media cue on short phones and laptops. */
@media (max-height: 700px) {
  [data-layout="presentation"] :is(.case-lead__intro, .case-legacy-intro) {
    font-size: clamp(20px, min(2.85vw, 5svh), 48px);
  }
  [data-layout="presentation"] .case-title-block { margin-top: 16px; }
}
@media (max-height: 700px) and (max-width: 767px) {
  [data-layout="presentation"] :is(.case-lead__intro, .case-legacy-intro) {
    font-size: clamp(20px, 3.6svh, 28px);
  }
}
@media (max-height: 700px) and (max-width: 600px) {
  [data-layout="presentation"] :is(.case-lead__intro, .case-legacy-intro) {
    font-size: calc(clamp(20px, 3.6svh, 28px) - 2px);
  }
}
@media (max-width: 360px) and (max-height: 620px) {
  [data-layout="presentation"] :is(.case-lead__intro, .case-legacy-intro) { font-size: 14px; }
  #work :is(.case-lead, .case-legacy-lead)[data-layout="presentation"] { padding-block: 12px; }
  .page-case:has([data-layout="presentation"]) .case-close { top: 8px; }
}
@media (max-height: 500px) {
  #work :is(.case-lead, .case-legacy-lead)[data-layout="presentation"] { padding-block: 10px; }
  [data-layout="presentation"] .case-title-block { margin-top: 4px; }
  .title-block__cell { padding-block: 5px; }
}

/* Press feedback is immediate and independent of the horizontal scroll spring. */
a.timeline-tile:active .timeline-tile__image,
a.timeline-tile.is-pressed .timeline-tile__image,
a.timeline-tile.is-navigating .timeline-tile__image {
  translate: 0 1px;
  transition: none;
}

.page-case .case-below { background: var(--page-surface); }

/* The selected thumbnail drops while its visible neighbours clear sideways.
   The live intro enters line by line behind these independent snapshots. */
@view-transition { navigation: none; }
:root { view-transition-name: none; }
html.project-reveal-active :is([data-layout="presentation"] + .case-below, body > .project-audio) {
  opacity: 0;
  visibility: hidden;
}
html.project-reveal-active::view-transition { pointer-events: none; }
.project-intro-line {
  display: block;
  white-space: nowrap;
}
@keyframes project-neighbour-exit {
  from { transform: translateX(0); }
  to { transform: translateX(var(--project-neighbour-distance)); }
}
html.project-reveal-active::view-transition-group(project-thumbnail) {
  z-index: 1;
  animation: none;
}
html.project-reveal-active::view-transition-image-pair(project-thumbnail) { overflow: visible; }
html.project-reveal-active::view-transition-old(project-thumbnail) {
  opacity: 1;
  mix-blend-mode: normal;
  animation: project-thumbnail-reveal 900ms 40ms cubic-bezier(.65, 0, .35, 1) both;
}
@keyframes project-thumbnail-reveal {
  from { transform: translateY(0); }
  to { transform: translateY(var(--project-reveal-distance)); }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

.site-footer__story { color: #52525b; }
.site-footer__dragon {
  position: relative;
  width: clamp(84px, 8.4vw, 120px);
  aspect-ratio: 1;
  margin: 0 auto;
}
.site-footer__dragon :is(img, canvas) { display: block; width: 100%; height: 100%; }
.site-footer__dragon [hidden] { display: none; }

/* Keep the overview's geometry and exact scroll position while a case is open. */
.project-overview-suspended {
  position: fixed;
  inset: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  contain: layout paint;
}

/* The material study, quietly embedded in the shared footer. */
.footer-dragon-canvas { cursor: grab; touch-action: none; border-radius: 8px; }
.footer-dragon-canvas:active { cursor: grabbing; }
.footer-dragon-canvas:focus-visible { outline: 2px solid #71717a; outline-offset: 3px; }
