/* ============================================================
   Pooja Sinha Portfolio — page styles
   Ported from the Claude Design prototype. The design-system
   components (NavLink, ProjectCard, Avatar, DisplayHeading,
   SectionLabel, DashedDivider) are reproduced here as plain
   CSS classes.
   ============================================================ */

html, body { margin: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-snap-type: y proximity; -webkit-text-size-adjust: 100%; }
/* faster, steadier taps: no double-tap-zoom delay on controls */
a, button { touch-action: manipulation; }
* { box-sizing: border-box; }
html { background: var(--paper); }
body { background: var(--paper); color: var(--ink); }

/* Keyboard focus — a visible branded ring. Browsers only paint this for
   keyboard/AT navigation (:focus-visible), so mouse clicks stay clean. */
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
/* light ring on dark fields where violet would sink into the background */
.ps-all :focus-visible,
.cs-ov :focus-visible,
.q-outcome :focus-visible { outline-color: var(--white); }

/* ============================================================
   ATOMS — single source of truth for the whole folio.
   ============================================================ */
.ps-page {
  /* type atoms */
  --size-title: 84px;            /* ALL section titles */
  --leading-title: 1.06;
  --size-hero: clamp(36px, min(10vw, 9.5vh), 184px); /* hero headline only */
  --size-body: 16px;             /* ALL body copy (Inter) */
  --leading-body: 28px;
  --text-title: var(--weight-regular) var(--size-title)/var(--leading-title) var(--font-display);
  --text-body: var(--weight-regular) var(--size-body)/var(--leading-body) var(--font-body);
  --text-section-title: var(--text-title);
  /* spacing atoms */
  --gut: clamp(20px, 3vw, 48px);
  --gap-title: clamp(16px, 2vw, 28px);
  --gap-block: clamp(24px, 3vw, 40px);
  --gap-cards: clamp(16px, 2vw, 24px);
  --gap-cols: clamp(24px, 4vw, 64px);
  --gap-links: clamp(14px, 1.6vw, 40px);
  --gap-section: clamp(48px, 6vw, 96px);
  --black: #232324;
  font-family: var(--font-display), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  width: 100%;
  background: var(--paper);
}

/* ---- components (were DS primitives) ---- */
.nav-link {
  font: var(--text-label);
  letter-spacing: var(--tracking-text);
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  display: inline-block;
  will-change: transform;
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-spring);
}
.nav-link::before { content: "("; }
.nav-link::after { content: ")"; }
.nav-link.is-inverse { color: var(--text-inverse); }
@media (hover: hover) {
  .nav-link:hover { opacity: .55; transform: translateY(-1px); }
  .nav-link:active { transform: translateY(.5px); }
}

.ps-name { font: var(--text-name); font-weight: var(--weight-regular); color: var(--ink); text-decoration: none; }

.ps-display {
  font: var(--text-section-title);
  letter-spacing: var(--tracking-display);
  color: var(--text-primary);
  margin: 0;
}
.ps-display.is-inverse { color: var(--text-inverse); }

.ps-label {
  font: var(--text-label);
  letter-spacing: var(--tracking-text);
  color: var(--text-primary);
}
.ps-label.is-caps { text-transform: uppercase; }
.ps-label.is-inverse { color: var(--text-inverse); }

.ps-avatar {
  width: 42px; height: 42px;
  border-radius: var(--radius-avatar);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex: 0 0 auto;
}

.ps-card { margin: 0; }
.ps-card > .ps-card-fill {
  width: 100%;
  border-radius: var(--radius-card);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.ps-card-cap { font: var(--text-label); margin-top: 12px; display: block; }
.ps-card-cap.is-inverse { color: var(--text-inverse); }

.ps-read-link { color: var(--ink); text-decoration: none; transition: opacity var(--dur-2) var(--ease-out); }
@media (hover: hover) { .ps-read-link:hover { opacity: .55; } }
/* footer lists: diamond markers */
#writing ul { list-style: none; }
#writing li { position: relative; }
#writing li::before { content: "◆"; position: absolute; left: -24px; font-size: 11px; line-height: inherit; }

.ps-divider {
  width: 100%; height: 0;
  border-top: var(--rule-width) var(--rule-style) var(--stroke-ink);
}
.ps-divider.is-inverse { border-top-color: var(--stroke-inverse); }
/* dotted rule matching the hero dot grid */
.ps-divider.is-dotted {
  border-top: none; height: 2px;
  background-image: radial-gradient(circle, rgba(35,35,36,0.32) 1px, transparent 1.5px);
  background-size: 5px 2px;
  background-repeat: repeat-x;
}

/* ---- consumers ---- */
.ps-sec { padding: var(--gap-section) var(--gut); }
/* case-study sections: cap content at the design width so the image
   cards keep their proportions on wide monitors; bg still full-bleed */
.ps-sec.ps-cs { padding: var(--gap-section) max(24px, calc((100% - 1392px) / 2)); }
.ps-cs-title { display: flex; align-items: center; gap: 24px; margin-bottom: 0; min-height: 94px; }
.ps-cs-title .ps-display { font: var(--weight-regular) 40px/1.15 var(--font-display); }
.ps-cs-head { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.ps-cs-col { min-width: 0; }
.ps-cs-para { font: var(--text-body); letter-spacing: 0; margin: 0; max-width: 672px; }
.ps-cs-role { margin-top: 16px; font: var(--text-body); }
.ps-cs-role strong { font-weight: 600; display: block; }
.ps-cs-soon { font: var(--text-label); letter-spacing: var(--tracking-text); color: var(--text-inverse); opacity: .7; }
.ps-grid { margin-top: 56px; display: flex; flex-direction: column; gap: var(--gap-cards); }
.ps-row { display: flex; gap: var(--gap-cards); }

/* Experience — label left, list right, year pills */
.ps-xp { background: var(--mint); color: var(--ink); padding: var(--gap-section) 24px; }
.ps-xp-in { max-width: 648px; margin: 0 auto; }
.ps-xp-title { margin: 0 0 clamp(28px,3.4vw,48px); max-width: 648px; font: var(--weight-regular) clamp(30px,3.4vw,40px)/1.2 var(--font-display); letter-spacing: -0.04em; color: var(--ink); }
.ps-xp-list { display: flex; flex-direction: column; }
.ps-xp-item { position: relative; padding: 16px 0; }
.ps-xp-item:first-child { padding-top: 0; }
.ps-xp-item::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-top: 1px dashed rgba(35,35,36,0.28); transform-origin: left center; }
.ps-xp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px 32px; }
.ps-xp-date { font: var(--weight-regular) 14px/22px var(--font-body); letter-spacing: 0; white-space: nowrap; }
.ps-xp-co { margin: 0; font: 600 14px/22px var(--font-body); letter-spacing: 0; text-align: right; }
.ps-xp-desc { margin: 8px 0 0; max-width: 648px; font: var(--weight-regular) 14px/22px var(--font-body); letter-spacing: 0; color: var(--ink); }
.ps-xp-cta { margin-top: var(--gap-block); }
.ps-xp-resume { display: inline-block; font: var(--weight-regular) 16px/28px var(--font-body); color: var(--ink); text-decoration: none; transition: opacity var(--dur-2) var(--ease-out); }
@media (hover: hover) { .ps-xp-resume:hover { opacity: .55; } }
@media (hover: none) {
  .ps-xp-resume { padding: 12px 4px; margin: -12px -4px; }
  .ps-xp-resume:active { opacity: .55; }
}
/* scroll-in: row rises (via [data-reveal]), then its dashed line draws left→right */
.motion .ps-xp-item::after { transform: scaleX(0); transition: transform var(--dur-2) var(--ease-out); }
.motion .ps-xp-item.is-in::after { transform: scaleX(1); transition-delay: .2s; }

/* SIDE QUESTS — draggable playground on an oversized ink canvas.
   Cards and the canvas are positioned purely with translate3d from JS
   (setupPlayground); CSS owns cursors, the drag lift shadow, the center
   link and the static mobile fallback. */
.ps-pin { position: relative; color: var(--white); height: 100svh; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; background: var(--ink) radial-gradient(circle, rgba(255,255,255,0.06) 1.6px, transparent 1.6px) 15px 15px / 30px 30px; }
.ps-play { position: absolute; inset: 0; overflow: hidden; }
.ps-play-canvas { position: absolute; inset: 0; }
.ps-play-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.ps-play-title { font: var(--weight-regular) 24px/1.2 var(--font-display); color: var(--white); }
.ps-play-link { display: inline-flex; align-items: center; gap: 12px; font: var(--weight-regular) 24px/1.2 var(--font-body); letter-spacing: 0.01em; color: rgba(255,255,255,0.6); text-decoration: none; transition: color var(--dur-2) var(--ease-out); }
.ps-play-link svg { width: 20px; height: 20px; }
@media (hover: hover) { .ps-play-link:hover { color: var(--white); } }
.ps-play-card { position: absolute; left: 0; top: 0; margin: 0; border: 8px solid rgba(255,255,255,0.1); border-radius: var(--radius-md); background-clip: padding-box; overflow: hidden; cursor: grab; will-change: transform; opacity: 0; user-select: none; -webkit-user-select: none; touch-action: none; transition: box-shadow .25s var(--ease-out); }
.ps-play-card img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ps-play-card.is-drag { cursor: grabbing; z-index: 5; box-shadow: 0 24px 64px rgba(0,0,0,0.45); }
.ps-play-cap { display: none; }
/* reset — appears once the pile has been shuffled */
.ps-play-reset { position: absolute; right: 16px; bottom: 16px; z-index: 10; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; background: none; border: 0; color: var(--white); cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(6px); transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.ps-play-reset.is-on { opacity: .75; pointer-events: auto; transform: none; }
@media (hover: hover) { .ps-play-reset.is-on:hover { opacity: 1; } }
.ps-play-reset svg { width: 24px; height: 24px; transform: scaleX(-1); transition: transform var(--dur-2) var(--ease-out); }
@media (hover: hover) { .ps-play-reset:hover svg { transform: scaleX(-1) rotate(-45deg); } }
/* static stacked fallback — must match the JS guard in setupPlayground()
   exactly: small screens AND all coarse-pointer devices (tablets), which
   never get the drag canvas */
@media (max-width: 767px), (pointer: coarse) {
  .ps-pin { height: auto; scroll-snap-align: none; padding: 48px 0; }
  .ps-play { position: static; cursor: default; overflow: visible; }
  .ps-play-canvas { position: static; width: auto; height: auto; transform: none !important; display: flex; flex-direction: column; gap: 6px; padding: 0 16px; max-width: 640px; margin: 0 auto; }
  .ps-play-center { position: static; transform: none; order: -1; margin-bottom: 28px; }
  .ps-play-card { position: static; opacity: 1 !important; transform: none !important; width: 100% !important; height: auto !important; border: none; border-radius: 0 !important; overflow: visible; cursor: default; touch-action: auto; }
  .ps-play-card img { height: auto; border-radius: var(--radius-md); }
  .ps-play-cap { display: block; font: var(--text-label); color: var(--white); opacity: .72; text-align: center; margin: 8px 0 14px; }
  .ps-play-reset { display: none; }
}

/* --- Hero entrance --- */
.ps-w { display: inline-block; vertical-align: top; }
.ps-w-i { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .ps-w-i { opacity: 0; filter: blur(10px); animation: psHeroBlur 1.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .ps-fade { opacity: 0; animation: psHeroFade var(--dur-3) var(--ease-out) both; }
}
@keyframes psHeroBlur {
  0% { opacity: 0; filter: blur(10px); }
  55% { opacity: 1; filter: blur(2.5px); }
  100% { opacity: 1; filter: blur(0); }
}
@keyframes psHeroFade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* --- Scroll reveal --- */
.motion [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .45s var(--ease-out) var(--rd, 0s), transform .45s var(--ease-out) var(--rd, 0s); }
.motion [data-reveal].is-in { opacity: 1; transform: none; }
.motion [data-reveal-words] .ps-w-b { display: inline-block; opacity: 0; filter: blur(10px); }
.motion [data-reveal-words].is-in .ps-w-b { animation: psHeroBlur 1.6s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: var(--wd, 0s); }

.ps-toast { position: fixed; left: 50%; bottom: calc(32px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--paper); font: var(--text-label); padding: 12px 18px; border-radius: var(--radius-avatar); transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); z-index: 60; max-width: calc(100vw - 48px); text-align: center; }
.ps-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.ps-top { position: fixed; right: var(--gut, 24px); bottom: calc(32px + env(safe-area-inset-bottom)); z-index: 60; background: var(--white); color: var(--ink); border: none; font: var(--weight-regular) 16px/28px var(--font-body); padding: 8px 24px; border-radius: var(--radius-pill); text-decoration: none; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.ps-top.is-on { opacity: 1; transform: translateY(0); pointer-events: auto; }
@media (hover: hover) { .ps-top:hover { opacity: .8; } }

@media (prefers-reduced-motion: reduce) {
  .motion [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .motion [data-reveal-words] .ps-w-b { opacity: 1 !important; filter: none !important; animation: none !important; }
}

/* --- Hero: "Design leader" hover reveals company logos --- */
.ps-dl { position: relative; display: inline-block; }
.ps-dl-logos { position: absolute; left: 50%; bottom: 115%; transform: translateX(-50%); display: flex; align-items: center; gap: clamp(2px, 0.5vw, 8px); pointer-events: none; }
.ps-dl-logos img { width: clamp(56px, 6vw, 92px); height: auto; opacity: 0; transform: translateY(calc(var(--dy, 0px) + 16px)) scale(.78); transition: opacity .18s ease, transform .22s ease; }
@media (hover: hover) {
  .ps-dl:hover .ps-w-i { color: var(--violet); }
  .ps-dl:hover .ps-dl-logos img { opacity: 1; transform: translateY(var(--dy, 0px)) scale(1); }
}

/* --- All Case Studies — maroon "see full body of work" banner --- */
.ps-all { display: block; background: var(--maroon); color: var(--white); text-decoration: none; padding: clamp(40px, 4.6vw, 64px) max(24px, calc((100% - 1392px) / 2)); }
.ps-all-inner { display: flex; align-items: center; justify-content: space-between; gap: clamp(32px, 5vw, 80px); }
.ps-all-text { display: flex; flex-direction: column; min-width: 0; max-width: 672px; }
.ps-all-title { font: var(--weight-regular) clamp(30px, 3.4vw, 40px)/1.1 var(--font-display); letter-spacing: -0.04em; }
.ps-all-desc { margin-top: 20px; font: var(--weight-regular) 16px/28px var(--font-body); color: rgba(255,255,255,0.88); }
.ps-all-cta { align-self: flex-start; margin-top: 20px; font: var(--weight-regular) 16px/28px var(--font-body); color: var(--white); transition: opacity var(--dur-2) var(--ease-out); }
@media (hover: hover) { .ps-all:hover .ps-all-cta { opacity: 0.7; } }

/* folder illustration: two blue PNG panels with white doc cards tucked between (decorative — not a click target) */
.ps-all-folder { flex: none; position: relative; width: clamp(128px, 13vw, 172px); aspect-ratio: 1 / 1; margin-right: clamp(16px, 4.2vw, 60px); cursor: default; }
.ps-all-folder-back, .ps-all-folder-front { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; }
.ps-all-folder-front { z-index: 3; }
.ps-all-card { position: absolute; z-index: 2; bottom: 30%; width: 46%; aspect-ratio: 3 / 4; box-sizing: border-box; overflow: hidden; display: flex; flex-direction: column; gap: 6%; padding: 14% 8% 10%; background: var(--white); border: 0.5px solid var(--gray-line); border-radius: 6px; box-shadow: 0 4px 10px rgba(0,0,0,0.12); transition: transform .25s var(--ease-out); }
.ps-all-card--b { left: 40%; transform: rotate(7deg); transform-origin: bottom center; }
.ps-all-card--f { left: 12%; transform: rotate(-1.5deg); transform-origin: bottom center; }
.ps-all-card .ln { height: 8%; border-radius: var(--radius-pill); background: var(--gray-line); }
.ps-all-card .ln--split { display: flex; gap: 5%; background: none; height: 8%; }
.ps-all-card .ln--split i { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--gray-line); }
.ps-all-card .ln--split i:first-child { width: 38%; }
.ps-all-card .ln--split i:last-child { flex: 1; }
.ps-all-card-logo { display: flex; align-items: center; gap: 8%; margin-top: 4%; }
.ps-all-card-logo i { width: 16%; aspect-ratio: 1; border-radius: 50%; background: var(--gray-line); }
.ps-all-card-logo b { flex: none; width: 32%; height: 8%; border-radius: var(--radius-pill); background: var(--gray-line); }
@media (hover: hover) {
  .ps-all-folder:hover .ps-all-card--b { transform: rotate(10deg) translate(2%, -15%); }
  .ps-all-folder:hover .ps-all-card--f { transform: rotate(-4deg) translate(-2%, -12%); }
}
@media (max-width: 640px) {
  .ps-all-inner { flex-direction: column; align-items: flex-start; }
  .ps-all-folder { align-self: flex-end; margin-top: -8px; }
}

/* --- All Case Studies — same-page pink overlay ---
   The curtain (.cs-ov-bg) and bar animate with transforms only; JS sets the
   collapsed-state transform inline from the banner's rect, the classes here
   define the open state. Delays sequence it: opening, the curtain leads and
   the list drops in late; closing, the list wraps up first, then the curtain
   (default delays below) shrinks back into the strip. */
.cs-ov { position: fixed; inset: 0; z-index: 200; }
.cs-ov-bg { position: absolute; inset: 0; background: var(--maroon); transform-origin: 50% 0; will-change: transform; }
.cs-ov-in { position: relative; height: 100%; display: flex; flex-direction: column; }
/* visible top bar with a back-to-home / close control (curtain + bar are
   animated together via the Web Animations API in setupOverlay) */
.cs-ov-bar { display: flex; align-items: center; width: 100%; padding: 24px; margin: 0; background: none; border: 0; color: var(--white); transform-origin: 50% 0; will-change: transform; }
/* close control: label crossfades "(Back to home)" <-> "(Check it out)" as the
   overlay expands/collapses, so it morphs into the banner CTA */
.cs-ov-close { display: inline-grid; background: none; border: 0; padding: 0; cursor: pointer; font: var(--weight-regular) 16px/28px var(--font-body); color: var(--white); white-space: nowrap; transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-spring); }
.cs-ov-close-lbl { grid-area: 1 / 1; text-align: left; transition: opacity .35s var(--ease-out); }
.cs-ov-close-lbl.is-home { opacity: 0; }
.cs-ov.is-open .cs-ov-close-lbl.is-cta { opacity: 0; }
.cs-ov.is-open .cs-ov-close-lbl.is-home { opacity: 1; }
@media (hover: hover) { .cs-ov-close:hover { opacity: .55; transform: translateY(-1px); } }
.cs-ov-list { flex: 1; min-height: 0; overflow-y: auto; width: 100%; max-width: 980px; margin: 0 auto; padding: 0 clamp(24px, 5vw, 64px); box-sizing: border-box; display: flex; flex-direction: column; align-items: stretch; justify-content: center; opacity: 0; transform: translateY(-28px); transition: opacity .35s var(--ease-out), transform .35s var(--ease-out); }
.cs-ov.is-open .cs-ov-list { opacity: 1; transform: none; transition-delay: .42s; transition-duration: .36s; }
.cs-ov-row { position: relative; text-decoration: none; display: flex; align-items: baseline; gap: clamp(16px, 2vw, 28px); padding: clamp(16px, 1.9vw, 24px) 4px; border-top: 1px dashed rgba(255,255,255,0.32); }
.cs-ov-row:last-of-type { border-bottom: 1px dashed rgba(255,255,255,0.32); }
.cs-ov-num { flex: none; width: 1.8em; font: var(--weight-regular) 13px/1 var(--font-body); letter-spacing: 0.04em; color: rgba(255,255,255,0.5); font-variant-numeric: tabular-nums; transition: color .2s ease; }
.cs-ov-meta { flex: none; margin-left: auto; font: var(--weight-regular) 12px/1.3 var(--font-body); letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.55); white-space: nowrap; text-align: right; }
/* in-overlay password gate (revealed when a locked visitor picks a case) */
.cs-ov-gate { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; padding: 0 24px; }
.cs-ov-note { margin: 0; font: var(--text-label); color: var(--white); max-width: 62ch; }
.cs-ov-note a { color: inherit; }
.cs-ov-pwrow { position: relative; display: flex; cursor: text; }
.cs-ov-pwrow input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; background: transparent; color: transparent; cursor: text; }
.cs-ov-boxes { display: flex; gap: 16px; }
.ov-box { width: 64px; height: 80px; border-radius: var(--radius-avatar); background: rgba(255,255,255,0.28); display: flex; align-items: center; justify-content: center; pointer-events: none; transition: background .25s ease; }
.ov-box.is-active { background: rgba(255,255,255,0.45); }
.ov-box.is-filled { background: rgba(255,255,255,0.38); }
.ov-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--white); opacity: 0; transform: scale(.2); transition: opacity .15s ease, transform .25s cubic-bezier(.34,1.56,.64,1); }
.ov-box.is-filled .ov-dot { opacity: 1; transform: scale(1); }
.cs-ov-msg { min-height: 17px; font: var(--text-label); color: var(--white); }
.cs-ov-pwrow.is-error { animation: ovShake .5s cubic-bezier(.36,.07,.19,.97); }
@keyframes ovShake { 10% { transform: translateX(-14px); } 25% { transform: translateX(13px); } 40% { transform: translateX(-11px); } 55% { transform: translateX(9px); } 70% { transform: translateX(-6px); } 85% { transform: translateX(3px); } }
.cs-ov-title { flex: 1 1 auto; min-width: 0; font: var(--weight-regular) clamp(22px, 2.5vw, 34px)/1.15 var(--font-display); letter-spacing: -0.03em; color: var(--white); transition: color .2s ease; }
/* coming-soon rows: inert, dimmed */
.cs-ov-row.is-soon { cursor: default; }
.cs-ov-row.is-soon .cs-ov-num, .cs-ov-row.is-soon .cs-ov-title, .cs-ov-row.is-soon .cs-ov-meta { opacity: .45; }
@media (hover: hover) {
  .cs-ov-row:not(.is-soon):hover .cs-ov-title { color: var(--maroon-light); }
  .cs-ov-row:not(.is-soon):hover .cs-ov-num { color: var(--maroon-light); }
}
/* mobile: stack each row (num gutter | title over meta) and scroll from the top */
@media (max-width: 640px) {
  .cs-ov-list { justify-content: flex-start; padding-top: 12px; padding-bottom: 40px; }
  .cs-ov-row { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 6px; align-items: baseline; padding: 18px 2px; }
  .cs-ov-num { grid-column: 1; }
  .cs-ov-title { grid-column: 2; font-size: 20px; line-height: 1.2; }
  .cs-ov-meta { grid-column: 2; margin-left: 0; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-ov-bg, .cs-ov-bar, .cs-ov-list, .cs-ov-close-lbl { transition: none !important; }
}

/* --- Hero: hovering the name reveals personal photos --- */
.ps-me { position: relative; display: inline-block; cursor: url("../assets/cursor-arrow.png") 8 6, pointer; }
.ps-me-pics { position: absolute; left: 0; top: calc(100% + clamp(20px, 3vh, 44px)); display: flex; align-items: flex-start; gap: clamp(14px, 1.8vw, 28px); pointer-events: none; z-index: 2; }
/* raw photos — cropped to a portrait card with the design's corner + shadow */
.ps-me-pics img { width: clamp(120px, 14vw, 205px); aspect-ratio: 165 / 282; height: auto; object-fit: cover; border-radius: clamp(18px, 2vw, 24px); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.13); opacity: 0; transform: translateY(calc(var(--dy, 0px) + 16px)) scale(.9) rotate(var(--rot, 0deg)); transition: opacity .18s ease, transform .22s ease; }
@media (hover: hover) {
  .ps-me:hover .ps-me-pics img { opacity: 1; transform: translateY(var(--dy, 0px)) scale(1) rotate(var(--rot, 0deg)); }
}

@media (max-width: 720px) {
  .ps-dl-logos { display: none; }
  .ps-me-pics { display: none; }
  .ps-page { --size-hero: clamp(38px, 11.5vw, 64px); --size-title: clamp(32px, 8.5vw, 52px); }
  #hero h1 { max-width: none !important; }
  .ps-cs-title { min-height: 0; }
  .ps-cs-title .ps-display { font: var(--weight-regular) clamp(28px, 7.5vw, 40px)/1.15 var(--font-display); }
  .ps-cs-head { grid-template-columns: 1fr; }
  .ps-xp-head { flex-wrap: wrap; gap: 4px 16px; }
  .ps-xp-date { white-space: normal; }
  .ps-cs-para { max-width: none; }
  .ps-row { flex-direction: column; }
  .ps-row > *, .ps-row figure { width: 100% !important; }
  .ps-contact-links { justify-content: flex-start !important; }

  /* case-study thumbnails: one swipeable, snapping strip per section
     instead of a tall stack of letterboxed images. .ps-grid becomes the
     scroller; display:contents flattens the desktop rows so every card
     joins the strip (rows lose their reveal box — cards just show). */
  .ps-grid { display: flex; flex-direction: row; gap: 12px; overflow-x: auto; margin: 56px calc(-1 * var(--gut)) 0; padding: 0 var(--gut); scroll-snap-type: x mandatory; scroll-padding-inline: var(--gut); overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .ps-grid::-webkit-scrollbar { display: none; }
  .ps-grid .ps-row { display: contents; }
  .ps-grid figure { flex: 0 0 78vw; width: 78vw !important; scroll-snap-align: start; }
  .ps-grid figure > .ps-card-fill { height: clamp(280px, 76vw, 400px) !important; }
  #writing { grid-template-columns: 1fr !important; gap: 32px !important; }
  .ps-pin { height: auto; display: block; padding: clamp(48px, 10vw, 96px) 0; scroll-snap-align: none; }
}

/* ============================================================
   MOBILE MENU + hero scroll hint  (mobile only; desktop untouched)
   ============================================================ */
.ps-burger,
.ps-scroll-hint,
.ps-menu { display: none; }

@media (max-width: 767px) {
  /* trade the wrapped nav for a single burger */
  #hero header nav,
  .cs-gate-head nav { display: none !important; }
  .ps-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin: -8px -8px 0 0;   /* bigger tap target, icon stays put */
    padding: 0; border: 0; background: none; color: var(--ink);
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .ps-burger svg { width: 24px; height: 24px; display: block; }
  .ps-burger.is-inverse { color: var(--white); }

  /* headline sized to the mobile comp (drives the hero h1's var()) */
  .ps-page { --size-hero: clamp(26px, 7.4vw, 32px); }

  /* full-screen menu overlay */
  .ps-menu {
    display: flex; flex-direction: column;
    position: fixed; inset: 0; z-index: 200;
    background: var(--white); color: var(--ink);
    padding:
      calc(env(safe-area-inset-top) + 40px)
      var(--gut)
      calc(env(safe-area-inset-bottom) + 24px);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .34s var(--ease-out), transform .34s var(--ease-out), visibility 0s .34s;
  }
  .ps-menu.is-open {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .34s var(--ease-out), transform .34s var(--ease-out);
  }
  .ps-menu-bar { display: flex; align-items: center; justify-content: space-between; }
  .ps-menu-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin: -8px -8px 0 0;
    padding: 0; border: 0; background: none; color: var(--ink);
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .ps-menu-close svg { width: 24px; height: 24px; display: block; }

  .ps-menu-list { margin-top: clamp(24px, 5vh, 52px); display: flex; flex-direction: column; }
  .ps-menu-link {
    display: block;
    font-family: var(--font-display); font-weight: var(--weight-regular);
    font-size: 28px; letter-spacing: -0.04em; line-height: 1.1;
    color: var(--ink); text-decoration: none; padding: 18px 0;
    border-bottom: var(--rule-width) var(--rule-style) var(--stroke-ink);
    -webkit-tap-highlight-color: transparent;
    opacity: 0; transform: translateY(10px);
    transition: opacity .45s var(--ease-out), transform .45s var(--ease-out);
  }
  .ps-menu-link::before { content: "("; }
  .ps-menu-link::after  { content: ")"; }
  .ps-menu-link:active { opacity: .55; }
  .ps-menu.is-open .ps-menu-link { opacity: 1; transform: none; }
  .ps-menu.is-open .ps-menu-link:nth-child(1) { transition-delay: .08s; }
  .ps-menu.is-open .ps-menu-link:nth-child(2) { transition-delay: .13s; }
  .ps-menu.is-open .ps-menu-link:nth-child(3) { transition-delay: .18s; }
  .ps-menu.is-open .ps-menu-link:nth-child(4) { transition-delay: .23s; }
  .ps-menu.is-open .ps-menu-link:nth-child(5) { transition-delay: .28s; }
  .ps-menu.is-open .ps-menu-link:nth-child(6) { transition-delay: .33s; }

  html.ps-menu-open, body.ps-menu-open { overflow: hidden; }

  /* hero scroll affordance */
  .ps-scroll-hint {
    display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
    position: relative; z-index: 1; margin: 0; padding: 6px 0 0;
    border: 0; background: none; color: var(--ink); opacity: .6;
    font: var(--text-body); font-size: 14px; cursor: pointer;
    -webkit-tap-highlight-color: transparent; transition: opacity .4s var(--ease-out);
  }
  .ps-scroll-hint svg { width: 16px; height: 16px; display: block; }
  .ps-scroll-hint.is-gone { opacity: 0; pointer-events: none; }
}

@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
  .ps-scroll-hint { animation: ps-hint-in .55s var(--ease-out) .9s backwards; }
  .ps-scroll-hint svg { animation: ps-bob 1.7s ease-in-out infinite; }
}
@keyframes ps-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes ps-hint-in { from { opacity: 0; transform: translateY(6px); } to { opacity: .6; transform: none; } }

/* ============================================================
   TOUCH POLISH — gated on input capability (hover: none), so
   tablets get it too; desktop pointer devices are untouched
   ============================================================ */
@media (hover: none) {
  /* hover never fires on touch — give taps the same feedback hovers give */
  .nav-link:active,
  .ps-read-link:active,
  .ps-name:active,
  .q-next-cards a:active .q-next-thumb,
  .ps-all-card:active { opacity: .55; }
  .q-next-cards a:active { transform: scale(.985); }

  /* press physicality on pressables — transition scoped to the pressed
     state so entrance/show transitions on these elements stay intact */
  .ps-burger, .ps-menu-close { transition: transform .14s var(--ease-out); }
  .ps-burger:active, .ps-menu-close:active { transform: scale(.9); }
  .cs-ov-close:active, .ps-top:active { transform: scale(.94); transition: transform .12s var(--ease-out); }
  .ps-menu-link:active { opacity: .55; transition: opacity .12s ease; }
  .cs-ov-row:active .cs-ov-title, .cs-ov-row:active .cs-ov-num { color: var(--maroon-light); }

  /* no snap-scroll fighting the thumb */
  html { scroll-snap-type: none; }

  /* 44px-class tap targets for text links (padding grows the hit area,
     the type stays the same size) */
  .nav-link { padding: 15px 4px; margin: -15px -4px; }
  .ps-contact-links { gap: 12px 28px !important; }
  .ps-read-link { display: inline-block; padding: 10px 0; }
  .cs-ov-close { padding: 12px 8px; margin: -12px -8px; }
}

/* the menu honors reduced motion like everything else: fade, don't slide */
@media (prefers-reduced-motion: reduce) {
  .ps-menu { transform: none; transition: opacity .2s ease, visibility 0s .2s; }
  .ps-menu.is-open { transform: none; transition: opacity .2s ease; }
  .ps-menu-link { transform: none !important; transition: opacity .2s ease !important; transition-delay: 0s !important; }
}

@media (max-width: 767px) {
  .ps-scroll-hint { padding: 14px 8px 14px 0; }

  /* --- mobile type scale (index) --- */
  /* experience blurbs read like body copy — give them body size */
  .ps-xp-desc { font-size: 15px; line-height: 24px; }
  /* overlay meta a notch more legible (close tap target lives in hover:none) */
  .cs-ov-meta { font-size: 13px; }

  /* case-study headers: the back-link takes the name's slot (the name is
     redundant inside a case study); burger keeps the right edge */
  #cs-content header .ps-name { display: none; }
  #cs-content header > div { flex: 1; justify-content: space-between; }

  /* back-to-top: quiet round icon button instead of the wide text pill */
  .ps-top { font-size: 0; line-height: 0; width: 48px; height: 48px; padding: 0; display: grid; place-items: center; box-shadow: 0 2px 14px rgba(0,0,0,.14); }
}
