/* ============================================================
   case.css — shared styles for case-study pages
   (loaded after styles.css; reuses its tokens)
   ============================================================ */

.case { --accent: #8b5cf6; --accent-2: #e05cc8; }

body.case {
  overflow-x: clip;
}

/* ── back link ────────────────────────────────────────────── */
.back {
  position: fixed;
  top: max(14px, env(safe-area-inset-top, 0px));
  left: max(clamp(16px, 4vw, 72px), env(safe-area-inset-left, 0px));
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 96%, var(--bg));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 8px 15px;
  border-radius: 100px;
  border: 1px solid var(--line-2);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.42);
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.back:hover { color: var(--text); border-color: var(--line-2); }
.back svg { width: 15px; height: 15px; }

/* ── 3D hero ──────────────────────────────────────────────── */
.chero {
  position: relative; min-height: 92vh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 clamp(20px, 6vw, 72px) clamp(48px, 8vw, 90px);
  overflow: hidden; isolation: isolate;
}
.chero-canvas { position: absolute; inset: 0; z-index: -1; }
.chero-canvas canvas { display: block; width: 100% !important; height: 100% !important; }
.chero::after { /* legibility gradient */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--bg) 92%, transparent));
  pointer-events: none;
}
.chero-inner { max-width: var(--max); margin-inline: auto; width: 100%; }
.chero-kicker {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 13px; font-weight: 400; line-height: 1.6;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 12px;
}
.chero h1 {
  font-family: "Fraunces", Georgia, serif; font-weight: 500;
  font-size: clamp(52px, 12vw, 150px); line-height: .92; letter-spacing: -.03em;
  margin: 0 0 14px;
}
.chero-tag {
  font-family: "Fraunces", Georgia, serif; font-style: italic; font-weight: 400;
  font-size: clamp(20px, 3.4vw, 38px); line-height: 0.9;
  color: var(--text); margin: 0 0 8px; max-width: 20ch;
}
.chero-sub {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: clamp(16px, 2vw, 20px); font-weight: 400; line-height: 1.55;
  color: var(--muted); max-width: 60ch; margin: 8px 0 0;
}
.chero-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 22px; }

.chero-scroll {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 4vw, 40px);
  transform: translateX(-50%);
  z-index: 2;
  display: block;
  padding: 6px;
  color: var(--muted);
  opacity: .7;
  transition: opacity .2s var(--ease);
}
.chero-scroll:hover { opacity: 1; }
.chero-scroll__track {
  display: block;
  position: relative;
  width: 22px;
  height: 38px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  overflow: hidden;
}
.chero-scroll__dot {
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: currentColor;
  animation: chero-scroll-dot 2.1s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes chero-scroll-dot {
  0% {
    bottom: 7px;
    opacity: 1;
  }
  55% {
    bottom: calc(100% - 11px);
    opacity: 1;
  }
  65% {
    bottom: calc(100% - 11px);
    opacity: 0;
  }
  66% {
    bottom: 7px;
    opacity: 0;
  }
  82% {
    bottom: 7px;
    opacity: 1;
  }
  100% {
    bottom: 7px;
    opacity: 1;
  }
}

/* ── meta bar ─────────────────────────────────────────────── */
.meta-bar {
  max-width: var(--max); margin: 0 auto; padding: 24px clamp(20px, 6vw, 72px);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  border-bottom: 1px solid var(--line);
}
.meta-bar dt { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 4px; }
.meta-bar dd { margin: 0; font-size: 15.5px; color: var(--text); }

/* ── section shell ────────────────────────────────────────── */
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: clamp(20px, 6vw, 72px); }
.sec { padding-block: clamp(40px, 6.5vw, 72px); }
.sec + .sec { border-top: 1px solid var(--line); }
.sec-label {
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 10px;
}
.sec h2 { font-size: clamp(28px, 4.4vw, 50px); letter-spacing: -.02em; margin: 0 0 12px; line-height: 1.05; }
.lede { font-size: clamp(18px, 2.4vw, 24px); line-height: 1.45; color: var(--text); max-width: 46ch; margin: 0; }
.sec p { color: var(--muted); font-size: 17px; max-width: 62ch; margin: 0; }
.sec p + p { margin-top: 10px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 3vw, 40px); align-items: start; }
.two-col > h2 { margin-bottom: 0; }
.cp-work-grid { row-gap: clamp(24px, 4vw, 32px); }
.cp-work-grid > h2 { grid-column: 1; grid-row: 1; }
.cp-work-grid > figure { grid-column: 1; grid-row: 2; }
.cp-work-copy { grid-column: 2; grid-row: 1 / span 2; align-self: start; }

/* ── stat row ─────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 8px; }
.stat { border: 1px solid var(--line); border-radius: 16px; padding: 26px 24px; background: var(--surface); }
.stat b { display: block; font-family: "Fraunces", serif; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.02em;
  background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: 14.5px; }

/* ── process stepper ──────────────────────────────────────── */
.steps { display: grid; gap: 2px; margin-top: 10px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 18px; padding: 22px 24px; background: var(--surface); transition: background .3s var(--ease); }
.step:hover { background: var(--bg-soft); }
.step .n { font-family: "Fraunces", serif; font-size: 22px; color: var(--accent); }
.step h4 { margin: 0 0 4px; font-family: "Inter", sans-serif; font-size: 16px; font-weight: 600; }
.step p { margin: 0; font-size: 14.5px; color: var(--muted); max-width: none; }
.steps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.steps-grid .step { padding: 16px 18px; }
.steps-grid .step .n { font-size: 18px; }
.steps-grid .step h4 { font-size: 14.5px; }
.steps-grid .step p { font-size: 13.5px; }

/* ── grouped research phases ─────────────────────────────── */
.phase-groups { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2vw, 18px); margin-top: 10px; }
.phase-group {
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--surface); display: flex; flex-direction: column;
}
.phase-hd {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: baseline;
  padding: 16px 18px 14px; border-bottom: 1px solid var(--line); background: var(--bg-soft);
}
.phase-n {
  font-family: "Fraunces", serif; font-size: 15px; color: var(--accent); white-space: nowrap;
}
.phase-hd h4 { margin: 0; font-family: "Inter", sans-serif; font-size: 15px; font-weight: 600; }
.phase-list { list-style: none; margin: 0; padding: 0; flex: 1; }
.phase-list li {
  padding: 12px 18px; font-size: 13.5px; color: var(--muted); line-height: 1.45;
  border-top: 1px solid var(--line);
}
.phase-list li:first-child { border-top: none; }
.phase-list b { color: var(--text); font-weight: 600; }

/* ── figures ──────────────────────────────────────────────── */
figure { margin: 0; }
.shot {
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--bg-soft);
  box-shadow: 0 30px 80px -40px rgba(0,0,0,.8);
}
.shot img { display: block; width: 100%; height: auto; }
.shot--bare {
  border: none; background: transparent;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,.55);
}
.shot--bare img { border-radius: 16px; }
.cp-overview-gif .shot {
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  border-radius: clamp(18px, 3vw, 24px);
}
.cp-overview-gif .shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: clamp(18px, 3vw, 24px);
  transform: scale(1.02);
  transform-origin: center center;
}
.shot--bare:has(.cp-arch-diagram) {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
}
.shot--bare .cp-arch-diagram { display: block; width: 100%; height: auto; border-radius: 0; }
figcaption { margin-top: 8px; font-size: 13.5px; color: var(--muted-2); }
.shot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2vw, 22px); margin-top: 6px; }
.shot-grid.mobile { grid-template-columns: repeat(4, 1fr); }
.shot-full { margin-top: 6px; }

/* ── expandable full-view images ──────────────────────────── */
.ev-expandable-shot { position: relative; }

.ev-fullview-btn {
  position: absolute;
  right: clamp(10px, 1.6vw, 16px);
  bottom: clamp(10px, 1.6vw, 16px);
  z-index: 2;
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--surface) 94%, var(--bg));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 10px 28px -12px rgba(0, 0, 0, 0.75);
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.ev-fullview-btn svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}
.ev-fullview-btn:hover {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  transform: translateY(-1px);
}

.ev-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  padding-top: max(clamp(16px, 4vw, 48px), env(safe-area-inset-top, 0px));
  padding-bottom: max(clamp(16px, 4vw, 48px), env(safe-area-inset-bottom, 0px));
  background: rgba(6, 10, 9, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: zoom-out;
}
.ev-lightbox.is-zoomed { cursor: default; }
.ev-lightbox-viewport {
  position: relative;
  width: 100%;
  max-width: min(96vw, 1440px);
  height: min(88dvh, 1200px);
  max-height: 88dvh;
  overflow: hidden;
  touch-action: none;
  cursor: default;
}
.ev-lightbox.is-zoomed .ev-lightbox-viewport { cursor: grab; }
.ev-lightbox-viewport.is-dragging { cursor: grabbing; }
.ev-lightbox-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.ev-lightbox:not(.is-ready) .ev-lightbox-stage img,
.ev-lightbox:not(.is-ready) .ev-lightbox--framed img {
  max-width: min(96vw, 100%);
  max-height: min(88dvh, 100%);
}
.ev-lightbox.is-ready .ev-lightbox-stage img,
.ev-lightbox.is-ready .ev-lightbox--framed img {
  max-width: none;
  max-height: none;
}
.ev-lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 32px 80px -24px rgba(0, 0, 0, 0.85);
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  -webkit-user-select: none;
}
.ev-lightbox--framed .ev-lightbox-frame {
  padding: clamp(18px, 2.4vw, 30px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 32px 80px -24px rgba(0, 0, 0, 0.85);
  line-height: 0;
}
.ev-lightbox--framed img {
  border-radius: 0;
  box-shadow: none;
}
@media (max-width: 820px) {
  .ev-lightbox {
    padding: max(10px, env(safe-area-inset-top, 0px)) 10px max(10px, env(safe-area-inset-bottom, 0px));
  }
  .ev-lightbox-viewport {
    max-width: 100%;
    height: min(calc(100dvh - 84px), 1200px);
    max-height: calc(100dvh - 84px);
  }
}
.ev-lightbox-tools {
  position: fixed;
  top: max(14px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 301;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ev-lightbox-tool {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text);
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.ev-lightbox-tool:hover:not(:disabled) {
  background: var(--bg-soft);
}
.ev-lightbox-tool:disabled {
  opacity: 0.35;
  cursor: default;
}
.ev-lightbox-tool:nth-child(2) {
  min-width: 52px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ev-lightbox-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top, 0px));
  right: max(clamp(16px, 4vw, 24px), env(safe-area-inset-right, 0px));
  z-index: 301;
  appearance: none;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.ev-lightbox-close:hover {
  background: var(--bg-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

/* ── feature list ─────────────────────────────────────────── */
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-top: 6px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.feature { padding: 20px 22px; background: var(--surface); }
.feature .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 10px;
  background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.feature h4 { margin: 0 0 4px; font-family: "Inter", sans-serif; font-size: 16.5px; font-weight: 600; }
.feature p { margin: 0; font-size: 14.5px; color: var(--muted); max-width: none; }

/* ── palette swatches ─────────────────────────────────────── */
.swatches { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.swatch { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; width: 130px; background: var(--surface); }
.swatch .chip { height: 76px; }
.swatch .lab { padding: 10px 12px; font-size: 12px; }
.swatch .lab b { display: block; color: var(--text); font-weight: 600; }
.swatch .lab span { color: var(--muted-2); font-family: ui-monospace, monospace; font-size: 11px; }

/* ── next / footer ────────────────────────────────────────── */
.next { border-top: 1px solid var(--line); }
.next a {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  max-width: var(--max); margin-inline: auto; padding: clamp(32px, 5.5vw, 56px) clamp(20px, 6vw, 72px);
  transition: background .3s var(--ease);
}
.next a:hover { background: var(--bg-soft); }
.next small { display: block; color: var(--muted-2); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; }
.next b { font-family: "Fraunces", serif; font-weight: 500; font-size: clamp(26px, 4vw, 44px); letter-spacing: -.02em; }
.next .arrow { font-size: 30px; color: var(--muted); }

/* ── reveal ───────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ── responsive ───────────────────────────────────────────── */
@media (max-width: 820px) {
  .sec { padding-block: clamp(32px, 5.5vw, 56px); }
  .chero--has-scroll {
    padding-bottom: clamp(56px, 11vw, 72px);
  }
  .chero--has-scroll .chero-inner {
    transform: translateY(-24px);
  }
  .chero--has-scroll .chero-scroll {
    bottom: 10px;
  }
  .meta-bar { grid-template-columns: 1fr 1fr; gap: 16px; }
  .two-col, .features, .media-duo, .steps-grid, .phase-groups { grid-template-columns: 1fr; }
  .two-col { gap: 14px; }
  .sec h2 { margin-bottom: 8px; }
  .cp-work-copy,
  .cp-work-grid > h2,
  .cp-work-grid > figure { grid-column: auto; grid-row: auto; }
  .shot-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .phone-strip figure { flex-basis: min(72vw, 260px); }
  #desktop .shot-full .shot { border-radius: 8px; }
  #audit > .wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    column-gap: 12px;
  }
  #audit > .wrap > .sec-label {
    grid-column: 1;
    grid-row: 1;
    margin: 0 0 10px;
    align-self: center;
  }
  #audit > .wrap > .audit-toolbar {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 70px;
    z-index: 40;
    margin: 0 0 10px;
    justify-self: end;
    flex-shrink: 0;
    pointer-events: none;
  }
  #audit > .wrap > :not(.sec-label):not(.audit-toolbar) { grid-column: 1 / -1; }
  #audit .audit-toolbar .audit-toggle { pointer-events: auto; }
  .annotated-label { font-size: 10px; letter-spacing: .1em; margin-bottom: 6px; }
  .annot-callout { display: none; }
  .annot-legend { display: none; }
  .annotated.is-mobile-annot .annotated-hotspots { pointer-events: auto; }
  .annotated.is-mobile-annot .annot-point { cursor: pointer; z-index: 1; }
  .annotated.is-mobile-annot .annot-point.is-active { z-index: 2; }
  .annotated.is-mobile-annot .annot-point:not(.is-active) .annot-mark::after {
    animation: none;
    opacity: 0;
  }
  .annotated.is-mobile-annot .annot-point.is-active .annot-mark {
    background: var(--accent-2);
    border-color: color-mix(in srgb, #fff 30%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 30%, transparent);
  }
  .annotated.is-mobile-annot .annot-point.is-active .annot-mark::after {
    inset: -5px;
    border-color: color-mix(in srgb, var(--accent-2) 50%, transparent);
    animation: annot-pulse 2.4s ease-out infinite;
    opacity: 1;
  }
  .annotated.is-mobile-annot .annot-mobile-note {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    align-items: start;
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--accent-2) 28%, var(--line));
    border-radius: 12px;
    background: var(--surface);
  }
  .annot-mobile-note .annot-mark {
    width: 26px; height: 26px; font-size: 12px;
    background: var(--accent-2);
    border: 2px solid color-mix(in srgb, #fff 30%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 30%, transparent);
  }
  .annot-mobile-note .annot-mark::after { display: none; }
  .annot-mobile-note p { margin: 3px 0 0; font-size: 14px; line-height: 1.45; color: var(--text); max-width: none; }
  #audit .annotated figcaption { display: none; }
  .annot-mark { width: 26px; height: 26px; font-size: 12px; }
  .annot-mark::after { inset: -5px; }
  #audit .audit-toggle {
    padding: 9px 12px;
    font-size: 12px;
    background: color-mix(in srgb, var(--surface) 96%, var(--bg));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
}
@media (max-width: 480px) {
  .shot-grid.mobile { grid-template-columns: 1fr 1fr; }
}

/* ── annotated audit schemes ──────────────────────────────── */
.annot-mobile-note { display: none; }
.annotated { margin-top: 20px; overflow: visible; }
.annotated + .annotated { margin-top: 32px; }
.audit-toolbar {
  position: sticky;
  top: 84px;
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 10px;
  pointer-events: none;
}
.audit-toolbar .audit-toggle { pointer-events: auto; }
.audit-toggle {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--surface) 90%, var(--bg));
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  padding: 11px 16px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 14px 32px -14px rgba(0,0,0,.8);
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.audit-toggle svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}
.audit-toggle:hover {
  background: color-mix(in srgb, var(--accent) 24%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  transform: translateY(-1px);
  box-shadow: 0 18px 36px -16px rgba(0,0,0,.9);
}
.audit-toggle-sticky { position: relative; }
.annotated-label {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 8px;
}
.annotated-stage {
  position: relative;
  padding: 0;
  border: none; background: none; box-shadow: none;
}
.annotated-media {
  position: relative; overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.annotated-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 28%, transparent);
}
.annotated-stage img {
  display: block; width: 100%; height: auto;
  filter: grayscale(0.65) brightness(0.52) contrast(0.9) saturate(0.5);
}
.annotated-hotspots {
  position: absolute; inset: 0;
  pointer-events: none; overflow: visible;
}
.annot-point {
  position: absolute; transform: translate(-50%, -50%); z-index: 1;
  appearance: none; border: none; padding: 0; margin: 0; background: none;
  font: inherit; color: inherit; cursor: default;
}
.annot-mark {
  position: relative; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  font-family: "Fraunces", serif; font-size: 13px; font-weight: 600; line-height: 1;
  color: #fff; background: var(--accent);
  border: 2px solid color-mix(in srgb, #fff 30%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent);
}
.annot-mark::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  animation: annot-pulse 2.4s ease-out infinite;
}
@keyframes annot-pulse {
  0% { transform: scale(0.92); opacity: .9; }
  70% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .annot-mark::after { animation: none; opacity: .45; transform: none; }
  .chero-scroll__dot { animation: none; opacity: .85; bottom: 7px; }
}
.annot-callout {
  position: absolute; z-index: 2; width: max-content; max-width: min(272px, 38vw);
  padding: 12px 14px 12px 18px; border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 94%, var(--bg));
  backdrop-filter: blur(14px);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 16px 48px -12px rgba(0,0,0,.85);
  font-size: 13.5px; line-height: 1.5; color: var(--text);
  pointer-events: none;
}
.annot-callout::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  border-radius: 99px; background: var(--accent);
}
.annot-callout::after {
  content: ""; position: absolute; width: 7px; height: 7px;
  background: color-mix(in srgb, var(--surface) 94%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  transform: rotate(45deg);
}
.annot-callout.side-right { left: calc(100% + 14px); top: 50%; transform: translateY(-50%); }
.annot-callout.side-right::after { left: -4px; top: 50%; margin-top: -3.5px; border-right: none; border-top: none; }
.annot-callout.side-left { right: calc(100% + 14px); top: 50%; transform: translateY(-50%); }
.annot-callout.side-left::after { right: -4px; top: 50%; margin-top: -3.5px; border-left: none; border-bottom: none; }
.annot-callout.side-bottom { left: 50%; top: calc(100% + 14px); transform: translateX(-50%); }
.annot-callout.side-bottom::after { top: -4px; left: 50%; margin-left: -3.5px; border-bottom: none; border-right: none; }
.annot-callout.side-top { left: 50%; bottom: calc(100% + 14px); transform: translateX(-50%); }
.annot-callout.side-top::after { bottom: -4px; left: 50%; margin-left: -3.5px; border-top: none; border-left: none; }
.annot-legend {
  display: none; margin-top: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 14px; overflow: hidden;
  background: var(--surface);
}
.annot-legend-item {
  display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start;
  padding: 15px 18px;
  border-top: 1px solid var(--line);
}
.annot-legend-item:first-child { border-top: none; }
.annot-legend-item .n {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: "Fraunces", serif; font-size: 13px; font-weight: 600; color: #fff;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.annot-legend-item p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--text); max-width: none; }
.annotated figcaption { margin-top: 10px; font-size: 13.5px; color: var(--muted-2); }
.annotated.phone .annotated-stage { max-width: 340px; margin-inline: auto; }
.annotated.phone .annotated-media { border-radius: 12px; }
.annotated.phone .annot-callout {
  max-width: min(200px, 52vw);
  font-size: 12.5px;
  padding: 10px 12px 10px 14px;
}
.annotated.phone .annot-legend { display: none; }
.annotated.is-clean .annotated-media::after { background: transparent; }
.annotated.is-clean .annotated-stage img { filter: none; }
.annotated.is-clean .annotated-hotspots,
.annotated.is-clean .annot-legend { display: none; }

.audit-mobile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 2vw, 22px);
  margin-top: 18px;
}
.audit-mobile-grid .annotated { margin-top: 0; }
.audit-mobile-grid .annotated + .annotated { margin-top: 0; }
@media (max-width: 820px) {
  .audit-mobile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(8px, 2.5vw, 12px);
    row-gap: clamp(12px, 3vw, 18px);
    align-items: start;
  }
  .audit-mobile-grid > .annotated {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 3;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    margin-top: 0;
    min-width: 0;
  }
  .audit-mobile-grid .annotated-label {
    font-size: 9px;
    letter-spacing: .08em;
    line-height: 1.35;
    margin: 0;
    min-height: 2.7em;
    align-self: end;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .audit-mobile-grid .annotated-stage {
    align-self: start;
    width: 100%;
  }
  .audit-mobile-grid .annotated-media {
    aspect-ratio: 390 / 844;
    background: color-mix(in srgb, var(--bg-soft) 88%, var(--surface));
  }
  .audit-mobile-grid .annotated-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
  }
  .annotated.phone .annotated-stage { max-width: none; margin-inline: 0; }
  #audit .audit-mobile-grid .annotated.is-mobile-annot .annot-mobile-note {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: start;
    align-self: stretch;
    margin-top: 0;
    min-height: 4.8em;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--accent-2) 28%, var(--line));
    border-radius: 12px;
    background: var(--surface);
  }
  #audit .audit-mobile-grid .annot-mobile-note .annot-mark {
    width: 22px;
    height: 22px;
    font-size: 11px;
    margin-top: 1px;
  }
  #audit .audit-mobile-grid .annot-mobile-note p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
  }
  #audit .audit-mobile-grid .annot-mark { width: 22px; height: 22px; font-size: 11px; }
  #audit .audit-mobile-grid .annot-mark::after { inset: -4px; }
}

/* ── before / after ───────────────────────────────────────── */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2vw, 22px); margin-top: 6px; }
.compare .tag {
  display: inline-block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 6px;
}
.compare .tag.new { color: var(--accent); }

@media (max-width: 820px) {
  .compare { grid-template-columns: 1fr; }
}

/* ── phone strip (mobile showcase) ────────────────────────── */
.phone-strip {
  display: flex; gap: clamp(12px, 1.8vw, 18px); margin-top: 6px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 8px; -webkit-overflow-scrolling: touch;
}
.phone-strip::-webkit-scrollbar { height: 6px; }
.phone-strip::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
.phone-strip figure {
  flex: 0 0 clamp(200px, 42vw, 280px); scroll-snap-align: start; margin: 0;
}
.phone-strip .shot { border-radius: 20px; }
.phone-strip figcaption { font-size: 12.5px; }
.phone-strip-wide {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow-x: visible;
  scroll-snap-type: none;
  padding-bottom: 0;
}
.phone-strip-wide figure {
  flex: none;
  min-width: 0;
  scroll-snap-align: none;
}

@media (max-width: 820px) {
  #mobile .phone-strip.phone-strip-wide {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(10px, 2.5vw, 16px);
    overflow-x: hidden;
    scroll-snap-type: none;
    padding-bottom: 0;
  }
  #mobile .phone-strip.phone-strip-wide figure:first-child {
    grid-column: 1 / -1;
  }
  #mobile .phone-strip.phone-strip-wide figure {
    min-width: 0;
    max-width: 100%;
  }
  #mobile .phone-strip.phone-strip-wide .shot,
  #mobile .phone-strip.phone-strip-wide img {
    width: 100%;
    max-width: 100%;
    height: auto;
  }
}

.phone-hero {
  max-width: 320px; margin: 28px auto 0;
}
.phone-hero .shot { border-radius: 24px; }

/* ── landscape photo strip (user testing, etc.) ───────────── */
.photo-strip figure { flex: 0 0 clamp(280px, 52vw, 400px); }

@media (max-width: 820px) {
  #user-testing .cp-ut-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(10px, 2.5vw, 14px);
    overflow: visible;
    scroll-snap-type: none;
    padding-bottom: 0;
    margin-top: 10px;
  }
  #user-testing .cp-ut-gallery .cp-ut-item {
    margin: 0;
    flex: none;
    width: auto;
    min-width: 0;
    scroll-snap-align: none;
  }
  #user-testing .cp-ut-gallery .cp-ut-item--lead,
  #user-testing .cp-ut-gallery .cp-ut-item--wide {
    grid-column: 1 / -1;
  }
  #user-testing .cp-ut-gallery .shot {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: none;
    border: 1px solid var(--line);
  }
  #user-testing .cp-ut-gallery .shot img {
    width: 100%;
    height: auto;
    display: block;
  }
}

.media-duo { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 2.4vw, 28px); margin-top: 8px; align-items: start; }
.media-duo .shot-gif img { width: 100%; height: auto; border-radius: 16px; }

/* ── publications list ────────────────────────────────────── */
.pubs {
  display: grid; gap: 2px; margin-top: 10px;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.pub {
  display: grid; grid-template-columns: 64px 1fr auto; gap: clamp(14px, 2vw, 22px);
  align-items: start; padding: 22px 24px; background: var(--surface);
  transition: background .3s var(--ease);
}
.pub:hover { background: var(--bg-soft); }
.pub-year {
  font-family: "Fraunces", serif; font-size: 20px; color: var(--accent); line-height: 1.2;
}
.pub h4 { margin: 0 0 6px; font-family: "Inter", sans-serif; font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.pub h4 a { color: var(--text); text-decoration: none; transition: color .2s var(--ease); }
.pub h4 a:hover { color: var(--accent); }
.pub-meta { margin: 0 0 8px; font-size: 13px; color: var(--muted-2); }
.pub p { margin: 0; font-size: 14px; color: var(--muted); max-width: none; line-height: 1.5; }
.pub-link {
  font-size: 13px; color: var(--accent); text-decoration: none; white-space: nowrap;
  align-self: center; padding: 6px 0; transition: opacity .2s var(--ease);
}
.pub-link:hover { opacity: .75; }
@media (max-width: 820px) {
  .pub { grid-template-columns: 1fr; gap: 8px; }
  .pub-year { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-family: "Inter", sans-serif; font-weight: 600; }
  .pub-link { align-self: start; }
}
