/* ============================================================
   SHADAB KHAN — PORTFOLIO STYLES
   Identity: dark editorial by default (ink ground, paper type, mono
   data labels, one acid accent) plus a designed Light theme.
   Every colour derives from the tokens below — edit them to re-theme.
   Mobile-first.
   ============================================================ */

/* ---------- Self-hosted fonts ----------
   Served from /fonts on this site instead of Google Fonts: no extra
   third-party connections and no render-blocking external stylesheet.
   Latin subset only, just the weights the site uses. font-display: swap
   shows text immediately in a fallback font until the file arrives.
   Licenses: fonts/LICENSE-*.txt (SIL Open Font License 1.1). */
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/space-grotesk-latin-400.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/space-grotesk-latin-500.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/inter-latin-400.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/inter-latin-500.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/inter-latin-600.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/ibm-plex-mono-latin-400.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/ibm-plex-mono-latin-500.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --ink: #0b0d12;          /* page ground */
  --surface: #12151d;      /* raised panels */
  --paper: #eef0f4;        /* primary type */
  --muted: #8b93a7;        /* secondary type */
  --accent: #c6f24e;       /* the one loud thing */
  --accent-ink: #0b0d12;   /* type on accent */
  --line: #232836;         /* hairlines */

  /* Placeholder chips: visible, editable, unmistakable */
  --ph: #ffc978;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --gutter: clamp(1.25rem, 5vw, 5rem);
  --max: 1200px;

  --glow-color: rgba(198, 242, 78, 0.055);
}

/* ---------- LIGHT THEME ----------
   A properly designed colour palette — not a washed-out inversion:
   cool paper ground, near-black navy type, vivid indigo accent.
   Toggled by the sun/moon switch in the nav, saved to localStorage.

   TO MAKE LIGHT THE DEFAULT instead of dark: swap these values with
   the :root block above (and flip the check in the <head> script of
   index.html from "light" to "dark"). */
[data-theme="light"] {
  --ink: #f4f4fa;          /* page ground */
  --surface: #ffffff;      /* raised panels */
  --paper: #14162b;        /* primary type */
  --muted: #5c6379;        /* secondary type */
  --accent: #4a34e0;       /* vivid indigo */
  --accent-ink: #ffffff;   /* type on accent */
  --line: #e2e1ee;         /* hairlines */
  --ph: #a85b00;           /* placeholder chips, readable on light */
  --glow-color: rgba(74, 52, 224, 0.06);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--accent); }
.mono { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; top: -60px; left: 12px; z-index: 300;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: 0.8rem;
  padding: 0.55rem 1rem; transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ---------- Motion safety ----------
   Scroll reveals and hover motion respect the OS "reduce motion"
   setting. A few small, slow, decorative loops (lifecycle diagram,
   tools/channels slider, portrait float) are deliberately exempted
   further down — they are JS-driven or re-enabled explicitly. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .cursor-glow { display: none !important; }
}

/* ---------- Cursor glow (desktop only; JS positions it) ---------- */
.cursor-glow {
  position: fixed; z-index: 0; pointer-events: none;
  width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow-color) 0%, transparent 60%);
  transform: translate(-50%, -50%);
  top: 0; left: 0; opacity: 0;
  transition: opacity 0.5s;
}
@media (hover: none), (pointer: coarse) { .cursor-glow { display: none; } }

/* ---------- Progress hairline ---------- */
.progress {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 2px; width: 0%;
  background: var(--accent);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--gutter);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav-name { font-size: 0.9rem; letter-spacing: 0.14em; color: var(--paper); }

.nav-links { display: none; gap: 1.6rem; }
.nav-links a {
  font-size: 0.86rem; color: var(--muted); font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--paper); }
.nav-links a.active .nav-idx { color: var(--accent); }
.nav-idx { color: var(--muted); font-size: 0.68rem; margin-right: 0.3rem; }
.nav-contact { color: var(--accent) !important; }

.nav-right { display: flex; align-items: center; gap: 1rem; }

/* ---------- Theme switch (Dark ↔ Light) ----------
   A pill with a sliding knob. The knob animates left→right, the two icons
   swap with a rotate+fade, and the label crossfades. */
.theme-switch {
  position: relative;
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.85rem 0.3rem 2.75rem;
  cursor: pointer;
  color: var(--paper);
  transition: border-color 0.25s, background 0.4s;
}
.theme-switch:hover { border-color: var(--accent); }

.theme-knob {
  position: absolute;
  left: 4px; top: 50%;
  width: 26px; height: 26px;
  margin-top: -13px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.45s cubic-bezier(0.5, 1.6, 0.5, 1), background 0.4s;
}
[data-theme="light"] .theme-knob { transform: translateX(4px) rotate(180deg); }

.theme-ico {
  position: absolute;
  left: 4px; top: 50%;
  width: 26px; height: 26px;
  margin-top: -13px;
  display: grid; place-items: center;
  color: var(--accent-ink);
  transition: opacity 0.35s, transform 0.45s cubic-bezier(0.5, 1.6, 0.5, 1);
  pointer-events: none;
}
.theme-ico svg { width: 15px; height: 15px; }

/* moon shows while dark is active, sun while light is active */
.theme-ico-dark  { opacity: 1; transform: rotate(0deg) scale(1); }
.theme-ico-light { opacity: 0; transform: rotate(-120deg) scale(0.4); }
[data-theme="light"] .theme-ico-dark  { opacity: 0; transform: rotate(120deg) scale(0.4); }
[data-theme="light"] .theme-ico-light { opacity: 1; transform: translateX(4px) scale(1); }

.theme-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  min-width: 2.6rem;
  text-align: left;
  animation: label-in 0.4s ease;
}
@keyframes label-in { from { opacity: 0; transform: translateY(-3px); } }

/* Whole-page colour crossfade when the theme flips */
body, .nav, .tabs, .testi-carousel, .case, .cred, .btn,
.tab-btn, .cap-title, .theme-switch, .lightbox img, .slider-pills li {
  transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease;
}

@media (max-width: 420px) {
  .theme-label { display: none; }
  .theme-switch { padding: 0.3rem 0.5rem 0.3rem 2.4rem; }
}

.nav-burger {
  display: flex; flex-direction: column; gap: 7px;
  background: none; border: 0; cursor: pointer; padding: 8px;
}
.nav-burger span {
  width: 26px; height: 2px; background: var(--paper);
  transition: transform 0.3s;
}
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4.5px) rotate(-45deg); }

/* Six links + the theme switch need room: desktop nav from 1080px */
@media (min-width: 1080px) {
  .nav-links { display: flex; }
  .nav-burger { display: none; }
}

/* Full-screen mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  background: var(--ink);
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter);
}
/* explicit display would defeat the hidden attribute — restore it */
.mobile-menu[hidden] { display: none; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 0.4rem; }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 8vw, 3rem);
  font-weight: 500; color: var(--paper);
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 1rem;
}
.mobile-menu a .mono { color: var(--accent); font-size: 0.85rem; }
.mobile-menu-foot { color: var(--muted); margin-top: 2.5rem; }

/* ---------- Layout primitives ---------- */
main { position: relative; z-index: 1; }

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 7rem) var(--gutter) 0;
}

.section-head {
  display: flex; align-items: baseline; gap: 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.section-idx { color: var(--accent); }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 500; letter-spacing: -0.02em;
}
.section-note { color: var(--muted); margin: -1.5rem 0 2.5rem; }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.reveal.visible { opacity: 1; transform: none; }

/* Hero entrance: pure CSS, starts with the first paint (no wait for JS or
   the scroll observer), short and staggered via --d on each element.
   Under reduced motion the global rule disables it and content shows as-is. */
.hero-in {
  animation: hero-in 0.5s cubic-bezier(0.2, 0.6, 0.2, 1) both;
  animation-delay: calc(var(--d, 0) * 60ms);
}
@keyframes hero-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Placeholder chips ---------- */
.ph {
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--ph);
  border: 1px dashed color-mix(in srgb, var(--ph) 55%, transparent);
  border-radius: 3px;
  padding: 0.05em 0.4em;
  cursor: help;
  white-space: normal;
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  /* top padding clears the ~62px fixed nav plus a ~30–37px breathing gap */
  padding: clamp(5.75rem, 11vh, 6.75rem) var(--gutter) 0;
}
.hero-eyebrow { color: var(--accent); margin-bottom: 2rem; text-transform: uppercase; }

.hero-h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 8.5vw, 6.2rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}
/* Phones: slightly smaller so the headline stays two tidy lines
   ("I turn customer data" / "into <phrase>") for every rotating phrase. */
@media (max-width: 480px) {
  .hero-h1 { font-size: clamp(2rem, 8.6vw, 2.3rem); }
}
.hero-line { display: block; }
.hero-h1 em { position: relative; }
/* hand-set underline on the money phrase */
.hero-h1 em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.02em;
  height: 0.06em; background: var(--accent); opacity: 0.9;
  transform-origin: left; transform: scaleX(0);
  animation: rule-in 0.9s 0.7s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
}
@keyframes rule-in { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .hero-h1 em::after { transform: scaleX(1); } }

/* ---------- Rotating hero phrase ----------
   script.js cycles the words in data-words. Out: the phrase lifts and fades
   while the underline retracts to the right. In: the next phrase rises into
   place and the underline draws again from the left. Small and slow, so it
   is kept even under reduced motion (like the other signature loops). */
.rot-word {
  display: inline-block;
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.rot-word.is-out { opacity: 0; transform: translateY(-0.3em); }
.rot-word.is-pre { opacity: 0; transform: translateY(0.3em); transition: none; }

.hero-h1 em.is-retract::after { animation: rule-out 0.35s ease-in forwards; }
.hero-h1 em.is-draw::after    { animation: rule-in 0.55s cubic-bezier(0.2, 0.6, 0.2, 1) forwards; }
@keyframes rule-out { from { transform: scaleX(1); transform-origin: right; } to { transform: scaleX(0); transform-origin: right; } }

@media (prefers-reduced-motion: reduce) {
  .rot-word { transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.2, 0.6, 0.2, 1) !important; }
  .rot-word.is-pre { transition: none !important; }
  .hero-h1 em.is-retract::after { animation: rule-out 0.35s ease-in forwards !important; }
  .hero-h1 em.is-draw::after    { animation: rule-in 0.55s cubic-bezier(0.2, 0.6, 0.2, 1) forwards !important; }
}

/* text for screen readers only (the rotating phrase itself is aria-hidden) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.hero-sub { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--paper); max-width: 560px; margin-bottom: 0.75rem; }
.hero-tags { color: var(--muted); margin-bottom: 2.5rem; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: clamp(3rem, 7vw, 4.5rem); }

.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.85rem 1.7rem;
  border: 1px solid var(--accent);
  transition: background 0.2s, color 0.2s, transform 0.2s, border-color 0.2s;
}
.btn-solid { background: var(--accent); color: var(--accent-ink); }
.btn-solid:hover { background: transparent; color: var(--accent); transform: translateY(-2px); }
.btn-line { color: var(--paper); border-color: var(--line); }
.btn-line:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* Stats: instrument readouts on a hairline grid */
.hero-stats {
  display: grid; grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
}
@media (min-width: 720px) { .hero-stats { grid-template-columns: repeat(3, 1fr); } }

.hstat {
  padding: 1.5rem 1.5rem 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 720px) {
  .hstat { border-bottom: 0; border-right: 1px solid var(--line); padding: 1.75rem 2rem; }
  .hstat:first-child { padding-left: 0; }
  .hstat:last-child { border-right: 0; }
}
.hstat-num {
  display: block;
  font-size: clamp(2rem, 4.5vw, 3rem);
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.hstat-arrow { color: var(--muted); font-size: 0.6em; margin: 0 0.15em; }
.hstat-label { font-size: 0.88rem; color: var(--muted); line-height: 1.5; }
/* company attribution under each stat */
.hstat-co { display: block; margin-top: 0.75rem; color: var(--accent); text-transform: uppercase; font-size: 0.7rem; opacity: 0.85; }

.hero-footnote { color: var(--muted); opacity: 0.75; margin-top: 1.25rem; }

/* ---------- Lifecycle loop (signature element) ---------- */
.loop-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 6.5rem) var(--gutter) 0;
}
.loop-scroll { overflow-x: auto; scrollbar-width: thin; }
.loop-svg { min-width: 760px; width: 100%; display: block; }

.loop-path { fill: none; stroke: var(--line); stroke-width: 2; }
.loop-flow {
  fill: none; stroke: var(--accent); stroke-width: 2;
  stroke-dasharray: 10 14;
  animation: flow 2.6s linear infinite;
  opacity: 0.5;
}
@keyframes flow { to { stroke-dashoffset: -48; } }
.loop-arrow { fill: var(--accent); }

/* travelling customer dots (moved by script.js) */
.loop-dot { fill: var(--accent); }
.loop-dot-2 { opacity: 0.55; }

/* node cores + expanding pulse rings, staggered in journey order */
.loop-core { fill: var(--ink); stroke: var(--accent); stroke-width: 2.5; }
.loop-ring {
  fill: none; stroke: var(--accent); stroke-width: 2;
  transform-box: fill-box; transform-origin: center;
  animation: ring 3.3s var(--pd, 0s) ease-out infinite;
  opacity: 0;
}
@keyframes ring {
  0%   { transform: scale(1); opacity: 0.8; }
  55%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

.loop-label {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.12em;
  fill: var(--paper); text-anchor: middle;
}
.loop-sub {
  font-family: var(--font-mono); font-size: 11px;
  fill: var(--muted); text-anchor: middle;
}
.loop-cap { font-style: italic; }

/* The lifecycle loop is the site's signature and stays animated even when
   the OS requests reduced motion — it's small, slow and contained. */
@media (prefers-reduced-motion: reduce) {
  .loop-flow { animation: flow 2.6s linear infinite !important; }
  .loop-ring { animation: ring 3.3s var(--pd, 0s) ease-out infinite !important; }
}

/* ---------- About: 60 / 40 text + portrait ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "photo" "text";   /* mobile: photo first */
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (min-width: 860px) {
  .about-grid {
    grid-template-columns: 3fr 2fr;       /* 60% text · 40% photo */
    grid-template-areas: "text photo";
  }
}
.about-body { grid-area: text; }
.about-photo { grid-area: photo; }

.about-lede {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}
.about-second { color: var(--paper); font-size: 1.02rem; opacity: 0.92; }
.about-second + .about-second { margin-top: 1rem; }

.about-facts {
  list-style: none;
  margin-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.about-facts li {
  display: flex; gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--paper);
}
.about-facts span { color: var(--muted); min-width: 6.5rem; text-transform: uppercase; }
.about-note { margin-top: 1.5rem; }

/* --- Portrait ---
   No box, no border, no panel: the photo sits straight on the page ground
   and its lower edge dissolves into it (mask), so text and image read as
   one composition rather than two blocks. */
.about-photo {
  position: relative;
  width: min(100%, 420px);
  justify-self: center;
  margin: 0;
}
@media (max-width: 859px) { .about-photo { width: min(78%, 360px); } }

.photo-tilt {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out;
  will-change: transform;
}

/* Arch shape: semicircular top, open bottom */
.photo-float {
  position: relative;
  z-index: 1;
  border-radius: 50% 50% 0 0 / 40% 40% 0 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  animation: photo-float 7s ease-in-out infinite;
}
.photo-float picture, .photo-img {
  display: block; width: 100%; height: auto;
}

/* wipe-up reveal when the About section scrolls into view */
.photo-img {
  clip-path: inset(100% 0 0 0);
  transform: scale(1.08);
  transition: clip-path 1.2s cubic-bezier(0.7, 0, 0.2, 1) 0.15s,
              transform 1.6s cubic-bezier(0.2, 0.6, 0.2, 1) 0.15s;
}
.about-photo.visible .photo-img { clip-path: inset(0 0 0 0); transform: scale(1); }

/* Accent outline arch, offset behind the photo, drifting counter to it */
.photo-outline {
  position: absolute;
  inset: 0 0 14% 0;
  z-index: 0;
  border: 1.5px solid var(--accent);
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 46% 46% 0 0;
  transform: translate(18px, -18px);
  opacity: 0.7;
  animation: outline-drift 7s ease-in-out infinite;
}

/* Live status badge with a pulsing dot */
.photo-badge {
  position: absolute;
  z-index: 2;
  left: -0.5rem; bottom: 16%;
  display: inline-flex; align-items: center; gap: 0.55rem;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.72rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  animation: badge-bob 7s ease-in-out infinite;
}
.photo-badge i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: live-pulse 2s ease-out infinite;
}

@keyframes photo-float   { 0%, 100% { transform: translateY(0); }  50% { transform: translateY(-10px); } }
@keyframes outline-drift { 0%, 100% { transform: translate(18px, -18px); } 50% { transform: translate(24px, -8px); } }
@keyframes badge-bob     { 0%, 100% { transform: translateY(0); }  50% { transform: translateY(-6px); } }
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); }
  100% { box-shadow: 0 0 0 10px transparent; }
}

/* Portrait idle motion is slow and small: kept even under reduced motion */
@media (prefers-reduced-motion: reduce) {
  .photo-float   { animation: photo-float 7s ease-in-out infinite !important; }
  .photo-outline { animation: outline-drift 7s ease-in-out infinite !important; }
  .photo-badge   { animation: badge-bob 7s ease-in-out infinite !important; }
  .photo-badge i { animation: live-pulse 2s ease-out infinite !important; }
}

/* ---------- Capabilities: tabbed console ---------- */
.cap-title { color: var(--muted); text-transform: uppercase; margin-bottom: 1rem; }

.tabs { border: 1px solid var(--line); background: var(--surface); }

.tab-list { display: flex; border-bottom: 1px solid var(--line); }
.tab-btn {
  flex: 1;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 1.9vw, 1.05rem);
  font-weight: 500;
  color: var(--muted);
  padding: 1.1rem 0.75rem;
  position: relative;
  transition: color 0.25s, background 0.25s;
}
.tab-btn + .tab-btn { border-left: 1px solid var(--line); }
.tab-btn:hover { color: var(--paper); }
.tab-btn .tab-num { color: var(--muted); margin-right: 0.4rem; font-size: 0.7rem; }
.tab-btn.active { color: var(--paper); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.tab-btn.active .tab-num { color: var(--accent); }
/* sliding accent indicator under the active tab */
.tab-btn::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.tab-btn.active::after { transform: scaleX(1); }

.tab-panels { padding: clamp(1.5rem, 4vw, 2.5rem); }
.tab-panel[hidden] { display: none; }

.tab-lede {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  max-width: 640px;
  margin-bottom: 1.5rem;
}

.tab-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.5rem; }
.tab-chips li {
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  color: var(--paper);
  background: var(--ink);
  transition: border-color 0.2s, transform 0.2s;
  opacity: 0;
  transform: translateY(10px);
}
.tab-chips li:hover { border-color: var(--accent); transform: translateY(-2px); }
.chip-note { font-size: 0.68rem; color: var(--accent); margin-left: 0.35rem; }

/* chips cascade in whenever their panel becomes active */
.tab-panel.active .tab-chips li {
  animation: chip-in 0.45s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 55ms);
}
@keyframes chip-in { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .tab-chips li { opacity: 1; transform: none; }
}

.tab-proof {
  color: var(--accent);
  border-top: 1px dashed var(--line);
  padding-top: 1rem;
}

/* ---------- Tools & Channels sliders ----------
   script.js clones each list and moves it with requestAnimationFrame,
   so any number of items loops seamlessly at a constant speed. */
/* minmax(0, 1fr) is essential: an auto grid column would size itself to
   the slider's (very wide) content, so every clone would widen the
   container and the clone loop would chase it forever. */
.stack { margin-top: 2.75rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
.stack-row { min-width: 0; }

.slider {
  min-width: 0;
  overflow: hidden;
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 0;
  /* soft fade at both edges */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.slider-track {
  list-style: none;
  display: flex;
  width: max-content;
  will-change: transform;
}
.slider-track li { flex: 0 0 auto; white-space: nowrap; }

/* Row style A — tool pills */
.slider-pills li {
  margin-right: 0.75rem;              /* margin, not gap: keeps loop maths exact */
  font-size: 0.9rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--paper);
  transition: border-color 0.2s, color 0.2s;
}
.slider-pills li:hover { border-color: var(--accent); color: var(--accent); }

/* Row style B — big channel words with accent separators */
.slider-big li {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.4vw, 2.2rem);
  color: var(--paper);
  padding-right: 0.9em;
  margin-right: 0.9em;
  position: relative;
}
.slider-big li::after {
  content: "";
  position: absolute; right: -0.12em; top: 50%;
  width: 0.24em; height: 0.24em; margin-top: -0.12em;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Case studies ---------- */
.cases { border-top: 1px solid var(--line); }
.case { border-bottom: 1px solid var(--line); }

.case-head {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1.4rem 0;
  background: none; border: 0; cursor: pointer;
  color: var(--paper); text-align: left;
  transition: color 0.2s;
}
.case-head:hover .case-title { color: var(--accent); }
.case-head-static { cursor: default; }

.case-idx { color: var(--muted); }
.case-title {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}
.case-kpi { color: var(--accent); white-space: nowrap; }
.case-kpi-soon { color: var(--muted); border: 1px dashed var(--line); padding: 0.25rem 0.7rem; }

/* company · period line under each case title (stays muted on hover) */
.case-co {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Impact metric tiles inside an open case */
.case-metrics {
  list-style: none;
  display: flex; flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.25rem 0 0.9rem;
}
.case-metrics li {
  display: flex; flex-direction: column; gap: 0.2rem;
  min-width: 9.5rem;
  padding: 0.8rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  background: var(--surface);
}
.case-metrics b {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.case-metrics span { font-size: 0.8rem; color: var(--muted); }

/* plus / minus toggle drawn in CSS */
.case-toggle { position: relative; width: 16px; height: 16px; }
.case-toggle::before, .case-toggle::after {
  content: ""; position: absolute; background: var(--muted);
  transition: transform 0.3s, background 0.2s;
}
.case-toggle::before { top: 7px; left: 0; width: 16px; height: 2px; }
.case-toggle::after { top: 0; left: 7px; width: 2px; height: 16px; }
.case-head[aria-expanded="true"] .case-toggle::after { transform: rotate(90deg); }
.case-head[aria-expanded="true"] .case-toggle::before,
.case-head[aria-expanded="true"] .case-toggle::after { background: var(--accent); }

@media (max-width: 719px) {
  .case-head { grid-template-columns: auto 1fr auto; }
  .case-kpi { display: none; }
}

/* Smooth expand via the 0fr → 1fr grid-row trick (no JS height math) */
.case-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.case-body.open { grid-template-rows: 1fr; }
.case-inner { overflow: hidden; }

.case-row {
  display: grid; grid-template-columns: 1fr;
  gap: 0.3rem 2rem;
  padding: 0.9rem 0;
  border-top: 1px dashed var(--line);
}
.case-inner dl { padding-bottom: 1.75rem; }
.case-row dt { color: var(--accent); text-transform: uppercase; }
.case-row dd { color: var(--paper); font-size: 0.95rem; max-width: 760px; }
@media (min-width: 720px) {
  .case-row { grid-template-columns: 140px 1fr; }
}

.case-soon .case-title { color: var(--muted); }

/* ---------- Experience timeline ---------- */
.xp-list {
  list-style: none;
  position: relative;
  padding-left: 1.75rem;
}
/* the rail — draws itself downward when the list scrolls into view */
.xp-list::before {
  content: "";
  position: absolute; left: 5px; top: 0.6rem; bottom: 0.6rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--line));
  transform: scaleY(0); transform-origin: top;
  transition: transform 1.4s cubic-bezier(0.2, 0.6, 0.2, 1) 0.2s;
}
.xp-list.visible::before { transform: scaleY(1); }

.xp {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem 2.5rem;
  padding: 0 0 clamp(2.5rem, 5vw, 3.5rem);
}
.xp:last-child { padding-bottom: 0; }
@media (min-width: 820px) {
  .xp { grid-template-columns: 190px 1fr; }
}

/* node on the rail */
.xp::before {
  content: "";
  position: absolute; left: calc(-1.75rem + 0px); top: 0.45rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--accent);
}
/* current role: live pulsing node */
.xp-current::before {
  background: var(--accent);
  animation: live-pulse 2s ease-out infinite;
}

.xp-when { display: flex; flex-direction: column; gap: 0.2rem; }
.xp-dates { color: var(--paper); text-transform: uppercase; }
.xp-dur { color: var(--muted); }
.xp-current .xp-dates { color: var(--accent); }

.xp-role {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.xp-org { color: var(--accent); font-weight: 500; margin: 0.2rem 0 0.75rem; }
.xp-org .mono { color: var(--muted); }
.xp-sum { color: var(--muted); max-width: 720px; margin-bottom: 0.9rem; }

.xp-points { list-style: none; max-width: 760px; }
.xp-points li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}
.xp-points li::before {
  content: "";
  position: absolute; left: 0; top: 0.72em;
  width: 7px; height: 1.5px;
  background: var(--accent);
}
.xp-points strong { color: var(--accent); font-weight: 600; }

.xp-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1rem; }
.xp-tags li {
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* Education */
.edu { margin-top: clamp(3rem, 6vw, 4rem); }
.edu-list { list-style: none; border-top: 1px solid var(--line); }
.edu-list li {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 0.35rem 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.edu-name { font-size: 0.98rem; }
.edu-meta { color: var(--muted); }

/* ---------- Credentials ---------- */
.cred-list { list-style: none; border-top: 1px solid var(--line); margin-bottom: 3.5rem; }
.cred {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.cred-name { font-size: 0.98rem; }
/* issuer shown under the credential name */
.cred-issuer {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
/* Credential actions reuse the site's main buttons:
   "view certificate" = .btn-solid (like "View case studies"),
   "verify certificate" = .btn-line (like "Get in touch"). */
.cred-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.cred { align-items: center; }
.cred-view { cursor: pointer; }   /* <button> — the .btn classes do the rest */
@media (max-width: 520px) {
  .cred-meta { width: 100%; }
  .cred-meta .btn { flex: 1 1 auto; justify-content: center; }
}

/* Certificate lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 250;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1rem, 5vw, 3rem);
}
.lightbox[hidden] { display: none; }
.lightbox figure {
  max-width: min(880px, 100%);
  max-height: 100%;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.lightbox img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border: 1px solid var(--line);
  background: var(--surface);
}
.lightbox figcaption { color: var(--muted); }
.lightbox-hint { color: var(--muted); opacity: 0.8; font-size: 0.7rem; }

/* Close button: deliberately loud — accent block, top-right, always visible */
.lightbox-close {
  position: absolute; top: 1rem; right: 1rem; z-index: 1;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.7rem 1.1rem;
  display: flex; align-items: center; gap: 0.5rem;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.lightbox-close .mono { font-size: 0.75rem; }
.lightbox-close:hover {
  background: transparent;
  color: var(--accent);
  transform: translateY(-1px);
}

/* ---------- Testimonials carousel ---------- */
.testi-block { margin-top: 1rem; }

.testi-carousel {
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  position: relative;
}
.testi-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.testi-slide {
  flex: 0 0 100%;
  padding: clamp(1.75rem, 4.5vw, 3rem);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "avatar quote" "avatar meta";
  gap: 0.75rem 1.5rem;
  align-items: start;
}
@media (max-width: 600px) {
  .testi-slide { grid-template-columns: 1fr; grid-template-areas: "avatar" "quote" "meta"; }
}

.testi-avatar { grid-area: avatar; width: 64px; height: 64px; }
.testi-avatar circle { fill: var(--ink); stroke: var(--accent); stroke-width: 2; }
.testi-avatar text {
  font-family: var(--font-mono); font-size: 20px;
  fill: var(--accent); text-anchor: middle;
}
/* real headshots: round, with the same accent ring as the initials badge */
.testi-photo {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  background: var(--surface);
}
.testi-slide blockquote {
  grid-area: quote;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
}
.testi-slide figcaption {
  grid-area: meta;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 1rem;
}
.testi-name { font-weight: 600; }
.testi-title { color: var(--muted); }
/* where the quote comes from (LinkedIn / experience letter) */
.testi-source {
  flex-basis: 100%;
  font-size: 0.68rem;
  color: var(--accent);
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
a.testi-source { transition: opacity 0.2s; }
a.testi-source:hover { opacity: 1; text-decoration: underline; }

.testi-dots {
  display: flex; gap: 0.6rem; justify-content: center;
  padding: 0 0 1.25rem;
}
.testi-dot {
  width: 26px; height: 4px;
  background: var(--line);
  border: 0; cursor: pointer;
  transition: background 0.3s;
}
.testi-dot.active { background: var(--accent); }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(4rem, 9vw, 7rem); }
.contact-lede {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4.5vw, 2.8rem);
  font-weight: 500; letter-spacing: -0.02em;
  max-width: 800px;
  margin-bottom: 0.75rem;
}
.contact-sub { color: var(--muted); margin-bottom: 2.25rem; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.contact-loc { color: var(--muted); }

/* Résumé split button: [ View résumé ↗ | ↓ ] */
.resume-cta { display: inline-flex; }
.resume-cta .btn-solid:first-child { border-right-color: color-mix(in srgb, var(--accent-ink) 25%, var(--accent)); }
.btn-dl { padding: 0.85rem 1rem; border-left: 0; }
.btn-dl svg { width: 17px; height: 17px; }
.btn-dl:hover svg { animation: dl-nudge 0.8s ease-in-out infinite; }
@keyframes dl-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

@media (max-width: 520px) {
  .contact-actions { flex-direction: column; align-items: stretch; }
  .contact-actions > .btn { justify-content: center; }
  .resume-cta .btn-solid:first-child { flex: 1; justify-content: center; }
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  align-items: center; justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 2rem;
  color: var(--muted);
}
.footer a { transition: color 0.2s; }
.footer a:hover { color: var(--accent); }
