/* Fonts and project images are embedded for a portable, single-file portfolio. */
@font-face {
  font-family: Novy;
  src: url("/fonts/novy-1.otf");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Novy;
  src: url("/fonts/novy-2.otf");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Novy;
  src: url("/fonts/novy-3.otf");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
:root {
  color-scheme: light;
  --gap: 18px;
  --ink: #161616;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: Novy, Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
}
::selection {
  background: #1c1c1c;
  color: #fff;
}
header {
  height: 78px;
  padding: 18px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.wordmark {
  font-family: Novy, Arial, sans-serif;
  font-size: 27px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  letter-spacing: -1.2px;
}
nav {
  display: flex;
  gap: 42px;
  font-size: 23px;
  line-height: 1.15;
}
nav a {
  position: relative;
  padding-bottom: 6px;
}
nav a:after {
  content: "";
  position: absolute;
  height: 1px;
  bottom: 0;
  left: 0;
  width: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
nav a:focus-visible:after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { nav a:hover:after { transform: scaleX(1); } }
nav [aria-current] {
  font-family: Arial, sans-serif;
  font-weight: 700;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid #4545f6;
  outline-offset: 5px;
}
.intro {
  padding: 54px 22px 48px;
}
h1 {
  font-size: clamp(32px, 2.85vw, 58px);
  font-weight: 100;
  line-height: 1.15;
  letter-spacing: -0.055em;
  max-width: 1120px;
  margin: 0;
}
h1 strong {
  font-weight: 400;
}
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.07em;
  margin-bottom: -0.07em;
}
.line-inner {
  display: block;
}
.disciplines {
  font-size: clamp(17px, 1.15vw, 23px);
  letter-spacing: -0.035em;
  font-style: italic;
  margin: 26px 0 0;
  line-height: 1.4;
}
.archive {
  padding: 0 22px 30px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: var(--gap);
}
.project {
  grid-column: span 4;
  aspect-ratio: 1;
  position: relative;
  min-width: 0;
  margin: 0;
  opacity: 1;
  transform: none;
  transition:
    opacity 0.85s ease,
    transform 1.05s cubic-bezier(0.18, 0.7, 0.2, 1);
  will-change: auto;
}
.project:nth-child(9n + 1) {
  grid-column: span 7;
  grid-row: span 2;
  aspect-ratio: auto;
}
.project:nth-child(9n + 2) {
  grid-column: span 5;
  aspect-ratio: 1.55;
}
.project:nth-child(9n + 3) {
  grid-column: span 5;
  aspect-ratio: 1.55;
}
.project:nth-child(9n + 7) {
  grid-column: span 5;
  aspect-ratio: 1.05;
}
.project:nth-child(9n + 8) {
  grid-column: span 3;
  aspect-ratio: auto;
}
.project:nth-child(9n + 9) {
  grid-column: span 4;
  aspect-ratio: auto;
}
.project .image-trigger {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  border-radius: 17px;
  overflow: hidden;
  cursor: zoom-in;
  background: #f0f0f0;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.project img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 1.1s cubic-bezier(0.2, 0.65, 0.2, 1);
}
@media (hover: hover) and (pointer: fine) {
  .project .image-trigger:hover img {
    transform: scale(1.045);
  }
}
.project.waiting {
  opacity: 0;
  transform: translateY(65px) scale(0.975);
}
@keyframes rise {
  from {
    transform: translateY(115%) rotate(2deg);
    opacity: 0;
  }
  to {
    transform: translateY(0) rotate(0);
    opacity: 1;
  }
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.line-inner {
  animation: rise 1.05s cubic-bezier(0.18, 0.75, 0.22, 1) both;
}
.line:nth-child(2) .line-inner {
  animation-delay: 0.12s;
}
.line:nth-child(3) .line-inner {
  animation-delay: 0.24s;
}
.disciplines {
  animation: fade 0.8s 0.48s both;
}
header {
  animation: fade 0.7s 0.05s both;
}
dialog {
  border: 0;
  padding: 0;
  max-width: 94vw;
  max-height: 94dvh;
  background: transparent;
  overflow: visible;
  color: white;
}
dialog::backdrop {
  background: rgba(12, 12, 12, 0.91);
  backdrop-filter: blur(12px);
}
dialog img {
  display: block;
  max-width: 92vw;
  max-height: 88dvh;
  object-fit: contain;
  border-radius: 5px;
}
.close {
  position: fixed;
  right: 22px;
  top: 18px;
  width: 46px;
  height: 46px;
  border: 1px solid #888;
  border-radius: 50%;
  background: #202020;
  color: white;
  font: 30px Arial;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .close:hover {
  background: #444;
} }
html.modal-open {
  overflow: hidden;
}
@media (min-width: 1800px) {
  header {
    padding-left: 14px;
    padding-right: 44px;
  }
  .intro {
    padding-left: 14px;
  }
  .archive {
    padding-left: 14px;
    padding-right: 22px;
  }
  h1 {
    font-size: 46px;
    max-width: 1030px;
  }
}
@media (max-width: 900px) {
  :root {
    --gap: 12px;
  }
  header {
    height: 70px;
    padding: 20px 16px;
  }
  nav {
    font-size: 19px;
    gap: 25px;
  }
  .intro {
    padding: 42px 16px 34px;
  }
  h1 {
    font-size: 40px;
  }
  .archive {
    padding: 0 16px 20px;
  }
  .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .project:nth-child(n) {
    grid-column: span 3;
    grid-row: auto;
    aspect-ratio: 1;
  }
  .project:nth-child(5n + 1) {
    grid-column: span 6;
    aspect-ratio: 1.5;
  }
  .project .image-trigger {
    border-radius: 13px;
  }
}
@media (max-width: 540px) {
  header {
    height: 65px;
  }
  .wordmark {
    font-size: 25px;
  }
  nav {
    font-size: 18px;
    gap: 22px;
  }
  .intro {
    padding-top: 40px;
    padding-bottom: 32px;
  }
  h1 {
    font-size: 34px;
    line-height: 1.13;
    letter-spacing: -0.048em;
  }
  .line {
    display: inline;
    overflow: visible;
  }
  .line-inner {
    display: inline;
    animation: none;
  }
  h1 {
    animation: fade 1s both;
  }
  .disciplines {
    font-size: 17px;
    max-width: 310px;
    margin-top: 22px;
  }
  .project:nth-child(n) {
    aspect-ratio: 0.88;
  }
  .project:nth-child(5n + 1) {
    aspect-ratio: 1.05;
  }
  .project.waiting {
    transform: translateY(35px);
  }
  .close {
    right: 12px;
    top: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
  .project.waiting {
    opacity: 1;
    transform: none;
  }
}

.project[data-size="square"] {
  grid-column: span 4;
  grid-row: auto;
  aspect-ratio: 1;
}
.project[data-size="wide"] {
  grid-column: span 8;
  grid-row: auto;
  aspect-ratio: 2;
}
.project[data-size="tall"] {
  grid-column: span 4;
  grid-row: span 2;
  aspect-ratio: auto;
  min-height: 400px;
}
@media (max-width: 900px) {
  .project[data-size="square"] {
    grid-column: span 3;
    aspect-ratio: 1;
  }
  .project[data-size="wide"] {
    grid-column: span 6;
    aspect-ratio: 1.6;
  }
  .project[data-size="tall"] {
    grid-column: span 3;
    min-height: 300px;
  }
}
.dialog-description {
  max-width: 70ch;
  margin: 12px 0;
  color: white;
  line-height: 1.4;
  font-size: 16px;
}

/* Shared layout rhythm */
:root {
  --page-gutter: clamp(20px, 3.5vw, 64px);
  --content-width: 1720px;
}
body > header {
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
}
.intro {
  padding: clamp(48px, 6vw, 100px) var(--page-gutter) clamp(36px, 4vw, 64px);
  max-width: calc(var(--content-width) + 2 * var(--page-gutter));
  margin-inline: auto;
}
.archive {
  padding-inline: var(--page-gutter);
  max-width: calc(var(--content-width) + 2 * var(--page-gutter));
  margin-inline: auto;
}

/* Archive intro spacing and discreet video controls. */
.intro h1 {
  line-height: 1.2;
}
.intro .disciplines {
  margin-top: 32px;
}
.intro {
  padding-bottom: clamp(48px, 4vw, 80px);
}
.video-tile {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 180px;
  background: #171717;
  border-radius: inherit;
  overflow: hidden;
}
.project > .video-tile {
  border-radius: 17px;
}
.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project .video-toggle,
.slide-media .video-toggle {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: white;
  background: #0002;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.video-toggle svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  pointer-events: none;
}
.progress-track {
  opacity: 0.25;
}
.progress-value {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  stroke-linecap: round;
}
.video-symbol {
  font:
    14px Arial,
    sans-serif;
  pointer-events: none;
}
.video-symbol { position: relative; width: 14px; height: 16px; }
.video-symbol::before, .video-symbol::after {
  content: ""; position: absolute; inset: 1px;
  background: currentColor; transition: opacity .22s ease, transform .22s ease;
}
.video-symbol::before { clip-path: polygon(12% 0, 100% 50%, 12% 100%); transform: scale(.9); }
.video-symbol::after { background: linear-gradient(to right, currentColor 0 28%, transparent 28% 72%, currentColor 72%); opacity: 0; transform: scale(.8); }
.video-toggle[aria-pressed="true"] .video-symbol::before { opacity: 0; transform: scale(.8); }
.video-toggle[aria-pressed="true"] .video-symbol::after { opacity: 1; transform: scale(1); }
@media (prefers-reduced-motion: reduce) {
  .video-symbol::before, .video-symbol::after { transition: none; }
}
.video-error {
  position: absolute;
  left: 14px;
  top: 14px;
  color: white;
  background: #111b;
  padding: 8px;
  font-size: 14px;
}

/* Site themes. Media retains its original colour and contrast. */
:root {
  --surface: #fff;
  --foreground: #181818;
  --card-surface: #191919;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --surface: #101010;
  --foreground: #f3f3f3;
  --card-surface: #202020;
  color-scheme: dark;
}
body {
  background: var(--surface);
  color: var(--foreground);
}
.theme-toggle {
  display: grid;
  place-items: center;
  align-self: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin-top: -5px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font:
    23px Arial,
    sans-serif;
}
@media (hover: hover) and (pointer: fine) { .theme-toggle:hover {
  background: #8882;
} }
@media (pointer: coarse) {
  .theme-toggle {
    width: 44px;
    height: 44px;
  }
}
@media (max-width: 540px) {
  header nav {
    gap: 16px;
  }
}

/* Quiet circular playback control, shown only on video elements. */
.project .video-toggle,
.slide-media .video-toggle {
  background: transparent;
  box-shadow: none;
  color: #ffffffa6;
  width: 44px;
  height: 44px;
}
.video-toggle:focus-visible { color: #fff; }
@media (hover: hover) and (pointer: fine) { .video-toggle:hover { color: #fff; } }

/* More breathing room without losing the original light typography. */
.intro h1 { letter-spacing: -.025em; word-spacing: .035em; line-height: 1.28; }
.intro .disciplines { letter-spacing: 0; word-spacing: .04em; line-height: 1.5; margin-top: 36px; }
.intro .line-inner { white-space: normal; }
@media (max-width: 600px) {
 .intro h1 { font-size: clamp(28px, 7vw, 42px); letter-spacing: -.02em; }
 .intro .disciplines { font-size: 17px; margin-top: 24px; }
}

.project-carousel,.carousel-frames,.carousel-frame { position: relative; height: 100%; width: 100%; min-height: 0; }
.carousel-frame[hidden] { display: none; }
.carousel-frame:not([hidden]) { animation: carousel-in .5s ease both; }
@keyframes carousel-in { from { opacity: .2; } to { opacity: 1; } }
.carousel-controls { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: calc(100% - 24px); padding: 3px 12px; border-radius: 28px; background: #1114; backdrop-filter: blur(8px); }
.carousel-dots { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; justify-content: center; }
.carousel-dot { display: grid; place-items: center; border: 0; background: transparent; padding: 0 4px; height: 36px; cursor: pointer; }
.carousel-dot span { display: block; height: 9px; width: 9px; border-radius: 12px; background: #ffffff65; transition: width .35s,background .35s; }
.carousel-dot[aria-current] span { width: 36px; background: white; }
.carousel-dot span { position: relative; overflow: hidden; background: #ffffff70; }
.carousel-dot[aria-current] span { width: 38px; background: #ffffff70; }
.carousel-dot span::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #fff;
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}

.project .project-carousel { height: 100%; width: 100%; }

/* Complete bento groups also fill the last row for any number of uploads. */
.archive { width: 100%; max-width: none; box-sizing: border-box; }
.archive .grid { display: flex; flex-direction: column; gap: var(--gap); }
.bento-row {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  height: clamp(380px, 54vw, 900px);
}
.bento-row .project:nth-child(n) { grid-column: 2; grid-row: auto; aspect-ratio: auto; min-height: 0; overflow: hidden; border-radius: 17px; }
.bento-row .project:first-child { grid-column: 1; grid-row: 1 / 3; }
.bento-row:nth-child(even) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.bento-row:nth-child(even) .project:first-child { grid-column: 2; }
.bento-row:nth-child(even) .project:not(:first-child) { grid-column: 1; }
.bento-row[data-count="1"] { grid-template-columns: 1fr; grid-template-rows: 1fr; height: clamp(300px, 48vw, 800px); }
.bento-row[data-count="1"] .project:first-child { grid-column: 1; grid-row: 1; }
.bento-row[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 1fr; height: clamp(280px, 38vw, 660px); }
.bento-row[data-count="2"] .project:nth-child(n) { grid-column: auto; grid-row: 1; }
@media (max-width: 600px) {
 .bento-row, .bento-row:nth-child(even) { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 1.3fr 1fr; height: 115vw; }
 .bento-row .project:first-child, .bento-row:nth-child(even) .project:first-child { grid-column: 1 / -1; grid-row: 1; }
 .bento-row .project:not(:first-child), .bento-row:nth-child(even) .project:not(:first-child) { grid-column: auto; grid-row: 2; }
 .bento-row[data-count="1"] { height: 82vw; grid-template-rows: 1fr; }
 .bento-row[data-count="2"] { height: 58vw; grid-template-rows: 1fr; }
 .bento-row[data-count="2"] .project:nth-child(n) { grid-column: auto; grid-row: 1; }
}

/* Editorial Archive items: copy beside media, or just a link beneath it. */
.archive-media { height: 100%; min-width: 0; min-height: 0; overflow: hidden; border-radius: 17px; }
.bento-row .project-with-link:nth-child(n) { display: flex; flex-direction: column; border-radius: 0; }
.project-with-link .archive-media { flex: 1; height: auto; }
.archive-link-caption { flex: none; padding: 14px 2px 4px; }
.archive-project-link { display: inline-flex; gap: 18px; align-items: center; min-height: 36px; color: inherit; font-size: 16px; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.archive-project-link span { transition: transform .2s; }
@media (hover: hover) and (pointer: fine) { .archive-project-link:hover span { transform: translate(2px, -2px); } }
.archive-project-link:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
.archive-story .project-with-copy {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 72px); aspect-ratio: auto;
  padding: clamp(20px, 3vw, 48px); border-radius: 20px;
  background: #8881; box-shadow: 0 5px 24px #0000000a;
}
.archive-story .archive-media { min-height: 360px; height: auto; }
.archive-story .archive-media > .image-trigger,
.archive-story .archive-media > .video-tile,
.archive-story .archive-media > .project-carousel { min-height: 360px; }
.archive-copy { align-self: center; padding-block: 12px; overflow-wrap: anywhere; }
.archive-copy h2 { margin: 0 0 24px; font-size: clamp(26px, 2.5vw, 44px); line-height: 1.15; letter-spacing: -.025em; }
.archive-copy p { margin: 0 0 20px; font-size: clamp(16px, 1.2vw, 20px); line-height: 1.6; max-width: 58ch; }
.archive-copy .archive-project-link { margin-top: 10px; }
@media (max-width: 760px) {
 .archive-story .project-with-copy { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 18px; }
 .archive-story .archive-media { height: 65vw; min-height: 220px; }
 .archive-story .archive-media > .image-trigger,
 .archive-story .archive-media > .video-tile,
 .archive-story .archive-media > .project-carousel { min-height: 0; }
 .archive-copy { padding: 0 4px 8px; }
}

/* Archive and case navigation stays legible over artwork. */
.archive-page > header,
.case-page > header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 40;
  align-items: center;
  color: var(--foreground);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid #8882;
  box-shadow: 0 5px 24px #00000006;
  animation: none;
}
.dialog-project-link {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-height: 44px;
  margin-top: 12px;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 5px;
}
dialog [hidden] { display: none !important; }
dialog:has(.dialog-project-link:not([hidden])) img { max-height: 72dvh; }
.dialog-video { display: block; max-width: 90vw; max-height: 72dvh; border-radius: 8px; }
.dialog-description { color: #fff; }
.dialog-description p { margin: 0 0 12px; }
.video-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: zoom-in;
  font-size: 22px;
  text-align: right;
  padding: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}
.video-tile .video-toggle { z-index: 2; }
.case-section-text a, .slide-description a, .archive-copy a { text-decoration: underline; text-underline-offset: 4px; }
.case-section-text strong, .slide-description strong, .archive-copy strong, .case-summary strong { font-weight: 700; }

/* Reserve the shared header height on document pages. */
.archive-page, .case-page { padding-top: 78px; }

/* Shared lightbox standard for Home, Archive, cases and future media pages. */
dialog.media-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  box-sizing: border-box;
  padding: max(64px, 5dvh, env(safe-area-inset-top)) max(24px, 4vw, env(safe-area-inset-right)) max(64px, 5dvh, env(safe-area-inset-bottom)) max(24px, 4vw, env(safe-area-inset-left));
  background: #101010;
  color: #fff;
  overflow: hidden;
}
dialog.media-lightbox[open] { display: grid; place-items: center; }
dialog.media-lightbox::backdrop { background: transparent; backdrop-filter: none; }
.media-lightbox .lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 2dvh, 24px);
  min-width: 0;
  min-height: 0;
}
.media-lightbox .lightbox-frame {
  position: relative;
  flex: none;
  overflow: hidden;
  border-radius: clamp(12px, 1.2vw, 22px);
  background: #181818;
  box-shadow: 0 20px 70px #0005;
}
dialog.media-lightbox .lightbox-frame > img,
dialog.media-lightbox .lightbox-frame > video {
  display: block;
  position: static;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  min-height: 0;
  margin: 0;
  border-radius: inherit;
  object-fit: contain;
}
.media-lightbox .lightbox-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: none;
  width: min(100%, 760px);
  overflow: auto;
  overscroll-behavior: contain;
  text-align: center;
}
.media-lightbox .dialog-description { margin: 0; font-size: clamp(14px, 1.2vw, 17px); line-height: 1.5; }
.media-lightbox .dialog-project-link {
  flex: none;
  min-height: 44px;
  margin: 0;
  padding: 10px 20px;
  border: 1px solid #ffffff5c;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  transition: background .2s;
}
@media (hover: hover) and (pointer: fine) { .media-lightbox .dialog-project-link:hover { background: #ffffff16; } }
.media-lightbox .close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid #ffffff5c;
  border-radius: 50%;
  color: #fff;
  background: #ffffff0d;
}
.media-lightbox .lightbox-footer, .media-lightbox .close { transition: opacity .24s ease; }
.media-lightbox.media-transitioning .lightbox-frame { visibility: hidden; }
.media-lightbox.media-transitioning .lightbox-footer,
.media-lightbox.media-transitioning .close { opacity: 0; }
.media-transition-layer { position: fixed; overflow: hidden; pointer-events: none; z-index: 1; }
dialog.media-lightbox .media-transition-layer > img,
dialog.media-lightbox .media-transition-layer > video {
  position: absolute; max-width: none; max-height: none; min-height: 0;
  margin: 0; border-radius: 0; object-fit: fill; display: block;
}
@media (max-width: 600px) {
  dialog.media-lightbox { padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); }
}
@media (max-height: 450px) {
  dialog.media-lightbox { padding-block: max(56px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-bottom)); }
}

/* Shared vector arrow: renders consistently on iOS without emoji substitution. */
.project-link::after, .dialog-project-link > span, .arrow-icon {
  content: ""; display: inline-block; width: 21px; height: 21px; flex: 0 0 21px;
  font-size: 0; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 19 19 5M5 5h14v14' fill='none' stroke='black' stroke-width='1.2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 19 19 5M5 5h14v14' fill='none' stroke='black' stroke-width='1.2'/%3E%3C/svg%3E") center / contain no-repeat;
}
header nav { align-items: center; }
.theme-toggle { flex: 0 0 36px; margin-top: 0; }
.theme-toggle span { display: grid; place-items: center; }
.theme-toggle svg { width: 22px; height: 22px; display: block; }
.theme-toggle svg { grid-area: 1 / 1; transform-origin: center; transition: opacity .24s ease, transform .4s cubic-bezier(.22,1,.36,1); }
.theme-toggle .theme-sun { opacity: 0; transform: rotate(-70deg) scale(.55); }
.theme-toggle .theme-moon { opacity: 1; transform: rotate(0) scale(1); }
:root[data-theme="dark"] .theme-toggle .theme-sun { opacity: 1; transform: rotate(0) scale(1); }
:root[data-theme="dark"] .theme-toggle .theme-moon { opacity: 0; transform: rotate(55deg) scale(.55); }
@media (prefers-reduced-motion: reduce) { .theme-toggle svg { transition: none; } }
.archive-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.archive-filters button {
  color: var(--foreground); background: transparent; border: 1px solid #8885;
  border-radius: 999px; padding: 10px 17px; min-height: 44px; cursor: pointer;
  font-size: 14px; transition: color .2s, background .2s, border-color .2s;
}
.archive-filters button[aria-pressed="true"] { background: var(--foreground); color: var(--surface); border-color: var(--foreground); }
@media (hover: hover) and (pointer: fine) { .archive-filters button:hover { border-color: var(--foreground); } }
.archive-filter-status { font-size: 13px; opacity: .65; margin: 0 0 24px; }
.archive-empty { padding: 60px 0; font-size: 18px; }
.archive-empty[hidden] { display: none; }
/* A fine edge keeps white artwork distinct without altering the artwork itself. */
.archive-media, .case-visual, .slides-page .slide-media {
  box-shadow: 0 0 0 1px rgb(0 0 0 / .08), 0 6px 24px rgb(0 0 0 / .045);
}
.archive-media { position: relative; }
.archive-media::after {
  content: ""; position: absolute; inset: 0; border: 1px solid rgb(0 0 0 / .08);
  border-radius: inherit; pointer-events: none; z-index: 3;
}
.bento-row > .project { box-shadow: 0 6px 24px rgb(0 0 0 / .045); }
:root[data-theme="dark"] .archive-media::after { border-color: rgb(255 255 255 / .09); }
:root[data-theme="dark"] :is(.archive-media, .case-visual, .slides-page .slide-media) {
  box-shadow: 0 0 0 1px rgb(255 255 255 / .09), 0 6px 24px rgb(0 0 0 / .14);
}
@media (max-width: 800px), (orientation: landscape) and (max-height: 600px) {
  body > header {
    height: 60px; align-items: center; padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  }
  header .wordmark { font-size: 25px; }
  header nav { font-size: 16px; gap: 14px; }
  header nav a { padding-bottom: 0; }
  header .theme-toggle {
    width: 32px; height: 32px; flex: 0 0 32px; margin: 0 2px 0 0;
    position: relative;
  }
  header .theme-toggle::before { content: ""; position: absolute; inset: -6px; }
  header .theme-toggle svg { width: 20px; height: 20px; }
  .archive-page, .case-page { padding-top: 60px; }
  .archive-filters { flex-wrap: wrap; overflow: visible; padding-bottom: 6px; }
  .archive-filters button { flex: none; padding: 9px 14px; font-size: 13px; }
}
