/* =========================================================
   Atefeh Fazaeli — portfolio
   Editorial minimal · off-white · Inter Variable + Newsreader
   ========================================================= */

@font-face {
  font-family: 'Inter Variable';
  src: url('https://rsms.me/inter/font-files/InterVariable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ECECEC;
  --ink: #0A0A0A;
  --muted: #6B6B6B;
  --line: #D4D4D4;
  --paper: #FFFFFF;
  --yellow: #FFE600;
  --accent-warm: #FF7A45;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;
  --space-7: 160px;
  --space-8: 240px;

  --reading: 540px;
  --radius: 22px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter Variable', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: -0.005em;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body { min-height: 100vh; }

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: opacity 0.18s cubic-bezier(0.4,0,0.2,1);
}
a:hover { opacity: 0.6; }
a.bare, .topnav a, .home-list a.bare { border-bottom: 0; }

::selection { background: var(--yellow); color: var(--ink); }

/* Visually hidden, available to screen readers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
/* Skip-to-content link, focusable on Tab */
.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  z-index: 10000;
  transform: translateY(-150%);
  transition: transform 0.18s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0 0 16px; }

/* ============== TOP ORNAMENT NAV ============== */
.topnav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 28px 24px 0;
  position: relative;
  z-index: 5;
}

/* Sticky top nav on detail pages (case studies + writing articles) */
body:has(.case-wrap):not(:has(.hscroll)) .topnav,
body:has(.article-wrap):not(:has(.hscroll)) .topnav,
body:has(.about-wrap):not(:has(.hscroll)) .topnav {
  position: sticky;
  top: 0;
  background: var(--bg);
  padding-top: 18px;
  padding-bottom: 14px;
  z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
}
.topnav .cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 12px;
  padding: 0 6px;
  min-width: 22px;
  border: 1px solid var(--ink);
  background: transparent;
  border-radius: 0;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  cursor: pointer;
  transition: background 0.18s cubic-bezier(0.4,0,0.2,1), border-color 0.18s cubic-bezier(0.4,0,0.2,1), color 0.18s cubic-bezier(0.4,0,0.2,1);
}
.topnav .cell.blank { width: 22px; padding: 0; }
.topnav .cell:hover { background: var(--ink); color: var(--bg); }
.topnav .cell.active { background: var(--yellow); border-color: var(--ink); color: var(--ink); }
.topnav .tick {
  width: 1px;
  height: 12px;
  background: var(--ink);
  opacity: 0.5;
  display: inline-block;
}

/* About-me card: matches Writing card width */
.hscroll .hcard.about-me-card {
  flex: 0 0 min(820px, calc(100vw - 60px));
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding: 48px 56px 56px 56px;
  align-content: start;
}
.about-me-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px 40px;
}
.about-me-block { display: flex; flex-direction: column; gap: 8px; }
.about-me-block h3 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 4px;
}
.about-me-block p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.about-me-block p strong { font-weight: 500; }
.about-me-block p .meta { font-size: 12px; color: var(--muted); }

/* Role rows with logo placeholders */
.about-me-block .role-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.about-me-block .role {
  display: block;
}
.about-me-block .role-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.about-me-block .role-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}
.about-me-block .role-line strong { font-weight: 500; }
.about-me-block .role-when {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.about-me-block .role .meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
.about-me-block .about-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.about-me-block .about-list li {
  position: relative;
  padding-left: 24px;
  font-size: 13px;
  line-height: 1.55;
}
.about-me-block .about-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.8em;
  width: 14px; height: 1px;
  background: var(--ink);
}
.about-me-block .about-list li strong { font-weight: 500; }

/* Writing card */
.hscroll .hcard.writing-card {
  flex: 0 0 min(820px, calc(100vw - 60px));
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding: 48px 56px 56px 56px;
  align-content: start;
}
.hscroll .hcard.writing-card .writing-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 560px;
}
.hscroll .hcard.writing-card .writing-list li {
  padding: 0;
  border-top: 1px solid var(--line);
}
.hscroll .hcard.writing-card .writing-list li > a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.hscroll .hcard.writing-card .writing-list li > a:hover { opacity: 0.65; }
.hscroll .hcard.writing-card .writing-list li:first-child > a { padding-top: 0; }
.hscroll .hcard.writing-card .writing-list li:first-child {
  border-top: 0;
  padding-top: 0;
}
.hscroll .hcard.writing-card .writing-list li .title {
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.hscroll .hcard.writing-card .writing-list li .status {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

/* ============== POSITION INDICATOR ============== */
.hscroll-indicator {
  position: fixed;
  top: 28px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  z-index: 10;
  font-variant-numeric: tabular-nums;
}
.hscroll-pos { color: var(--ink); font-weight: 500; }
.hscroll-sep { color: var(--muted); }
.hscroll-track {
  width: 60px;
  height: 1px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.hscroll-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: var(--ink);
  transform-origin: left center;
  transition: transform 0.12s cubic-bezier(0.4,0,0.2,1);
}
.hscroll-arrow {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}
.hscroll-arrow:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.hscroll-arrow[disabled] {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

/* ============== HORIZONTAL SCROLL CONTAINER ============== */
.hscroll {
  display: flex;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  /* Free scrolling — no snap. JS smooths wheel input via a RAF lerp. */
  scroll-padding: 40px;
  /* Disable rubber-band at the bounds so the orb scale doesn't jitter
     against an oscillating scrollLeft. */
  overscroll-behavior-x: contain;
  padding: 0 calc(50vw - 410px);
  height: calc(100vh - 180px);
  min-height: 560px;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }

.hscroll .hcard {
  flex: 0 0 min(820px, calc(100vw - 60px));
  background: var(--paper);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  --card-scale: 0.88;
  --card-opacity: 0.55;
  transform: translateY(8px) scale(var(--card-scale));
  transition:
    opacity 0.6s cubic-bezier(0.2,0,0.2,1);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 24px 60px -28px rgba(0,0,0,0.12);
  position: relative;
}
body.ready .hscroll .hcard {
  opacity: var(--card-opacity);
  transform: translateY(0) scale(var(--card-scale));
}
/* Hovering a card commits it to the fully-focused state — same growth
   the scroll-driven proximity gives, but without needing perfect snap. */
body.ready .hscroll .hcard:hover {
  --card-scale: 1;
  --card-opacity: 1;
}
body.ready .hscroll .hcard:nth-child(1) { transition-delay: 0.05s; }
body.ready .hscroll .hcard:nth-child(2) { transition-delay: 0.12s; }
body.ready .hscroll .hcard:nth-child(3) { transition-delay: 0.19s; }
body.ready .hscroll .hcard:nth-child(4) { transition-delay: 0.26s; }

/* --- Card 1: hero poster --- */
.hscroll .hero-poster.hcard {
  position: relative;
  overflow: hidden;
  padding: 80px 64px;
  align-items: flex-start;
  text-align: left;
  min-height: 560px;
  --orb-x: 0px;
  --orb-y: 0px;
  --orb-scale: 1;
}
.hscroll .hero-poster.hcard::before {
  content: '';
  position: absolute;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: var(--yellow);
  /* Half-visible on the RIGHT edge, vertically centered */
  top: 50%; right: -160px; left: auto; bottom: auto;
  margin-top: -160px;
  z-index: 0;
  transform: scale(var(--orb-scale));
  transform-origin: left center;
  /* No transition — the JS sets --orb-scale on every scroll event already,
     so any CSS easing on top just adds lag and produces visible shake. */
  will-change: transform;
}
.hscroll .hero-poster.hcard > * { position: relative; z-index: 1; }
@keyframes heroOrbDrift {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(-30px,20px) scale(1.04); }
}

.preamble {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.preamble::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink);
  display: inline-block;
}

.hero-poster h1 {
  font-size: clamp(38px, 6vw, 76px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin: 0 0 32px;
  text-wrap: balance;
  text-align: left;
  max-width: 720px;
}
.hero-poster h1 .line { display: block; }
.hero-poster h1 .line.muted { color: var(--muted); }

.hero-poster .sub {
  max-width: 520px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 40px;
  text-wrap: pretty;
}

.scroll-hint {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  animation: scrollPulse 2.4s cubic-bezier(0.4,0,0.2,1) infinite;
  display: inline-block;
}
@keyframes scrollPulse {
  0%, 100% { transform: translateX(0); opacity: 0.55; }
  50%      { transform: translateX(8px); opacity: 1; }
}

/* --- Cards 2 & 3: karri list section --- */
.home-section.hcard {
  padding: 56px 56px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  align-items: start;
  justify-content: start;
  min-height: 560px;
}
/* Projects card: title on top, then list and preview side-by-side.
   Preview spans both grid rows so the centered hover image sits in the
   true vertical middle of the card, not under the title row. */
.hscroll .hcard.projects-card {
  flex: 0 0 min(1080px, calc(100vw - 60px));
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 32px 48px;
  padding: 48px 48px 56px 48px;
  align-content: start;
}
.projects-card > h2 { grid-column: 1; }
.projects-card .project-preview { grid-column: 2; grid-row: 1 / -1; }
.projects-card .home-list { max-width: 360px; }
.home-section.hcard h2 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  padding-top: 8px;
}
.home-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 460px;
}
.home-list li {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}
.home-list li:first-child { border-top: 0; padding-top: 0; }
.home-list li a {
  font-size: 16px;
  letter-spacing: -0.01em;
  font-weight: 500;
  border-bottom: 0;
  text-decoration: underline;
  text-decoration-color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  display: inline-block;
  align-self: flex-start;
  padding-bottom: 1px;
  transition: opacity 0.18s;
}
.home-list li a::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
/* Extend the first item's hit zone upward so the cursor ring (24–34px)
   registers a hover/click even when only its lower edge is over the link. */
.home-list li:first-child a::before { inset: -22px 0 0 0; }
.home-list li > *:not(a) { pointer-events: none; }
.home-list li a:hover { opacity: 0.55; }
.home-list .meta,
.home-list .meta-block {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0;
  margin-top: 1px;
}
.home-list .meta-block { display: block; }

/* Project hover preview (within the projects card) */
.project-preview {
  position: relative;
  align-self: stretch;
  border-radius: var(--radius);
  overflow: hidden;
  background: transparent;
  min-height: 100%;
}
.project-preview .pv { background-color: transparent; }
.project-preview .pv-open { display: none !important; }
.project-preview .pv {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.4,0,0.2,1), transform 0.5s cubic-bezier(0.2,0.8,0.2,1);
  transform: scale(1.04);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.project-preview .pv.active { opacity: 1; transform: scale(var(--pv-scale, 1.05)); }
.project-preview .pv-label { display: none; }
.project-preview.has-active .pv-label { opacity: 0; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20,18,15,0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox .lb-inner {
  position: relative;
  max-width: 1280px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: scale(0.98);
  transition: transform 0.3s cubic-bezier(0.2,0.8,0.2,1);
}
.lightbox.open .lb-inner { transform: scale(1); }
.lightbox .lb-img {
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 12px;
  background: var(--paper);
}
.lightbox .lb-close {
  position: absolute;
  top: -36px; right: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--paper);
  border: 0;
  font: 20px/1 inherit;
  color: var(--ink);
  cursor: pointer;
}
.lightbox .lb-link {
  align-self: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.86);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.4);
  padding-bottom: 2px;
}

.copy-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 8px;
  opacity: 0;
  transition: opacity 0.18s cubic-bezier(0.4,0,0.2,1);
}
.copy-label.shown { opacity: 1; }

/* --- Card 4: mantras --- */
.hscroll .mantras.hcard {
  position: relative;
  overflow: hidden;
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-align: left;
  padding: 96px 64px 96px 96px;
  align-items: flex-start;
  justify-content: center;
  min-height: 560px;
  --orb-scale: 1;
}
.hscroll .mantras.hcard span {
  display: block;
  padding: 4px 0;
}
.hscroll .mantras.hcard .muted { color: var(--muted); }
.hscroll .mantras.hcard::before {
  content: '';
  position: absolute;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: var(--yellow);
  /* Half-shown on the left edge of the card, vertically centered */
  top: 50%; left: -160px; right: auto; bottom: auto;
  margin-top: -160px;
  z-index: 0;
  transform: scale(var(--orb-scale));
  transform-origin: right center;
  /* No transition — see hero orb note above. */
  will-change: transform;
}
.hscroll .mantras.hcard::after {
  content: 'end';
  position: absolute;
  top: 40px; right: 40px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 1;
}
.hscroll .mantras.hcard > * { position: relative; z-index: 1; }
@keyframes mantraOrbDrift {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(40px,-20px) scale(1.06); }
}

/* ============== SIDE WIDGET ============== */
.side-widget {
  position: fixed;
  right: 28px;
  bottom: 24px;
  background: var(--paper);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 12px;
  line-height: 1.4;
  z-index: 20;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04), 0 12px 30px -16px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  gap: 12px;
}
.side-widget::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #00C853;
  box-shadow: 0 0 0 4px rgba(0,200,83,0.12);
  flex-shrink: 0;
  animation: dotPulse 2.4s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(0,200,83,0.12); }
  50%      { box-shadow: 0 0 0 6px rgba(0,200,83,0.18); }
}
.side-widget strong { font-weight: 500; display: block; font-size: 12px; }
.side-widget .meta { color: var(--muted); font-size: 11px; }

/* ============== FOOTER ============== */
.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 40px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}
.footer a { border-bottom: 1px solid var(--line); }
.footer a:hover { border-bottom-color: var(--ink); opacity: 1; }
.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}
.footer-links .dot { color: var(--muted); opacity: 0.6; }

.footer-extra {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 40px 28px;
  font-size: 12px;
  color: var(--muted);
}
.footer-extra a { border-bottom: 1px solid var(--line); }

/* ============== ABOUT PAGE ============== */
.about-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 40px 96px;
}
.about-hero {
  text-align: center;
  margin-bottom: 96px;
}
.about-portrait {
  width: 120px; height: 144px;
  background: var(--ink);
  border-radius: 8px;
  margin: 0 auto 40px;
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.06) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, #1a1a1a, #0A0A0A);
  position: relative;
  overflow: hidden;
}
.about-portrait::after {
  content: 'portrait';
  position: absolute;
  bottom: 8px; left: 0; right: 0;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}
.about-hero h1 {
  font-size: clamp(30px, 3.8vw, 44px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}
.about-hero h1 .row { display: block; }
.about-hero h1 .muted { color: var(--muted); }

.about-section {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 40px;
  align-items: start;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.about-section h2 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  padding-top: 4px;
}
.about-section .item {
  margin-bottom: 18px;
}
.about-section .item:last-child { margin-bottom: 0; }
.about-section .item strong {
  font-weight: 500;
  display: block;
}
.about-section .item .meta {
  font-size: 13px;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}
.about-section ul.about-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.about-section ul.about-list li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
}
.about-section ul.about-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.8em;
  width: 14px; height: 1px;
  background: var(--ink);
}
.about-section ul.about-list li strong { font-weight: 500; }

.writing-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.writing-list li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.writing-list li:first-child { border-top: 0; padding-top: 0; }
.writing-list li .title { color: var(--muted); }
.writing-list li .status {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============== CASE STUDY ============== */
.case-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 40px 0;
  position: relative;
}
.case-back {
  font-size: 12px;
  color: var(--muted);
  display: inline-block;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
}
.case-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px;
  align-items: start;
  padding-bottom: 96px;
}
.case-media { position: sticky; top: 80px; align-self: start; }
.case-media .video-frame {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.case-media .video-frame video,
.case-media .video-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* Hide any native browser overlay (play button, pause button, PiP button,
   media controls panel) — exhaustive across WebKit/Chromium so no video
   chrome ever surfaces, paused or playing, hover or not. */
.case-media .video-frame video::-webkit-media-controls,
.case-media .video-frame video::-webkit-media-controls-start-playback-button,
.case-media .video-frame video::-webkit-media-controls-overlay-play-button,
.case-media .video-frame video::-webkit-media-controls-play-button,
.case-media .video-frame video::-webkit-media-controls-pause-button,
.case-media .video-frame video::-webkit-media-controls-panel,
.case-media .video-frame video::-webkit-media-controls-enclosure,
.case-media .video-frame video::-webkit-media-controls-overlay-enclosure,
.case-media .video-frame video::-webkit-media-controls-picture-in-picture-button,
.case-evidence video::-webkit-media-controls,
.case-evidence video::-webkit-media-controls-start-playback-button,
.case-evidence video::-webkit-media-controls-overlay-play-button,
.case-evidence video::-webkit-media-controls-play-button,
.case-evidence video::-webkit-media-controls-pause-button,
.case-evidence video::-webkit-media-controls-panel,
.case-evidence video::-webkit-media-controls-enclosure,
.case-evidence video::-webkit-media-controls-overlay-enclosure,
.case-evidence video::-webkit-media-controls-picture-in-picture-button,
.case-figure video::-webkit-media-controls,
.case-figure video::-webkit-media-controls-start-playback-button,
.case-figure video::-webkit-media-controls-overlay-play-button,
.case-figure video::-webkit-media-controls-play-button,
.case-figure video::-webkit-media-controls-pause-button,
.case-figure video::-webkit-media-controls-panel,
.case-figure video::-webkit-media-controls-enclosure,
.case-figure video::-webkit-media-controls-overlay-enclosure,
.case-figure video::-webkit-media-controls-picture-in-picture-button {
  display: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
}
/* Videos in case studies are decorative/looping. Disable pointer events so
   nothing the user can click — native overlay, scrubber, anything — can
   appear or interrupt playback. */
/* Videos accept clicks so the user can pause/resume them. */
.case-media .video-frame video,
.case-evidence video,
.case-figure video {
  pointer-events: auto;
}
.case-media .video-caption {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

.case-text { max-width: var(--reading); }
.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}
.case-title {
  font-size: clamp(32px, 3.6vw, 44px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 32px;
  text-wrap: balance;
}
.case-text .case-subtitle {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-size: 18px;
  line-height: 1.4;
  color: var(--muted);
  margin: -20px 0 32px;
  letter-spacing: -0.005em;
}
.case-text .lead {
  font-size: 18px;
  line-height: 1.65;
  margin-bottom: 48px;
}
.case-text .lead::first-letter {
  font-family: 'Newsreader', serif;
  font-size: 5em;
  float: left;
  line-height: 0.82;
  padding-right: 14px;
  padding-top: 8px;
  font-weight: 500;
  font-feature-settings: "lnum";
}
.case-text h2 {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-top: 48px;
  margin-bottom: 16px;
}
.case-text p { font-size: 17px; line-height: 1.75; }
.case-text ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.case-text ul li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
  font-size: 17px;
  line-height: 1.6;
}
.case-text ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.85em;
  width: 14px; height: 1px;
  background: var(--ink);
}
.case-text .caveat {
  font-style: italic;
  color: var(--muted);
  font-size: 14px;
  margin-top: 12px;
}

.case-nav {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
  margin-bottom: 24px;
}
.case-nav .col { display: flex; flex-direction: column; gap: 4px; }
.case-nav .col.right { text-align: right; align-items: flex-end; }
.case-nav .col .label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.case-nav .col a {
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid var(--ink);
}

/* ============== RESPONSIVE ============== */
@media (max-width: 900px) {
  /* Hide the desktop topnav on mobile — replaced by the side-panel menu */
  .topnav { display: none !important; }

  /* ============== MOBILE SIDE MENU ============== */
  /* Pushed down to clear the iPhone status bar / dynamic island area. */
  .mobile-menu-btn {
    position: fixed;
    top: 60px;
    right: 16px;
    width: 44px;
    height: 44px;
    z-index: 9500;
    background: var(--bg);
    border: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-menu-btn span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: var(--ink);
    border-radius: 1px;
    transition: transform 0.25s cubic-bezier(0.2,0.8,0.2,1),
                opacity 0.2s;
  }
  .mobile-menu-btn.open span:nth-child(1) {
    transform: translateY(3.25px) rotate(45deg);
  }
  .mobile-menu-btn.open span:nth-child(2) {
    transform: translateY(-3.25px) rotate(-45deg);
  }
  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20,18,15,0.32);
    z-index: 9400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .mobile-menu-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }
  .mobile-menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(72vw, 280px);
    background: var(--paper, var(--bg));
    z-index: 9450;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.2,0.8,0.2,1);
    padding: 128px 24px 32px;
    box-shadow: -8px 0 36px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .mobile-menu-panel.open { transform: translateX(0); }
  .mobile-menu-panel a {
    display: block;
    padding: 16px 0;
    font-size: 18px;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    letter-spacing: -0.005em;
  }
  .mobile-menu-panel a:last-of-type { border-bottom: 0; }
  .mobile-menu-panel a.active {
    font-weight: 500;
  }
  .mobile-menu-panel a.active::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--yellow, #f5d44a);
    margin-left: 10px;
    vertical-align: middle;
  }

  /* ---- Inner pages (case studies + writing): fixed top bar on mobile.
     "All work" / "All writing" pinned top-left, hamburger pinned top-right.
     Both share the same chrome and sit above the page content. ---- */
  .case-wrap .case-back,
  .article-wrap .case-back {
    position: fixed !important;
    top: 60px;
    left: 16px;
    z-index: 9500;
    background: var(--bg);
    border: 0;
    border-bottom: 0 !important;
    border-radius: 0;
    height: 44px;
    padding: 0 14px 0 0;
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    box-shadow: none;
    margin: 0 !important;
  }
  /* Push case content below the fixed bar so it doesn't sit behind it. */
  .case-wrap,
  .article-wrap {
    padding-top: 120px !important;
  }
  /* First video / media on case studies: explicitly centered on mobile,
     with a touch of breathing room above so it doesn't kiss the fixed bar.
     Override the desktop left-bleed and dark frame: video sits centered on
     the page background, no ink letterbox, full reading width. */
  .case-split .case-media {
    margin: 8px auto 0 !important;
    text-align: center;
  }
  .case-split .case-media .video-frame {
    margin: 0 auto;
    background: var(--bg) !important;
    border-radius: 0 !important;
  }
  .case-split .case-media .video-frame::after { box-shadow: none !important; }
  .case-split .case-media .video-caption {
    text-align: center;
    padding-left: 0 !important;
  }
  /* Kill the desktop left-bleed that was throwing the landscape video
     off-center inside the iPhone frame. */
  .case-wrap > .case-split > .case-media.is-landscape {
    margin-left: 0 !important;
  }
  .case-wrap > .case-split > .case-media.is-landscape .video-frame {
    border-radius: 0 !important;
    background: var(--bg) !important;
  }
  .case-wrap > .case-split > .case-media.is-landscape .video-caption {
    padding-left: 0 !important;
    text-align: center;
  }

  /* ---- Banking JTBD video (.is-portrait inside case-text): on mobile,
     keep the frame small and place the caption alongside it on the right
     so the figure reads as one compact unit, not a hero. ---- */
  .case-text .case-figure.is-portrait {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    justify-content: flex-start !important;
    gap: 14px;
    margin: 28px 0 24px;
  }
  .case-text .case-figure.is-portrait .frame {
    width: 180px !important;
    max-width: 180px !important;
    flex: 0 0 180px;
  }
  /* Wide portrait variant stays stacked + bigger on mobile so the JTBD
     prototype frame doesn't shrink into a thumbnail. */
  .case-text .case-figure.is-portrait.is-wide {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }
  .case-text .case-figure.is-portrait.is-wide .frame {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
  }
  .case-text .case-figure.is-portrait figcaption {
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 0;
    font-size: 11px;
    line-height: 1.5;
  }
  /* Kill the inset hairline border that reads as a gray overlay on the
     video on mobile. Videos in case studies autoplay and shouldn't show
     any visible chrome. */
  .case-text .case-figure .frame::after,
  .case-media .video-frame::after,
  .case-evidence .frame::after {
    box-shadow: none !important;
  }

  /* ---- Fleet page: tighten the huge desktop section gaps on mobile so
     it reads as one continuous story rather than a series of empty
     screens. Consistent ~32px rhythm between sections. ---- */
  .case-wrap.case-scrolly { padding-top: 120px !important; padding-bottom: 0; }
  .case-wrap.case-scrolly .case-hero,
  .case-wrap.case-scrolly .case-hero.is-split { margin: 0 0 32px !important; gap: 20px !important; }
  .case-wrap.case-scrolly .case-hero .case-title { margin: 0 0 8px; }
  .case-wrap.case-scrolly .hero-overview h3 { margin-top: 18px; }
  .case-wide-section { margin: 32px 0 !important; }
  .case-wide-section .sec-media { margin: 0 0 18px !important; }
  .case-wide-section .sec-body h2 { margin-top: 4px; }
  .case-scrolly-section { padding: 32px 0 !important; gap: 18px !important; }
  .case-scrolly-section .sec-text h2:not(:first-child) { margin-top: 24px !important; }
  .case-wrap.case-scrolly .case-close { margin: 32px 0 0 !important; padding-top: 28px !important; }
  .case-wrap.case-scrolly .case-close h2:not(:first-child) { margin-top: 24px; }
  .case-wrap.case-scrolly .outcomes-block { gap: 24px; }
  .case-evidence { margin: 24px auto !important; }
  /* Trim case-nav inter-row gaps on mobile too */
  .case-nav { margin-top: 40px !important; }

  /* Case study pages: the print-link sat top-right and would clash with
     the hamburger. Hide it on mobile (PDF export is a desktop affordance). */
  .case-wrap .print-link { display: none !important; }

  .topnav { gap: 6px; padding-top: 18px; flex-wrap: nowrap; overflow: hidden; padding-left: 16px; padding-right: 16px; }
  .topnav .cell { font-size: 8px; padding: 0 5px; min-width: 18px; }
  /* Trim decorative ticks on small screens so the cells stay readable on one line */
  .topnav .tick:nth-child(1),
  .topnav .tick:nth-child(2),
  .topnav .tick:nth-last-child(1),
  .topnav .tick:nth-last-child(2),
  .topnav .tick:nth-last-child(3) { display: none; }

  /* Mobile: stack vertically, normal page scroll. Top padding clears the
     iPhone status bar + the fixed hamburger menu so the hero/work content
     doesn't sit underneath them. */
  .hscroll {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    min-height: 0;
    padding: 60px 16px 64px;
    gap: 16px;
    overflow: visible;
    scroll-snap-type: none;
  }
  .hscroll .hcard {
    flex: 0 0 auto;
    width: 100%;
    scroll-snap-align: none;
    min-height: auto;
    --card-scale: 1;
    --card-opacity: 1;
    opacity: 1 !important;
    transform: none !important;
  }

  .hscroll .hero-poster.hcard {
    padding: 80px 24px 64px;
    align-items: flex-start;
    text-align: left;
    min-height: 480px;
  }
  /* Hero circle on mobile: tucked up at the TOP edge, centered horizontally.
     Less of the circle is visible at default (~100px slice instead of half),
     so the growth on scroll reads as more dramatic.
     Pivot from the TOP of the orb (which is offscreen) so when --orb-scale
     grows, the orb expands DOWN into the visible card — the visible portion
     grows in both width AND height, not just width. */
  .hscroll .hero-poster.hcard::before {
    width: 280px; height: 280px;
    top: -290px; bottom: auto;
    left: 50%; right: auto;
    margin: 0 0 0 -140px;
    transform: scale(var(--orb-scale, 1));
    transform-origin: center top;
    animation: none;
  }
  .hero-poster h1 { font-size: clamp(32px, 9vw, 44px); }
  .hero-poster .sub { font-size: 15px; }

  /* Projects: list and preview stack — preview shows first image by default */
  .home-section.hcard {
    grid-template-columns: 1fr;
    padding: 40px 24px;
    gap: 20px;
  }
  .hscroll .hcard.projects-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
    padding: 24px 24px 32px;
  }
  .projects-card .home-list { max-width: none; order: 2; }
  .projects-card h2 { order: 1; padding-top: 0; }
  .projects-card .project-preview { display: none; }
  .projects-card .pv-open { display: none; }
  .home-list li a { font-size: 15px; }

  .hscroll .mantras.hcard {
    padding: 64px 24px 96px;
    font-size: clamp(24px, 7vw, 36px);
    text-align: left;
    min-height: 480px;
  }
  /* Mantras circle on mobile: tucked down at the BOTTOM edge, centered horizontally.
     Mirror of the hero — only a small slice visible at default state.
     Pivot from the BOTTOM of the orb (offscreen) so when --orb-scale grows,
     the orb expands UP into the visible card. */
  .hscroll .mantras.hcard::before {
    width: 280px; height: 280px;
    top: auto; bottom: -290px;
    left: 50%; right: auto;
    margin: 0 0 0 -140px;
    transform: scale(var(--orb-scale, 1));
    transform-origin: center bottom;
  }

  /* Hide horizontal-scroll chrome on mobile */
  .hscroll-indicator { display: none; }
  .scroll-hint { display: none; }
  .side-widget { display: none; }

  /* Lightbox: edge-to-edge on mobile */
  .lightbox { padding: 16px; }
  .lightbox .lb-close { top: -32px; }
  .lightbox .lb-img { max-height: 70vh; }

  .case-split { grid-template-columns: 1fr; gap: 32px; padding-bottom: 64px; }
  .case-media { position: relative; top: 0; transform: none; width: 100%; }
  .case-media .video-frame { aspect-ratio: 16 / 9; }
  .case-wrap { padding: 24px 20px 0; }

  .about-wrap { padding: 32px 20px 64px; }
  .about-section { grid-template-columns: 1fr; gap: 12px; }

  /* Footer: contact info first, copyright after — per spec on mobile.
     Force the phone number onto its own line so it doesn't break in the
     middle of the number across two lines. Works for both index.html
     (.footer-links flex layout) and detail pages (inline flow with
     &nbsp;·&nbsp; separators). */
  .footer { flex-direction: column-reverse; align-items: flex-start; gap: 8px; padding: 24px 20px 32px; }
  .footer-links { gap: 4px 8px; font-size: 11px; }
  .footer a[href^="tel:"] {
    display: block;
    flex-basis: 100%;
    margin-top: 4px;
  }
  .footer-links a[href^="tel:"] + .dot,
  .footer-links .dot:has(+ a[href^="tel:"]) { display: none; }

  /* Tweaks panel — too big on a phone, hide entirely */
  .tweaks-panel { display: none !important; }

  /* About-me card stacks on mobile */
  .hscroll .hcard.about-me-card {
    grid-template-columns: 1fr;
    padding: 32px 24px;
    gap: 18px;
  }
  .about-me-grid { gap: 24px; }

  /* Writing card stacks on mobile */
  .hscroll .hcard.writing-card {
    grid-template-columns: 1fr;
    padding: 32px 24px;
    gap: 14px;
  }
  .hscroll .hcard.writing-card .writing-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* Custom cursor + shortcut card hidden on touch */
  .cur, .shortcut-card { display: none !important; }
}
@media (min-width: 901px) {
  .mobile-menu-btn,
  .mobile-menu-backdrop,
  .mobile-menu-panel { display: none !important; }
}
@media (max-width: 480px) {
  .hscroll .hcard { border-radius: 16px; }
  .hero-poster h1 { font-size: 32px; }
}


/* ============== ARTICLE (writing inner pages) ============== */
.article-wrap {
  max-width: 760px;
  padding: 56px 40px 0;
}
.article-wrap .case-text {
  max-width: none;
}
.article-wrap .case-title {
  margin-top: 8px;
}
.article-placeholder {
  margin: 40px 0 8px;
  padding: 24px 28px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(0,0,0,0.015);
}
.article-placeholder p { font-size: 15px; line-height: 1.7; margin: 0 0 12px; }
.article-placeholder p:last-child { margin-bottom: 0; }
.article-nav { margin-top: 80px; }
@media (max-width: 720px) {
  .article-wrap { padding: 28px 20px 0; }
}


/* Case study — landscape (16:9) media frame variant */
.case-media.is-landscape .video-frame { aspect-ratio: 16 / 9; }
.case-media.is-landscape .video-frame video,
.case-media.is-landscape .video-frame img {
  object-fit: cover;
  background: var(--ink);
}

/* Inline figures inside the right-column reading text */
.case-text .case-figure {
  margin: 36px 0 28px;
}
.case-text .case-figure.is-portrait {
  display: flex;
  justify-content: flex-start;
}
.case-text .case-figure .frame {
  position: relative;
  width: 100%;
  background: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}
.case-text .case-figure.is-portrait .frame {
  width: min(360px, 100%);
  aspect-ratio: 310 / 408;
}
/* Wider portrait variant — frame ~2× the default portrait width.
   Stack the figcaption underneath (instead of beside) so the frame can
   actually claim that width without flex-shrink collapsing it. */
.case-text .case-figure.is-portrait.is-wide {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}
.case-text .case-figure.is-portrait.is-wide .frame {
  width: min(360px, 100%);
  flex: 0 0 auto;
}
.case-text .case-figure.is-landscape .frame {
  aspect-ratio: 16 / 10;
}
.case-text .case-figure.is-wide-image .frame {
  aspect-ratio: 1128 / 639;
  background: var(--paper-2, #f3efe7);
}
.case-text .case-figure .frame img,
.case-text .case-figure .frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.case-text .case-figure.is-wide-image .frame img { object-fit: cover; }
.case-text .case-figure .frame::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(20,18,15,0.06);
  border-radius: var(--radius);
}
.case-text .case-figure figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: none;
}
.case-text .case-figure figcaption .num {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .case-text .case-figure.is-portrait { justify-content: center; }
  .case-text .case-figure.is-portrait .frame { width: 100%; max-width: 320px; }
}


/* Banking shopfront variant: give the wide landscape video more space */
.case-split.is-wide-media {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}
@media (max-width: 720px) {
  .case-split.is-wide-media { grid-template-columns: 1fr; }
}

/* Bleed the landscape case-media to the left edge so the video has no
   surrounding whitespace on its left. */
.case-wrap > .case-split > .case-media.is-landscape {
  margin-left: -40px;
}
.case-wrap > .case-split > .case-media.is-landscape .video-frame {
  border-radius: 0 var(--radius) var(--radius) 0;
}
.case-wrap > .case-split > .case-media.is-landscape .video-caption {
  padding-left: 40px;
}
@media (max-width: 720px) {
  .case-wrap > .case-split > .case-media.is-landscape { margin-left: -20px; }
  .case-wrap > .case-split > .case-media.is-landscape .video-caption { padding-left: 20px; }
}


/* Inline 4:5 portrait figure that fills the reading column (for larger
   portrait artifacts like experience maps). */
.case-text .case-figure.is-fourfive .frame {
  aspect-ratio: 4 / 5;
  width: 100%;
}
.case-text .case-figure.is-fourfive .frame video,
.case-text .case-figure.is-fourfive .frame img {
  object-fit: cover;
}


/* Workshop / FigJam-style figure: clean, no backdrop */
.case-text .case-figure.is-workshop .frame {
  aspect-ratio: 833 / 495;
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}
.case-text .case-figure.is-workshop .frame img {
  object-fit: contain;
  background: transparent;
}
.case-text .case-figure.is-workshop {
  margin-top: 48px;
  margin-bottom: 36px;
}

/* Screens collage figure: clean, no backdrop */
.case-text .case-figure.is-screens .frame {
  aspect-ratio: 752 / 690;
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}
.case-text .case-figure.is-screens .frame img {
  object-fit: contain;
  background: transparent;
}

/* Suppress the default inset hairline border on these clean variants */
.case-text .case-figure.is-workshop .frame::after,
.case-text .case-figure.is-screens .frame::after {
  box-shadow: none;
}


/* Clean figure: no backdrop, no frame, just the image and caption */
.case-text .case-figure.is-clean .frame {
  aspect-ratio: 884 / 658;
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}
.case-text .case-figure.is-clean .frame img {
  object-fit: contain;
  background: transparent;
}
.case-text .case-figure.is-clean .frame::after { box-shadow: none; }


/* Press-and-hold pause: subtle visual feedback */
video { cursor: pointer; }
video.held { filter: brightness(0.95); }

/* Scroll-margin so sticky-nav doesn't hide the target section after a hash jump */
.home-section, #projects, #writing, #about-me, #mantras { scroll-margin-top: 80px; }

/* Case-study size tuning: trim the hero a notch */
.case-title { font-size: clamp(28px, 3.2vw, 38px); }
.case-text .lead { font-size: 17px; margin-bottom: 36px; }
.case-text .lead::first-letter { font-size: 4em; }
.case-media .video-frame { aspect-ratio: 4 / 5; }

/* Smaller portrait videos on mobile */
@media (max-width: 720px) {
  .case-text .case-figure.is-portrait .frame {
    width: 100%;
    max-width: 240px;
  }
}

/* PRINT — PDF export */
.print-link {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 5px 11px;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
  margin-left: 16px;
  vertical-align: middle;
}
.print-link:hover { background: var(--ink); color: var(--bg); }
@media print {
  body { background: #fff; color: #000; }
  .topnav, .footer, .case-nav, .case-back, .print-link, .skip-link,
  .hscroll-indicator, .side-widget, .palette-backdrop, .shortcut-card,
  .lightbox, .page-fade, .cur-dot, .cur-ring { display: none !important; }
  .case-wrap, .article-wrap {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .case-media { position: static !important; transform: none !important; }
  .case-split { display: block !important; }
  .case-split > .case-media { margin-bottom: 24px; }
  video, img { max-width: 100% !important; height: auto !important; page-break-inside: avoid; }
  h1, h2, h3 { page-break-after: avoid; }
  figure, .case-evidence, .outcomes-block { page-break-inside: avoid; }
  a { color: inherit; }
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 10px;
    color: #666;
  }
  a[href^="#"]:after, a[href^="mailto:"]:after, a[href^="tel:"]:after { content: ""; }
}

/* Small evidence videos — centred, captioned, no full-bleed */
.case-evidence {
  margin: 64px auto 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.case-evidence .frame {
  border-radius: 14px;
  overflow: hidden;
  background: var(--ink);
  position: relative;
}
.case-evidence.is-small .frame {
  width: 180px;
  aspect-ratio: 480 / 642;
}
.case-evidence.is-medium .frame {
  width: 320px;
  aspect-ratio: 480 / 558;
}
.case-evidence.is-portrait .frame {
  width: 280px;
  aspect-ratio: 480 / 854;
}
.case-evidence .frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.case-evidence figcaption {
  font-family: 'Newsreader', serif;
  font-style: italic;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  max-width: 380px;
  line-height: 1.5;
}

/* Inline right-aligned variant — sits next to body text and lets paragraphs wrap around */
.case-evidence.is-inline-right {
  float: right;
  margin: 4px 0 14px 28px;
  display: block;
}
.case-evidence.is-inline-right .frame { margin-left: auto; margin-right: 0; }
.case-evidence.is-inline-right figcaption {
  margin-top: 8px;
  text-align: right;
}
.case-evidence.is-inline-right.is-small .frame { width: 160px; }
.case-evidence.is-inline-right.is-medium .frame { width: 240px; }

/* Outcomes block: text on the left, evidence video on the right, aligned tops */
.outcomes-block {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 40px;
}
.outcomes-block .outcomes-text { flex: 1; min-width: 0; }
.outcomes-block .outcomes-evidence {
  flex: 0 0 auto;
  margin: 0;
}
.outcomes-block .outcomes-evidence figcaption { max-width: 160px; }
@media (max-width: 720px) {
  .outcomes-block { flex-direction: column; gap: 24px; }
  .outcomes-block .outcomes-evidence { align-self: center; }
}
@media (max-width: 720px) {
  .case-evidence.is-inline-right {
    float: none;
    margin: 32px auto;
  }
  .case-evidence.is-inline-right .frame { margin: 0 auto; }
  .case-evidence.is-inline-right figcaption { text-align: center; }
}


/* ============== CASE STUDY — SINGLE-COLUMN LONGFORM ============== */
.case-wrap.case-long {
  max-width: 1280px;
  padding: 40px 40px 0;
}
.case-wrap.case-long .case-back { margin-bottom: 64px; }
.case-wrap.case-long .case-text {
  max-width: 720px;
  margin: 0 auto;
}
.case-wrap.case-long .case-text .case-meta { justify-content: center; }
.case-wrap.case-long .case-text .case-title {
  text-align: center;
  font-size: clamp(36px, 4vw, 56px);
}
.case-wrap.case-long .case-text .case-subtitle {
  text-align: center;
}
.case-wrap.case-long .case-text .lead {
  text-align: left;
  margin-bottom: 64px;
}
.case-wrap.case-long .case-nav { margin-top: 96px; }

/* Full-bleed figures that escape the reading column */
.case-wrap.case-long .case-figure.full-bleed {
  max-width: 1200px;
  margin-left: calc((720px - 1200px) / 2);
  margin-right: calc((720px - 1200px) / 2);
}
@media (max-width: 1280px) {
  .case-wrap.case-long .case-figure.full-bleed {
    max-width: calc(100vw - 80px);
    margin-left: calc((100% - (100vw - 80px)) / 2);
    margin-right: calc((100% - (100vw - 80px)) / 2);
  }
}
@media (max-width: 800px) {
  .case-wrap.case-long .case-figure.full-bleed {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .case-wrap.case-long { padding: 24px 20px 0; }
}

/* Override: clean variant with explicit per-instance aspect-ratio via inline style */
.case-text .case-figure.is-clean .frame img {
  object-fit: contain;
}


/* ============== CASE STUDY — SCROLLY SECTIONS ============== */
/* Per-section sticky: image stays fixed only while reading that section, then scrolls away */
.case-wrap.case-scrolly {
  max-width: 1360px;
  padding: 40px 40px 0;
}

/* Hero variants */
.case-wrap.case-scrolly .case-hero {
  margin: 0 auto 80px;
}
.case-wrap.case-scrolly .case-hero.is-centered {
  max-width: 720px;
  text-align: center;
}
.case-wrap.case-scrolly .case-hero.is-centered .case-meta { justify-content: center; }
.case-wrap.case-scrolly .case-hero.is-centered .case-subtitle { text-align: center; }
.case-wrap.case-scrolly .case-hero.is-centered .lead {
  text-align: left;
  max-width: 640px;
  margin: 40px auto 0;
}
.case-wrap.case-scrolly .case-hero .case-title {
  font-size: clamp(36px, 4vw, 56px);
  margin: 0 0 12px;
}

/* Split hero: text left, mockup right */
.case-wrap.case-scrolly .case-hero.is-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px;
  align-items: center;
  margin: 16px 0 96px;
}
.case-wrap.case-scrolly .case-hero.is-split .hero-text {
  text-align: left;
}
.case-wrap.case-scrolly .case-hero.is-split .case-meta { justify-content: flex-start; }
.case-wrap.case-scrolly .case-hero.is-split .case-subtitle { text-align: left; }
.case-wrap.case-scrolly .case-hero.is-split .hero-overview p {
  font-size: 17px;
  line-height: 1.75;
  margin: 0 0 16px;
}
.case-wrap.case-scrolly .case-hero.is-split .hero-overview h3 {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 28px 0 10px;
  font-weight: 500;
}
.case-wrap.case-scrolly .case-hero.is-split .hero-media .frame {
  width: 100%;
  background: transparent;
}
.case-wrap.case-scrolly .case-hero.is-split .hero-media .frame img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Full-width section: image full width, text below full width left-aligned */
.case-wide-section {
  margin: 80px 0;
}
.case-wide-section .sec-media {
  margin: 0 0 32px;
}
.case-wide-section .sec-media .frame {
  width: 100%;
  background: transparent;
}
.case-wide-section .sec-media .frame img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}
.case-wide-section .sec-media figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.case-wide-section .sec-media figcaption .num {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.case-wide-section .sec-body {
  max-width: 1100px;
  text-align: left;
}
.case-wide-section .sec-body h2 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 16px;
}
.case-wide-section .sec-body h3 {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 24px 0 10px;
  font-weight: 500;
}
.case-wide-section .sec-body p {
  font-size: 17px;
  line-height: 1.75;
  margin: 0 0 16px;
  max-width: 900px;
}

/* Scrolly-pair section (image left, text right) */
.case-scrolly-section {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 64px;
  align-items: start;
  padding: 80px 0;
}
.case-scrolly-section .sec-media {
  position: sticky;
  top: 56px;
  align-self: start;
  margin-left: -40px;
}
.case-scrolly-section .sec-media .frame {
  position: relative;
  width: 100%;
  background: transparent;
  overflow: hidden;
}
.case-scrolly-section .sec-media .frame img,
.case-scrolly-section .sec-media .frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.case-scrolly-section .sec-media figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding-left: 40px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.case-scrolly-section .sec-media figcaption .num {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.case-scrolly-section .sec-text {
  max-width: 380px;
}
.case-scrolly-section .sec-text h2 {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.case-scrolly-section .sec-text h2:not(:first-child) { margin-top: 40px; }
.case-scrolly-section .sec-text p {
  font-size: 16px;
  line-height: 1.75;
  margin: 0 0 16px;
}
.case-scrolly-section .sec-text ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.case-scrolly-section .sec-text ul li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.6;
}
.case-scrolly-section .sec-text ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 12px;
  width: 14px; height: 1px;
  background: var(--ink);
}

/* Closing block (no image) */
.case-wrap.case-scrolly .case-close {
  max-width: 1100px;
  margin: 96px 0 0;
  padding-top: 80px;
  border-top: 1px solid var(--line);
}
.case-wrap.case-scrolly .case-close h2 {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.case-wrap.case-scrolly .case-close h2:not(:first-child) { margin-top: 40px; }
.case-wrap.case-scrolly .case-close p { font-size: 17px; line-height: 1.75; margin: 0 0 16px; max-width: 900px; }
.case-wrap.case-scrolly .case-close ul { list-style: none; padding: 0; margin: 0 0 16px; }
.case-wrap.case-scrolly .case-close ul li {
  position: relative; padding-left: 26px; margin-bottom: 12px;
  font-size: 16px; line-height: 1.6;
}
.case-wrap.case-scrolly .case-close ul li::before {
  content: ''; position: absolute; left: 0; top: 12px;
  width: 14px; height: 1px; background: var(--ink);
}
.case-wrap.case-scrolly .case-close .caveat {
  font-style: italic; color: var(--muted); font-size: 14px; margin-top: 12px;
}

/* Stacked hero: text → image → overview, all single-column. Used on fleet
   page so the screenshot sits between the title block and the
   "problem / what I found" overview. */
.case-wrap.case-scrolly .case-hero.is-stacked {
  max-width: 880px;
  margin: 0 auto 96px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.case-wrap.case-scrolly .case-hero.is-stacked .hero-text {
  text-align: left;
}
.case-wrap.case-scrolly .case-hero.is-stacked .case-meta { justify-content: flex-start; }
.case-wrap.case-scrolly .case-hero.is-stacked .case-subtitle { text-align: left; margin-bottom: 0; }
.case-wrap.case-scrolly .case-hero.is-stacked .hero-media {
  margin: 0;
}
.case-wrap.case-scrolly .case-hero.is-stacked .hero-media .frame {
  width: 100%;
  background: transparent;
}
.case-wrap.case-scrolly .case-hero.is-stacked .hero-media .frame img {
  width: 100%;
  height: auto;
  display: block;
}
.case-wrap.case-scrolly .case-hero.is-stacked .hero-overview {
  display: block;
}
.case-wrap.case-scrolly .case-hero.is-stacked .hero-overview h3 {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 500;
}
.case-wrap.case-scrolly .case-hero.is-stacked .hero-overview h3:not(:first-child) {
  margin-top: 24px;
}
.case-wrap.case-scrolly .case-hero.is-stacked .hero-overview p {
  font-size: 17px;
  line-height: 1.75;
  margin: 0 0 16px;
}

@media (max-width: 1000px) {
  .case-wrap.case-scrolly .case-hero.is-stacked { gap: 28px; }
  .case-wrap.case-scrolly .case-hero.is-split {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .case-scrolly-section {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 60px 0;
  }
  .case-scrolly-section .sec-media,
  .case-scrolly-section .sec-text {
    position: relative;
    top: 0;
    margin-left: 0;
    max-width: 100%;
  }
  .case-scrolly-section .sec-media figcaption { padding-left: 0; }
  .case-wrap.case-scrolly { padding: 24px 20px 0; }
  .case-wide-section { margin: 56px 0; }
  .case-wide-section .sec-body { max-width: 100%; }
  .case-wrap.case-scrolly .case-close { max-width: 100%; }
}
