﻿/* ═════════════════════════════════════════════════════════
   M THE CREATIVE TOOL
   Editorial / brutalist portfolio 2026
   ═════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;
  --bg:        #F1F0E8;
  --bg-2:      #F5F5F5;
  --ink:       #171717;
  --ink-soft:  #454545;
  --ink-mute:  #525252;
  --line:      #E5E5E5;
  --red:       #BE3434;
  --red-dark:  #9C2A2A;
  --paper:     #DDDDD1;
  --shadow:    #2C2C2C;

  --f-display: "Space Mono", "space-mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --f-body:    "Sora", sans-serif;
  --f-mono:    "Space Mono", "space-mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --maxw: 1280px;
  --pad:  clamp(20px, 4vw, 48px);
}

/* ───────── dark mode ───────── */
html.dark {
  color-scheme: dark;
  --bg:       #111111;
  --bg-2:     #1C1C1C;
  --ink:      #F1F0E8;
  --ink-soft: #C8C8BF;
  --ink-mute: #88887F;
  --line:     #2A2A2A;
  --paper:    #1E1E1E;
  --shadow:   #000;
}

/* dark mode targeted overrides for elements using rgba/hex literals */
html.dark .card__visit:hover { color: var(--bg); }

/* ───────── reset ───────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
/* Root: avoid locking vertical overflow on html; keep horizontal clipping on body. */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-top: 88px; /* space for fixed nav (desktop) */
  min-width: 0;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
::selection { background: var(--red); color: var(--bg); }

/* ───────── scrollbars thin, transparent track, dark grey thumb ───────── */
* {
  scrollbar-width: thin;
  scrollbar-color: #4d4d4d transparent;
}
html.dark,
html.dark * {
  scrollbar-color: #6a6a6a transparent;
}
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
html.dark *::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background-color: #4d4d4d;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background-color: #3a3a3a;
}
html.dark *::-webkit-scrollbar-thumb {
  background-color: #6a6a6a;
  border: 0;
  background-clip: border-box;
}
html.dark *::-webkit-scrollbar-thumb:hover {
  background-color: #858585;
}

/* ───────── grain ───────── */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  mix-blend-mode: multiply; opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .22 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

/* ───────── nav ───────── */
.nav {
  width: 100%;
  padding: 28px var(--pad) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--ink-mute);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 400;
  background: transparent;
  transition: background .35s ease, padding .35s ease;
}

.nav__bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

/* Desktop: toggle sits bottom-left viewport; omit wrapper from layout (mark + MENU only in bar) */
@media (min-width: 761px) {
  .nav > .nav__bar > .mode-island {
    display: contents;
  }

  /* Liquid-glass capsule on the btn (formerly on .mode-island wrapper) */
  .nav > .nav__bar > .mode-island > .mode-island__btn,
  .nav > .nav__bar > .mode-island > .mode-island__btn.is-active {
    position: fixed !important;
    bottom: 24px !important;
    left: 24px !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    z-index: 2000;

    box-sizing: border-box;
    width: 46px;
    height: 46px;
    padding: 0;

    border-radius: 5px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(36px) saturate(210%);
    -webkit-backdrop-filter: blur(36px) saturate(210%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow:
      0 4px 24px rgba(0, 0, 0, 0.07),
      0 12px 40px rgba(0, 0, 0, 0.05),
      inset 0 1px 0 rgba(255, 255, 255, 0.65),
      inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    transition: background .35s, border-color .35s, box-shadow .35s, opacity .2s ease;
  }

  html.dark .nav > .nav__bar > .mode-island > .mode-island__btn,
  html.dark .nav > .nav__bar > .mode-island > .mode-island__btn.is-active {
    background: rgba(22, 22, 22, 0.42);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
      0 4px 28px rgba(0, 0, 0, 0.45),
      0 14px 48px rgba(0, 0, 0, 0.32),
      inset 0 1px 0 rgba(255, 255, 255, 0.12),
      inset 0 -1px 0 rgba(0, 0, 0, 0.35);
  }

  .nav > .nav__bar > .mode-island > .mode-island__btn.is-active {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  html.dark .nav > .nav__bar > .mode-island > .mode-island__btn.is-active {
    background: rgba(255, 255, 255, 0.05);
  }

  .nav__menu {
    font-size: 18px;
  }
}

/* when overlay is open logo switches to page background colour, text goes light */
body.overlay-open .nav__logo-icon {
  filter: brightness(0) invert(0.95) sepia(0.12) saturate(0.6);
}
body.overlay-open .nav__menu {
  color: rgba(255,255,255,.55);
}
body.overlay-open .nav__menu:hover {
  color: var(--red);
}
.nav__mark {
  display: inline-flex; align-items: center; gap: 10px; color: var(--ink-mute);
}
.nav__mark svg { flex-shrink: 0; }
.nav__logo-icon { flex-shrink: 0; height: 32px; width: auto; display: block; transition: filter .35s ease; }
.nav__wordmark {
  font-size: 11px; text-transform: uppercase; letter-spacing: .14em;
  border-left: 1px solid currentColor; padding-left: 10px;
}
.nav__links {
  justify-self: center;
  display: flex; gap: 28px;
  text-transform: uppercase; font-weight: 500;
}
.nav__links a { position: relative; padding: 4px 0; transition: color .2s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--red); transform: scaleX(0);
  transform-origin: left; transition: transform .35s cubic-bezier(.7,.1,.2,1);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); }

.nav__menu {
  font-family: var(--f-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--ink-mute);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1.5px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.nav__menu:hover {
  color: var(--red);
  border-bottom-color: var(--red);
}

@media (max-width: 760px) {
  .nav__links { display: none; }
}

/* ───────── hero ───────── */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 60px) var(--pad) clamp(80px, 12vw, 180px);
  text-align: center;
  position: relative;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.hero__meta {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-mute);
  display: inline-flex; gap: 14px; align-items: center;
  margin-bottom: 36px;
}
.hero__meta-sep { opacity: .5; }

.hero__title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(72px, 13vw, 200px);
  line-height: 1.15;
  letter-spacing: -.055em;
  display: flex; flex-direction: column; gap: 4px;
  text-transform: uppercase;
  animation: rise 1s .1s backwards cubic-bezier(.2,.7,.2,1);
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-wrap: break-word;
}
.hero__word { display: block; }
.hero__word--with-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hero__split-l,
.hero__split-r {
  display: inline-block;
  transition: transform .9s cubic-bezier(.16, 1, .3, 1);
}
.hero__word--with-dot.is-split .hero__split-l { transform: translateX(-6px); }
.hero__word--with-dot.is-split .hero__split-r { transform: translateX(6px); }

/* dot collapsed until is-split fires */
.hero__dot {
  display: inline-block;
  width:  0;
  height: clamp(72px, 11.5vw, 155px);
  margin-inline: 0;
  vertical-align: middle;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  transition: width .9s cubic-bezier(.16, 1, .3, 1),
              margin-inline .9s cubic-bezier(.16, 1, .3, 1);
}
.hero__word--with-dot.is-split .hero__dot {
  width: clamp(72px, 11.5vw, 155px);
  margin-inline: clamp(4px, .8vw, 14px);
}
/* All logos stacked; only .is-active is visible */
.hero__logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: none;
  pointer-events: none;
}
.hero__logo.is-active { display: block; }
.hero__word--outlined {
  color: transparent;
  -webkit-text-stroke: clamp(1.5px, .25vw, 3.4px) var(--ink);
}

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

/* ───────── Hero 3-state inline-SVG button ───────── */
/*
  Single-property chevron transition (no jitter):
    transform-origin: 50% 95% anchors the scale pivot at the bar centre
    (bar y-centre = 34.02 / 35.77 = 95.1% of SVG viewport height).
    scaleY(0) → scaleY(1) is ONE property perfectly linear interpolation.
    The chevron appears to grow directly out of the bar with no curved path.
*/

.hero__btn {
  margin: clamp(80px, 12vw, 140px) auto 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  cursor: pointer;
}

/* Stack holds the SVG (bar, chevron, press circle) */
.hero__btn-stack {
  position: relative;
  display: inline-block;
  width: clamp(140px, 16vw, 220px);
  aspect-ratio: 105.28 / 35.77;
  overflow: visible;
}

.hero__btn-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Bar cross-fades out on press as circle blooms */
.btn-bar {
  fill: var(--red);
  transition: opacity .35s ease, transform .35s ease;
}
.hero__btn:active .btn-bar {
  opacity: 0;
  transform: scaleX(.6);
}

/* Chevron collapses back into bar smoothly on click */
.btn-chevron {
  fill: var(--red);
  transform-origin: 50% 95%;
  transform: scaleY(0);
  opacity: 0;
  transition:
    transform .48s cubic-bezier(.34, 1.5, .64, 1),
    opacity   .22s ease;
}
.hero__btn:hover .btn-chevron,
.hero__btn:focus-visible .btn-chevron {
  transform: scaleY(1);
  opacity: 1;
}
.hero__btn:active .btn-chevron {
  transform: scaleY(0);
  opacity: 0;
  transition:
    transform .25s cubic-bezier(.4, 0, 1, 1),
    opacity   .2s ease;
}

/* Press feedback solid circle at bar centre (52.64, 34.02) */
.btn-press-circle {
  fill: var(--red);
  opacity: 0;
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center;
  pointer-events: none;
  transition:
    opacity   .22s ease,
    transform .4s cubic-bezier(.34, 1.4, .64, 1);
}
.hero__btn:active .btn-press-circle {
  opacity: 1;
  transform: scale(1);
}
.hero__btn:focus-visible .hero__btn-svg {
  outline: 2px solid var(--red);
  outline-offset: 8px;
}

/* Hero CTA label hidden at rest, slides in on hover, gone on click */
.hero__btn-label {
  font-family: var(--f-mono);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--red);
  margin-top: 10px;
  display: block;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity .3s ease, transform .38s cubic-bezier(.16, 1, .3, 1);
}
.hero__btn:hover .hero__btn-label,
.hero__btn:focus-visible .hero__btn-label {
  opacity: 1;
  transform: translateY(0);
}
.hero__btn:active .hero__btn-label {
  opacity: 0;
  transform: translateY(-5px);
  transition-duration: .1s, .1s;
}

/* Touch / tablet: SVG bar loses hover reveal show labelled button only */
@media (max-width: 1024px) {
  .hero__btn-stack {
    display: none;
  }

  .hero__btn-label {
    opacity: 1;
    transform: none;
    margin-top: 0;
    font-family: var(--f-mono);
    font-size: clamp(13px, 3.2vw, 16px);
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fff;
    padding: 12px 28px;
    border: 2px solid var(--red-dark);
    border-radius: 5px;
    background: var(--red);
    box-shadow: 4px 4px 0 var(--red-dark);
    transition:
      transform 0.2s ease,
      box-shadow 0.2s ease,
      opacity 0.2s ease,
      border-color 0.2s ease,
      color 0.2s ease;
  }

  .hero__btn:active .hero__btn-label {
    opacity: 1;
    transform: translateY(2px);
    box-shadow: 2px 2px 0 var(--red-dark);
  }
}


/* ───────── work grid ───────── */
.work {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad) clamp(80px, 10vw, 140px);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.work__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  min-width: 0;
  flex-wrap: wrap;
}
.work__head-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.work__head-desc {
  font-family: var(--f-body);
  font-size: clamp(13px, 1.1vw, 15px);
  color: var(--ink-mute);
  line-height: 1.6;
  max-width: 42ch;
}
.work__head-eye {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--red);
}
.work__head-title {
  flex: 1;
  font-family: var(--f-display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--ink);
}
.work__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  min-width: 0;
  width: 100%;
}

/* Figma layout: row 1 → Poster (8 col) + Editorial (4 col)
                 row 2 → Digital (4 col) + Brand (8 col)   */
.card--poster    { grid-column: 1 / span 8; grid-row: 1; }
.card--editorial { grid-column: 9 / span 4; grid-row: 1; }
.card--digital   { grid-column: 1 / span 4; grid-row: 2; }
.card--brand     { grid-column: 5 / span 8; grid-row: 2; }

@media (max-width: 980px) {
  .card--poster,
  .card--editorial,
  .card--digital,
  .card--brand { grid-column: 1 / -1; grid-row: auto; }
}

.card {
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 5px;
  overflow: hidden;
  display: flex; flex-direction: column;
  position: relative;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); z-index: 2; }


/* card bar fixed 36px dark terminal header */
.card__bar {
  background: var(--ink);
  color: var(--bg);
  height: 36px;
  padding: 0 12px;
  display: flex; justify-content: flex-start; align-items: center;
  flex-shrink: 0;
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: .13em; text-transform: uppercase;
}
.card__bar-label { opacity: .95; }

/* image containers */
.card__media {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  margin: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
/* Poster wide landscape */
.card__media--landscape { aspect-ratio: 16 / 9; }
/* Editorial portrait, fills remaining card height */
.card__media--portrait  { flex: 1; aspect-ratio: unset; }
/* Digital square */
.card__media--square    { aspect-ratio: 1 / 1; }
/* Brand left panel flush, fills height */
.card__media--flush     { margin: 0; border: 0; flex: 1; }

.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.02);
  transition: transform .9s cubic-bezier(.2,.7,.2,1), filter .5s;
}
.card:hover .card__media img { transform: scale(1.04); filter: grayscale(0) contrast(1.05); }

/* Raw image fills card width; media block height tracks intrinsic ratio (no fixed aspect crop) */
.card__media:has(.card__media-img--raw) {
  aspect-ratio: unset;
  height: auto;
}
.card__media img.card__media-img--raw {
  object-fit: contain;
  width: 100%;
  height: auto;
  display: block;
  transition: transform .9s cubic-bezier(.2, .7, .2, 1), filter .5s;
}

.card__media img.card__media-img--raw.card__media-img--bw {
  filter: grayscale(100%) contrast(1.02);
}

/* Hover color: must beat resting rule above (same cascade issue as .card:hover .card__media img) */
.card:hover .card__media img.card__media-img--raw {
  filter: grayscale(0) contrast(1.05);
}

.card__body {
  padding: 22px 24px 28px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card__media-img--bw {
  filter: grayscale(100%);
  transition: filter .4s ease;
}
.card__media-img--bw:hover {
  filter: grayscale(0%);
}

/* ── Prototype modal ── */
.proto-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.proto-modal.is-open { display: flex; }

.proto-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
}
.proto-modal__box {
  position: relative;
  z-index: 1;
  width: min(1280px, 96vw);
  height: min(780px, 92vh);
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 5px;
  box-shadow: 8px 8px 0 var(--ink);
  display: grid;
  grid-template-columns: 1fr 320px;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

/* Topbar spans full width across both columns */
.proto-modal__topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--ink);
  flex-shrink: 0;
}
.proto-modal__topbar-badge {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #fff;
  opacity: .9;
}
.proto-modal__close {
  background: none;
  border: none;
  font-size: 11px;
  font-family: var(--f-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color .2s;
}
.proto-modal__close:hover { color: var(--red); }

.proto-modal__frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  border-right: 2px solid var(--ink);
}

/* Info panel */
.proto-modal__info {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 24px;
  overflow-y: auto;
  background: var(--bg);
}
.proto-modal__info-label {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--red);
}
.proto-modal__info-title {
  font-family: var(--f-display);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1;
  margin-top: 4px;
}
.proto-modal__info-sub {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-top: -12px;
}
.proto-modal__info-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.proto-modal__info-section-title {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.proto-modal__info-text {
  font-family: var(--f-body);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink);
}
.proto-modal__info-text strong {
  font-weight: 600;
  color: var(--ink);
}
.proto-modal__info-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.proto-modal__info-steps li {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  padding-left: 14px;
  position: relative;
}
.proto-modal__info-steps li::before {
  content: ' ';
  position: absolute;
  left: 0;
  color: var(--red);
}

@media (max-width: 760px) {
  .proto-modal {
    padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    align-items: flex-start;
  }
  .proto-modal__box {
    width: 100%;
    max-width: 100%;
    max-height: min(92dvh, 92vh, 900px);
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(36vh, 1fr) auto;
  }
  .proto-modal__frame {
    border-right: none;
    border-bottom: 2px solid var(--ink);
    min-height: 36vh;
  }
}
.card__title {
  font-family: var(--f-mono); font-weight: 700;
  font-size: clamp(14px, 1.3vw, 18px);
  letter-spacing: .02em; color: var(--ink);
  margin-bottom: 8px;
}
.card__desc {
  color: var(--ink-soft);
  font-size: 13px; line-height: 1.55;
  max-width: 62ch;
}

/* visit website button on cards */
.card__visit {
  display: inline-block;
  align-self: flex-start;
  margin-top: 0;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--ink);
  padding: 7px 14px;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 5px;
  transition: background .2s, color .2s;
}
.card__visit:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* tags Figma beige #DDDDD1 */
.tags { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-mono); font-size: 11px;
  padding: 4px 8px; letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 5px;
}

/* brand card horizontal split */
.card--brand { flex-direction: row; }
.card--brand .card__split {
  display: contents;
}
.card--brand .card__split-media {
  width: 50%;
  border-right: 2px solid var(--ink);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
}
/* Artium: flex height chain + true box for the MP4 (height:100% on video was broken) */
.card--brand .card__media--artium {
  flex: 1 1 0;
  min-height: min(52vh, 420px);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  border: none;
  border-radius: 0;
  outline: none;
  box-shadow: none;
}
html.dark .card--brand .card__media--artium { background: #000; }
/* Zoom the frame slightly: source has a lot of black scale keeps the full clip
   visible in the center while trimming mostly empty edges (overflow on parent). */
.card--brand .card__media__video--artium {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  min-height: 0;
  transform: scale(1.99);
  transform-origin: center center;
  border: none;
  outline: none;
}
@media (max-width: 760px) {
  .card--brand .card__media__video--artium { transform: scale(1.75); }
}
.card--brand .card__split-body {
  flex: 1;
  padding: clamp(32px, 4vw, 56px) clamp(24px, 3vw, 40px);
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
}
.card--brand .card__desc { max-width: 36ch; }

@media (max-width: 760px) {
  .card--brand { flex-direction: column; }
  .card--brand .card__split-media { width: 100%; border-right: 0; border-bottom: 2px solid var(--ink); }
  .card--brand .card__media--artium { min-height: min(36vh, 320px); }
}

/* case study button */
.btn {
  align-self: flex-start;
  display: inline-block;
  font-family: var(--f-mono); font-size: 12px; font-weight: 700;
  padding: 10px 26px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 2px 2px 0 var(--ink);
  letter-spacing: .1em;
  transition: transform .2s, box-shadow .2s;
}
.btn:hover {
  transform: translate(-1px,-1px);
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--ink); color: var(--bg);
}

/* ───────── clients / partners marquee ───────── */
.clients {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad) clamp(60px, 8vw, 100px);
}
.clients__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.clients__label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* mask fade edges */
.clients__track-wrap {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.clients__track {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: clamp(40px, 5vw, 72px);
  width: max-content;
  will-change: transform;
  backface-visibility: hidden;
  animation-name: clients-marquee;
  animation-duration: 40s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: none;
  animation-direction: normal;
  animation-play-state: running;
}

@keyframes clients-marquee {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

.clients__logo {
  height: clamp(48px, 6vw, 80px);
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
  filter: brightness(0);
  opacity: .55;
  pointer-events: none;
  user-select: none;
}
html.dark .clients__logo { filter: brightness(0) invert(1); }

/* ───────── scans ───────── */
.scans {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad) clamp(60px, 8vw, 120px);
}
.scans__head {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 28px;
  font-family: var(--f-mono); font-size: 14px;
  text-transform: uppercase; letter-spacing: .1em;
}
.scans__icon {
  width: 48px; height: 48px;
  border-radius: 5px;
  background: var(--red);
  border: 2px solid var(--ink);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 2px 2px 0 var(--ink);
}
.scans__icon svg { width: 22px; height: 18px; }
.scans__head h2 {
  flex: 1;
  font-family: var(--f-display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1;
}
.scans__count { color: var(--ink-mute); font-size: 12px; }

.scans__desc {
  font-family: var(--f-body);
  font-size: clamp(13px, 1.1vw, 15px);
  color: var(--ink-mute);
  line-height: 1.6;
  margin-top: -14px;
  margin-bottom: 28px;
  max-width: 480px;
}

.scans__grid {
  columns: 4;
  column-gap: 16px;
}
@media (max-width: 820px) { .scans__grid { columns: 2; } }
@media (max-width: 480px)  { .scans__grid { columns: 1; } }

.scan {
  break-inside: avoid;
  margin-bottom: 16px;
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 5px;
  box-shadow: 2px 2px 0 var(--ink);
  overflow: hidden;
  position: relative;
  transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s;
}
.scan:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.scan img {
  width: 100%; height: auto; display: block;
  filter: grayscale(.4);
  transition: filter .5s, transform .9s;
}
.scan:hover img { filter: grayscale(0); transform: scale(1.05); }
.scan figcaption {
  position: absolute; left: 10px; bottom: 10px;
  font-family: var(--f-mono); font-size: 10px;
  background: var(--ink); color: var(--bg);
  padding: 4px 8px; letter-spacing: .12em;
}

/* ───────── brands strip: 16 red geometric marks ───────── */
.brands {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) var(--pad);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.brands__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 40px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--line);
}
.brands__label {
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--red);
}
.brands__count {
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: .18em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.brands__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}
@media (max-width: 820px) { .brands__grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .brands__grid { grid-template-columns: repeat(2, 1fr); } }

.mark {
  aspect-ratio: 1 / 1;
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: var(--red);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(18px, 2.6vw, 36px);
  position: relative;
  transition: background-color .4s ease, color .4s ease, transform .4s ease;
  cursor: pointer;
}
.mark svg {
  width: 100%;
  height: 100%;
  max-width: 72px;
  max-height: 72px;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.mark::after {
  content: attr(title);
  position: absolute;
  bottom: 10px;
  left: 12px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .18em;
  color: var(--ink-mute);
  opacity: 0;
  transition: opacity .3s ease;
}
.mark:hover {
  background: var(--ink);
  color: #F1F0E8;
}
.mark:hover svg { transform: rotate(-8deg) scale(1.06); }
.mark:hover::after { opacity: 1; color: var(--paper); }

/* ───────── contact CTA section ───────── */
.cta-section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(80px, 10vw, 140px) var(--pad) clamp(120px, 16vw, 200px);
}
.cta-section__inner h2 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(40px, 6.4vw, 96px);
  line-height: 1.02;
  letter-spacing: -.05em;
  margin-bottom: 36px;
  text-transform: uppercase;
}
.cta-section__inner em {
  font-style: italic;
  color: var(--red);
  font-weight: 400;
}
.cta-section__link {
  font-family: var(--f-mono);
  font-size: clamp(20px, 2.75vw, 32px);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-top: 4px;
  transition: color .2s, border-color .2s, letter-spacing .25s, gap .25s;
}
.cta-section__link-arrow {
  flex-shrink: 0;
  width: 0.85em;
  height: 0.85em;
  margin-top: 0.08em;
  transition: transform .25s ease;
}
.cta-section__link:hover {
  color: var(--red);
  border-color: var(--red);
  letter-spacing: .16em;
  gap: 0.55em;
}
.cta-section__link:hover .cta-section__link-arrow {
  transform: translate(2px, -2px);
}

/* ───────── footer ───────── */
.foot-wrap {
  background: var(--paper);
  position: relative;
  z-index: 10;
  margin-top: clamp(80px, 10vw, 140px);
  border-top: 2px solid var(--ink);
}
.foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 6vw, 80px) var(--pad) 40px;
  position: relative;
  overflow: hidden;
}

/* big right-aligned SVG wordmark (--foot-wm-ty synced in script.js for scroll scrub) */
.foot__wordmark {
  --foot-wm-ty: 140px;
  --foot-wm-mb: clamp(80px, 10vw, 140px);
  display: block;
  width: clamp(260px, 55vw, 820px);
  height: auto;
  margin-top: 0;
  margin-bottom: var(--foot-wm-mb);
  margin-left: auto;
  transform: translateY(var(--foot-wm-ty));
  opacity: 0;
  will-change: transform, opacity;
}
.foot__cta h2 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(40px, 6.4vw, 96px);
  line-height: 1.02;
  letter-spacing: -.05em;
  margin-bottom: 36px;
  text-transform: uppercase;
}
.foot__cta em {
  font-style: italic; color: var(--red); font-weight: 400;
}
.foot__meta {
  margin-top: 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
}
.foot__copy {
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: .1em; color: var(--ink-soft);
}
.foot__social {
  display: flex;
  gap: 14px;
  justify-self: end;
}
.soc {
  width: 36px; height: 36px;
  border-radius: 5px;
  display: grid; place-items: center;
  color: var(--ink-mute);
  transition: color .2s, transform .2s;
}
.soc:hover { color: var(--red); transform: translateY(-2px); }
.soc svg { width: 20px; height: 20px; }

@media (max-width: 1024px) {
  .foot {
    padding: clamp(36px, 5vw, 56px) var(--pad) 36px;
  }
  .foot__wordmark {
    --foot-wm-ty: 70px;
    --foot-wm-mb: clamp(64px, 12vw, 104px);
  }
}

@media (max-width: 720px) {
  .foot {
    padding: clamp(28px, 5vw, 44px) var(--pad) 32px;
  }
  .foot__wordmark {
    --foot-wm-ty: 42px;
    --foot-wm-mb: clamp(48px, 11vw, 72px);
  }
  .foot__meta { grid-template-columns: 1fr; text-align: center; gap: 20px; }
  .foot__social { justify-self: center; }
}

/* ───────── overlay nav ───────── */
.overlay {
  position: fixed;
  inset: 0;
  /* liquid glass base */
  background: rgba(6, 6, 6, 0.78);
  backdrop-filter: blur(48px) saturate(180%) brightness(75%);
  -webkit-backdrop-filter: blur(48px) saturate(180%) brightness(75%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--pad);
  clip-path: inset(0 0 100% 0);
  transition: clip-path .75s cubic-bezier(.77,0,.18,1);
  pointer-events: none;
  overflow: hidden;
}
.overlay.is-open {
  clip-path: inset(0 0 0% 0);
  pointer-events: all;
}

/* glass refraction gradient light bends across the surface */
.overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,.055) 0%, transparent 38%),
    linear-gradient(315deg, rgba(255,255,255,.025) 0%, transparent 42%);
  pointer-events: none;
}

/* top glass edge bright specular line where the pane catches light */
.overlay::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,.18) 25%,
    rgba(255,255,255,.38) 50%,
    rgba(255,255,255,.18) 75%,
    transparent 100%
  );
  pointer-events: none;
}

/* close button */
.overlay__close {
  position: absolute;
  top: 28px;
  right: var(--pad);
  display: flex;
  gap: 0;
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  color: #555;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color .2s;
}
.overlay__close span { display: inline; }
.overlay__close:hover { color: var(--red); }

/* main nav list */
.overlay__nav { width: 100%; }
.overlay__list { list-style: none; }

.overlay__item {
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,.07);
  padding: clamp(10px, 1.5vw, 20px) 0;
  cursor: pointer;
}
.overlay__item:last-child { border-bottom: 1px solid rgba(255,255,255,.07); }

/* glass shimmer highlight on hover */
.overlay__item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent       0%,
    rgba(255,255,255,.03) 35%,
    rgba(255,255,255,.08) 50%,
    rgba(255,255,255,.03) 65%,
    transparent       100%
  );
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), inset 0 -1px 0 rgba(255,255,255,.03);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}
.overlay__item:hover::before {
  opacity: 1;
  transform: translateX(0);
}

/* main links slide up from below on open */
.overlay__link {
  display: block;
  width: 100%;
  font-family: var(--f-mono);
  font-size: clamp(40px, 7.2vw, 88px);
  font-weight: 700;
  letter-spacing: -.04em;
  color: #fff;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  transform: translateY(110%);
  transition: transform .65s cubic-bezier(.77,0,.18,1);
  line-height: 1.05;
}
.overlay.is-open .overlay__link { transform: translateY(0); }
.overlay__item:nth-child(1) .overlay__link { transition-delay: .10s; }
.overlay__item:nth-child(2) .overlay__link { transition-delay: .18s; }
.overlay__item:nth-child(3) .overlay__link { transition-delay: .26s; }
.overlay__item:nth-child(4) .overlay__link { transition-delay: .34s; }

/* Projects link row link + toggle button side by side */
.overlay__link-row {
  display: flex;
  align-items: center;
  gap: 14px;
}


/* Toggle button hidden on desktop */
.overlay__sub-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ink);
  flex-shrink: 0;
}
.overlay__sub-toggle svg {
  width: 14px;
  height: 14px;
  display: block;
  transition: transform .3s;
}
.overlay__sub-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
  opacity: 1;
}
.overlay__sub-toggle svg {
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .2s ease;
  opacity: 0.55;
}

/* sub-links under Projects hidden until Projects is hovered */
.overlay__sub {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-top: 0;
  transition: max-height .4s cubic-bezier(.7,0,.2,1),
              opacity .3s ease,
              padding .3s ease;
}
.overlay__item--has-sub:hover .overlay__sub {
  max-height: 200px;
  opacity: 1;
  padding-top: 10px;
}
.overlay__sublink {
  font-family: var(--f-mono);
  font-size: clamp(10px, 1.15vw, 14px);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #aaa;
  text-decoration: none;
  transition: color .2s;
  cursor: pointer;
}
.overlay__sublink:hover { color: var(--red); }

/* footer strip */
.overlay__footer {
  position: absolute;
  bottom: 28px;
  left: var(--pad);
  right: var(--pad);
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

/* ───────── inner page shared ───────── */
.page-hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 72px) var(--pad) clamp(32px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
}
.page-hero__eye {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-hero__eye::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 1px;
  background: currentColor;
}
.page-hero__title {
  font-family: var(--f-display);
  font-size: clamp(56px, 10vw, 140px);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1;
  color: var(--ink);
  overflow: hidden;
}
.page-hero__title > span {
  display: block;
  animation: ph-slide-up .75s cubic-bezier(.7,0,.2,1) both;
}
@keyframes ph-slide-up {
  from { transform: translateY(105%); }
  to   { transform: translateY(0); }
}
.page-hero__lede {
  margin-top: 28px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-mute);
  max-width: 480px;
  letter-spacing: .03em;
}

/* ───────── about page ───────── */
.about-body {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(60px, 8vw, 120px) var(--pad);
}

.about-profile {
  display: grid;
  grid-template-columns: minmax(200px, 380px) 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  margin-bottom: clamp(56px, 8vw, 96px);
  padding-bottom: clamp(48px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
}
@media (max-width: 760px) {
  .about-profile {
    grid-template-columns: 1fr;
    align-items: start;
  }
}
.about-profile__figure {
  margin: 0;
  position: relative;
}
.about-profile__img {
  width: 100%;
  max-width: 380px;
  height: auto;
  display: block;
  border: 2px solid var(--ink);
  border-radius: 5px;
  box-shadow: 6px 6px 0 var(--ink);
}
@media (max-width: 760px) {
  .about-profile__img { max-width: none; }
}
html.dark .about-profile__img {
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
}
.about-profile__eyebrow {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.about-profile__title {
  font-family: var(--f-display);
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 20px;
}
.about-profile__desc {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 52ch;
  margin-bottom: 16px;
}
.about-profile__desc:last-child { margin-bottom: 0; }

.about-statement {
  font-family: var(--f-display);
  font-size: clamp(22px, 3.5vw, 44px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
  color: var(--ink);
  max-width: 820px;
  margin-bottom: clamp(60px, 8vw, 100px);
  border-left: 3px solid var(--red);
  padding-left: 24px;
}
.about-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  margin-bottom: clamp(60px, 8vw, 100px);
}
@media (max-width: 680px) { .about-cols { grid-template-columns: 1fr; } }
.about-col__label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}
.about-col__heading {
  font-family: var(--f-display);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -.02em;
}
.about-col__text { font-size: 13px; line-height: 1.75; color: var(--ink-soft); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: clamp(60px, 8vw, 100px);
}
@media (min-width: 540px) {
  .services-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
.service-cell {
  padding: 24px 20px;
  border-right: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  transition: background .2s, color .2s;
}
.service-cell:hover { background: var(--ink); color: var(--bg); }
.about-cta {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.about-cta__text { font-size: 13px; color: var(--ink-mute); }
.about-cta__link {
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
  text-decoration: none;
  border-bottom: 1px solid var(--red);
  padding-bottom: 2px;
  transition: opacity .2s;
}
.about-cta__link:hover { opacity: .7; }

/* ───────── contact page ───────── */
.contact-body {
  max-width: min(1320px, 100%);
  width: 100%;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 100px) var(--pad) clamp(80px, 10vw, 140px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: clamp(20px, 3vw, 28px);
  align-items: start;
}

.contact-aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.contact-map__embed {
  position: relative;
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--bg-2);
  aspect-ratio: 4 / 3;
  isolation: isolate;
}

html.dark .contact-map__embed {
  border-color: var(--line);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .5);
}

/* Charcoal land + light linework via invert stack (no extra saturate tint) */
.contact-map__embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: min(340px, 48vw);
  border: 0;
  transform: translateZ(0);
  transition: filter 0.4s ease;
}

html:not(.dark) .contact-map__embed iframe {
  filter: grayscale(100%) invert(93%) hue-rotate(174deg) contrast(1.1) brightness(0.74);
}

html.dark .contact-map__embed iframe {
  filter: grayscale(100%) invert(91%) hue-rotate(174deg) contrast(1.12) brightness(0.6);
}

@media (prefers-reduced-motion: reduce) {
  .contact-map__embed iframe {
    transition: none;
  }
}

/* Main form card high contrast, readable on grain */
.contact-form-panel {
  width: 100%;
  background: var(--bg-2);
  border: 2px solid var(--ink);
  border-radius: 5px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: clamp(28px, 3.5vw, 48px) clamp(26px, 3.5vw, 48px) clamp(36px, 4vw, 52px);
  position: relative;
  isolation: isolate;
}
html.dark .contact-form-panel {
  box-shadow: 6px 6px 0 rgba(0,0,0,.5);
}
.contact-form-panel__kicker {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}
.contact-form-panel__title {
  font-family: var(--f-display);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 8px;
}
.contact-form-panel__lede {
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--ink-mute);
  line-height: 1.5;
  margin-bottom: 28px;
  max-width: 40ch;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 700;
}
.form-input,
.form-select,
.form-textarea {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  outline: none;
  padding: 12px 14px;
  resize: none;
  -webkit-appearance: none;
  transition: box-shadow .2s, border-color .2s;
  box-shadow: inset 0 0 0 1px transparent;
}
html.dark .form-input,
html.dark .form-select,
html.dark .form-textarea {
  background: #151515;
  border-color: var(--ink-mute);
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--ink-mute);
  opacity: .85;
}
.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--ink);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(190, 52, 52, 0.2);
}
.form-select { cursor: pointer; }
.form-textarea { min-height: 168px; }
.form-textarea { font-family: var(--f-body); }

.form-submit {
  margin-top: 8px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 5px;
  padding: 16px 32px;
  cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
  align-self: flex-start;
  box-shadow: 3px 3px 0 var(--red);
}
.form-submit:hover {
  background: var(--red);
  border-color: var(--red);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.form-submit:active { transform: translate(0, 0); }

/* “Also reach us” stacks under map on desktop right column */
.contact-info {
  padding: 0;
  width: 100%;
}
.contact-info--panel {
  background: var(--bg-2);
  border: 2px solid var(--ink);
  border-radius: 5px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: clamp(22px, 2.5vw, 36px) clamp(26px, 3vw, 40px);
}
html.dark .contact-info--panel {
  box-shadow: 4px 4px 0 rgba(0,0,0,.45);
}
.contact-info__eyebrow {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.contact-info__label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}
.contact-info__val {
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 24px;
  line-height: 1.45;
  word-break: break-word;
}
.contact-info__val:last-of-type { margin-bottom: 0; }
.contact-info__val a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; transition: color .2s; }
.contact-info__val a:hover { color: var(--red); }

@media (max-width: 960px) {
  .contact-body {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .contact-map__embed {
    aspect-ratio: 16 / 10;
  }

  .contact-map__embed iframe {
    min-height: 260px;
  }
}

/* ───────── projects page ───────── */
.proj-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px var(--pad) 0;
}
.proj-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 24px var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}
.proj-filter__btn {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all .2s;
}
.proj-filter__btn:hover,
.proj-filter__btn.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.proj-section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 6vw, 80px) var(--pad);
  border-bottom: 1px solid var(--line);
}
.proj-section__head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 36px;
}
.proj-section__title {
  font-family: var(--f-display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -.04em;
}
.proj-section__count {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--ink-mute);
}
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.proj-card {
  background: var(--bg-2);
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: background .3s, border-color .3s;
  border-radius: 5px;
  border: 1px solid var(--line);
  box-sizing: border-box;
}
.proj-card:hover { background: var(--ink); border-color: var(--ink); }
.proj-card:hover .proj-card__name,
.proj-card:hover .proj-card__type { color: var(--bg); }
.proj-card__num {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--ink-mute);
  transition: color .3s;
}
.proj-card:hover .proj-card__num { color: #555; }

/* preview image variant fills the card area, no filter */
.proj-card__logo-wrap--img {
  position: absolute;
  inset: 0 0 64px 0;
  padding: 0;
  overflow: hidden;
}
.proj-card__preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease, opacity .3s ease;
}
.proj-card:hover .proj-card__preview-img { transform: scale(1.04); opacity: .85; }

.proj-card__logo-wrap {
  position: absolute;
  inset: 0 0 64px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.proj-card__logo {
  max-width: 76%;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: brightness(0);
  transition: filter .35s ease;
}
.proj-card:hover .proj-card__logo {
  filter: brightness(0) invert(1);
}
html.dark .proj-card__logo { filter: brightness(0) invert(1); opacity: .7; }
html.dark .proj-card:hover .proj-card__logo { filter: brightness(0); opacity: 1; }
/* Workbench: dedicated light/dark SVGs no mono filter; hover inverts variant */
.proj-card[data-id="workbench"] .proj-card__logo-wb--light {
  display: block;
  width: 121.53px;
  max-width: 121.53px;
  height: auto;
  max-height: none;
}
.proj-card[data-id="workbench"] .proj-card__logo-wb--dark { display: none; }
.proj-card[data-id="workbench"]:hover .proj-card__logo-wb--light { display: none; }
.proj-card[data-id="workbench"]:hover .proj-card__logo-wb--dark { display: block; }
html.dark .proj-card[data-id="workbench"] .proj-card__logo-wb--light { display: none; }
html.dark .proj-card[data-id="workbench"] .proj-card__logo-wb--dark { display: block; }
html.dark .proj-card[data-id="workbench"]:hover .proj-card__logo-wb--light { display: block; }
html.dark .proj-card[data-id="workbench"]:hover .proj-card__logo-wb--dark { display: none; }
.proj-card[data-id="workbench"] .proj-card__logo-wb {
  filter: none;
  opacity: 1;
  transition: transform .35s ease, filter .35s ease, opacity .35s ease;
}
.proj-card[data-id="workbench"]:hover .proj-card__logo-wb {
  opacity: 1;
}
/* Light mode: Workbench hover = white silhouette */
html:not(.dark) .proj-card[data-id="workbench"]:hover .proj-card__logo-wb {
  filter: brightness(0) invert(1);
}
html.dark .proj-card[data-id="workbench"]:not(:hover) .proj-card__logo-wb {
  filter: brightness(0) invert(1);
  opacity: 1;
}
html.dark .proj-card[data-id="workbench"]:hover .proj-card__logo-wb {
  filter: none;
  opacity: 1;
}
/* TypoMatch: light = color at rest, white on hover · dark = white at rest, color on hover */
.proj-card[data-id="typomatch"] .proj-card__logo-tm {
  max-width: 64%;
  max-height: none;
  filter: none;
  opacity: 1;
  transition: transform .35s ease, filter .35s ease, opacity .35s ease;
}
.proj-card[data-id="typomatch"]:hover .proj-card__logo-tm {
  transform: scale(1.04);
}
html:not(.dark) .proj-card[data-id="typomatch"]:hover .proj-card__logo-tm {
  filter: brightness(0) invert(1);
  opacity: 1;
}
html.dark .proj-card[data-id="typomatch"]:not(:hover) .proj-card__logo-tm {
  filter: brightness(0) invert(1);
  opacity: 1;
}
html.dark .proj-card[data-id="typomatch"]:hover .proj-card__logo-tm {
  filter: none;
  opacity: 1;
}
.proj-card__name {
  font-family: var(--f-display);
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 4px;
  transition: color .3s;
}
.proj-card__type {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  transition: color .3s;
}

/* ───────── project detail modal ───────── */
/* Closed: visibility hidden + pointer-events none so wheel/touch scroll reaches the page */
.proj-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 2.5vw, 44px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s ease, visibility 0s linear 0.28s;
}
.proj-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transition: opacity .28s ease, visibility 0s;
}
/* Closed: do not take layout; avoids full-screen layer blocking wheel/scroll (projects page) */
#projModal[aria-hidden="true"],
#posterLightbox[aria-hidden="true"] {
  display: none !important;
}
/* Modal shell: single card column row fills viewport so the card can stretch tall */
.proj-modal__content-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  max-width: min(96vw, 900px);
  margin: 0 auto;
  min-height: 0;
  flex: 1 1 auto;
  align-self: stretch;
  /* do NOT set pointer-events: auto here it overrides the closed modal's
     pointer-events: none and blocks clicks to the page behind */
}

.proj-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23,23,23,.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
}

/* outer card shell stretch to available height (viewport minus modal padding) */
.proj-modal__card {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: min(96vw, 900px);
  max-height: min(96vh, calc(100dvh - 32px));
  max-height: min(96vh, calc(100svh - 32px));
  min-height: 0;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  transform: scale(.96) translateY(16px);
  transition: transform .4s cubic-bezier(.7,0,.2,1);
}
.proj-modal.is-open .proj-modal__card { transform: scale(1) translateY(0); }

/* project body: must be a flex parent so .proj-modal__column can flex + scroll */
.proj-modal__main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Workbench: Figma stage fills width under topbar; default height when editorial visible */
.proj-modal__prototype-stage {
  flex-shrink: 0;
  width: 100%;
  height: min(58vh, 720px);
  min-height: 320px;
  border-bottom: 2px solid var(--ink);
  background: #1a1a1a;
}
.proj-modal__column.is-prototype-only .proj-modal__prototype-stage {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  align-self: stretch;
  border-bottom: none;
}
.proj-modal__column.is-prototype-only {
  overflow: hidden;
}
.proj-modal__prototype-frame {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border: none;
  display: block;
}
.proj-modal__column.is-prototype-only .proj-modal__prototype-frame {
  min-height: 0;
}

@media (max-width: 720px) {
  .proj-modal__content-row {
    flex-direction: column;
    align-items: center;
    max-width: min(96vw, 900px);
    gap: 0;
  }
}

.proj-modal__column {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* full-width hero: show entire image (no cover crop); width matches column, height = natural aspect ratio */
.proj-modal__hero {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  flex-shrink: 0;
}

/* ── top bar: dark strip in light mode, reversed in dark mode */
.proj-modal__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #171717;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  min-height: 0;
  z-index: 3;
}
html.dark .proj-modal__topbar {
  background: #F1F0E8;
  border-bottom-color: var(--line);
}
.proj-modal__topbar-left { display: flex; align-items: center; gap: 12px; }
.proj-modal__topbar-badge {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.92);
}
html.dark .proj-modal__topbar-badge {
  color: #171717;
  opacity: 0.9;
}
.proj-modal__topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* visit website button red pill, only shown when project has a URL */
.proj-modal__visit {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #fff;
  background: var(--red);
  padding: 5px 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, color .2s;
  border: 1px solid transparent;
  border-radius: 5px;
}
.proj-modal__visit:hover { background: #fff; color: #171717; }
html.dark .proj-modal__visit:hover { background: #fff; color: #171717; }

/* ── proj modal prev/next nav (desktop only) ── */
.proj-modal__nav {
  display: none; /* shown only on desktop via media query below */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 0;
  background: none;
  color: rgba(255,255,255,.55);
  cursor: pointer;
  transition: color .2s, transform .2s, opacity .2s;
  pointer-events: all;
}
.proj-modal__nav:hover { color: #fff; }
.proj-modal__nav:active { transform: translateY(-50%) scale(0.9); }
.proj-modal__nav--prev { left: calc(50% - min(48vw, 470px) - 56px); }
.proj-modal__nav--next { right: calc(50% - min(48vw, 470px) - 56px); }
.proj-modal__nav[hidden] { display: none !important; }

@media (min-width: 761px) {
  .proj-modal__nav { display: flex; }
}

/* slide animation classes for proj modal column */
.pm--exit-left  { animation: lbExitLeft  .18s cubic-bezier(.4,0,1,1) both; pointer-events: none; }
.pm--exit-right { animation: lbExitRight .18s cubic-bezier(.4,0,1,1) both; pointer-events: none; }
.pm--enter-right { animation: lbEnterRight .32s cubic-bezier(.22,1,.36,1) both; }
.pm--enter-left  { animation: lbEnterLeft  .32s cubic-bezier(.22,1,.36,1) both; }

.proj-modal__close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 5px;
  cursor: pointer;
  padding: 6px 12px 6px 14px;
  line-height: 1;
  transition: color .2s, background .2s, border-color .2s;
  flex-shrink: 0;
}
.proj-modal__close-glyph {
  font-size: 12px;
  line-height: 1;
  opacity: 0.9;
  font-weight: 600;
}
html.dark .proj-modal__close {
  color: #171717;
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.12);
}
.proj-modal__close:hover { color: #fff; background: var(--red); border-color: var(--red); }
html.dark .proj-modal__close:hover { color: #fff; background: var(--red); border-color: var(--red); }

/* ── intro: centered title + copy (hero above) ── */
.proj-modal__intro {
  padding: clamp(28px, 4vw, 48px) clamp(22px, 3.5vw, 48px) 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  text-align: center;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}
/* large display name */
.proj-modal__title {
  font-family: var(--f-body);
  font-weight: 600;
  font-size: clamp(1.75rem, 4.2vw, 3.25rem);
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.08;
  margin: 0;
  text-transform: none;
  word-break: normal;
  min-width: 0;
}
.proj-modal__title--hero {
  text-align: center;
  width: 100%;
  margin: 0 0 10px 0;
}
.proj-modal__type-line {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 16px 0;
  text-align: center;
}

/* short description below title */
.proj-modal__short-desc {
  font-family: var(--f-body);
  font-size: .9rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 16px;
  text-align: center;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

/* tags outlined, same small mono style as screenshot */
.proj-modal__tags-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.proj-modal__tag {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 9px;
  cursor: default;
  transition: background .18s, color .18s, border-color .18s;
}
.proj-modal__tag:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ── extended content sections (below the primary card block) ── */
.proj-modal__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.proj-modal__section {
  padding: 20px clamp(22px, 3.5vw, 48px);
  border-bottom: 1px solid var(--line);
  text-align: center;
  max-width: 1000px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.proj-modal__section:last-child { border-bottom: none; }

.proj-modal__section-label {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.proj-modal__section-label::after { display: none; }

.proj-modal__desc {
  font-family: var(--f-body);
  font-size: .9rem;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 10px;
  white-space: pre-line;
}
.proj-modal__desc:last-child { margin-bottom: 0; }

/* two-up image pair */
/* colour palette */
.proj-modal__colors {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  margin-top: 6px;
  align-items: flex-end;
  justify-content: center;
}
.proj-modal__color-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 64px;
}
.proj-modal__color-swatch {
  width: 72px;
  height: 72px;
  border-radius: 5px;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
  flex-shrink: 0;
}
html.dark .proj-modal__color-swatch {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.proj-modal__color-hex {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .06em;
  color: var(--ink-mute);
  text-transform: uppercase;
}

/* mockup + typeface (two columns) */
.proj-modal__mocktype {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 32px;
  align-items: start;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  text-align: center;
}
.proj-modal__mocktype--no-mockup {
  grid-template-columns: 1fr;
  max-width: 560px;
}
.proj-modal__mocktype-col { min-width: 0; }
.proj-modal__mocktype .proj-modal__typeface { text-align: center; }
.proj-modal__section-label--stack {
  margin-bottom: 10px;
  display: block;
}
.proj-modal__section-label--stack::after { display: none; }

/* single mockup frame */
.proj-modal__mockup-wrap {
  margin-top: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  display: block;
  overflow: hidden;
}
.proj-modal__mockup-img {
  width: 100%;
  max-height: min(55vh, 560px);
  height: auto;
  object-fit: contain;
  object-position: center top;
  display: block;
  background: var(--bg);
}

.proj-modal__typeface {
  font-family: var(--f-body);
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.65;
}
.proj-modal__typeface-desc,
.proj-modal__typeface-custom {
  margin: 0 0 16px 0;
  line-height: 1.6;
  color: var(--ink-soft);
}
.proj-modal__type-sample {
  font-size: 11px;
  letter-spacing: 0.06em;
  margin: 0 0 6px 0;
  line-height: 1.4;
  color: var(--ink);
  word-break: break-word;
}
.proj-modal__type-sample--lower {
  font-size: 10px;
  margin-bottom: 16px;
  opacity: 0.9;
}
.proj-modal__type-sample--body {
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .proj-modal__mocktype {
    grid-template-columns: 1fr;
  }
  .proj-modal__mocktype--no-mockup {
    max-width: none;
  }
}

.proj-modal__line-tracing-section {
  margin-top: 0;
}

.proj-modal__line-tracing-pair {
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  min-height: min(120px, 20vh);
  width: 100%;
}

/* One panel visible avoid empty sibling column (line/colored/load failure) */
.proj-modal__line-tracing-pair:has(#projModalPanelLine[hidden]):has(#projModalPanelColor:not([hidden])) {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}
.proj-modal__line-tracing-pair:has(#projModalPanelColor[hidden]):has(#projModalPanelLine:not([hidden])) {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}
.proj-modal__line-tracing-panel {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.proj-modal__brand-visuals {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  align-items: stretch;
  justify-content: flex-start;
}

/* Evergreen / MoodMorcels: colored logo + mock same capped layout */
.proj-modal__brand-visuals--brand-mock-750 {
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 750px;
  margin-inline: auto;
}

.proj-modal__line-tracing-panel img {
  flex: 0 1 auto;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(52vh, 520px);
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 12px;
}


.proj-modal__brand-visuals--brand-mock-750 img {
  align-self: center;
  flex-shrink: 1;
  width: auto;
  max-width: min(750px, 100%);
  height: auto;
  max-height: min(750px, 70vh);
  object-fit: contain;
}

.proj-modal__img-caption {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: center;
  margin-top: 6px;
}

/* details table Year omitted → five cells; desktop = one stretchy row across full width */
.proj-modal__details-table {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 900px;
}
.proj-modal__detail-cell {
  grid-column: span 2;
  padding: 12px 14px;
  background: var(--bg-2);
  text-align: center;
}
.proj-modal__detail-cell--bottom {
  grid-column: span 3;
}
.proj-modal__detail-label {
  font-family: var(--f-mono);
  font-size: 8px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 3px;
}
.proj-modal__detail-val {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--ink);
  line-height: 1.4;
}

@media (max-width: 900px) {
  .proj-modal {
    padding: 12px;
  }
  .proj-modal__mockup-img {
    max-height: min(58vh, 520px);
  }
  .proj-modal__line-tracing-pair {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .proj-modal__details-table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .proj-modal__detail-cell {
    grid-column: span 1;
  }
  .proj-modal__detail-cell:nth-child(3) {
    grid-column: span 2;
  }
  .proj-modal__detail-cell--bottom {
    grid-column: span 2;
  }
  .proj-modal__color-swatch { width: 56px; height: 56px; }
  .proj-modal__colors { gap: 12px 14px; }
}

/* ═══════════════════════════════════════════════
   MODE ISLAND (liquid glass toggle)
═══════════════════════════════════════════════ */
.mode-island {
  position: fixed;
  bottom: 24px;
  left: 24px;
  top: auto;
  transform: none;
  z-index: 2000;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 5px;

  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(36px) saturate(210%);
  -webkit-backdrop-filter: blur(36px) saturate(210%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.07),
    0 12px 40px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05);

  transition: background .35s, border-color .35s, box-shadow .35s, opacity .2s ease;
}
html.dark .mode-island {
  background: rgba(22, 22, 22, 0.42);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 4px 28px rgba(0, 0, 0, 0.45),
    0 14px 48px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

/* Menu open: sit under the overlay (overlay is z-index 300) theme toggle fades with tray */
body.overlay-open .mode-island__btn {
  z-index: 199 !important;
  pointer-events: none;
  opacity: 0;
}

.mode-island__btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--ink-mute);
  transition: color .25s, background .25s, border-color .25s, box-shadow .25s;
}
.mode-island__icon {
  display: none;
  align-items: center;
  justify-content: center;
}
.mode-island__icon svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1);
}
.mode-island__btn:hover .mode-island__icon svg { transform: scale(1.18); }

html:not(.dark) .mode-island__icon--moon { display: flex; }
html.dark .mode-island__icon--sun { display: flex; }

/* Active = no pigment fill only edge light so you see straight through island glass */
.mode-island__btn.is-active {
  color: var(--ink);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06),
    inset 1px 0 0 rgba(255, 255, 255, 0.35),
    inset -1px 0 0 rgba(255, 255, 255, 0.28);
}
html.dark .mode-island__btn.is-active {
  color: var(--ink);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    inset 1px 0 0 rgba(255, 255, 255, 0.08),
    inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

.mode-island__btn:hover {
  color: var(--ink);
}
html.dark .mode-island__btn:hover {
  color: var(--ink);
}

/* ───────── reveal on scroll ───────── */
.reveal { opacity: 0; transform: translateY(24px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
}

/* ═══════════════════════════════════════════════
   POSTER MARQUEE ROWS (index page)
═══════════════════════════════════════════════ */
.poster-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.poster-row {
  overflow: hidden;
  cursor: default;
  user-select: none;
  touch-action: auto;
  -webkit-touch-callout: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 94%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 94%, transparent 100%);
}

.poster-row__track {
  display: flex;
  gap: 12px;
  width: max-content;
  will-change: transform;
}

.pr-card {
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 5px;
  box-shadow: 2px 2px 0 var(--ink);
}
.pr-card img {
  height: 340px;
  width: auto;
  display: block;
  pointer-events: none;
  user-select: none;
}
.pr-card figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 7px 10px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(100%);
  transition: transform .22s cubic-bezier(.2, .7, .2, 1);
  white-space: nowrap;
  pointer-events: none;
}
.pr-card:hover figcaption {
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════
   POSTER GALLERY
═══════════════════════════════════════════════ */
.poster-gallery {
  columns: 2;
  column-gap: 16px;
}
@media (max-width: 600px) {
  .poster-gallery {
    columns: 2;
    column-gap: 10px;
  }
  .poster-item { margin-bottom: 10px; }
}

.poster-item {
  break-inside: avoid;
  margin-bottom: 16px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 5px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s;
}
.poster-item:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
  z-index: 2;
}
.poster-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .9s cubic-bezier(.2,.7,.2,1);
}
.poster-item:hover img {
  transform: scale(1.04);
}

.poster-item__overlay {
  display: none;
}

.poster-item__num {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .2em;
  color: rgba(255,255,255,.5);
  line-height: 1;
  margin-bottom: 4px;
}
.poster-item__label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.3;
}

/* Mobile: static poster tiles (no hover lift); tap opens lightbox in projects.html */
@media (max-width: 760px) {
  .poster-item {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: none;
  }

  .poster-item:hover {
    transform: none;
    box-shadow: none;
  }

  .poster-item img,
  .poster-item:hover img {
    filter: none;
    animation: none;
  }

  .poster-item__overlay,
  .poster-item:hover .poster-item__overlay {
    display: none;
    pointer-events: none;
  }
}

/* ═══════════════════════════════════════════════
   POSTER LIGHTBOX
═══════════════════════════════════════════════ */
.poster-lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.42s cubic-bezier(.2,.7,.2,1),
    visibility 0s linear 0.42s;
}
.poster-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transition:
    opacity 0.42s cubic-bezier(.2,.7,.2,1),
    visibility 0s;
}

.poster-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .82);
  cursor: pointer;
}

/* Side gutters: prev / next sit in the horizontal dead space beside the card */
.poster-lightbox__stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 3vw, 32px);
  width: 100%;
  max-width: min(1160px, calc(100vw - 32px));
  pointer-events: none;
}
.poster-lightbox__stage > * {
  pointer-events: auto;
}

.poster-lightbox__nav {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: color .2s, transform .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.poster-lightbox__nav:hover {
  color: #fff;
}
.poster-lightbox__nav:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
.poster-lightbox__nav:active {
  transform: scale(0.9);
}
.poster-lightbox__nav-icon {
  display: block;
  margin: 0;
}

.poster-lightbox__inner {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 1000px;
  max-height: min(90vh, calc(100vh - 48px));
  max-height: min(90vh, calc(100dvh - 48px));
  height: min(90vh, calc(100vh - 48px));
  height: min(90vh, calc(100dvh - 48px));
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 5px;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 -1px 0 rgba(0, 0, 0, 0.06) inset;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(1);
  transition:
    transform 0.42s cubic-bezier(.2,.7,.2,1),
    box-shadow 0.42s cubic-bezier(.2,.7,.2,1),
    opacity 0.35s ease;
}
html.dark .poster-lightbox__inner {
  background: rgba(18, 18, 18, 0.42);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.10) inset,
    0 -1px 0 rgba(0, 0, 0, 0.25) inset;
}
.poster-lightbox.is-open .poster-lightbox__inner {
  transform: translateY(0) scale(1);
}

.poster-lightbox__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  flex-shrink: 0;
  background: #1E1E1E;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

/* Dark site mode: cream-tinted liquid glass (higher opacity so label type stays legible) */
html.dark .poster-lightbox__topbar {
  background: rgba(241, 240, 232, 0.82);
  backdrop-filter: blur(24px) saturate(185%);
  -webkit-backdrop-filter: blur(24px) saturate(185%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 -1px 0 rgba(0, 0, 0, 0.04) inset;
}

.poster-lightbox__topbar-badge {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}
html.dark .poster-lightbox__topbar-badge {
  color: #0a0a0a;
  opacity: 1;
  font-weight: 700;
}
.poster-lightbox__topbar-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  cursor: pointer;
  padding: 6px 12px 6px 14px;
  line-height: 1;
  transition: color .2s, background .2s, border-color .2s;
  flex-shrink: 0;
}
.poster-lightbox__close-glyph {
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  opacity: 0.9;
}
html.dark .poster-lightbox__topbar-close {
  color: #0a0a0a;
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(0, 0, 0, 0.14);
  font-weight: 700;
}
.poster-lightbox__topbar-close:hover { color: #fff; background: var(--red); border-color: var(--red); }
html.dark .poster-lightbox__topbar-close:hover { color: #fff; background: var(--red); border-color: var(--red); }

.poster-lightbox__layout {
  --lb-exit-shift: -16px;
  --lb-enter-shift: 22px;
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-rows: minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  transition: opacity 0.28s ease, transform 0.34s cubic-bezier(.2,.7,.2,1);
  touch-action: pan-y;
}

/* Poster lightbox slide animations */
.lb--exit-left {
  animation: lbExitLeft 0.19s cubic-bezier(.4,0,1,1) both;
  pointer-events: none;
}
.lb--exit-right {
  animation: lbExitRight 0.19s cubic-bezier(.4,0,1,1) both;
  pointer-events: none;
}
.lb--enter-right {
  animation: lbEnterRight 0.36s cubic-bezier(.22,1,.36,1) both;
}
.lb--enter-left {
  animation: lbEnterLeft 0.36s cubic-bezier(.22,1,.36,1) both;
}

@keyframes lbExitLeft {
  to { opacity: 0; transform: translateX(-22px); }
}
@keyframes lbExitRight {
  to { opacity: 0; transform: translateX(22px); }
}
@keyframes lbEnterRight {
  from { opacity: 0; transform: translateX(22px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes lbEnterLeft {
  from { opacity: 0; transform: translateX(-22px); }
  to   { opacity: 1; transform: translateX(0); }
}

.poster-lightbox__img-wrap {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}
html.dark .poster-lightbox__img-wrap {
  background: rgba(0, 0, 0, 0.28);
  border-right-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}
.poster-lightbox__img-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}

.poster-lightbox__info {
  padding: 32px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  /* Light site mode: nearly solid cream so --ink type reads clearly */
  background: rgba(241, 240, 232, 0.94);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-left: 1px solid rgba(23, 23, 23, 0.12);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.65),
    inset 0 1px 0 rgba(0, 0, 0, 0.04);
}
html.dark .poster-lightbox__info {
  /* Dark site mode: nearly solid charcoal (matches --bg) so light type reads clearly */
  background: rgba(17, 17, 17, 0.94);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-left-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.poster-lightbox__num {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--ink-soft);
}
.poster-lightbox__dir {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--red);
}
.poster-lightbox__title {
  font-family: var(--f-display);
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 700;
  letter-spacing: -.02em;
  color: #171717;
  line-height: 1.1;
  margin-top: 4px;
}
html.dark .poster-lightbox__title {
  color: #F1F0E8;
}
.poster-lightbox__year {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--ink-soft);
}
.poster-lightbox__desc {
  font-family: var(--f-body);
  font-size: 13px;
  line-height: 1.7;
  color: #171717;
  margin-top: 6px;
  flex: 1;
}
html.dark .poster-lightbox__desc {
  color: #F1F0E8;
}
.poster-lightbox__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.poster-lightbox__tag {
  font-family: var(--f-mono);
  font-size: 8px;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid rgba(23, 23, 23, 0.18);
  border-radius: 5px;
  color: #171717;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
}
html.dark .poster-lightbox__tag {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  color: #F1F0E8;
  background: rgba(30, 30, 30, 0.88);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
}

@media (max-width: 960px) {
  .poster-lightbox {
    padding: clamp(14px, 3vw, 22px);
  }
  .poster-lightbox__stage {
    max-width: min(1100px, calc(100vw - 28px));
  }
  .poster-lightbox__inner {
    max-height: min(92dvh, calc(100dvh - 44px));
    height: min(92dvh, calc(100dvh - 44px));
  }
}

@media (max-width: 760px) {
  .poster-lightbox {
    align-items: center;
    justify-content: center;
    padding:
      max(6px, env(safe-area-inset-top, 0px))
      max(10px, env(safe-area-inset-right, 0px))
      max(8px, env(safe-area-inset-bottom, 0px))
      max(10px, env(safe-area-inset-left, 0px));
  }

  .poster-lightbox__stage {
    gap: 0;
    max-width: none;
    width: 100%;
  }

  /* Swipe replaces prev/next arrows on touch breakpoints */
  .poster-lightbox__nav {
    display: none !important;
  }

  .poster-lightbox__inner {
    width: 100%;
    flex: 0 1 auto;
    max-height: min(96dvh, calc(100dvh - max(52px, env(safe-area-inset-top))));
    height: min(96dvh, calc(100dvh - max(52px, env(safe-area-inset-top))));
    transform: translateY(18px) scale(0.95);
    border-radius: 8px;
  }

  html.dark .poster-lightbox__inner {
    border-radius: 8px;
  }

  .poster-lightbox.is-open .poster-lightbox__inner {
    transition:
      transform 0.5s cubic-bezier(.34, 1.06, .2, 1),
      box-shadow 0.5s cubic-bezier(.2,.7,.2,1),
      opacity 0.4s ease;
  }

  .poster-lightbox__layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 3fr) minmax(0, 2fr);
    touch-action: pan-y pinch-zoom;
  }

  .poster-lightbox__img-wrap {
    border-right: none;
    border-bottom: 1px solid rgba(23, 23, 23, 0.18);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      inset 0 -1px 0 rgba(0, 0, 0, 0.08);
  }

  html.dark .poster-lightbox__img-wrap {
    border-bottom-color: rgba(255, 255, 255, 0.10);
  }

  .poster-lightbox__info {
    border-left: none;
    border-top: 1px solid rgba(23, 23, 23, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  }

  html.dark .poster-lightbox__info {
    border-top-color: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
}

/* ════════════════════════════════════════
   MOBILE FLOATING ISLANDS
   Must stay at end of file so these rules
   win regardless of component specificity
════════════════════════════════════════ */
@media (max-width: 760px) {
  /* Don’t stack with hero/page-hero top padding (single offset for fixed UI) */
  body {
    padding-top: 0;
    padding-left: max(0px, env(safe-area-inset-left, 0px));
    padding-right: max(0px, env(safe-area-inset-right, 0px));
  }

  .nav__links { display: none; }

  /* Nav tray: transparent; one glass slab wraps mark toggle MENU */
  .nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 490;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding:
      max(14px, env(safe-area-inset-top, 0px))
      max(28px, calc(12px + env(safe-area-inset-right, 0px)))
      12px
      max(28px, calc(12px + env(safe-area-inset-left, 0px)));
    pointer-events: none;
    background: transparent;
    box-shadow: none;
  }

  .nav__bar {
    pointer-events: all;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;

    padding: 4px max(10px, env(safe-area-inset-left)) 4px max(10px, env(safe-area-inset-right));
    box-sizing: border-box;
    min-height: 46px;

    border-radius: 5px;
    background: rgba(241, 240, 232, 0.60);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow:
      0 2px 12px rgba(0, 0, 0, .08),
      0 8px 32px rgba(0, 0, 0, .06),
      inset 0 1px 0 rgba(255, 255, 255, .9),
      inset 0 -1px 0 rgba(0, 0, 0, .04);
    transition: background .35s, border-color .35s, box-shadow .35s;
  }

  html.dark .nav__bar {
    background: rgba(17, 17, 17, 0.65);
    border-color: rgba(255, 255, 255, 0.10);
    box-shadow:
      0 2px 12px rgba(0, 0, 0, .45),
      0 8px 32px rgba(0, 0, 0, .35),
      inset 0 1px 0 rgba(255, 255, 255, .07),
      inset 0 -1px 0 rgba(0, 0, 0, .30);
  }

  .nav__mark {
    grid-column: 1;
    justify-self: start;
    align-self: center;
    pointer-events: auto;
    background: transparent;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0 4px 0 10px;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0;
    width: auto;
    min-width: 0;
    max-width: none;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
  }

  /* Toggle shell lives on .nav__bar glass; strip duplicate outer frosting */
  .nav .mode-island {
    grid-column: 2;
    justify-self: center;
    align-self: center;

    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;

    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    z-index: 1;
  }

  html.dark .nav .mode-island {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Toggle blends into bar glass no separate rim / capsule */
  .nav .mode-island .mode-island__btn,
  .nav .mode-island .mode-island__btn.is-active,
  html.dark .nav .mode-island .mode-island__btn,
  html.dark .nav .mode-island .mode-island__btn.is-active {
    border: none !important;
    border-color: transparent !important;
    border-radius: 0;
    box-shadow: none !important;
    background: transparent !important;
  }

  .nav .nav__logo-icon {
    height: 20px;
    width: auto;
    max-height: 20px;
  }

  .nav__menu {
    grid-column: 3;
    justify-self: end;
    align-self: center;
    pointer-events: auto;

    appearance: none;
    -webkit-appearance: none;

    margin: 0;
    padding: 0 14px 0 12px;

    border: none;
    border-radius: 0;
    border-bottom: none;
    box-shadow: none;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;

    width: auto;
    min-width: 46px;
    max-width: none;
    height: auto;
    min-height: 0;
    max-height: none;

    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.16em;
    line-height: 1;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;

    transition: color .2s ease;
  }

  /* Push content below the fixed nav bar */
  .hero,
  .page-hero {
    padding-top: max(100px, calc(env(safe-area-inset-top, 0px) + 80px));
    padding-left: max(var(--pad), env(safe-area-inset-left, 0px));
    padding-right: max(var(--pad), env(safe-area-inset-right, 0px));
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .page-hero .page-hero__title {
    font-size: clamp(40px, 12vw, 100px);
  }
  .page-hero__lede { max-width: 100%; }

  .work__head {
    flex-direction: column;
    align-items: flex-start;
    align-self: stretch;
  }

  .hero__title {
    animation: rise 0.68s 0.08s backwards cubic-bezier(0.2, 0.7, 0.2, 1);
    font-size: clamp(60px, 16vw, 168px);
    margin-top: 20px; /* sit slightly lower under meta */
  }

  .hero__split-l,
  .hero__split-r {
    transition: transform 0.58s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .hero__dot {
    height: clamp(56px, 14vw, 130px);
    transition: width 0.58s cubic-bezier(0.16, 1, 0.3, 1),
      margin-inline 0.58s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .hero__word--with-dot.is-split .hero__dot {
    width: clamp(56px, 14vw, 130px);
  }
  .hero__meta { margin-bottom: 40px; }

  .hero__btn { margin: clamp(48px, 9vw, 100px) auto 0; }

  .about-body,
  .contact-body { min-width: 0; max-width: 100%; }
  .cta-section {
    min-width: 0;
    max-width: 100%;
    padding-left: max(var(--pad), env(safe-area-inset-left, 0px));
    padding-right: max(var(--pad), env(safe-area-inset-right, 0px));
  }
  .cta-section__inner h2 { font-size: clamp(28px, 8vw, 64px); }
  .foot-wrap { min-width: 0; }
  .clients,
  .scans { min-width: 0; width: 100%; box-sizing: border-box; }
  .proj-header,
  .proj-section { min-width: 0; }

  /* No grayscale on mobile hover doesn't exist on touch */
  .card__media img,
  .card__media video,
  .card__media-img--bw,
  .card__media img.card__media-img--raw.card__media-img--bw {
    filter: none !important;
  }

  /* Bigger nav text on mobile to fill the overlay */
  .overlay__link {
    font-size: clamp(52px, 14vw, 80px);
  }

  /* Stretch the link-row so arrow sits on the far right */
  .overlay__link-row {
    width: 100%;
    justify-content: space-between;
  }

  /* Show the dropdown toggle on mobile */
  .overlay__sub-toggle {
    display: flex;
    color: #fff;
    opacity: 0.55;
    padding: 6px;
    flex-shrink: 0;
  }
  .overlay__sub-toggle svg {
    width: 22px;
    height: 22px;
  }

  /* Sub-links collapsed by default on mobile; JS toggle opens them */
  .overlay__sub {
    max-height: 0 !important;
    opacity: 0 !important;
    padding-top: 0 !important;
    transform: translateY(-6px);
    transition: max-height .35s ease,
                opacity .25s ease,
                transform .25s ease,
                padding .25s ease !important;
    pointer-events: none;
  }
  .overlay__item--has-sub.is-open .overlay__sub {
    max-height: 300px !important;
    opacity: 1 !important;
    padding-top: 8px !important;
    transform: translateY(0);
    pointer-events: all;
  }
  /* Sub-links slightly larger on mobile */
  .overlay__sublink {
    font-size: 11px;
    letter-spacing: .12em;
  }
}

/* Overlay menu open strip glass only; lock layout to closed-state grid so logo / CLOSE stay put */
@media (max-width: 1024px) {
  body.overlay-open header.nav > .nav__bar,
  html.dark body.overlay-open header.nav > .nav__bar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
    align-items: center !important;
    column-gap: 10px !important;

    min-height: 46px !important;
    padding: 4px max(10px, env(safe-area-inset-left)) 4px max(10px, env(safe-area-inset-right)) !important;

    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Invisible spacer: same center track as toggle so flanking columns don't shift */
  body.overlay-open header.nav .mode-island {
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;

    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    justify-self: center !important;

    grid-column: 2 !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.overlay-open header.nav .mode-island .mode-island__btn {
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* ───────── theme toggle: circular iris (View Transitions API) ───────── */
@keyframes theme-circle-reveal {
  from {
    clip-path: circle(0px at var(--theme-reveal-x, 50%) var(--theme-reveal-y, 50%));
  }
  to {
    clip-path: circle(var(--theme-reveal-r, 150vmax) at var(--theme-reveal-x, 50%) var(--theme-reveal-y, 50%));
  }
}

/* Old snapshot stays underneath; new state wipes in from the toggle as a seamless circle */
@supports selector(::view-transition-old(root)) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    mix-blend-mode: normal;
  }

  /* Avoid UA default crossfade on the outgoing snapshot */
  ::view-transition-old(root) {
    animation: none !important;
    z-index: 1;
  }

  ::view-transition-new(root) {
    animation: theme-circle-reveal 0.6s cubic-bezier(0.25, 0.08, 0.2, 1) both;
    z-index: 2;
  }

  @media (prefers-reduced-motion: reduce) {
    ::view-transition-new(root) {
      animation: none !important;
    }
  }
}