/* ============================================================
   Abhinav Velidi — editorial portfolio system
   Warm paper, near-black ink, one terracotta accent.
   Sans: Inter (body + all headings) · Meta: IBM Plex Mono
   Accent script: Bon Vivant Script (decorative words only)

   ⚠ LICENSING — READ BEFORE PRODUCTION:
   assets/fonts/bon-vivant-script.woff2 is Nicky Laatz's commercial
   "Bon Vivant Script". Free/demo copies are PERSONAL-USE ONLY —
   a portfolio advertising professional services counts as commercial
   use. The file mirrored here came from another studio's server and is
   staged as a visual comp ONLY. Before publishing: buy the webfont
   license (≈$22: nickylaatz.com, Creative Market, MyFonts or Fontspring)
   and drop the licensed .woff2 over this file (same filename, no code
   changes needed) — or swap --font-script to a free OFL script such as
   "Great Vibes" / "Allura" / "Pinyon Script" from Google Fonts.
   ============================================================ */
@font-face {
  font-family: "Bon Vivant Script";
  src: url("../assets/fonts/bon-vivant-script.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  --paper: #faf7f1;
  --paper-2: #f3eee3;
  --ink: #171310;
  --ink-soft: #3d362e;
  --muted: #6f685b;
  --line: #e2dac8;
  --line-strong: #cfc4ac;
  --accent: #bc4a1e;
  --accent-ink: #8f340f;
  --card: #fffdf8;
  --radius: 18px;
  --wrap: 1180px;
  --font-display: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-script: "Bon Vivant Script", "Snell Roundhand", "Brush Script MT", cursive;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
  --step-2: clamp(1.7rem, 1.35rem + 1.6vw, 2.5rem);
  --step-3: clamp(2.4rem, 1.7rem + 3.2vw, 4rem);
  --step-4: clamp(3rem, 1.9rem + 5.2vw, 6.2rem);
}
/* Dark mode: same system, inverted warmth. Toggled via [data-theme]
   on <html> (see the boot script in <head> + the nav toggle). */
[data-theme="dark"] {
  --paper: #161210;
  --paper-2: #201a16;
  --ink: #f2ebdd;
  --ink-soft: #d6cdbb;
  --muted: #a79d8a;
  --line: #322a23;
  --line-strong: #4a3f33;
  --accent: #e0682f;
  --accent-ink: #ed9a63;
  --card: #1d1815;
}
[data-theme="dark"] body::before {
  background-image: radial-gradient(rgba(242,235,221,0.05) 1px, transparent 1px);
}
/* Keep the contact card distinctly dark in both modes — and re-pin every
   text/button color inside it that references flippable tokens. */
[data-theme="dark"] .contact-card { background: #211c17; border: 1px solid var(--line); color: var(--ink); }
[data-theme="dark"] .contact-card .btn--solid { background-color: var(--ink); border-color: var(--ink); color: var(--paper); }
[data-theme="dark"] .contact-card .btn--solid:hover { background-color: #e8b04b; border-color: #e8b04b; color: #161210; }
[data-theme="dark"] .contact-card .btn--ghost { color: var(--ink); }
[data-theme="dark"] .skip { color: #161210; }
[data-theme="dark"] ::selection { color: #161210; }
/* Gently dim photography so it sits in the dark page, never inverts. */
[data-theme="dark"] .case-figure img,
[data-theme="dark"] .cover--img,
[data-theme="dark"] .hero-shot { filter: brightness(0.93) saturate(0.96); }
/* Theme toggle (sun/moon). Icon swaps with the active theme. */
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; flex: none;
  border-radius: 50%; border: 1px solid var(--line-strong);
  background: transparent; color: var(--ink); cursor: pointer;
}
.theme-btn:hover { background: var(--paper-2); }
.theme-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-btn svg { width: 1.1rem; height: 1.1rem; }
.theme-btn .icon-sun { display: none; }
[data-theme="dark"] .theme-btn .icon-sun { display: block; }
[data-theme="dark"] .theme-btn .icon-moon { display: none; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* ---------- Brand loader: mark draws in, dot pops, panel lifts ----------
   Full sequence on first view per session, quick fade on repeats
   (.quick), skipped under reduced motion (see js/loader.js). A CSS
   failsafe hides the panel even if the script never runs. */
.loader {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: var(--paper); color: var(--ink);
  animation: loader-kill 0.5s ease 4s forwards;
}
@keyframes loader-kill { to { opacity: 0; visibility: hidden; } }
.loader-inner {
  display: flex; flex-direction: column; align-items: center; gap: 1.1rem;
  transition: opacity 0.3s ease;
}
.loader-markrow { display: flex; align-items: flex-end; gap: 0.7rem; }
.loader-mark { height: 76px; width: auto; }
.loader-mark path {
  fill: transparent; stroke: var(--ink); stroke-width: 16;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: loader-draw 0.9s 0.1s ease forwards, loader-fillin 0.5s 0.75s forwards;
}
@keyframes loader-draw { to { stroke-dashoffset: 0; } }
@keyframes loader-fillin { to { fill: var(--ink); stroke: transparent; } }
.loader-dot {
  width: 15px; height: 15px; border-radius: 50%; background: var(--accent);
  margin-bottom: 9px; transform: scale(0);
  animation: loader-pop 0.45s 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}
@keyframes loader-pop { to { transform: scale(1); } }
.loader-name {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.42em;
  text-indent: 0.42em; text-transform: uppercase; color: var(--muted);
  opacity: 0; animation: loader-fadein 0.6s 0.55s ease forwards;
}
@keyframes loader-fadein { to { opacity: 1; } }
.loader-bar { width: 128px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.loader-bar span {
  display: block; width: 100%; height: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  animation: loader-sweep 0.9s 0.15s ease forwards;
}
@keyframes loader-sweep { to { transform: scaleX(1); } }
.loader.quick .loader-mark path { animation-duration: 0.35s, 0.25s; animation-delay: 0s, 0.25s; }
.loader.quick .loader-dot { animation-duration: 0.25s; animation-delay: 0.2s; }
.loader.quick .loader-name { animation-duration: 0.3s; animation-delay: 0.15s; }
.loader.quick .loader-bar span { animation-duration: 0.28s; animation-delay: 0s; }
.loader.done { transform: translateY(-100%); transition: transform 0.65s cubic-bezier(0.7, 0, 0.3, 1) 0.05s; animation: none; }
.loader.done .loader-inner, .loader.done .loader-bar { opacity: 0; }
/* subtle paper grain, no blobs / no gradients-as-decoration */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0; opacity: 0.5;
  background-image: radial-gradient(rgba(23,19,16,0.055) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, black, transparent 60%);
}
main, #site-nav, #site-footer { position: relative; z-index: 1; }

::selection { background: var(--accent); color: #fff; }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img, svg { display: block; max-width: 100%; }

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 99;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 8px;
  transition: top 0.2s ease;
}
.skip:focus { top: 1rem; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 0;
}
.wordmark {
  font-family: var(--font-display); font-weight: 800; font-size: 1.35rem;
  letter-spacing: -0.01em; text-decoration: none; margin-right: auto; color: var(--ink);
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.wordmark .wm-dot { color: var(--accent); }
.brand-mark { height: 2rem; width: auto; flex: none; color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none; font-size: 0.92rem; font-weight: 500;
  padding: 0.5rem 0.8rem; border-radius: 999px;
}
.nav-links a:hover { background: var(--paper-2); }
.nav-links a:focus-visible, .btn:focus-visible, .wordmark:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.nav-cta {
  text-decoration: none; font-weight: 600; font-size: 0.9rem;
  border: 1px solid var(--ink); border-radius: 999px; padding: 0.55rem 1.05rem;
}
.nav-cta:hover { background: var(--ink); color: var(--paper); }
.menu-btn {
  display: none; margin-left: auto;
  font: inherit; font-weight: 600; background: none; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.5rem 1rem;
}

/* ---------- Hero ---------- */
.hero { padding: clamp(3rem, 6vw, 5.5rem) 0 1rem; }
.kicker {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 0.6rem; margin: 0 0 1.4rem;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: #2e7d4f; box-shadow: 0 0 0 4px rgba(46,125,79,0.15); }
.display {
  font-family: var(--font-display);
  font-size: var(--step-4);
  line-height: 0.98; letter-spacing: -0.04em; font-weight: 800;
  margin: 0 0 1.8rem; max-width: 14ch;
  padding-bottom: 0.06em; /* room for script-accent descenders */
}
.display .line { display: block; }
.display .line--italic { font-style: italic; font-weight: 800; color: var(--ink); }
.display em { font-style: italic; color: var(--accent-ink); }
/* Decorative script accents — the ONLY place Bon Vivant is used. */
.font-script,
.display em,
.contact-card h2 em {
  font-family: var(--font-script);
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  font-feature-settings: "liga" 1, "dlig" 1;
}
.display em { font-size: 1.14em; padding-right: 0.08em; }
.contact-card h2 em { font-size: 1.14em; }
.hero-grid {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem 3rem;
  align-items: start; border-top: 1px solid var(--line); padding-top: 1.6rem;
}
.lede { font-size: var(--step-1); line-height: 1.45; letter-spacing: -0.01em; margin: 0; max-width: 34ch; }
.hero-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.hero-meta {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin: 0.4rem 0 0; padding: 1.1rem 0 0;
  border-top: 1px dashed var(--line-strong);
}
.hero-meta div { margin: 0; }
.hero-meta dt { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.hero-meta dd { margin: 0.2rem 0 0; font-weight: 500; font-size: 0.95rem; }
.hero-meta a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.hero-index {
  list-style: none; margin: 2.2rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--card);
}
.hero-index li + li { border-left: 1px solid var(--line); }
.hero-index a { display: block; padding: 1rem 1.2rem; text-decoration: none; }
.hero-index a:hover { background: var(--paper-2); }
.hero-index .hi-no { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent-ink); }
.hero-index .hi-title { display: block; font-weight: 600; margin-top: 0.2rem; }
.hero-index .hi-cat { display: block; font-size: 0.82rem; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border-radius: 999px; padding: 0.7rem 1.3rem;
  font-weight: 600; font-size: 0.95rem; text-decoration: none;
  border: 1px solid var(--ink);
  position: relative; overflow: hidden;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.15s ease, transform 0.18s ease-out;
}
.btn:hover { transform: translateY(-1px); }
.btn--solid { background-color: var(--ink); color: var(--paper); }
.btn--solid:hover { background-color: var(--accent-ink); border-color: var(--accent-ink); }
.btn--ghost { background-color: transparent; }
.btn--ghost:hover { background-color: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--large { font-size: 1rem; padding: 0.9rem 1.6rem; overflow-wrap: anywhere; }
/* Pixel-block fill (Heron-style, direction-aware). js/pixelfill.js wraps the
   label and tiles this grid; squares cascade in column by column from the
   entry side until the button is a pure fill. The :hover background above
   stays as the no-JS / reduced-motion / touch fallback. */
.btn-label { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 0.5rem; }
.pixelfill {
  position: absolute; inset: 0; z-index: 0; display: grid;
  pointer-events: none;
}
.pixelfill i { display: block; background-color: transparent; transition: background-color 0.16s ease; }
.btn--solid .pixelfill i.on { background-color: var(--accent-ink); }
.btn--ghost .pixelfill i.on { background-color: var(--ink); }
.contact-card .btn--solid .pixelfill i.on { background-color: #e8b04b; }
.contact-card .btn--ghost .pixelfill i.on { background-color: #e9e2d2; }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 6rem) 0 0; }
.section-head {
  display: grid; grid-template-columns: auto 1fr; gap: 0 1.5rem;
  align-items: baseline; border-top: 2px solid var(--ink);
  padding-top: 1rem; margin-bottom: 2.2rem;
}
.section-no { font-family: var(--font-mono); color: var(--accent-ink); margin: 0; font-size: 0.85rem; }
.section-head h2 {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em;
  font-size: var(--step-3); line-height: 1; margin: 0;
}
.section-note { grid-column: 2; margin: 0.6rem 0 0; color: var(--muted); max-width: 52ch; }

/* ---------- Work list: art-directed entries ---------- */
.work-list { display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
.work {
  display: grid; grid-template-columns: 1.05fr 1fr;
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
  overflow: hidden; background: var(--card);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.work:hover { box-shadow: 0 24px 60px -30px rgba(23,19,16,0.35); transform: translateY(-2px); }
.work:nth-child(even) .work-visual { order: 2; }
.work-visual {
  min-height: 340px; padding: 2rem;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; text-decoration: none;
}
.work-visual .cover { width: min(100%, 380px); filter: drop-shadow(0 24px 30px rgba(0,0,0,0.22)); transition: transform 0.35s ease; }
.work:hover .cover { transform: translateY(-6px) rotate(-0.5deg); }
.work-no {
  position: absolute; top: 1.1rem; left: 1.3rem;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; opacity: 0.7;
}
.work-body { padding: clamp(1.5rem, 3vw, 2.6rem); display: flex; flex-direction: column; gap: 0.9rem; }
.work-cat { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); margin: 0; }
.work-title { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.05; letter-spacing: -0.02em; margin: 0; font-weight: 750; }
.work-title a { text-decoration: none; }
.work-title a:hover { color: var(--accent-ink); }
.work-summary { color: var(--ink-soft); margin: 0; max-width: 46ch; }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin: 0; padding: 0; list-style: none; font-size: 0.86rem; color: var(--muted); }
.meta-row b { color: var(--ink); font-weight: 600; }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.tag-row li { font-family: var(--font-mono); font-size: 0.72rem; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.25rem 0.7rem; color: var(--ink-soft); }
.work-link { margin-top: auto; padding-top: 1rem; display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }
.text-link { font-weight: 600; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.text-link:hover { color: var(--accent-ink); }

/* CSS-composed covers (graceful without real screenshots) */
.cover-phone {
  background: #101010; border-radius: 34px; padding: 12px; width: 210px;
}
.cover-phone .screen { background: #f7f4ec; border-radius: 24px; overflow: hidden; }
.cover-phone .bar { height: 26px; display: flex; justify-content: center; align-items: center; }
.cover-phone .notch { width: 74px; height: 7px; border-radius: 99px; background: #101010; opacity: 0.85; }
.cover-ui { padding: 12px 12px 16px; display: grid; gap: 8px; }
.cover-ui .pill { height: 10px; border-radius: 99px; background: #ddd3bf; }
.cover-ui .card { border-radius: 12px; padding: 10px; background: #fff; border: 1px solid #e4dcc9; }
.cover-ui .card strong { display: block; font-size: 12px; }
.cover-ui .card span { font-size: 11px; color: #777; }
.cover-ui .chips { display: flex; gap: 6px; }
.cover-ui .chips i { display: block; height: 22px; border-radius: 99px; background: #1e4d3b; flex: 1; }
.cover-ui .chips i:last-child { background: #e8b04b; }
.cover-nest { width: 100%; max-width: 340px; background: #fff8ef; border-radius: 22px; padding: 18px; border: 1px solid rgba(0,0,0,0.08); }
.cover-nest .mascot { width: 64px; height: 64px; border-radius: 50%; background: #e9b98f; display: grid; place-items: center; font-size: 30px; }
.cover-nest h4 { margin: 10px 0 2px; font-family: var(--font-display); font-weight: 700; }
.cover-nest p { margin: 0; font-size: 12px; color: #7a6a58; }
.cover-nest .rows { display: grid; gap: 8px; margin-top: 12px; }
.cover-nest .rows div { background: #fff; border: 1px solid #eadfc8; border-radius: 12px; padding: 9px 11px; font-size: 12px; display: flex; justify-content: space-between; }
.cover-dash { width: 100%; max-width: 360px; background: #14171b; border-radius: 18px; padding: 16px; color: #eef0f2; }
.cover-dash .stations { display: grid; gap: 8px; margin-top: 12px; }
.cover-dash .st { display: flex; align-items: center; gap: 10px; background: #1f242b; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; }
.cover-dash .eq { display: flex; gap: 3px; align-items: flex-end; height: 18px; }
.cover-dash .eq i { width: 3px; background: #e8b04b; border-radius: 2px; display: block; }

/* ---------- About / process ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 3rem; }
.about-big { font-family: var(--font-display); font-weight: 500; font-size: var(--step-1); line-height: 1.4; letter-spacing: -0.01em; margin: 0; }
.about-big em { color: var(--accent-ink); }
.about-copy p { margin-top: 0; color: var(--ink-soft); }
.tick-list { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; gap: 0.9rem; }
.tick-list li { border-top: 1px solid var(--line); padding-top: 0.8rem; }
.tick-list strong { display: block; }
.tick-list span { color: var(--muted); font-size: 0.94rem; }
.process-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.process-grid li { background: var(--card); padding: 1.3rem 1.2rem 1.5rem; }
.process-grid .p-no { font-family: var(--font-mono); color: var(--accent-ink); font-size: 0.78rem; }
.process-grid h3 { margin: 0.4rem 0 0.4rem; font-size: 1.02rem; }
.process-grid p { margin: 0; font-size: 0.9rem; color: var(--muted); }

/* ---------- Contact / footer ---------- */
.contact-card {
  border-radius: calc(var(--radius) + 6px);
  background: var(--ink); color: var(--paper);
  padding: clamp(2rem, 5vw, 4rem);
}
.contact-card .section-no { color: #e8b04b; }
.contact-card h2 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; font-size: var(--step-3); line-height: 1.05; margin: 0.4rem 0 0.8rem; max-width: 16ch; }
.contact-card h2 em { color: #e8b04b; }
.contact-sub { color: #cfc7b4; max-width: 52ch; margin: 0 0 1.6rem; }
.contact-card .btn--solid { background-color: var(--paper); color: var(--ink); border-color: var(--paper); }
.contact-card .btn--solid:hover { background-color: #e8b04b; border-color: #e8b04b; }
.contact-card .btn--ghost { border-color: #5a5347; color: var(--paper); }
.contact-card .btn--ghost:hover { background-color: #e9e2d2; color: #161210; border-color: #e9e2d2; }
.contact-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.contact-links { list-style: none; display: flex; gap: 1.4rem; flex-wrap: wrap; margin: 1.8rem 0 0; padding: 1.2rem 0 0; border-top: 1px solid #38322a; }
.contact-links a { color: #e9e2d2; text-decoration: none; font-weight: 500; }
.contact-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.footer { border-top: 1px solid var(--line); margin-top: clamp(3rem, 7vw, 5rem); padding: 1.4rem 0 2.4rem; }
.footer-inner { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: 0.88rem; color: var(--muted); }
.footer-inner ul { list-style: none; display: flex; gap: 1.1rem; margin: 0; padding: 0; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Case study ---------- */
.crumbs { padding: 2rem 0 0; font-size: 0.9rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
.case-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; padding: 1.4rem 0 2rem; align-items: end; }
.case-hero h1 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; font-size: var(--step-3); line-height: 1.02; margin: 0.5rem 0 0.8rem; }
.case-hero .standfirst { font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); margin: 0; max-width: 40ch; }
.case-facts { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 1.2rem 1.3rem; display: grid; gap: 0.7rem; font-size: 0.92rem; }
.case-facts div { display: grid; grid-template-columns: 110px 1fr; gap: 0.8rem; }
.case-facts dt { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding-top: 0.2rem; }
.case-facts dd { margin: 0; }
.case-cover { border-radius: calc(var(--radius) + 6px); overflow: hidden; border: 1px solid var(--line); min-height: 300px; display: flex; align-items: center; justify-content: center; padding: 3rem 2rem; }
.case-blocks { display: grid; gap: 0; max-width: 820px; }
.case-block { border-top: 1px solid var(--line); padding: 1.8rem 0; }
.case-block h2 { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: -0.02em; margin: 0 0 0.7rem; font-weight: 750; }
.case-block p { color: var(--ink-soft); margin: 0 0 0.9rem; max-width: 65ch; }
.case-block ul { margin: 0.4rem 0 1rem; padding-left: 1.1rem; color: var(--ink-soft); }
.case-block li { margin-bottom: 0.4rem; }
.case-block li::marker { color: var(--accent); }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2.5rem 0 4rem; }
.prevnext a { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; text-decoration: none; background: var(--card); display: block; }
.prevnext a:hover { border-color: var(--ink); }
.prevnext small { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.prevnext strong { display: block; font-family: var(--font-display); font-size: 1.2rem; font-weight: 750; margin-top: 0.2rem; }

/* ---------- Case study figures ---------- */
.fig-group { display: grid; gap: 1.4rem; margin-top: 1.4rem; }
.case-figure {
  margin: 0; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--card);
}
.case-figure img { width: 100%; height: auto; margin-inline: auto; }
.case-figure figcaption {
  padding: 0.8rem 1.1rem 1rem; font-size: 0.86rem; color: var(--muted);
  border-top: 1px solid var(--line);
}
/* Two-up figure groups (narrow pairs like sign-in / sign-up). */
.fig-group.duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fig-group.duo .case-figure.wide { grid-column: 1 / -1; }
.fig-group.duo .case-figure.wide img { margin-inline: auto; }
@media (max-width: 640px) {
  .fig-group.duo { grid-template-columns: 1fr; }
  .fig-group.duo .case-figure.wide { grid-column: auto; }
}
/* Homepage/hero covers render at natural size, centered — never upscaled. */
.cover--real { position: relative; width: min(100%, 380px); display: flex; justify-content: center; }
.cover--real .cover--img {
  width: auto; max-width: 100%; max-height: 440px; height: auto;
  border-radius: 14px;
  filter: drop-shadow(0 24px 30px rgba(0,0,0,0.22));
}
.cover--real .cover--fallback { display: none; }
.cover--real.img-missing .cover--img { display: none; }
.cover--real.img-missing .cover--fallback { display: block; }
.hero-covers { display: flex; justify-content: center; width: 100%; }
.hero-covers .hero-shot {
  width: min(100%, 300px); height: auto; border-radius: 18px;
  box-shadow: 0 30px 50px -20px rgba(0,0,0,0.35);
  border: 1px solid rgba(0,0,0,0.1);
}
.hero-covers.duo {
  display: grid; grid-template-columns: repeat(2, minmax(0, 290px));
  gap: clamp(1rem, 3vw, 2rem); justify-content: center; align-items: start;
}
/* Landscape hero art gets a wide cinematic frame instead of the phone slot. */
.hero-covers .hero-shot.wide { width: min(100%, 720px); border-radius: 14px; }
/* Landscape card covers fill more of the panel. */
.cover--real.wide { width: min(100%, 560px); }
.cover--real.wide .cover--img { max-height: none; }
@media (max-width: 640px) {
  .hero-covers.duo { grid-template-columns: minmax(0, 270px); }
}

/* ---------- Custom cursor: dot + trailing ring, contextual states ----------
   Only ever activated on fine pointers without reduced-motion (see
   js/cursor.js). Touch, keyboard and reduced-motion users keep the native
   cursor and are completely unaffected. */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 200; pointer-events: none;
  opacity: 0;
}
.cursor-dot.on, .cursor-ring.on { opacity: 1; }
.cursor-dot {
  width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: var(--accent); transition: opacity 0.25s ease, scale 0.25s ease;
}
.cursor-dot.is-link { scale: 0; }
.cursor-dot.is-view { scale: 0; }
.cursor-ring { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
.cursor-disc {
  display: grid; place-items: center; width: 100%; height: 100%;
  border-radius: 50%; border: 1.5px solid var(--ink); opacity: 0.5;
  transition: transform 0.28s ease, background-color 0.28s ease, border-color 0.28s ease, opacity 0.28s ease;
}
.cursor-ring.is-link .cursor-disc { transform: scale(1.35); opacity: 0.9; }
.cursor-ring.is-view .cursor-disc {
  transform: scale(1.9); background: var(--ink); border-color: var(--ink); opacity: 1;
}
.cursor-label {
  font-family: var(--font-body); font-weight: 600; font-size: 0.66rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper);
  opacity: 0; transition: opacity 0.2s ease;
}
.cursor-ring.is-view .cursor-label { opacity: 1; }
html.has-cursor, html.has-cursor a, html.has-cursor button { cursor: none; }
@media (prefers-reduced-motion: reduce) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ---------- Side line-navigation (scroll-spy section jumps) ---------- */
.sidenav { position: fixed; right: 1.3rem; top: 50%; transform: translateY(-50%); z-index: 40; }
.sidenav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.sidenav a {
  display: flex; align-items: center; flex-direction: row-reverse; gap: 0.55rem;
  text-decoration: none; padding: 0.25rem 0;
}
.sn-no { font-family: var(--font-mono); font-size: 0.62rem; color: var(--muted); }
.sn-line {
  width: 26px; height: 2px; border-radius: 2px; background: var(--line-strong);
  transition: width 0.25s ease, background-color 0.25s ease;
}
.sn-label {
  font-size: 0.78rem; font-weight: 600; white-space: nowrap;
  opacity: 0; transform: translateX(5px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.sidenav a:hover .sn-line, .sidenav a:focus-visible .sn-line { background: var(--ink); }
.sidenav a:hover .sn-label, .sidenav a:focus-visible .sn-label, .sidenav a.active .sn-label {
  opacity: 1; transform: none;
}
.sidenav a.active .sn-line { width: 44px; background: var(--accent); }
@media (max-width: 1024px) { .sidenav { display: none; } }

/* ---------- Reveal motion (lightweight, respects reduced motion) ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-grid, .about-grid, .case-hero { grid-template-columns: 1fr; }
  .work { grid-template-columns: 1fr; }
  .work:nth-child(even) .work-visual { order: 0; }
  .work-visual { min-height: 260px; }
  .hero-index { grid-template-columns: 1fr; }
  .hero-index li + li { border-left: 0; border-top: 1px solid var(--line); }
  .hero-meta { grid-template-columns: 1fr 1fr; }
  .process-grid { grid-template-columns: 1fr 1fr; }
  .prevnext { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links, .nav-cta { display: none; }
  .nav-links.open {
    display: flex; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 0.6rem 1.2rem 1rem;
  }
  .nav-links.open a { padding: 0.8rem 0.4rem; border-top: 1px solid var(--line); border-radius: 0; }
  .menu-btn { display: inline-block; }
  .hero-meta { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; }
  .contact-card .btn--large { font-size: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
