/* Settings and base */

:root {
  --bg: #14130f;
  --surface: #e7e1d4;
  --surface-dark: #0b0b09;
  --ink: #ede7dc;
  --text: var(--ink);
  --muted: rgba(237, 231, 220, 0.52);
  --line: rgba(237, 231, 220, 0.18);
  --menu-strong: rgba(237, 231, 220, 0.96);
  --menu-soft: rgba(237, 231, 220, 0.52);
  --accent: #b6533f;
  --space: 16px;
  --top-ui-band: 34px;
  --bottom-ui-band: 46px;
  --fullscreen-top-safe: clamp(14px, calc(var(--top-ui-band) * 0.28), 24px);
  --category-menu-width: calc((var(--sheet-columns, 4) * min(21vw, 18vh)) + ((var(--sheet-columns, 4) - 1) * 8px));
  --compact-sheet-scale: 1;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(182, 83, 63, 0.14), transparent 28%),
    linear-gradient(145deg, #1b1914 0%, #0f0f0c 48%, #211d17 100%);
  color: var(--text);
  font-family: "Familjen Grotesk", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(237, 231, 220, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237, 231, 220, 0.035) 1px, transparent 1px);
  background-size: 46px 46px, 46px 46px;
  mix-blend-mode: soft-light;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

a {
  text-decoration: none;
}

/* Shell */

.entry-view {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 4px;
  min-height: 100dvh;
  padding: 10px 24px 14px;
  overflow: hidden;
  background: #0b0b09;
  color: var(--text);
  transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.42s ease;
}

body:not(.entry-mode) .entry-view {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.entry-image {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  justify-self: center;
  display: block;
  width: min(92vw, 1500px);
  height: calc(100dvh - 62px);
  max-width: 100%;
  max-height: none;
  margin-top: 0;
  object-fit: cover;
  object-position: 58% bottom;
  box-shadow: 0 34px 96px rgba(0, 0, 0, 0.46);
  animation: entryImageIn 780ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.entry-copy {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: start;
  z-index: 2;
  display: grid;
  gap: clamp(14px, 2.2vh, 26px);
  max-width: min(78vw, 1120px);
  padding: clamp(42px, 10vh, 112px) 0 0 clamp(6px, 2vw, 28px);
  pointer-events: none;
}

.entry-author {
  margin: 0;
  color: rgba(237, 231, 220, 0.68);
  font-size: clamp(0.72rem, 0.82vw, 0.92rem);
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  mix-blend-mode: difference;
}

.entry-copy h1 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: clamp(4rem, 8.6vw, 10rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 0.86;
  color: rgba(237, 231, 220, 0.94);
  mix-blend-mode: difference;
}

.entry-manifesto {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(28rem, 42vw);
  max-width: 100%;
  color: rgba(237, 231, 220, 0.88);
  font-size: clamp(0.9rem, 0.58vw + 0.58rem, 1.08rem);
  line-height: 1.38;
  mix-blend-mode: difference;
}

.entry-manifesto p {
  margin: 0;
}

.entry-manifesto p + p {
  margin-top: 0;
}

.entry-manifesto-label {
  color: rgba(237, 231, 220, 0.62);
  font-size: clamp(0.68rem, 0.78vw, 0.82rem);
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.entry-nav {
  grid-column: 1 / -1;
  grid-row: 2;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
  padding: 2px 0 4px;
}

.entry-nav-item {
  position: relative;
  padding-top: 7px;
  border-top: 1px solid rgba(237, 231, 220, 0.18);
  color: rgba(237, 231, 220, 0.64);
  font-size: clamp(0.68rem, 0.76vw, 0.82rem);
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.entry-nav-item:hover,
.entry-nav-item:focus-visible {
  border-color: var(--accent);
  color: rgba(237, 231, 220, 0.98);
}

@keyframes entryImageIn {
  from {
    opacity: 0;
    transform: scale(0.985) translateY(14px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.stage {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
}

.content {
  height: 100dvh;
}

.panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  height: 100dvh;
}

/* Menu */

.brand {
  position: fixed;
  right: 34px;
  bottom: 28px;
  z-index: 130;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 11.5ch;
  padding: 0.15rem 0 0.15rem 0.5rem;
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 2.4rem);
  font-family: "Newsreader", serif;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  color: var(--menu-strong);
  mix-blend-mode: difference;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.brand {
  color: rgba(237, 231, 220, 0.82);
}

.brand:hover,
.brand:focus-visible {
  color: var(--menu-strong);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 140;
  width: auto;
  padding: 26px 34px 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: start;
  column-gap: 6px;
}

.mobile-dock,
.mobile-dock-hint {
  display: none;
}

.menu {
  display: contents;
  width: auto;
  min-width: 0;
}

.sidebar .brand,
.sidebar .menu,
.sidebar button,
.sidebar a {
  pointer-events: auto;
}

.menu-item,
.category-item {
  color: var(--menu-soft);
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
  font-weight: 400;
}

.menu-item {
  font-size: 0.82rem;
  letter-spacing: 0;
  line-height: 1;
}

.menu-item:hover,
.menu-item.is-active,
.category-item:hover,
.category-item.is-active {
  color: var(--menu-strong);
}

.category-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  grid-column: 2;
  min-width: 0;
  width: min(50vw, 700px);
  max-width: calc(100vw - 24px);
  margin: 0;
  column-gap: clamp(20px, 4vw, 72px);
}

.category-item {
  position: relative;
  font-size: clamp(0.74rem, 0.8vw, 0.86rem);
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  padding: 5px 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.category-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  background: currentColor;
  transition: transform 0.18s ease;
}

.category-item.is-active::after {
  transform: scaleX(1);
}

.category-item.is-active::after {
  background: var(--accent);
}

.category-item:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 5px;
}

.category-menu .category-item:nth-child(1) {
  justify-self: start;
}

.category-menu .category-item:nth-child(2) {
  justify-self: center;
}

.category-menu .category-item:nth-child(3) {
  justify-self: end;
}

body.high-res-image-mode .sidebar,
body.high-res-image-mode .brand {
  opacity: 0;
  pointer-events: none;
}

/* Contact sheets */

.gallery {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  transform-origin: center center;
  transition:
    opacity 0.62s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.62s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery.portfolio-grid {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  scrollbar-color: rgba(237, 231, 220, 0.28) transparent;
}

.gallery.portfolio-grid::-webkit-scrollbar {
  display: none;
}

.portfolio-set-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: stretch;
  gap: 0;
  padding: 78px 34px 70px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  animation: portfolioSetIn 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gallery.no-card-intro .portfolio-set-card {
  animation: none;
}

.portfolio-set-card:nth-child(2n) {
  animation-delay: 70ms;
}

.portfolio-set-card:nth-child(3n) {
  animation-delay: 130ms;
}

.portfolio-set-card:nth-child(3n + 2) {
  padding-top: 78px;
}

.portfolio-set-card:nth-child(4n) {
  min-height: 100dvh;
}

.portfolio-set-header {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 30px;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  color: rgba(237, 231, 220, 0.82);
  font-size: 0.68rem;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
  cursor: default;
}

.portfolio-set-header span:last-child {
  display: none;
}

.portfolio-set-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-auto-rows: minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  height: 100%;
  gap: 8px;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.portfolio-set-grid[style*="--set-card-count: 1"],
.portfolio-set-grid[style*="--set-card-count: 2"] {
  grid-template-columns: repeat(var(--set-card-count), minmax(0, 1fr));
}

.portfolio-set-frame {
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background: #070706;
  cursor: pointer;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.26);
}

.portfolio-set-frame:first-child:nth-last-child(3),
.portfolio-set-frame:first-child:nth-last-child(4),
.portfolio-set-frame:first-child:nth-last-child(5) {
  grid-row: span 2;
}

.portfolio-set-frame:first-child:nth-last-child(3),
.portfolio-set-frame:first-child:nth-last-child(3) ~ .portfolio-set-frame {
  min-height: 0;
}

.portfolio-set-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.portfolio-set-frame:hover img,
.portfolio-set-frame:focus-within img {
  transform: scale(1.035);
}

@keyframes portfolioSetIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery.contact-sheets {
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  border-top: 1px solid rgba(237, 231, 220, 0.1);
  border-bottom: 1px solid rgba(237, 231, 220, 0.1);
  background:
    linear-gradient(90deg, rgba(237, 231, 220, 0.035), transparent 18%, transparent 82%, rgba(237, 231, 220, 0.035)),
    var(--surface-dark);
}

.gallery.contact-sheets::-webkit-scrollbar {
  display: none;
}

.contact-sheet {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  height: 100%;
  content-visibility: auto;
  contain-intrinsic-size: 100dvh 100vw;
  --contact-cell-size: calc(min(18.5vw, 17.5vh) * var(--compact-sheet-scale));
  --contact-row-gap: calc(clamp(18px, 1.9vw, 32px) * var(--compact-sheet-scale));
  --contact-set-gap: calc(clamp(24px, 2.8vw, 48px) * var(--compact-sheet-scale));
  --contact-image-gap: calc(clamp(3px, 0.35vw, 5px) * var(--compact-sheet-scale));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--contact-row-gap);
  padding: 0;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.contact-sheet.free-contact-sheet {
  --free-cell-size: calc(clamp(72px, min(10vw, 13vh), 142px) * var(--compact-sheet-scale));
  --free-overlap-scale: 1;
  position: relative;
  display: block;
}

.free-contact-sheet .contact-set {
  position: absolute;
  left: var(--free-x);
  top: var(--free-y);
  grid-template-columns: repeat(var(--set-count), var(--free-cell-size));
  transform:
    translate(-50%, -50%)
    translate(var(--edit-x), calc(var(--set-nudge-y) + var(--edit-y)));
}

.free-contact-sheet .contact-frame {
  width: var(--free-cell-size);
  height: var(--free-cell-size);
}

.free-contact-sheet .free-contact-frame {
  position: absolute;
  left: var(--free-x);
  top: var(--free-y);
  transform: translate(-50%, -50%);
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--contact-set-gap);
  width: min(76vw, 820px);
  min-width: 0;
  min-height: 0;
}

.contact-row[data-align="grid-left"] {
  justify-content: flex-start;
  transform: translateX(clamp(-34px, -3vw, -18px));
}

.contact-row[data-align="grid-right"] {
  justify-content: flex-end;
  transform: translateX(clamp(18px, 3vw, 34px));
}

.contact-row[data-align="grid-left-soft"] {
  justify-content: flex-start;
  transform: translateX(clamp(-10px, -1vw, -4px));
}

.contact-row[data-align="grid-right-soft"] {
  justify-content: flex-end;
  transform: translateX(clamp(4px, 1vw, 10px));
}

.contact-row[data-align="grid-center"],
.contact-row[data-align="center"] {
  justify-content: center;
}

.contact-row[data-align="bottom-right"] {
  justify-content: flex-end;
  margin-top: auto;
}

body[data-category="views"] .contact-sheet {
  --contact-row-gap: calc(clamp(8px, 0.9vw, 14px) * var(--compact-sheet-scale));
  --contact-set-gap: calc(clamp(18px, 2vw, 34px) * var(--compact-sheet-scale));
}

body[data-category="details"] .contact-sheet {
  --contact-cell-size: calc(min(22vw, 23vh) * var(--compact-sheet-scale));
  --contact-row-gap: calc(clamp(18px, 1.8vw, 30px) * var(--compact-sheet-scale));
  --contact-set-gap: calc(clamp(22px, 2.5vw, 42px) * var(--compact-sheet-scale));
}

body[data-category="details"] .contact-row {
  width: min(88vw, 1080px);
}

.contact-set {
  --edit-x: 0px;
  --edit-y: 0px;
  --set-nudge-y: 0px;
  display: grid;
  grid-template-columns: repeat(var(--set-count), var(--contact-cell-size));
  gap: var(--contact-image-gap);
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-items: center;
  transform: translate(var(--edit-x), calc(var(--set-nudge-y) + var(--edit-y)));
  transition: transform 0.18s ease, outline-color 0.18s ease;
}

.contact-set[data-index="2"],
.contact-set[data-index="5"],
.contact-set[data-index="8"] {
  --set-nudge-y: clamp(5px, 0.9vh, 12px);
}

.contact-set[data-index="3"],
.contact-set[data-index="7"],
.contact-set[data-index="10"] {
  --set-nudge-y: clamp(-8px, -1vh, -4px);
}

.contact-set[data-count="5"][data-chunk="2"] {
  --set-nudge-y: clamp(7px, 1vh, 14px);
}

body[data-category="views"] .contact-set,
body[data-category="details"] .contact-set,
body[data-category="portraits"] .free-contact-sheet .contact-set {
  --set-nudge-y: 0px;
}

body[data-category="views"] .contact-set[data-count="5"][data-chunk="2"] {
  --set-nudge-y: clamp(5px, 0.8vh, 10px);
}

.contact-frame {
  --image-edit-x: 0px;
  --image-edit-y: 0px;
  --image-scale: 1;
  position: relative;
  width: var(--contact-cell-size);
  height: var(--contact-cell-size);
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  align-self: center;
  justify-self: center;
  opacity: 1;
  transition:
    opacity 0.18s ease,
    filter 0.18s ease,
    transform 0.18s ease;
}

.contact-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 96%;
  max-height: 96%;
  object-fit: contain;
  margin: 0;
  transform: translate(var(--image-edit-x), var(--image-edit-y)) scale(var(--image-scale));
  transform-origin: center;
  transition: transform 0.18s ease;
}

.free-contact-sheet .free-contact-frame img {
  transform: translate(var(--image-edit-x), var(--image-edit-y))
    scale(calc(var(--image-scale) * var(--free-overlap-scale)));
}

.contact-frame:not(.free-contact-frame)[data-count="2"][data-index="1"],
.contact-frame:not(.free-contact-frame)[data-count="3"][data-index="1"],
.contact-frame:not(.free-contact-frame)[data-count="5"][data-index="1"] {
  transform: translateY(clamp(-5px, -0.6vh, -3px));
}

.contact-frame:not(.free-contact-frame)[data-count="2"][data-index="2"],
.contact-frame:not(.free-contact-frame)[data-count="3"][data-index="3"],
.contact-frame:not(.free-contact-frame)[data-count="5"][data-index="4"] {
  transform: translateY(clamp(3px, 0.45vh, 6px));
}

.contact-frame[data-index="2"] img,
.contact-frame[data-index="4"] img {
  max-width: 86%;
  max-height: 86%;
}

.contact-sheet.is-hovering-set .contact-frame {
  opacity: 0.42;
}

.contact-sheet.is-hovering-set .contact-frame.is-set-hovered {
  opacity: 1;
}

.fullscreen-hud {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.fullscreen-hud-button {
  position: absolute;
  border: 0;
  background: transparent;
  color: rgba(237, 231, 220, 0.42);
  font-size: clamp(18px, 2.1vw, 24px);
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.18s ease, opacity 0.18s ease;
  user-select: none;
}

.fullscreen-hud-button:hover,
.fullscreen-hud-button:focus-visible {
  color: rgba(237, 231, 220, 0.86);
}

.fullscreen-hud-close {
  top: 8px;
  right: 10px;
  font-size: clamp(16px, 1.8vw, 20px);
}

/* High-res overlay */

.high-res-image-viewer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  width: 100vw;
  height: 100dvh;
  background: rgba(8, 8, 7, 0.98);
  color: var(--text);
  cursor: default;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scroll-snap-type: none;
  scroll-behavior: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.high-res-image-viewer::-webkit-scrollbar {
  display: none;
}

.high-res-image-viewer.is-active {
  display: block;
}

.high-res-image-strip {
  display: flex;
  flex-direction: row;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  padding: 0 clamp(56px, 12vw, 180px);
}

.high-res-image-frame {
  margin: 0;
  min-width: auto;
  width: auto;
  min-height: 100dvh;
  padding: calc(var(--fullscreen-top-safe) + 14px) 0 calc(var(--bottom-ui-band) + 14px);
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: none;
  scroll-snap-stop: normal;
}

.high-res-image-frame:not(:last-child) {
  margin-right: 3px;
}

.high-res-image-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - var(--fullscreen-top-safe) - var(--bottom-ui-band) - 16px);
  object-fit: contain;
  border: 1px solid rgba(245, 243, 238, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-set-card {
    animation: none;
  }
}

.gallery-item {
  margin: 0;
  align-self: center;
  justify-self: center;
  overflow: visible;
}

.is-hidden {
  display: none;
}

/* Responsive shell */

@media (max-width: 920px) {
  :root {
    --category-menu-width: calc((var(--sheet-columns, 3) * min(29vw, 20vh)) + ((var(--sheet-columns, 3) - 1) * 8px));
  }

  .sidebar {
    padding-left: 24px;
    padding-right: 24px;
    grid-template-columns: minmax(84px, 1fr) auto minmax(84px, 1fr);
    column-gap: 4px;
  }

  .brand {
    font-size: clamp(0.94rem, 1.45vw, 1.02rem);
    right: 24px;
  }

  .category-menu {
    width: min(92vw, 860px);
    max-width: calc(100vw - 20px);
    column-gap: clamp(16px, 4vw, 40px);
  }

  .category-item {
    font-size: clamp(0.84rem, 1.3vw, 0.95rem);
  }

  .menu-item {
    font-size: clamp(0.8rem, 1.25vw, 0.86rem);
  }

}

@media (max-width: 760px) {
  :root {
    --top-ui-band: 44px;
    --category-menu-width: calc((var(--sheet-columns, 3) * min(29vw, 22vh)) + ((var(--sheet-columns, 3) - 1) * 5px));
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 16px;
    right: 16px;
    width: auto;
    padding: 4px 0 0;
    display: grid;
    grid-template-columns: minmax(72px, 1fr) auto minmax(72px, 1fr);
    align-items: start;
    column-gap: 4px;
    row-gap: 0;
  }

  .entry-view {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    gap: 4px;
    padding: 8px 10px 12px;
  }

  .entry-image {
    grid-column: 1;
    width: 100%;
    height: calc(100dvh - 98px);
    max-width: 100%;
    max-height: none;
    margin-top: 0;
    align-self: end;
    object-fit: cover;
    object-position: center bottom;
  }

  .entry-copy {
    grid-column: 1;
    align-self: start;
    max-width: 100%;
    gap: 12px;
    padding: clamp(34px, 9vh, 74px) 0 0;
  }

  .entry-copy h1 {
    font-size: clamp(2.45rem, 11vw, 4.2rem);
    line-height: 0.86;
  }

  .entry-manifesto {
    grid-template-columns: 1fr;
    width: min(100%, 26rem);
    font-size: clamp(0.82rem, 2.8vw, 0.96rem);
    line-height: 1.3;
  }

  .entry-author {
    display: none;
  }

  .entry-manifesto p + p {
    margin-top: 0;
  }

  .entry-nav {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 2px 0 4px;
  }

  .entry-nav-item {
    padding-top: 6px;
    font-size: 0.68rem;
  }

  .brand {
    left: auto;
    right: 16px;
    bottom: 14px;
    font-size: clamp(0.8rem, 2.9vw, 0.96rem);
  }

  .menu {
    min-width: 0;
  }

  .category-menu {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    grid-column: 2;
    column-gap: 16px;
    min-width: 0;
    width: min(100%, 620px);
    max-width: calc(100vw - 32px);
    margin: 0;
  }

  .category-item {
    width: auto;
    min-width: max-content;
    font-size: clamp(0.76rem, 2.55vw, 0.92rem);
  }

  .category-menu .category-item:nth-child(1) {
    justify-self: start;
  }

  .category-menu .category-item:nth-child(2) {
    justify-self: center;
  }

  .category-menu .category-item:nth-child(3) {
    justify-self: end;
  }

  .panel {
    padding: var(--top-ui-band) 16px var(--bottom-ui-band);
    height: 100dvh;
    min-height: 100dvh;
  }

  .gallery {
    display: flex;
  }

  .gallery.contact-sheets {
    align-items: stretch;
  }

}

@media (max-width: 560px) {
  :root {
    --compact-sheet-scale: 0.86;
  }
}

@media (max-width: 420px) {
  :root {
    --top-ui-band: 38px;
    --compact-sheet-scale: 0.68;
  }

  .sidebar {
    left: 8px;
    right: 8px;
    padding: 6px 0 0;
    grid-template-columns: minmax(56px, 1fr) auto minmax(56px, 1fr);
    column-gap: 2px;
  }

  .brand {
    right: 10px;
    bottom: 10px;
    min-width: 9.2ch;
    padding: 0.12rem 0 0.12rem 0.35rem;
    font-size: clamp(0.72rem, 3.1vw, 0.88rem);
  }

  .category-menu {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    column-gap: 10px;
  }

  .category-item {
    font-size: clamp(0.64rem, 2.25vw, 0.78rem);
    letter-spacing: -0.01em;
  }

  .menu-item {
    font-size: clamp(0.66rem, 2.1vw, 0.8rem);
  }

}

body.mobile-layout {
  --top-ui-band: 82px;
  --bottom-ui-band: 34px;
  --compact-sheet-scale: 0.8;
}

body.mobile-layout .content {
  height: 100dvh;
}

body.mobile-layout .panel {
  height: 100dvh;
  min-height: 100dvh;
  padding: var(--top-ui-band) 0 var(--bottom-ui-band);
}

body.mobile-layout .sidebar {
  top: 0;
  left: 0;
  right: 0;
  z-index: 220;
  height: var(--top-ui-band);
  padding: 0 12px;
  display: block;
  background: #14130f;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 1px 0 rgba(237, 231, 220, 0.1);
}

body.mobile-layout .category-menu {
  position: absolute;
  top: 14px;
  left: 12px;
  right: 12px;
  z-index: 230;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100vw - 24px);
  max-width: none;
  column-gap: 0;
  margin: 0;
}

body.mobile-layout .brand,
body.mobile-layout .category-item {
  color: rgba(237, 231, 220, 0.86);
}

body.mobile-layout .category-item {
  display: block;
  flex: 0 0 33.333%;
  min-width: 0;
  font-size: clamp(0.72rem, 2.4vw, 0.88rem);
  line-height: 1;
  opacity: 0.72;
  overflow: visible;
  text-align: center;
}

body.mobile-layout .category-item.is-active {
  color: #f7f0e4;
  opacity: 1;
}

body.mobile-layout .category-item:nth-child(1) {
  text-align: left;
}

body.mobile-layout .category-item:nth-child(2) {
  text-align: center;
}

body.mobile-layout .category-item:nth-child(3) {
  text-align: right;
}

body.mobile-layout .mobile-progress {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 229;
  display: block;
  width: auto;
  height: 2px;
  margin: 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(237, 231, 220, 0.14);
  pointer-events: none;
}

body.mobile-layout .mobile-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: var(--text);
  transition: transform 0.22s ease;
}

body.mobile-layout .mobile-dock {
  display: none;
}

body.mobile-layout .mobile-dock-button {
  width: 38px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(237, 231, 220, 0.18);
  color: rgba(237, 231, 220, 0.88);
  font-size: 1.35rem;
  line-height: 1;
  text-align: center;
}

body.mobile-layout .mobile-dock-button:disabled {
  opacity: 0.45;
}

body.mobile-layout .mobile-set-indicator {
  margin: 0;
  text-align: center;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: rgba(237, 231, 220, 0.78);
  white-space: nowrap;
  text-transform: uppercase;
}

body.mobile-layout .mobile-dock-hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 62px;
  z-index: 224;
  display: none;
  margin: 0;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: rgba(17, 17, 17, 0.54);
  pointer-events: none;
}

body.mobile-layout .gallery.contact-sheets {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body.mobile-layout .gallery.mobile-feed {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  scroll-padding-top: 0;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

body.mobile-layout #work-view {
  overflow: hidden;
  touch-action: pan-y;
}

body.mobile-layout .mobile-set-card {
  position: relative;
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 10px 10px calc(var(--bottom-ui-band) + 10px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

body.mobile-layout .portfolio-set-card:nth-child(n) {
  min-height: 100%;
  padding-top: 10px;
}

body.mobile-layout .mobile-set-card + .mobile-set-card {
  border-top: 0;
}

body.mobile-layout .mobile-set-header {
  display: none;
}

body.mobile-layout .mobile-set-header span:last-child {
  display: none;
}

body.mobile-layout .mobile-set-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 4px;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
}

body.mobile-layout .mobile-set-grid[style*="--mobile-set-count: 1"],
body.mobile-layout .mobile-set-grid[style*="--mobile-set-count: 2"] {
  grid-template-columns: repeat(var(--mobile-set-count), minmax(0, 1fr));
}

body.mobile-layout .mobile-set-grid[data-count="4"] {
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

body.mobile-layout .mobile-set-grid[data-count="5"] {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

body.mobile-layout .mobile-set-grid[data-count="5"] .mobile-set-frame {
  grid-column: span 2;
}

body.mobile-layout .mobile-set-grid[data-count="5"] .mobile-set-frame:nth-child(1),
body.mobile-layout .mobile-set-grid[data-count="5"] .mobile-set-frame:nth-child(2) {
  grid-column: span 3;
}

body.mobile-layout .mobile-set-grid[data-count="5"] .mobile-set-frame img {
  object-fit: contain;
}

body.mobile-layout .mobile-set-frame {
  min-height: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #070706;
  box-shadow: none;
}

body.mobile-layout .mobile-set-frame:first-child:nth-last-child(3) {
  grid-row: span 2;
}

body.mobile-layout .mobile-set-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.mobile-layout .contact-sheet {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: calc(100dvh - var(--top-ui-band) - var(--bottom-ui-band));
  padding: 4px 0 28px;
  justify-content: flex-start;
  gap: 14px;
  scroll-snap-align: start;
}

body.mobile-layout .contact-sheet.mobile-set-sheet {
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px 0 24px;
  min-height: calc(100dvh - var(--top-ui-band) - var(--bottom-ui-band));
  scroll-snap-stop: always;
}

body.mobile-layout .contact-sheet.mobile-set-sheet .contact-set {
  width: 100%;
  max-width: min(92vw, 560px);
  margin: 0 auto;
}

body.mobile-layout .mobile-slide {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

body.mobile-layout .mobile-slide-stack {
  width: min(94vw, 640px);
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.mobile-layout .mobile-slide-frame {
  flex: 1 1 0;
  min-height: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

body.mobile-layout .mobile-slide-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
}

body.mobile-layout .contact-sheet.free-contact-sheet {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

body.mobile-layout .free-contact-sheet .contact-set,
body.mobile-layout .free-contact-sheet .free-contact-frame {
  position: static;
  left: auto;
  top: auto;
  transform: none;
}

body.mobile-layout .contact-row {
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

body.mobile-layout .contact-row[data-align],
body.mobile-layout .contact-row[data-align="grid-left"],
body.mobile-layout .contact-row[data-align="grid-right"],
body.mobile-layout .contact-row[data-align="grid-left-soft"],
body.mobile-layout .contact-row[data-align="grid-right-soft"],
body.mobile-layout .contact-row[data-align="bottom-right"] {
  justify-content: center;
  transform: none;
  margin-top: 0;
}

body.mobile-layout .contact-set {
  width: 100%;
  max-width: min(92vw, 540px);
  grid-template-columns: repeat(var(--set-count), minmax(0, 1fr));
  gap: 4px;
  transform: none;
}

body.mobile-layout .contact-frame {
  width: min(26vw, 20vh);
  height: min(26vw, 20vh);
}

body.mobile-layout .free-contact-sheet .contact-frame {
  width: min(28vw, 22vh);
  height: min(28vw, 22vh);
}

body.mobile-layout .contact-frame img {
  max-width: 100%;
  max-height: 100%;
}

body.mobile-layout .contact-frame[data-index="2"] img,
body.mobile-layout .contact-frame[data-index="4"] img {
  max-width: 100%;
  max-height: 100%;
}

body.mobile-layout .high-res-image-frame img {
  max-width: 100vw;
  max-height: calc(100dvh - var(--fullscreen-top-safe) - var(--bottom-ui-band) - 20px);
}

body.mobile-layout .high-res-image-strip {
  padding: 0;
}

body.mobile-layout .brand {
  right: 10px;
  bottom: 10px;
}
