/* ==========================================================================
   Harshal Palande — portfolio
   ========================================================================== */
:root {
  --bg: #0a0a0a;
  --bg-2: #0f0f0f;
  --bg-3: #151515;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #ededed;
  --muted: #8a8a8a;
  --dim: #5a5a5a;
  --accent: #ededed;
  --cyan: #8a8a8a;
  --violet: #8a8a8a;
  --amber: #8a8a8a;
  --f-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: #ededed; color: #0a0a0a; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--f-mono); }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 2000; background: var(--accent); color: #000; padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- scroll progress readout ---------- */
.progress {
  position: fixed; right: 18px; bottom: 18px; z-index: 900;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 11px; color: var(--muted);
  opacity: 0; transform: translateY(8px); transition: opacity 0.4s, transform 0.4s var(--ease);
  pointer-events: none;
}
.progress.show { opacity: 1; transform: none; }
.progress-track { width: 70px; height: 2px; background: var(--line-2); position: relative; overflow: hidden; border-radius: 2px; }
.progress-track i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); }

/* ---------- cursor ring (fine pointers only) ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 3000; pointer-events: none;
  width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  mix-blend-mode: difference;
  transition: width 0.25s var(--ease), height 0.25s var(--ease), margin 0.25s var(--ease), background 0.25s, opacity 0.3s;
  opacity: 0;
}
.cursor.on { opacity: 1; }
.cursor.hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: rgba(255, 255, 255, 0.9); border-color: transparent; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px; font-size: 15px; font-weight: 500; text-decoration: none;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03);
  transition: transform 0.3s var(--ease), background 0.25s, border-color 0.25s, color 0.25s;
}
.btn:hover { border-color: var(--text); transform: translateY(-2px); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: #fff; border-color: #fff; }

/* ---------- SECTIONS ---------- */
.section { position: relative; padding: clamp(96px, 14vw, 180px) 0; }
.label {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 28px;
}
.label span { color: var(--accent); }
.label::after { content: ""; width: 48px; height: 1px; background: var(--line-2); transform-origin: left; transform: scaleX(var(--lp, 0)); transition: transform 1s var(--ease) 0.2s; }
.label.in { --lp: 1; }
.display {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(40px, 7vw, 92px); line-height: 0.98; letter-spacing: -0.035em;
}

/* split-text reveal — letters rise out of a mask */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split .c { display: inline-block; transform: translateY(105%) rotate(6deg); transform-origin: left bottom; transition: transform 0.9s var(--ease); transition-delay: calc(var(--i) * 22ms); }
.split.in .c { transform: none; }

/* fade / slide reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* clip-path wipe reveal (images) */
.reveal-clip { clip-path: inset(12% 8% 12% 8% round 20px); transition: clip-path 1.3s var(--ease); }
.reveal-clip img { transform: scale(1.18); transition: transform 1.6s var(--ease); }
.reveal-clip.in { clip-path: inset(0 0 0 0 round 16px); }
.reveal-clip.in img { transform: scale(1.08); }
.reveal-clip.settled img { transition: none; }

/* ---------- ABOUT ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.about-portrait { position: relative; border-radius: 16px; overflow: hidden; background: var(--bg-3); aspect-ratio: 1; }
.about-portrait img { width: 100%; height: 100%; object-fit: cover; }
.about-portrait figcaption {
  position: absolute; left: 14px; bottom: 12px; font-size: 11px; color: rgba(255, 255, 255, 0.8);
  padding: 4px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px);
}
.about-copy .display { font-size: clamp(38px, 5.4vw, 72px); margin-bottom: 28px; }
#greeting { display: inline-block; color: var(--accent); min-width: 2ch; }
.lead { font-size: clamp(18px, 1.9vw, 24px); line-height: 1.55; color: #c9cfd8; max-width: 36em; }
.facts { display: grid; gap: 0; margin-top: 40px; border-top: 1px solid var(--line); }
.fact { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.fact dt { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; padding-top: 3px; }
.fact dd { color: var(--text); }
.fact:nth-child(2) { --d: 0.08s; } .fact:nth-child(3) { --d: 0.16s; }

/* ---------- ATTENTION BAND ---------- */
.attn { position: relative; padding: 0 var(--gutter); max-width: 1200px; margin: 0 auto; }
.attn-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin-bottom: 10px; }
.attn-grid { display: grid; grid-template-columns: repeat(var(--cols, 32), 1fr); gap: 3px; }
.attn-grid i { aspect-ratio: 1; border-radius: 2px; background: var(--accent); opacity: 0.04; transition: opacity 0.25s linear; }

/* ---------- PROJECTS ---------- */
.projects .display { margin-bottom: clamp(56px, 8vw, 110px); }
.loss-curve { position: absolute; left: 0; top: 0; width: 60px; height: 100%; pointer-events: none; overflow: visible; }
.loss-curve path { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; opacity: 0.22; }
@media (max-width: 1320px) { .loss-curve { opacity: 0.4; width: 36px; } }

.project {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 72px);
  align-items: start; padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--line);
}
.project.flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.project.flip .project-media { order: 2; }
.project-media {
  position: relative; display: block; border-radius: 16px; overflow: hidden; background: var(--bg-3);
  border: 1px solid var(--line); text-decoration: none;
  position: sticky; top: 96px;
}
.project-media img { width: 100%; height: auto; will-change: transform; }
.project.flip .project-media img { aspect-ratio: 1; object-fit: cover; }
.media-open {
  position: absolute; right: 14px; bottom: 14px;
  font-family: var(--f-mono); font-size: 12px; padding: 8px 12px; border-radius: 10px;
  background: rgba(7, 8, 10, 0.8); border: 1px solid var(--line-2); backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(8px); transition: opacity 0.35s, transform 0.35s var(--ease);
}
.project-media:hover .media-open, .project-media:focus-visible .media-open { opacity: 1; transform: none; }
.project-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(7, 8, 10, 0.5)); opacity: 0; transition: opacity 0.35s; }
.project-media:hover::after { opacity: 1; }

.project-meta { display: flex; gap: 16px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px; }
.project-meta span:first-child { color: var(--accent); }
.project-title { font-family: var(--f-display); font-weight: 700; font-size: clamp(30px, 3.6vw, 48px); line-height: 1.02; letter-spacing: -0.03em; margin-bottom: 16px; }
.project-sum { color: #c3c9d2; font-size: 17px; margin-bottom: 24px; }
.highlights { list-style: none; border-top: 1px solid var(--line); margin-bottom: 24px; }
.highlights li {
  position: relative; overflow: hidden; height: 52px;
  border-bottom: 1px solid var(--line);
  font-family: var(--f-display); font-weight: 500; font-size: clamp(18px, 1.8vw, 22px); letter-spacing: -0.01em;
}
.highlights span { position: absolute; inset: 0; display: flex; align-items: center; transition: transform 0.5s var(--ease); }
.highlights .hl-main { color: var(--text); }
.highlights .hl-alt { transform: translateY(100%); color: #0a0a0a; background: var(--text); padding-left: 12px; }
.highlights li:hover .hl-main { transform: translateY(-100%); }
.highlights li:hover .hl-alt { transform: translateY(0); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tags li { font-family: var(--f-mono); font-size: 12px; color: var(--muted); padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 999px; }
.problems { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.problems summary {
  list-style: none; cursor: pointer; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center;
  font-family: var(--f-mono); font-size: 13px; color: var(--text);
}
.problems summary::-webkit-details-marker { display: none; }
.problems summary::after { content: "+"; font-size: 18px; color: var(--accent); transition: transform 0.3s var(--ease); }
.problems[open] summary::after { transform: rotate(45deg); }
.problems ol { list-style: none; counter-reset: p; padding: 0 16px 16px; display: grid; gap: 14px; }
.problems li { counter-increment: p; position: relative; display: block; padding-left: 32px; font-size: 15px; color: #b5b5b5; line-height: 1.65; }
.problems li::before { content: counter(p, decimal-leading-zero); position: absolute; left: 0; top: 3px; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.problems strong { color: var(--text); font-weight: 600; }

/* ---------- MARQUEE ---------- */
.marquee { padding: 40px 0; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-2); }
.marquee-row { white-space: nowrap; will-change: transform; }
.marquee-track { display: inline-flex; align-items: center; gap: 36px; padding-right: 36px; }
.marquee-row span { font-family: var(--f-display); font-weight: 700; font-size: clamp(40px, 7vw, 96px); letter-spacing: -0.03em; line-height: 1.15; }
.marquee-row i { font-style: normal; color: var(--accent); font-size: clamp(16px, 2vw, 26px); }
.marquee-row.outline span { color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.35); }

/* ---------- STACK ---------- */
.stack .display { margin-bottom: 56px; }
.stack-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack-col { border: 1px solid var(--line); border-radius: 16px; padding: 24px; background: var(--bg-2); transition: border-color 0.3s, transform 0.4s var(--ease); }
.stack-col:hover { border-color: var(--line-2); transform: translateY(-4px); }
.stack-col:nth-child(2) { --d: 0.1s; } .stack-col:nth-child(3) { --d: 0.2s; }
.stack-head { display: flex; align-items: center; gap: 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 18px; }
.sw { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.stack-col ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.stack-col li { font-size: 15px; padding: 7px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); transition: border-color 0.2s, color 0.2s; }
.stack-col li:hover { border-color: var(--text); color: #fff; }

/* ---------- EXPERIENCE ---------- */
.experience { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 30%, var(--bg-2) 70%, var(--bg) 100%); }
.xp { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 6vw, 88px); }
.xp-side { position: sticky; top: 110px; align-self: start; }
.xp-time { font-size: 12px; color: var(--accent); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 12px; }
.xp-side .display { margin-bottom: 12px; }
.xp-role { color: var(--muted); margin-bottom: 18px; font-size: 17px; }
.link-arrow { font-family: var(--f-mono); font-size: 13px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line-2); padding-bottom: 2px; transition: color 0.2s, border-color 0.2s; }
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }
.xp-main { color: #c3c9d2; font-size: 17px; display: grid; gap: 18px; }
.lead-sm { font-size: clamp(19px, 2vw, 24px); color: var(--text); line-height: 1.45; }
.xp-list { list-style: none; border-top: 1px solid var(--line); }
.xp-list li { display: grid; grid-template-columns: 44px 1fr; padding: 16px 0; border-bottom: 1px solid var(--line); }
.xp-list .mono { font-size: 12px; color: var(--accent); padding-top: 4px; }
.xp-list strong { color: var(--text); font-weight: 600; }
.xp-mockup { width: min(100%, 680px, 95vh); margin: clamp(56px, 8vw, 96px) auto 0; border-radius: 16px; overflow: hidden; }
.xp-mockup img { width: 100%; height: auto; }
.xp-mockup.reveal-clip img, .xp-mockup.reveal-clip.in img { transform: none; }

/* ---------- BLOG ---------- */
.blog-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 48px; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.blog-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; min-height: 250px;
  padding: 26px; border-radius: 16px; text-decoration: none; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line);
  transition: border-color 0.3s, transform 0.5s var(--ease);
}
.blog-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.05), transparent 60%);
}
.blog-card:hover { border-color: var(--line-2); transform: translateY(-4px); }
.blog-card:hover::before { opacity: 1; }
.blog-date { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.blog-title { font-family: var(--f-display); font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; }
.blog-excerpt { color: var(--muted); font-size: 15px; }
.blog-more { margin-top: auto; font-family: var(--f-mono); font-size: 12px; color: var(--text); }
.blog-more span { display: inline-block; transition: transform 0.3s var(--ease); }
.blog-card:hover .blog-more span { transform: translateX(6px); }

/* ---------- CONTACT ---------- */
.contact { padding-bottom: 32px; overflow: hidden; }
.contact-big { font-family: var(--f-display); font-weight: 700; font-size: clamp(64px, 16vw, 220px); line-height: 0.9; letter-spacing: -0.05em; margin-bottom: 28px; }
.contact-mail {
  display: inline-block; font-family: var(--f-display); font-size: clamp(20px, 3vw, 36px); text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 2px no-repeat;
  transition: background-size 0.5s var(--ease), color 0.3s; padding-bottom: 4px; word-break: break-all;
}
.contact-mail:hover { background-size: 100% 2px; color: var(--accent); }
.contact-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 40px; }
.socials { display: flex; gap: 10px; }
.socials a { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 12px; transition: border-color 0.2s, background 0.2s, transform 0.3s var(--ease); }
.socials a:hover { border-color: var(--text); background: rgba(255, 255, 255, 0.05); transform: translateY(-3px); }
.socials svg { width: 18px; height: 18px; fill: var(--text); }
.socials .soc-hf svg { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.socials .soc-hf svg .dot { fill: var(--text); stroke: none; }
.footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: clamp(96px, 12vw, 160px); padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* ---------- BLOG PAGES ---------- */
.page { max-width: 820px; margin: 0 auto; padding: 140px var(--gutter) 120px; }
.back-link { display: table; font-family: var(--f-mono); font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 40px; transition: color 0.2s; }
.back-link:hover { color: var(--accent); }
.page .display { margin-bottom: 48px; }
.blog-list { display: grid; gap: 14px; }
.post-date { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.post-title { font-family: var(--f-display); font-weight: 700; font-size: clamp(32px, 5vw, 54px); line-height: 1.05; letter-spacing: -0.03em; margin: 14px 0 40px; }
.post-image { width: 100%; border-radius: 16px; margin-bottom: 40px; }
.post-body { font-size: 18px; line-height: 1.85; color: #c9cfd8; }
.post-body p { margin-bottom: 1.4em; }
.post-body strong { color: var(--text); }
.post-body h1, .post-body h2, .post-body h3 { font-family: var(--f-display); color: var(--text); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.2; letter-spacing: -0.02em; margin: 0.4em 0 0.2em; }
.post-divider { border: 0; height: 1px; background: var(--line-2); margin: 2.4em 0; }
.reading-bar { position: fixed; left: 0; top: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); z-index: 1100; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .about-grid, .project, .project.flip, .xp { grid-template-columns: 1fr; }
  .project.flip .project-media { order: 0; }
  .project-media { position: relative; top: 0; }
  .about-portrait { max-width: 420px; }
  .xp-side { position: static; }
  .stack-grid { grid-template-columns: 1fr; }
  .loss-curve { display: none; }
}
@media (max-width: 640px) {
  .fact { grid-template-columns: 1fr; gap: 2px; }
  .progress { right: 12px; bottom: 12px; }
  .highlights li { height: auto; min-height: 48px; }
  .highlights span { position: relative; padding: 12px 0; }
  .highlights .hl-alt { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; transition-delay: 0s !important; }
  .split .c, .reveal, .reveal-clip, .reveal-clip img { transform: none !important; opacity: 1 !important; clip-path: none !important; }
}

/* monochrome imagery: colour returns on hover */
.project-media img, .xp-mockup img, .about-portrait img { filter: grayscale(1) contrast(1.05); transition: filter 0.6s var(--ease), transform 1.6s var(--ease); }
.reveal-clip.settled img { transition: filter 0.6s var(--ease); }
.project-media:hover img, .xp-mockup:hover img, .about-portrait:hover img { filter: none; }

/* ==========================================================================
   Hero, nav, film hand-off, stage curtain
   ========================================================================== */
@font-face { font-family: "HP Display"; src: url("../assets/fonts/heros-bold.woff") format("woff"); font-weight: 700; font-display: block; }
:root {
  --ivory: #F4F1EA; --ink: #111111; --char: #3a3834;
  --f-name: "HP Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-serif: "Instrument Serif", Georgia, serif;
  --f-ui: "Inter Tight", "Inter", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
}

/* ---------- NAV (top bar, inverts over any background) ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; gap: 24px;
  padding: clamp(16px, 2.4vw, 28px) clamp(20px, 4vw, 56px);
  color: #fff; mix-blend-mode: difference;
  font-family: var(--f-ui); font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  transition: transform 0.7s var(--ease-out), opacity 0.6s;
}
.nav.hide { transform: translateY(-110%); }
.logo { font-family: var(--f-name); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; text-transform: none; text-decoration: none; white-space: nowrap; }
.nav-links { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: clamp(14px, 2.2vw, 34px); }
.nav-links a, .nav-cv { position: relative; text-decoration: none; padding: 4px 0; }
.nav-links a::after, .nav-cv::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease-out);
}
.nav-links a:hover::after, .nav-links a.active::after, .nav-cv:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cv { margin-left: auto; }
.nav-toggle { display: none; position: relative; width: 36px; height: 28px; margin-right: -6px; }
.nav-toggle span { position: absolute; left: 6px; right: 6px; height: 1.5px; background: currentColor; transition: transform 0.4s var(--ease-out); }
.nav-toggle span:first-child { top: 10px; }
.nav-toggle span:last-child { top: 17px; }
.nav.open .nav-toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav.open .nav-toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
html.hero-pending .nav { opacity: 0; transform: translateY(-100%); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-cv { margin-left: auto; }
  .nav-links {
    position: fixed; inset: 0; left: 0; transform: none; z-index: -1;
    flex-direction: column; justify-content: center; gap: 4px; padding: 0 clamp(20px, 6vw, 48px);
    background: #0a0a0a;
    clip-path: inset(0 0 100% 0); transition: clip-path 0.7s var(--ease-io);
  }
  .nav.open .nav-links { clip-path: inset(0 0 0 0); }
  .nav-links a { font-family: var(--f-name); font-weight: 700; font-size: clamp(36px, 11vw, 64px); letter-spacing: -0.03em; text-transform: none; color: #ededed; line-height: 1.05; }
  .nav.open { mix-blend-mode: normal; color: #ededed; }
  .nav-links a::after { display: none; }
}

.cursor { border-color: rgba(255, 255, 255, 0.6); }

/* ---------- HERO ---------- */
.hero {
  --g: clamp(20px, 4vw, 56px);
  --pw: min(calc(66svh * 1.0622), 44vw);            /* portrait width  */
  --ph: calc(var(--pw) / 1.0622);                    /* portrait height */
  --pt: calc(54svh - var(--ph) / 2);                 /* portrait top    */
  --nf: min(13vw, 21svh);                            /* name size       */
  position: sticky; top: 0; z-index: 0;
  height: 100vh; height: 100svh; min-height: 560px; overflow: hidden;
  background: var(--ivory); color: var(--ink);
}
.hero::before { /* paper grain, same feel as the film */
  content: ""; position: absolute; inset: -50%; pointer-events: none; z-index: 5; opacity: 0.22; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.hero::after { /* dims as the page slides over it */
  content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; background: #000; opacity: var(--hero-dim, 0);
}
.crop { position: absolute; width: 14px; height: 14px; border: 0 solid rgba(17, 17, 17, 0.45); z-index: 4; transition: opacity 0.8s; }
.crop.tl, .crop.tr { display: none; }
.crop.tl { left: 20px; top: 20px; border-left-width: 1px; border-top-width: 1px; }
.crop.tr { right: 20px; top: 20px; border-right-width: 1px; border-top-width: 1px; }
.crop.bl { left: 20px; bottom: 20px; border-left-width: 1px; border-bottom-width: 1px; }
.crop.br { right: 20px; bottom: 20px; border-right-width: 1px; border-bottom-width: 1px; }

.hero-portrait {
  position: absolute; z-index: 1; margin: 0;
  width: var(--pw); height: var(--ph); left: calc(50% - var(--pw) / 2); top: var(--pt);
  transform-origin: 0 0;
}
.hp-frame { position: absolute; inset: 0; overflow: hidden; background: #d9d4ca; will-change: transform; }
.hp-img {
  position: absolute; max-width: none; height: auto;
  width: var(--cw, 100%); left: var(--cx, 0%); top: var(--cy, 0%);
  transition: width 1.1s var(--ease-io), left 1.1s var(--ease-io), top 1.1s var(--ease-io);
}
.hp-color { clip-path: inset(0 0 var(--scan, 0%) 0); }
.hp-scan {
  position: absolute; left: 0; right: 0; height: 1px; top: calc(100% - var(--scan, 0%)); opacity: 0;
  background: #fff; box-shadow: 0 0 14px 2px rgba(255, 255, 255, 0.7);
}
.hp-scan::after { content: ""; position: absolute; left: 0; right: 0; bottom: 1px; height: 60px; background: linear-gradient(to top, rgba(255,255,255,.18), transparent); }

.hero-name { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hn { position: absolute; display: block; overflow: hidden; transform-origin: 0 0; padding-bottom: 0.02em; }
.hn-in {
  display: block; font-family: var(--f-name); font-weight: 700; font-size: var(--nf);
  line-height: 1; letter-spacing: -0.035em; white-space: nowrap; color: var(--ink); will-change: transform;
}
.hn-1 { left: calc(var(--g) - 0.04em); top: calc(var(--pt) - var(--nf) * 0.52); }
.hn-2 { right: var(--g); top: calc(var(--pt) + var(--ph) - var(--nf) * 0.5); }

.hero-side { position: absolute; z-index: 3; top: calc(var(--pt) + var(--ph) * 0.34); width: calc(50% - var(--pw) / 2 - var(--g) - 32px); max-width: 300px; }
.hero-left { left: var(--g); }
.hero-right { right: var(--g); text-align: right; }
.hs-kicker { font-family: var(--f-serif); font-style: italic; font-size: 26px; line-height: 1; color: var(--ink); padding-top: 14px; border-top: 1px solid var(--ink); display: inline-block; }
.hs-text { margin-top: 18px; font-size: 15px; line-height: 1.5; color: var(--char); }
.hs-link, .hs-replay { display: inline-flex; gap: 8px; margin-top: 18px; font-family: var(--f-ui); font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 3px; }
.hs-link span { transition: transform 0.4s var(--ease-out); }
.hs-link:hover span { transform: translateY(3px); }
.hs-label { font-family: var(--f-ui); font-size: 12px; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink); }
.hs-fig { margin-top: 12px; font-size: 14px; color: var(--char); }
.hs-fig em { font-family: var(--f-serif); font-size: 20px; }
.hs-replay { border-bottom-color: rgba(17,17,17,.3); color: var(--char); }
.hs-replay:hover { color: var(--ink); border-bottom-color: var(--ink); }

.scroll-cue {
  position: absolute; z-index: 3; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--f-ui); font-size: 11px; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; color: var(--char);
}
.scroll-cue i { position: relative; width: 1px; height: 28px; background: rgba(17,17,17,.2); overflow: hidden; }
.scroll-cue i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--ink); animation: cueLine 1.8s var(--ease-io) infinite; }
@keyframes cueLine { to { top: 100%; } }

/* states driven by js/hero.js */
html.hero-pending .hero-side, html.hero-pending .scroll-cue, html.hero-pending .crop { opacity: 0; }
html.hero-pending .hn-in { transform: translateY(105%); }
html.hero-pending .hp-frame { clip-path: inset(100% 0 0 0); }
html.hero-pending .hp-color { --scan: 100%; }
.hero-side, .scroll-cue { transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }

@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  .hero {
    --pw: min(84vw, 52svh * 1.0622);
    --nf: min(18.5vw, 13svh);
    /* name, portrait and text sit together as one group, centred on the screen */
    --grp: calc(6svh + var(--nf) * 1.05 + var(--ph) + 120px);
    --t0: max(13svh, calc((100svh - var(--grp)) / 2 + 28px));
    --pt: calc(var(--t0) + 6svh + var(--nf) * 0.6);
  }
  .hn-1 { top: var(--t0); }
  .hn-2 { top: calc(var(--pt) + var(--ph) - var(--nf) * 0.55); }
  .hero-side { top: calc(var(--pt) + var(--ph) + var(--nf) * 0.45 + 22px); bottom: auto; width: auto; max-width: none; }
  .hero-left { right: var(--g); }
  .hero-left .hs-kicker { display: none; }
  .hs-text { margin-top: 0; font-size: 14px; max-width: 30ch; }
  .hero-right { display: none; }
  .scroll-cue { display: none; }
}
@media (max-height: 620px) and (min-width: 761px) { .hero-side .hs-text { display: none; } }

/* ---------- STAGE: the rest of the page slides over the hero ---------- */
.stage {
  position: relative; z-index: 2; background: var(--bg);
  border-radius: clamp(20px, 3vw, 40px) clamp(20px, 3vw, 40px) 0 0;
}

/* ---------- FILM ---------- */
.film { display: none; }
.film-on body, .hero-lock body { overflow: hidden; }
.film-on .film { display: block; position: fixed; inset: 0; z-index: 5000; background: #F0EFE6; }
.film video { display: block; width: 100%; height: 100%; object-fit: contain; background: #F0EFE6; }
.film-skip {
  position: absolute; right: clamp(20px, 6vmin, 64px); bottom: clamp(20px, 5vmin, 48px);
  font: 500 12px/1 var(--f-ui); letter-spacing: 0.12em; text-transform: uppercase; color: #fff; mix-blend-mode: difference;
  padding: 10px 14px; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 999px; background: transparent;
  transition: background 0.3s, color 0.3s, opacity 0.4s;
}
.film-skip:hover { background: #fff; color: #000; }
.film-skip kbd { font: inherit; opacity: 0.5; margin-left: 6px; }
.film.handoff .film-skip { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .hn-in, .hp-frame, .hp-color, .hero-side, .scroll-cue { transform: none !important; clip-path: none !important; opacity: 1 !important; }
}

/* ---------- PROJECTS (case-study layout) ---------- */
.work { padding: clamp(52px, 7vw, 104px) 0; border-top: 1px solid var(--line); }
.work-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: clamp(16px, 3vw, 44px); margin-bottom: clamp(22px, 3vw, 36px); }
.work-num { font-size: 13px; color: var(--text); padding-bottom: 12px; letter-spacing: 0.04em; }
.work-num i { font-style: normal; color: var(--dim); margin-left: 2px; }
.work-cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 12px; }
.work-title { font-family: var(--f-display); font-weight: 700; font-size: clamp(36px, 5.4vw, 76px); line-height: 0.98; letter-spacing: -0.035em; }
.work-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; white-space: nowrap;
  font-family: var(--f-mono); font-size: 12px; text-decoration: none; color: var(--text);
  padding: 11px 16px; border: 1px solid var(--line-2); border-radius: 999px;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.work-cta span { transition: transform 0.35s var(--ease); }
.work-cta:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.work-cta:hover span { transform: translate(2px, -2px); }

.work-media {
  position: relative; display: block; aspect-ratio: 16 / 8; border-radius: 18px; overflow: hidden;
  background: var(--bg-3); border: 1px solid var(--line); text-decoration: none;
}
.work-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; will-change: transform;
  filter: grayscale(1) contrast(1.05); transition: filter 0.6s var(--ease), transform 1.6s var(--ease); }
.work-media.settled img { transition: filter 0.6s var(--ease); }
.work-media:hover img { filter: none; }
.work-media--fit { background: #f3f1ec; }
.work-media--fit img { object-fit: contain; object-position: center; padding: 3% 0; }
.work-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(7, 8, 10, 0.45)); opacity: 0; transition: opacity 0.35s; pointer-events: none; }
.work-media:hover::after { opacity: 1; }
.work-media:hover .media-open, .work-media:focus-visible .media-open { opacity: 1; transform: none; }
.work-media .media-open { z-index: 1; }

.work-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); margin-top: clamp(26px, 3.4vw, 40px); }
.work-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.work-sum { font-size: 18px; line-height: 1.55; color: #cfcfcf; }
.work-points { list-style: none; display: grid; gap: 10px; }
.work-points li { position: relative; padding-left: 20px; font-size: 15.5px; line-height: 1.5; color: var(--text); }
.work-points li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 9px; height: 1px; background: var(--muted); }
.work .tags { margin-bottom: 0; }
.work .problems { margin-top: clamp(26px, 3.4vw, 40px); }

@media (max-width: 900px) {
  .work-head { grid-template-columns: auto minmax(0, 1fr); }
  .work-cta { grid-column: 1 / -1; justify-self: start; margin: 4px 0 0; }
  .work-grid { grid-template-columns: 1fr; gap: 26px; }
  .work-media { aspect-ratio: 16 / 10; }
}
@media (max-width: 640px) {
  .work-num { padding-bottom: 6px; }
  .work-media { border-radius: 14px; }
  .work-sum { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .work-media img { transform: none !important; } }

/* ---------- interactive self-attention ---------- */
.about { padding-bottom: clamp(48px, 6vw, 88px); }
.projects { padding-top: clamp(64px, 8vw, 112px); }
.attnx { position: relative; padding: clamp(28px, 4vw, 56px) 0; }
.attnx-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 11px; letter-spacing: 0.06em; color: var(--dim); }
.attnx-row i { font-style: normal; color: var(--line-2); margin: 0 4px; }
.attnx-row b { font-weight: 500; color: var(--muted); }
.attnx-formula sup { font-size: 0.75em; }
.attnx-stage { position: relative; max-width: 1200px; margin: 0 auto; padding: clamp(96px, 13vw, 176px) var(--gutter) 0; }
.attnx-arcs { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.attnx-arcs path { fill: none; stroke: #ededed; stroke-linecap: round; }
.attnx-arcs circle { fill: #ededed; }
.attnx-sent { position: relative; display: flex; justify-content: center; gap: 0.28em; white-space: nowrap;
  font-family: var(--f-display); font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; font-size: 64px; padding-bottom: 46px; }
.tok { position: relative; display: inline-block; cursor: pointer; padding: 0.06em 0.16em 0.1em; border-radius: 0.16em; outline: none;
  color: rgba(237, 237, 237, calc(0.16 + 0.84 * var(--w, 0))); transition: background 0.35s var(--ease), color 0.35s var(--ease); }
.tok.q { background: #ededed; color: #0a0a0a; }
.tok:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.tok .bar { position: absolute; left: 0.16em; right: 0.16em; top: calc(100% + 12px); height: 2px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; overflow: hidden; }
.tok .bar i { display: block; height: 100%; width: calc(var(--w, 0) * 100%); background: #ededed; border-radius: 2px; }
.tok .val { position: absolute; left: 50%; top: calc(100% + 22px); transform: translateX(-50%); font: 500 11px/1 var(--f-mono); letter-spacing: 0; color: var(--muted); }
.tok.q .val { color: var(--text); }
.attnx-foot { margin-top: clamp(18px, 2.4vw, 28px); min-height: 34px; }
.attnx-q { color: var(--muted); }
.attnx-q b { color: var(--text); font-weight: 500; }
.attnx-try { display: inline-flex; align-items: center; gap: 12px; }
#attnTry { font: inherit; letter-spacing: inherit; color: var(--text); padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; transition: background 0.3s, color 0.3s; }
#attnTry:hover { background: var(--text); color: var(--bg); }
.attnx-form input { width: min(320px, 52vw); background: transparent; border: 0; border-bottom: 1px solid var(--line-2); color: var(--text);
  font: 500 13px var(--f-mono); padding: 8px 2px; outline: none; }
.attnx-form input:focus { border-bottom-color: var(--text); }
@media (max-width: 640px) {
  .attnx-formula { display: none; }
  .tok .val { display: none; }
  .attnx-sent { padding-bottom: 26px; }
  .attnx-foot { flex-direction: column; align-items: flex-start; }
  .attnx-try { flex-wrap: wrap; }
}

/* ---------- PROJECTS: index list + 3D card deck ---------- */
.projects .display { margin-bottom: 16px; }
.pj-hint { font-size: 12px; letter-spacing: 0.06em; color: var(--dim); margin-bottom: clamp(36px, 5vw, 64px); }
.pj-list { border-bottom: 1px solid var(--line); }
.pj { border-top: 1px solid var(--line); }
.pj-row {
  width: 100%; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto 28px; align-items: center;
  gap: clamp(12px, 2vw, 28px); padding: clamp(22px, 2.6vw, 34px) 0; text-align: left; color: var(--text);
  transition: opacity 0.45s var(--ease);
}
.pj-num { font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }
.pj-title { position: relative; display: block; overflow: hidden; height: 1.1em; font-family: var(--f-display); font-weight: 700;
  font-size: clamp(30px, 4.3vw, 68px); line-height: 1.1; letter-spacing: -0.04em; }
.pj-t1, .pj-t2 { display: block; white-space: nowrap; transition: transform 0.75s var(--ease); }
.pj-t2 { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -0.015em; }
.pj.is-hot .pj-t1, .pj.is-hot .pj-t2, .pj-row:focus-visible .pj-t1, .pj-row:focus-visible .pj-t2,
.pj.open .pj-t1, .pj.open .pj-t2 { transform: translateY(-100%); }
.pj-cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; text-align: right; max-width: 21ch; line-height: 1.5; }
.pj-plus { position: relative; width: 22px; height: 22px; justify-self: end; transition: transform 0.5s var(--ease); }
.pj-plus::before, .pj-plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 1.5px; background: var(--text); transform: translate(-50%, -50%); }
.pj-plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.pj.open .pj-plus { transform: rotate(45deg); }
@media (hover: hover) and (pointer: fine) {
  .pj-list.is-hovering .pj-row { opacity: 0.26; }
  .pj-list.is-hovering .pj.is-hot .pj-row, .pj-list .pj.open .pj-row { opacity: 1; }
}

.pj-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.8s var(--ease); }
.pj.open .pj-panel { grid-template-rows: 1fr; }
.pj-inner { min-height: 0; overflow: hidden; }
.pj-inner > .pj-gallery { margin-top: 4px; }
.pj .problems { margin: clamp(26px, 3.4vw, 40px) 0 clamp(36px, 5vw, 56px); }
.pj-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.pj-links .work-cta { margin: 0; }

.pj-gallery { display: grid; gap: 14px; }
.pj-n2 { grid-template-columns: 1fr 1fr; }
.pj-n3 { grid-template-columns: repeat(3, 1fr); }
.pj-shot { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-3); aspect-ratio: 4 / 3; }
.pj-n1 .pj-shot { aspect-ratio: 16 / 7; }
.pj-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
#pj-ex .pj-shot { background: #f3f1ec; }
#pj-ex .pj-shot img { object-fit: contain; object-position: center; }

/* floating deck that follows the cursor */
.pj-deck { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; width: clamp(240px, 23vw, 360px); aspect-ratio: 4 / 3; will-change: transform; visibility: hidden; }
.pj-deck.on { visibility: visible; }
.pj-deck-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; opacity: 0; transform: scale(0.55);
  transition: opacity 0.35s var(--ease), transform 0.6s var(--ease); }
.pj-deck.on .pj-deck-in { opacity: 1; transform: scale(1); }
.pj-card { position: absolute; inset: 0; margin: 0; border-radius: 14px; overflow: hidden; background: #111;
  border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 6px 18px rgba(0, 0, 0, 0.4);
  opacity: 0; transform: translate(0, 0) rotate(0deg); transition: transform 0.7s var(--ease), opacity 0.35s; }
.pj-card img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.pj-deck[data-id="ex"] .pj-card { background: #f3f1ec; }
.pj-deck[data-id="ex"] .pj-card img { object-fit: contain; object-position: center; }
.pj-deck[data-n="1"] .pj-card:nth-child(1),
.pj-deck[data-n="2"] .pj-card:nth-child(-n+2),
.pj-deck[data-n="3"] .pj-card { opacity: 1; }
.pj-deck[data-n="3"] .pj-card:nth-child(2), .pj-deck[data-n="2"] .pj-card:nth-child(2) { z-index: 2; }
.pj-deck.deal[data-n="1"] .pj-card:nth-child(1) { transform: rotate(-2deg); }
.pj-deck.deal[data-n="2"] .pj-card:nth-child(1) { transform: translate(-24%, 5%) rotate(-8deg); }
.pj-deck.deal[data-n="2"] .pj-card:nth-child(2) { transform: translate(20%, -3%) rotate(5deg); transition-delay: 0.06s; }
.pj-deck.deal[data-n="3"] .pj-card:nth-child(1) { transform: translate(-40%, 7%) rotate(-11deg); }
.pj-deck.deal[data-n="3"] .pj-card:nth-child(2) { transform: translate(0, -4%) rotate(0deg); transition-delay: 0.05s; }
.pj-deck.deal[data-n="3"] .pj-card:nth-child(3) { transform: translate(40%, 7%) rotate(11deg); transition-delay: 0.1s; }
.deck-on .cursor { opacity: 0 !important; }

@media (max-width: 760px) {
  .pj-row { grid-template-columns: 36px minmax(0, 1fr) 24px; row-gap: 6px; }
  .pj-title { height: auto; overflow: visible; font-size: clamp(28px, 8.4vw, 44px); }
  .pj-t1 { white-space: normal; transform: none !important; }
  .pj-t2 { display: none; }
  .pj-cat { grid-column: 2 / 3; grid-row: 2; text-align: left; font-size: 11px; white-space: normal; }
  .pj-plus { grid-column: 3; grid-row: 1; }
  .pj-gallery, .pj-n2, .pj-n3 { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .pj-shot { scroll-snap-align: start; }
  .pj-n1 { grid-auto-columns: 100%; }
  .pj-n1 .pj-shot { aspect-ratio: 16 / 10; }
}
@media (prefers-reduced-motion: reduce) { .pj-deck { display: none; } }

/* hints: hover wording for mouse, tap wording for touch screens */
.hint-touch { display: none; }
@media (hover: none), (pointer: coarse) {
  .hint-fine { display: none; }
  .hint-touch { display: inline; }
}

/* the scroll counter sits on top of body text on small screens */
@media (max-width: 640px) { .progress { display: none; } }
