/* Zaid Ismail — site styles. Neutral palette, one typeface, motion on transform/opacity only. */

:root {
  --bg: #F5F5F2;
  --bg-alt: #ECEBE6;
  --surface: #FFFFFF;
  --ink: #111111;
  --ink-2: #33332F;
  --muted: #64635D;
  --line: rgba(17, 17, 17, 0.12);
  --dark: #121212;
  --on-dark: #F5F5F2;
  --on-dark-muted: #A9A8A1;

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 56px);
  --section: clamp(88px, 12vw, 160px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--on-dark); padding: 10px 16px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Type ---------- */
.eyebrow { font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.display { font-size: clamp(56px, 11vw, 160px); font-weight: 600; letter-spacing: -0.045em; line-height: 0.95; }
.h2 { font-size: clamp(32px, 4.6vw, 56px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.06; }
.body-lg { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; color: var(--ink-2); }
.body-lg + .body-lg { margin-top: 1em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font: 500 16px/1 var(--font); text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.btn-dark { background: var(--ink); color: var(--on-dark); }
.btn-dark:hover { background: #2A2A27; }
.btn-light { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-light:hover { border-color: var(--ink); }
.btn-cream { background: var(--on-dark); color: var(--ink); }
.btn-ghost-light { background: transparent; color: var(--on-dark); border-color: rgba(245, 245, 242, 0.3); }
.btn-ghost-light:hover { border-color: var(--on-dark); }
.text-link { font-weight: 500; text-decoration: none; padding: 12px 4px; }
.text-link span { display: inline-block; transition: transform 0.2s var(--ease); }
.text-link:hover span { transform: translateX(4px); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 245, 242, 0.96);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 32px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand img { width: auto; height: 28px; }
.nav { display: flex; gap: 28px; margin-left: auto; font-size: 15px; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 8px 0; transition: color 0.15s; }
.nav a:hover { color: var(--ink); }
.menu-btn { display: none; }

/* Mobile menu: a plain opaque panel that fades/slides on transform + opacity — no blur, nothing to repaint. */
.menu {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 49;
  background: var(--bg);
  opacity: 0; transform: translateY(-8px);
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
  overflow-y: auto;
}
.menu.open { opacity: 1; transform: none; }
.menu-inner { display: flex; flex-direction: column; padding-top: 24px; padding-bottom: 40px; }
.menu-inner a:not(.btn) { font-size: 32px; font-weight: 600; letter-spacing: -0.03em; text-decoration: none; padding: 12px 0; border-bottom: 1px solid var(--line); }
.menu-cta { margin-top: 32px; align-self: flex-start; }

@media (max-width: 899px) {
  .nav, .header-cta { display: none; }
  .menu-btn {
    display: inline-flex; margin-left: auto; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; cursor: pointer; color: var(--ink);
    border-radius: 999px; -webkit-tap-highlight-color: transparent;
  }
  .menu-icon { position: relative; width: 22px; height: 12px; }
  .menu-icon span { position: absolute; left: 0; width: 22px; height: 1.5px; background: currentColor; transition: transform 0.18s ease-out; }
  .menu-icon span:first-child { top: 0; }
  .menu-icon span:last-child { bottom: 0; }
  .menu-btn[aria-expanded="true"] .menu-icon span:first-child { transform: translateY(5.25px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] .menu-icon span:last-child { transform: translateY(-5.25px) rotate(-45deg); }
}
body.menu-open { overflow: hidden; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.3fr 0.7fr; gap: clamp(40px, 6vw, 96px); align-items: center;
  padding-top: clamp(32px, 5vw, 72px); padding-bottom: clamp(48px, 6vw, 88px);
}
.hero-title { font-size: clamp(40px, 5.4vw, 76px); font-weight: 600; letter-spacing: -0.045em; line-height: 1.02; margin-bottom: 24px; max-width: 13ch; }
.hero .lead { font-size: clamp(18px, 1.45vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 580px; margin-bottom: 32px; }
.hero-portrait { border-radius: 28px; overflow: hidden; background: #E3E3E1; aspect-ratio: 1; }
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 899px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .hero-portrait { order: -1; max-width: 360px; width: 72%; border-radius: 22px; }
}

/* Load-in: staggered rise, once */
.js .load { opacity: 0; transform: translateY(16px); animation: rise 0.9s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 90ms + 80ms); }
.js .hero-portrait.load { transform: scale(0.98); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Facts ---------- */
.facts { padding-bottom: clamp(24px, 4vw, 48px); }
.facts-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.facts-grid > div { display: flex; flex-direction: column; padding: 28px 24px 8px 0; }
.facts-grid dt { font-size: 15px; font-weight: 500; color: var(--ink); }
.facts-grid dd { order: -1; font-size: clamp(40px, 5vw, 64px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; margin-bottom: 12px; }
.facts-grid p { font-size: 14px; color: var(--muted); max-width: 22ch; }
@media (max-width: 899px) { .facts-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Sections ---------- */
.section { padding-top: var(--section); padding-bottom: var(--section); }
.section-alt { background: var(--bg-alt); }
.section .h2 { margin-bottom: clamp(40px, 6vw, 80px); }

.profile-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(40px, 7vw, 112px); align-items: start; }
.profile-grid .h2 { margin-bottom: 32px; }
.glance { border-top: 1px solid var(--line); }
.glance > div { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.glance dt { color: var(--muted); }
@media (max-width: 899px) { .profile-grid { grid-template-columns: 1fr; } .glance > div { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Experience ---------- */
.timeline { border-top: 1px solid var(--line); }
.role { display: grid; grid-template-columns: 300px 1fr; gap: clamp(24px, 5vw, 80px); padding: clamp(40px, 5vw, 64px) 0; border-bottom: 1px solid var(--line); }
.role-dates { font-size: 14px; font-weight: 500; color: var(--muted); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.role-org { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.role-env { font-size: 14px; color: var(--muted); margin-top: 4px; }
.role h3 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 12px; }
.role-sum { font-size: 18px; color: var(--ink-2); margin-bottom: 24px; max-width: 64ch; }
.points li { position: relative; padding-left: 22px; margin-bottom: 10px; color: var(--ink-2); max-width: 70ch; }
.points li::before { content: ""; position: absolute; left: 0; top: 0.78em; width: 10px; height: 1.5px; background: var(--ink); transform: rotate(-56deg); }
.tags { margin-top: 20px; font-size: 14px; color: var(--muted); }
.metrics { display: flex; flex-wrap: wrap; gap: 16px 48px; margin-bottom: 24px; }
.metrics p { display: flex; flex-direction: column; }
.metrics strong { font-size: clamp(36px, 4vw, 52px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.metrics span { font-size: 14px; color: var(--muted); margin-top: 6px; }
@media (max-width: 899px) { .role { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- Projects ---------- */
.case { border-top: 1px solid var(--ink); padding: clamp(32px, 4vw, 48px) 0 clamp(56px, 7vw, 96px); }
.case-head { display: grid; grid-template-columns: 300px 1fr; gap: clamp(24px, 5vw, 80px); align-items: baseline; margin-bottom: clamp(24px, 3vw, 40px); }
.case-num { font-size: clamp(48px, 6vw, 88px); font-weight: 600; letter-spacing: -0.05em; line-height: 0.9; color: var(--ink); font-variant-numeric: tabular-nums; }
.case h3 { font-size: clamp(26px, 3vw, 40px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
.case-org { font-size: 15px; color: var(--muted); margin-top: 8px; }
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 48px; margin-left: calc(300px + clamp(24px, 5vw, 80px)); }
.case-grid .wide { grid-column: 1 / -1; }
.case-grid dt { font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.case-grid dd { color: var(--ink-2); }
.case-grid .outcome { background: var(--surface); border-radius: 18px; padding: 24px 28px; }
.case-grid .outcome dd { font-size: 19px; color: var(--ink); line-height: 1.5; }
.num { font-weight: 600; }
@media (max-width: 1079px) { .case-grid { margin-left: 0; } }
@media (max-width: 899px) { .case-head { grid-template-columns: 1fr; gap: 12px; } .case-grid { grid-template-columns: 1fr; } }

/* ---------- Capabilities ---------- */
.caps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.caps section { background: var(--surface); border-radius: 22px; padding: 28px; }
.caps h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 18px; }
.caps li { font-size: 15px; color: var(--ink-2); padding: 9px 0; border-top: 1px solid var(--line); }
.quals { margin-top: clamp(56px, 7vw, 96px); }
.quals h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 20px; }
.quals dl { border-top: 1px solid var(--line); }
.quals dl > div { display: grid; grid-template-columns: 160px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.quals dt { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 1079px) { .caps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 599px) { .caps { grid-template-columns: 1fr; } .quals dl > div { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- CV band ---------- */
.cv-band { background: var(--dark); color: var(--on-dark); padding: clamp(72px, 9vw, 120px) 0; }
.cv-band-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 32px; align-items: center; }
.cv-band img { height: 48px; width: auto; }
.cv-band .h2 { margin-bottom: 8px; }
.cv-band p { color: var(--on-dark-muted); }
.cv-band :focus-visible { outline-color: var(--on-dark); }
@media (max-width: 899px) { .cv-band-inner { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact .display { margin-bottom: 28px; }
.contact-list { margin-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); }
.contact-list li { display: grid; grid-template-columns: 160px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.contact-list span { color: var(--muted); font-size: 15px; }
.contact-list a, .contact-list p { font-size: clamp(20px, 2.4vw, 30px); font-weight: 500; letter-spacing: -0.02em; text-decoration: none; overflow-wrap: anywhere; }
.contact-list a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size 0.3s var(--ease); }
.contact-list a:hover { background-size: 100% 1.5px; }
@media (max-width: 599px) { .contact-list li { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; }
.site-footer .brand { color: var(--ink); }
.site-footer .brand img { height: 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 24px; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { color: var(--ink); }
.footer-inner > p { margin-left: auto; }

/* ---------- Scroll reveal (only when JS is running) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- CV page ---------- */
.cv-page { background: var(--bg-alt); }
.cv-bar { position: sticky; top: var(--header-h); z-index: 40; background: rgba(236, 235, 230, 0.97); border-bottom: 1px solid var(--line); }
.cv-bar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-top: 12px; padding-bottom: 12px; }
.cv-bar h1 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.cv-bar p { font-size: 13px; color: var(--muted); }
.cv-bar .actions { margin-left: auto; }
.sheet {
  background: var(--surface); max-width: 880px; margin: clamp(24px, 5vw, 56px) auto; padding: clamp(28px, 6vw, 72px);
  border-radius: 6px; box-shadow: 0 1px 2px rgba(17, 17, 17, 0.06), 0 12px 40px rgba(17, 17, 17, 0.06);
  font-size: 15px; line-height: 1.55; color: #1E1E1C;
}
.sheet-head { text-align: center; padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.sheet-head h2 { font-size: 30px; font-weight: 600; letter-spacing: 0.06em; }
.sheet-head .title { margin-top: 6px; font-weight: 500; }
.sheet-head .contact { margin-top: 4px; color: var(--muted); font-size: 14px; }
.sheet h3 { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.sheet h4 { font-size: 16px; font-weight: 600; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-top: 18px; }
.sheet h4 span { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.sheet .job { font-style: italic; margin-bottom: 6px; }
.sheet h5 { font-size: 15px; font-weight: 600; margin: 12px 0 4px; }
.sheet p + p { margin-top: 8px; }
.sheet ul.cv-list li { position: relative; padding-left: 16px; margin-bottom: 4px; }
.sheet ul.cv-list li::before { content: "•"; position: absolute; left: 0; }
.sheet .comp li { margin-bottom: 6px; }
.sheet .comp strong { font-weight: 600; }
.sheet .rows li { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; }
.cv-note { max-width: 880px; margin: 0 auto 56px; padding: 0 var(--gutter); font-size: 13px; color: var(--muted); text-align: center; }

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .site-header, .cv-bar, .site-footer, .cv-note, .skip, .menu { display: none !important; }
  .sheet { box-shadow: none; margin: 0; padding: 0; max-width: none; font-size: 10pt; }
  .sheet h3 { break-after: avoid; }
  .sheet h4, .sheet h5 { break-after: avoid; }
  .sheet li { break-inside: avoid; }
  .js [data-reveal], .js .load { opacity: 1 !important; transform: none !important; }
}

/* ---------- Reduced motion: everything visible, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
  .js .load, .js [data-reveal] { opacity: 1; transform: none; }
}

/* Cross-links from a role to its case studies */
.see { margin-top: 16px; font-size: 14px; }
.see a { color: var(--ink); text-underline-offset: 3px; }

/* Case study disclosure: context + outcome up front, detail on request */
.case-more { margin-left: calc(300px + clamp(24px, 5vw, 80px)); margin-top: 24px; }
.case-more > .case-grid { margin-left: 0; margin-top: 28px; }
.case-more summary {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 20px;
  border: 1px solid var(--line); border-radius: 999px; font-weight: 500; cursor: pointer; list-style: none;
  transition: border-color 0.2s;
}
.case-more summary::-webkit-details-marker { display: none; }
.case-more summary::after { content: "+"; font-size: 20px; line-height: 1; transition: transform 0.2s var(--ease); }
.case-more[open] summary::after { transform: rotate(45deg); }
.case-more summary:hover { border-color: var(--ink); }
.case-more[open] > .case-grid { animation: open-in 0.45s var(--ease) both; }
@keyframes open-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 1079px) { .case-more { margin-left: 0; } }

/* Phones: tighter rhythm so a recruiter can skim the whole page quickly */
@media (max-width: 599px) {
  :root { --section: 64px; }
  .section .h2 { margin-bottom: 32px; }
  .role { padding: 32px 0; }
  .role-sum { font-size: 17px; margin-bottom: 16px; }
  .metrics { gap: 12px 32px; margin-bottom: 16px; }
  .case { padding: 28px 0 40px; }
  .case-num { font-size: 40px; }
  .case-grid { gap: 20px; }
  .case-grid .outcome { padding: 18px 20px; }
  .case-grid .outcome dd { font-size: 17px; }
  .caps { gap: 12px; }
  .caps section { padding: 22px; }
  .caps li { padding: 6px 0; }
  .glance > div, .quals dl > div { padding: 12px 0; }
}

/* =====================================================================
   MOTION — all transform/opacity; scroll effects use CSS scroll-driven
   animations where supported (Chrome, Edge, Safari 26+) and fall back to
   a still page elsewhere. Everything is switched off for reduced motion.
   ===================================================================== */

/* Eyebrow diagonal tick — the logo's slash, drawn on load */
.slash { display: inline-block; width: 22px; height: 1.5px; background: currentColor; margin-right: 14px; vertical-align: middle; transform: rotate(-56deg); }
.js .slash { transform: rotate(-56deg) scaleX(0); animation: draw 0.7s var(--ease) 0.25s forwards; }
@keyframes draw { to { transform: rotate(-56deg) scaleX(1); } }

/* Word-by-word heading reveal (words are wrapped by site.js) */
[data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.08em 0 0.12em; margin: -0.08em 0 -0.12em; }
[data-split] .w > span { display: inline-block; }
.js [data-split].split .w > span { transform: translateY(110%) rotate(5deg); transform-origin: 0 100%; transition: transform 1s var(--ease); transition-delay: calc(var(--i) * 45ms); }
.js .hero-title.split .w > span { transition-delay: calc(var(--i) * 60ms + 120ms); }
.js [data-split].split.in .w > span { transform: none; }
/* Never leave a heading hidden if the script fails to run */
.js [data-split]:not(.split) { visibility: hidden; animation: failsafe 0s 2s forwards; }
@keyframes failsafe { to { visibility: visible; } }

/* Numbers */
[data-count] { font-variant-numeric: tabular-nums; }

/* Organisations marquee */
.orgs { padding: 8px 0 clamp(32px, 5vw, 56px); overflow: hidden; }
.orgs .eyebrow { margin-bottom: 16px; }
.marquee { display: flex; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.marquee-track { display: flex; flex-shrink: 0; gap: clamp(36px, 5vw, 72px); padding-right: clamp(36px, 5vw, 72px); animation: marquee 45s linear infinite; }
.marquee-track li { font-size: clamp(20px, 2.6vw, 34px); font-weight: 500; letter-spacing: -0.025em; color: var(--muted); white-space: nowrap; }
.marquee-track li::before { content: ""; display: inline-block; width: 14px; height: 1.5px; background: var(--ink); margin-right: clamp(36px, 5vw, 72px); vertical-align: middle; transform: rotate(-56deg); opacity: 0.5; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* Case studies: rule draws across, number slides in, outcome lifts */
.case { border-top: 0; position: relative; }
.case::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--ink); transform-origin: left; }
.js .case[data-reveal]::before { transform: scaleX(0); transition: transform 1.2s var(--ease); }
.js .case[data-reveal] .case-num { opacity: 0; transform: translateX(-28px); transition: opacity 0.9s var(--ease) 0.15s, transform 0.9s var(--ease) 0.15s; }
.js .case[data-reveal] .outcome { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease) 0.3s, transform 0.9s var(--ease) 0.3s; }
.js .case.in::before { transform: scaleX(1); }
.js .case.in .case-num, .js .case.in .outcome { opacity: 1; transform: none; }

/* Capability cards cascade in */
.js .caps [data-reveal] { transition-delay: calc(var(--i, 0) * 90ms); }

/* Scroll-driven extras */
@supports (animation-timeline: view()) {
  /* portrait drifts and slowly zooms as the hero scrolls away */
  .hero-portrait img { animation: drift linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
  @keyframes drift { from { transform: scale(1.03); } to { transform: translateY(9%) scale(1.12); } }

  /* experience timeline fills as you read down it */
  @media (min-width: 900px) {
    .timeline { position: relative; padding-left: 40px; }
    .timeline::before, .timeline::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--line); }
    .timeline::after { width: 2px; left: -0.5px; background: var(--ink); transform-origin: top; animation: fill linear both; animation-timeline: view(); animation-range: entry 40% cover 80%; }
    .role { position: relative; }
    .role::before { content: ""; position: absolute; left: -45px; top: calc(clamp(40px, 5vw, 64px) + 6px); width: 11px; height: 11px; border-radius: 50%; background: var(--bg-alt); border: 2px solid var(--ink); }
    @keyframes fill { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  }
}

/* =====================================================================
   PHONES & TABLETS
   ===================================================================== */
/* Keep content clear of the notch / rounded corners in landscape */
.wrap { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.site-footer { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
/* iOS Safari needs the lock on <html> as well as <body> */
html.menu-open { overflow: hidden; }
.menu { overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom); }
/* Tablets (iPad portrait and up) keep the side-by-side hero */
@media (min-width: 760px) and (max-width: 899px) {
  .hero { grid-template-columns: 1.35fr 0.65fr; padding-top: 48px; }
  .hero-portrait { order: 0; width: 100%; max-width: none; border-radius: 22px; }
}
/* Touch screens: bigger targets, no sticky hover lifts */
@media (pointer: coarse) {
  .btn-sm { min-height: 44px; }
  .nav a { padding: 12px 0; }
  .see a { display: inline-block; padding: 6px 0; }
}
@media (hover: none) {
  .btn:hover { transform: none; }
  .marquee:hover .marquee-track { animation-play-state: running; }
}

/* Reduced motion: words, numbers and lines appear in place; marquee becomes a static list */
@media (prefers-reduced-motion: reduce) {
  .js .slash, .js [data-split].split .w > span, .js .case[data-reveal] .case-num, .js .case[data-reveal] .outcome, .js .case[data-reveal]::before { transform: none; opacity: 1; animation: none; }
  .js .slash { transform: rotate(-56deg); }
  .marquee { flex-wrap: wrap; -webkit-mask-image: none; mask-image: none; }
  .marquee-track { animation: none; flex-wrap: wrap; row-gap: 8px; padding-left: var(--gutter); }
  .marquee-track[aria-hidden="true"] { display: none; }
  .hero-portrait img, .timeline::after { animation: none !important; }
}

/* =====================================================================
   ACCENT, HIGHLIGHTER, LINE ART, LOGO INTRO
   ===================================================================== */
:root { --accent: #E0362C; --kw: rgba(72, 132, 228, 0.24); }

/* Self-drawing line art: every stroke has pathLength="1" so one dash covers it */
.art { display: block; height: auto; overflow: visible; color: var(--ink); }
.art .ln { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.art .red { fill: var(--accent); transform-box: fill-box; transform-origin: center; }
.js .art .ln { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 110ms); }
.js .art .red { transform: scale(0); transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 1.1s; }
.js .art.in .ln { stroke-dashoffset: 0; }
.js .art.in .red { transform: scale(1); }
.art.in .blink { animation: blink 2.6s ease-in-out 1.8s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.hero-art { width: min(300px, 80%); margin-top: clamp(32px, 4vw, 48px); }
.contact-art { width: min(220px, 60%); margin-top: clamp(32px, 4vw, 48px); }

/* Logo intro — CSS only, so it always ends; site.js never touches it */
.intro { display: none; }
html.intro-on .intro {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 200; background: var(--bg);
  animation: intro-out 0.7s cubic-bezier(0.76, 0, 0.24, 1) 1.2s forwards;
}
.intro-mark { position: relative; }
.intro-mark svg { display: block; height: min(22vh, 150px); width: auto; overflow: visible; }
.intro-mark path { fill: var(--ink); fill-opacity: 0; stroke: var(--ink); stroke-width: 12; stroke-dasharray: 1; stroke-dashoffset: 1; animation: logo-draw 0.9s ease-in-out 0.1s forwards, logo-fill 0.35s ease 0.8s forwards; }
@keyframes logo-draw { to { stroke-dashoffset: 0; } }
@keyframes logo-fill { to { fill-opacity: 1; } }
@keyframes intro-out { to { transform: translateY(-100%); visibility: hidden; } }
/* While the intro plays, hold the hero's own entrance until the curtain lifts */
html.intro-on .load { animation-delay: calc(var(--d, 0) * 90ms + 1500ms); }
html.intro-on .slash { animation-delay: 1.65s; }
html.intro-on .hero-title.split .w > span { transition-delay: calc(var(--i) * 60ms + 1550ms); }
html.intro-on .hero-art .ln { transition-delay: calc(var(--i, 0) * 110ms + 1.9s); }
html.intro-on .hero-art .red { transition-delay: 3s; }

@media (prefers-reduced-motion: reduce) {
  .js .art .ln { stroke-dashoffset: 0; }
  .js .art .red { transform: none; }
  html.intro-on .intro { display: none; }
}

/* Keyword highlights: soft blue marker on the lower part of the words recruiters scan for */
mark.kw {
  color: inherit; background: linear-gradient(transparent 46%, var(--kw) 46%, var(--kw) 96%, transparent 96%) no-repeat 0 0 / 100% 100%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 0.08em; margin: 0 -0.08em;
}
/* swipe in left to right when its block scrolls into view */
.js [data-reveal] mark.kw { background-size: 0% 100%; transition: background-size 0.9s var(--ease) 0.45s; }
.js [data-reveal].in mark.kw { background-size: 100% 100%; }
/* the hero intro paragraph animates on load instead */
.js .lead mark.kw { background-size: 0% 100%; animation: kw-in 0.9s var(--ease) 1.1s forwards; }
html.intro-on .lead mark.kw { animation-delay: 2.5s; }
@keyframes kw-in { to { background-size: 100% 100%; } }
@media (prefers-reduced-motion: reduce) { .js mark.kw { background-size: 100% 100%; } }
@media print { mark.kw { background: none; } }
