/* iharsha.online — shared styles for the homepage, case studies, privacy and 404 pages. */

/* ---------- Fonts (self-hosted, SIL Open Font License — see /assets/fonts/OFL-*.txt) ---------- */
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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: "Geist Mono";
  src: url("/assets/fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
  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: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-italic-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  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;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --surface: #131315;
  --surface-2: #1a1a1d;
  --line: #26262a;
  --line-2: #34343a;
  --text: #f3f2ee;
  --muted: #a7a59f;
  --faint: #85837d;          /* 5.2:1 on --bg, 4.9:1 on --surface (WCAG AA) */
  --accent: #2b5cff;           /* energetic blue: white text on it 5.2:1 */
  --accent-ink: #ffffff;
  --ok: #6ee7a8;
  --error: #ff9d7e;
  --accent-text: #6b9bff;    /* accent used as text: 7.3:1 on --bg; deeper in light mode */
  --accent-soft: #101a33;    /* tinted surface behind accent badges */
  --term-bg: #0f0f11;
  --live: #3ddc84;
  --header-glass: rgba(11, 11, 12, .9);
  --info-bg: rgba(243,242,238,.06);
  --shadow: rgba(0,0,0,.35);
  --caption-k: #1d4ed8;      /* label on the inverted hero caption */
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  --serif: "Instrument Serif", Georgia, serif;
  --radius: 14px;
  --header-h: 68px;
}

/* Light theme: chosen with the header toggle and remembered on this device */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f2f0eb;
  --line: #e6e3dc;
  --line-2: #d5d1c7;
  --text: #161614;
  --muted: #55524c;          /* 7.4:1 on --bg */
  --faint: #6c6861;          /* 5.3:1 on --bg (WCAG AA) */
  --accent-text: #1d4ed8;    /* 6.4:1 on --bg (WCAG AA) */
  --accent-soft: #eaf0ff;
  --term-bg: #f6f4ef;
  --live: #16a34a;
  --ok: #15803d;
  --error: #b42318;
  --header-glass: rgba(250, 249, 246, .88);
  --info-bg: rgba(22,22,20,.04);
  --shadow: rgba(40,30,20,.14);
  --caption-k: #8db2ff;
}
/* Pages that run without JavaScript (the 404 page, or scripts turned off) follow the device setting */
@media (prefers-color-scheme: light) {
  html:not(.js):not([data-theme]) {
    color-scheme: light;
    --bg: #faf9f6;
    --surface: #ffffff;
    --surface-2: #f2f0eb;
    --line: #e6e3dc;
    --line-2: #d5d1c7;
    --text: #161614;
    --muted: #55524c;          /* 7.4:1 on --bg */
    --faint: #6c6861;          /* 5.3:1 on --bg (WCAG AA) */
    --accent-text: #1d4ed8;    /* 6.4:1 on --bg (WCAG AA) */
    --accent-soft: #eaf0ff;
    --term-bg: #f6f4ef;
    --live: #16a34a;
    --ok: #15803d;
    --error: #b42318;
    --header-glass: rgba(250, 249, 246, .88);
    --info-bg: rgba(22,22,20,.04);
    --shadow: rgba(40,30,20,.14);
    --caption-k: #8db2ff;
  }
}


/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, picture, svg { display: block; max-width: 100%; }
img { height: auto; }
/* <picture> wrappers must fill fixed-ratio frames so object-fit can crop the image */
.cover > picture, .frame > picture, .photo > picture, .cs-figure > picture { width: 100%; height: 100%; }
ul, ol { list-style: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: -100px; z-index: 100;
  background: var(--text); color: var(--bg); font-weight: 600;
  padding: 10px 16px; border-radius: 10px; transition: top .15s;
}
.skip-link:focus { top: 12px; }

/* Visible keyboard focus everywhere; outlines follow each element's own rounded shape. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.on-accent :focus-visible, .btn-accent:focus-visible, .nav-cta:focus-visible { outline-color: var(--text); }
.contact-card :focus-visible { outline-color: var(--accent-ink); }

/* Reveal on scroll — only when JS runs; never hides content in print. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  border-bottom: 1px solid transparent;
  transition: background .25s, border-color .25s;
}
.site-header.scrolled, .site-header.open {
  background: var(--header-glass);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.nav { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; border-radius: 8px; }
.brand-mark { width: 32px; height: 32px; flex-shrink: 0; }
.brand { margin-right: auto; }

/* Theme toggle */
.theme-toggle { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; transition: border-color .2s, background .2s; }
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle svg { width: 18px; height: 18px; transition: transform .5s cubic-bezier(.2,.75,.2,1); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
.theme-toggle:active svg { transform: rotate(-30deg) scale(.9); }
/* smooth colour change only while switching, so normal scrolling stays cheap */
html.theme-switching, html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease !important; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; color: var(--muted); }
.nav-links a { border-radius: 6px; transition: color .15s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-cta {
  color: var(--accent-ink) !important; background: var(--accent);
  padding: 8px 16px; border-radius: 999px !important; font-weight: 500;
}
.nav-cta:hover { opacity: .9; }
.menu-btn {
  display: none; width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--line-2); background: transparent; color: var(--text);
  place-items: center; cursor: pointer;
}
.menu-btn svg { width: 20px; height: 20px; }
.menu-btn .icon-close { display: none; }
.menu-btn[aria-expanded="true"] .icon-open { display: none; }
.menu-btn[aria-expanded="true"] .icon-close { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-size: 15px; font-weight: 500; line-height: 1.2;
  border: 1px solid var(--line-2); background: transparent; cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s, opacity .15s;
}
.btn:hover { border-color: var(--muted); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-accent { background: var(--accent); border-color: var(--accent-text); color: var(--accent-ink); }
.btn-accent:hover { border-color: var(--accent-text); transform: translateY(-1px); }
.btn-light { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.text-link { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.text-link:hover { text-decoration-thickness: 2px; }

/* ---------- Hero ---------- */
.hero { padding: calc(var(--header-h) + 72px) 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 64px; align-items: center; }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 14px 6px 10px;
}
.status-row { display: flex; flex-wrap: wrap; gap: 10px; }
.status.cert { color: var(--text); background: var(--accent-soft); border-color: rgba(43,92,255,.5); transition: border-color .2s, transform .2s; }
.status.cert:hover { border-color: var(--accent); transform: translateY(-1px); }
.status.cert svg { width: 17px; height: 17px; flex: none; color: var(--accent); }
.js .hero .status.cert { animation-delay: .08s; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61,220,132,.5); } 70% { box-shadow: 0 0 0 8px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }
h1 {
  margin-top: 28px;
  font-size: clamp(42px, 7.2vw, 94px);
  line-height: .96; letter-spacing: -0.045em; font-weight: 600;
}
h1 em { color: var(--accent-text); font-size: 1.04em; }
.hero-sub { margin-top: 28px; font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 590px; line-height: 1.55; }
.hero-sub strong { color: var(--text); font-weight: 500; }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-photo { position: relative; }
.hero-photo .frame { aspect-ratio: 4 / 5; border-radius: 20px; overflow: hidden; background: var(--surface); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.hero-photo .caption {
  position: absolute; left: -28px; bottom: 32px; max-width: 260px;
  background: var(--text); color: var(--bg); border-radius: 12px; padding: 14px 16px;
  font-size: 14px; line-height: 1.4; box-shadow: 0 20px 40px var(--shadow);
}
.caption .k { display: block; margin-bottom: 4px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--caption-k); }

/* ---------- Hero entrance (movement only: text is never hidden, so loading speed is unaffected) ---------- */
h1 .ln { display: block; }
h1 em { position: relative; display: inline-block; }
h1 em::after { content: ""; position: absolute; left: 2%; right: 4%; bottom: .02em; height: .06em; border-radius: 1em; background: var(--accent); transform-origin: left; transform: scaleX(0); animation: underline-draw .7s .75s cubic-bezier(.65,0,.35,1) forwards; }
.js .hero h1 .ln { animation: line-up .8s cubic-bezier(.2,.75,.2,1) both; }
.js .hero h1 .ln:nth-child(2) { animation-delay: .07s; }
.js .hero h1 .ln:nth-child(3) { animation-delay: .14s; }
.js .hero h1 .ln:nth-child(4) { animation-delay: .21s; }
.js .hero .status, .js .hero .hero-sub, .js .hero .hero-actions { animation: fade-up .7s cubic-bezier(.2,.75,.2,1) both; }
.js .hero .status { animation-delay: 0s; }
.js .hero .hero-sub { animation-delay: .3s; }
.js .hero .hero-actions { animation-delay: .4s; }
.js .hero-photo .frame { animation: photo-settle 1.1s cubic-bezier(.2,.75,.2,1) both; }
.js .hero-photo .caption { animation: fade-up .7s .6s cubic-bezier(.2,.75,.2,1) both; }
@keyframes line-up { from { transform: translateY(.45em); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes photo-settle { from { transform: scale(1.05); } to { transform: none; } }
@keyframes underline-draw { to { transform: scaleX(1); } }

/* ---------- Pipeline lights up step by step when scrolled into view ---------- */
.pipeline li { transition: border-color .4s, background .4s, box-shadow .4s; }
.js .pipeline.play li { animation: step-on 1.4s ease both; }
.js .pipeline.play li:nth-child(2) { animation-delay: .25s; }
.js .pipeline.play li:nth-child(3) { animation-delay: .5s; }
.js .pipeline.play li:nth-child(4) { animation-delay: .75s; }
.js .pipeline.play li:nth-child(5) { animation-delay: 1s; }
.js .pipeline.play li:nth-child(6) { animation-delay: 1.25s; }
.js .pipeline.play li:not(:last-child)::after { transform-origin: left; animation: connector 1.4s ease both; }
.js .pipeline.play li:nth-child(2)::after { animation-delay: .25s; }
.js .pipeline.play li:nth-child(3)::after { animation-delay: .5s; }
.js .pipeline.play li:nth-child(4)::after { animation-delay: .75s; }
.js .pipeline.play li:nth-child(5)::after { animation-delay: 1s; }
@keyframes step-on {
  0% { border-color: var(--line); }
  35% { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent), 0 12px 32px rgba(43,92,255,.18); background: var(--accent-soft); }
  100% { border-color: rgba(43,92,255,.35); box-shadow: none; background: var(--surface-2); }
}
@keyframes connector { 0% { background: var(--line-2); transform: scaleX(0); } 35% { background: var(--accent); transform: scaleX(1); } 100% { background: rgba(43,92,255,.5); transform: scaleX(1); } }

/* ---------- Reading progress + current section in the menu ---------- */
.scroll-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(var(--read, 0)); pointer-events: none; }
.nav-links a.is-current:not(.nav-cta) { color: var(--text); }
.nav-links a:not(.nav-cta) { position: relative; }
.nav-links a.is-current:not(.nav-cta)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: var(--accent); }

/* ---------- Magnetic buttons (mouse only) ---------- */
.magnetic { transition: transform .25s cubic-bezier(.2,.75,.2,1), background .15s, border-color .15s, opacity .15s; will-change: transform; }

/* ---------- Ticker (pausable; static list when motion is reduced) ---------- */
.ticker { position: relative; display: flex; align-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ticker-viewport { flex: 1; overflow: hidden; padding: 18px 0; }
.ticker-track { display: flex; width: max-content; animation: ticker 40s linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track, .ticker.paused .ticker-track { animation-play-state: paused; }
.ticker-track li { display: flex; align-items: center; gap: 44px; padding: 0 22px; font-size: 15px; color: var(--muted); white-space: nowrap; }
.ticker-track li::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
@keyframes ticker { to { transform: translateX(-50%); } }
.ticker-toggle {
  flex-shrink: 0; margin: 0 16px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--muted);
}
.ticker-toggle:hover { color: var(--text); }
.ticker-toggle svg { width: 14px; height: 14px; }
.ticker-toggle .icon-play { display: none; }
.ticker.paused .ticker-toggle .icon-play { display: block; }
.ticker.paused .ticker-toggle .icon-pause { display: none; }

/* ---------- Sections ---------- */
section { padding: 120px 0 0; }
.kicker { font-family: var(--mono); font-size: 13px; color: var(--accent-text); text-transform: uppercase; letter-spacing: .1em; }
h2 { margin-top: 16px; font-size: clamp(32px, 4.4vw, 56px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 600; max-width: 840px; }
.lead { margin-top: 20px; font-size: 18px; color: var(--muted); max-width: 660px; }
.head { margin-bottom: 56px; }
.sub-head { margin: 56px 0 18px; font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.sub-head:first-child { margin-top: 0; }

/* Copilot Studio feature */
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 48px; }
.feature-top { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; margin-bottom: 44px; }
.feature h3 { font-size: clamp(26px, 3vw, 36px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 600; }
.feature-top p { color: var(--muted); font-size: 16.5px; }
.pipeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; counter-reset: step; }
.pipeline li { position: relative; padding: 18px 16px 20px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.pipeline li::before { counter-increment: step; content: "0" counter(step); font-family: var(--mono); font-size: 12px; color: var(--accent-text); }
.pipeline li:not(:last-child)::after { content: ""; position: absolute; top: 26px; right: -13px; width: 14px; height: 1px; background: var(--line-2); }
.pipeline b { display: block; margin: 10px 0 6px; font-size: 15px; font-weight: 600; }
.pipeline span { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.surfaces { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.surfaces .lbl { margin-right: 6px; font-family: var(--mono); font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.chip { font-size: 13px; border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px; }

/* Capabilities */
.caps { margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cap { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; transition: border-color .2s, background .2s; }
.cap:hover { border-color: var(--line-2); background: var(--surface); }
.ico { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--accent-text); }
.ico svg { width: 20px; height: 20px; }
.cap h3 { margin: 20px 0 8px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.cap p { color: var(--muted); font-size: 15px; }
.tools { margin-top: 16px; font-family: var(--mono); font-size: 12px; color: var(--faint); line-height: 1.8; }

/* Full applications */
.apps {
  margin-top: 16px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px;
  border: 1px solid var(--line); border-radius: 24px; padding: 48px;
  background: linear-gradient(180deg, var(--surface), var(--bg));
}
.apps h3 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.12; letter-spacing: -0.03em; font-weight: 600; }
.apps-intro p { margin-top: 14px; color: var(--muted); }
.apps-list { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 32px; }
.apps-list li { padding-top: 16px; border-top: 1px solid var(--line-2); }
.apps-list b { display: block; margin-bottom: 6px; font-weight: 600; }
.apps-list span { color: var(--muted); font-size: 15px; }

/* Initiatives */
.initiatives { border-top: 1px solid var(--line); }
.initiatives li { display: grid; grid-template-columns: 56px 1fr 1.3fr; gap: 24px; align-items: baseline; padding: 28px 0; border-bottom: 1px solid var(--line); }
.initiatives .n { font-family: var(--mono); font-size: 13px; color: var(--faint); }
.initiatives h3 { font-size: clamp(20px, 2.2vw, 26px); font-weight: 500; letter-spacing: -0.02em; }
.initiatives p { color: var(--muted); }
.callout {
  margin-top: 32px; display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 22px 26px; border: 1px dashed var(--line-2); border-radius: var(--radius);
  color: var(--muted); transition: border-color .2s, background .2s;
}
.callout:hover { border-color: var(--accent-text); background: var(--surface); }
.callout strong { color: var(--accent-text); font-weight: 500; white-space: nowrap; }

/* ---------- Work ---------- */
.projects { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.projects .sub-head { grid-column: 1 / -1; }
.proj {
  position: relative; grid-column: span 3; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  transition: border-color .2s, transform .25s;
}
.proj:hover, .proj:focus-within { border-color: var(--line-2); }
.proj:hover { transform: translateY(-3px); }
.proj.wide { grid-column: span 6; display: grid; grid-template-columns: 1.1fr 1fr; }
.proj.small { grid-column: span 2; }
.proj .cover { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.proj .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.proj:hover .cover img { transform: scale(1.04); }
.proj .cover.top img { object-position: 50% 0; }
.proj.wide .cover { aspect-ratio: auto; min-height: 340px; }
.proj .body { display: flex; flex-direction: column; flex: 1; padding: 26px 28px 28px; }
.proj.wide .body { justify-content: center; padding: 44px; }
.meta { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.meta .win { color: var(--accent-text); }
.proj h4 { margin: 14px 0 10px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.proj.wide h4 { font-size: clamp(26px, 3vw, 34px); }
.proj h4 a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.proj h4 a:focus-visible { outline: none; }
.proj h4 a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 18px; }
.proj p { color: var(--muted); font-size: 15px; flex: 1; }
.foot { margin-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.go { display: inline-flex; gap: 14px; position: relative; z-index: 2; font-size: 14px; white-space: nowrap; }
.go a { color: var(--text); border-radius: 4px; }
.go a:hover, .go a.primary { color: var(--accent-text); }
.go span { color: var(--text); }

.term { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 32px; font-family: var(--mono); font-size: 13.5px; background: var(--term-bg); border-right: 1px solid var(--line); }
.term .bar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.term .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.term .bar .tag { margin-left: auto; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 8px; }
.term .prompt { color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 16px; line-height: 1.5; }
.term .prompt::before { content: "› "; color: var(--accent-text); }
.term .step { display: flex; gap: 10px; color: var(--muted); }
.term .step::before { content: "✓"; color: var(--live); }
.term .step b { color: var(--text); font-weight: 400; }
/* Live agent demo (JS only): prompt types itself, then each tool call runs and completes */
.term .caret { display: inline-block; width: .55em; height: 1.1em; margin-left: 1px; vertical-align: -.2em; background: var(--accent); animation: caret-blink 1s steps(1) infinite; }
.term.live .step { opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease; }
.term.live .step.run, .term.live .step.done { opacity: 1; transform: none; }
.term .step .res { transition: opacity .3s ease; }
.term .step.run .res { opacity: 0; }
.term .step.run::before { content: ""; width: 11px; height: 11px; margin: 3px 1px 0; border: 1.5px solid var(--line-2); border-top-color: var(--accent-text); border-radius: 50%; animation: spin .7s linear infinite; flex: none; }
.term .step.done::before { animation: tick-pop .35s cubic-bezier(.2,.9,.3,1.4); }
@keyframes caret-blink { 50% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes tick-pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
/* Illustrations used as case-study figures */
.cs-figure > .rev, .cs-figure > .xlate { border-bottom: 1px solid var(--line); padding: 28px 30px; gap: 10px; font-size: 13px; }
.cs-figure img { width: 100%; max-height: 560px; object-fit: cover; }
.mono-sm { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }

/* Code-review illustration on the CodeReview Pro card */
.rev { --bad: #ff7b7b; --warn: #f5b041; --good: #3ddc84; display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 16px 18px; background: var(--term-bg); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; }
:root[data-theme="light"] .rev { --bad: #b42318; --warn: #7a4a00; --good: #0f6a34; }
.rev-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--faint); }
.rev-bar .tag { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.rev-code { margin: 0; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.rev-code .ln { color: var(--faint); margin-right: 10px; }
.rev-note { display: flex; gap: 8px; align-items: baseline; padding: 5px 9px; border-radius: 7px; border-left: 2px solid currentColor; color: var(--muted); white-space: nowrap; overflow: hidden; }
.rev-note span { overflow: hidden; text-overflow: ellipsis; }
.rev-note b { flex: none; font-weight: 500; }
.rev-note.bad { border-color: var(--bad); background: rgba(229,72,77,.07); } .rev-note.bad b { color: var(--bad); }
.rev-note.warn { border-color: var(--warn); background: rgba(245,176,65,.07); } .rev-note.warn b { color: var(--warn); }
.rev-note.ok { border-color: var(--good); background: rgba(61,220,132,.07); } .rev-note.ok b { color: var(--good); }

/* Code-conversion illustration on the XAI-MCC card */
.xlate { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 18px 20px; background: var(--term-bg); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; }
.xlate .code { position: relative; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface-2); }
.xlate .out { border-color: rgba(43,92,255,.5); box-shadow: 0 0 0 3px rgba(43,92,255,.08); }
.xlate pre { margin: 0; font: inherit; line-height: 1.55; color: var(--text); white-space: pre; overflow: hidden; }
.xlate .lang { position: absolute; top: 9px; right: 11px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.xlate .out .lang { color: var(--accent-text); }
.xlate .arrow { align-self: center; color: var(--accent-text); font-size: 15px; line-height: 1; }


/* ---------- Experience timeline ---------- */
.exp-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 64px; }
.exp-side { position: sticky; top: calc(var(--header-h) + 42px); align-self: start; }
.exp-side .photo { margin-top: 36px; max-width: 340px; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; }
.exp-side .photo img { width: 100%; height: 100%; object-fit: cover; }
.timeline { position: relative; border-left: 1px solid var(--line-2); margin-left: 6px; }
.job { position: relative; padding: 0 0 44px 34px; }
.job:last-child { padding-bottom: 0; }
.job::before { content: ""; position: absolute; left: -6px; top: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-2); }
.job.current::before { background: var(--accent); border-color: var(--accent-text); box-shadow: 0 0 0 4px rgba(43,92,255,.18); }

/* Experience scroll animation: the line draws as you scroll, roles slide in, dots light up. */
.timeline::after { content: ""; position: absolute; left: -1px; top: 0; width: 2px; height: calc(var(--tl, 0) * 100%); background: linear-gradient(var(--accent), rgba(43,92,255,.35)); border-radius: 2px; }
.job::before { z-index: 1; transition: background .4s, border-color .4s, box-shadow .4s, transform .4s; }
#experience { overflow-x: clip; } /* roles slide in from the right; keep that off-screen start from widening the page */
.js .timeline .job { opacity: 0; transform: translateX(32px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.js .timeline .job.is-in { opacity: 1; transform: none; }
.js .timeline .job .bullets li, .js .timeline .job p { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.js .timeline .job.is-in .bullets li, .js .timeline .job.is-in p { opacity: 1; transform: none; }
.js .timeline .job.is-in p { transition-delay: .15s; }
.js .timeline .job.is-in .bullets li:nth-child(1) { transition-delay: .2s; }
.js .timeline .job.is-in .bullets li:nth-child(2) { transition-delay: .3s; }
.js .timeline .job.is-in .bullets li:nth-child(3) { transition-delay: .4s; }
.js .timeline .job.is-in .bullets li:nth-child(4) { transition-delay: .5s; }
.js .timeline .job.is-in .bullets li:nth-child(5) { transition-delay: .6s; }
.job.is-active::before { background: var(--accent); border-color: var(--accent-text); transform: scale(1.3); box-shadow: 0 0 0 5px rgba(43,92,255,.2); }
.job.is-active h3 { color: var(--text); }
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.job-head .when { padding-top: 4px; }
.job-id { display: flex; align-items: center; gap: 14px; }
.mark { flex: none; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: .02em; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); transition: border-color .4s, color .4s, background .4s; }
.job.current .mark, .job.is-active .mark { border-color: rgba(43,92,255,.55); color: var(--accent-text); background: var(--accent-soft); }
.tags { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; }
.js .timeline .job .tags { opacity: 0; transition: opacity .6s ease .5s; }
.js .timeline .job.is-in .tags { opacity: 1; }
.bullets strong, .job p strong, .cap p strong, .initiatives p strong { color: var(--text); font-weight: 500; }

/* Research papers */
.papers { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.paper { display: flex; flex-direction: column; gap: 18px; padding: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; transition: border-color .25s; }
.paper:hover { border-color: var(--line-2); }
.p-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.p-pub { font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: .04em; color: var(--accent-text); border: 1px solid rgba(43,92,255,.45); background: var(--accent-soft); border-radius: 999px; padding: 4px 12px; }
.p-type { font-family: var(--mono); font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.paper h3 { font-size: clamp(20px, 2vw, 24px); font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; }
.p-sum { color: var(--muted); font-size: 15.5px; }
.p-sum strong { color: var(--text); font-weight: 500; }
.p-meta { display: grid; gap: 0; border-top: 1px solid var(--line); }
.p-meta > div { display: grid; grid-template-columns: 92px 1fr; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.p-meta dt { font-family: var(--mono); font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.p-meta dd { color: var(--muted); }
.p-meta dd b { color: var(--text); font-weight: 500; }
.p-meta .mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }
.p-links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.p-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 14px; transition: border-color .2s, background .2s; }
.p-link:hover { border-color: var(--accent-text); background: var(--accent-soft); }
.p-link:first-child { background: var(--text); color: var(--bg); border-color: var(--text); }
.p-link:first-child:hover { background: var(--accent); border-color: var(--accent-text); color: var(--accent-ink); }

/* Cursor spotlight on cards (mouse only, added by JS) */
.spot.spot-on { background-image: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(43,92,255,.09), transparent 42%); }
.spot { transition: border-color .25s, background-color .25s, transform .25s; }
.spot.spot-on { border-color: rgba(43,92,255,.28); }

/* Research cards: detail rows slide in one after another, publisher badge glows once */
.js .paper .p-meta > div, .js .paper .p-links { opacity: 0; transform: translateX(-12px); transition: opacity .5s ease, transform .5s cubic-bezier(.2,.75,.2,1); }
.js .paper.in .p-meta > div, .js .paper.in .p-links { opacity: 1; transform: none; }
.js .paper.in .p-meta > div:nth-child(1) { transition-delay: .25s; }
.js .paper.in .p-meta > div:nth-child(2) { transition-delay: .33s; }
.js .paper.in .p-meta > div:nth-child(3) { transition-delay: .41s; }
.js .paper.in .p-meta > div:nth-child(4) { transition-delay: .49s; }
.js .paper.in .p-meta > div:nth-child(5) { transition-delay: .57s; }
.js .paper.in .p-links { transition-delay: .7s; }
.js .paper.in .p-pub { animation: badge-glow 1.8s .3s ease both; }
@keyframes badge-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(43,92,255,0); } 40% { box-shadow: 0 0 0 6px rgba(43,92,255,.16), 0 0 24px rgba(43,92,255,.35); } }

/* At a glance: the four facts a recruiter looks for first */
.glance { border-bottom: 1px solid var(--line); }
.glance-list { display: grid; grid-template-columns: repeat(4, 1fr); }
.glance-list li { display: flex; flex-direction: column; gap: 6px; padding: 34px 28px; border-left: 1px solid var(--line); }
.glance-list li:first-child { border-left: 0; padding-left: 0; }
.g-k { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.glance-list b { font-size: clamp(20px, 1.9vw, 25px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.glance-list li:first-child b { color: var(--accent-text); }
.g-s { font-size: 14px; color: var(--muted); line-height: 1.45; }

/* Initiatives: area label + hover */
.initiatives .area { display: inline-block; margin-top: 8px; font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.initiatives .n { transition: color .25s; }
.initiatives li:hover .n { color: var(--accent-text); }
.job h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.org { margin-top: 2px; color: var(--muted); }
.when { font-family: var(--mono); font-size: 13px; color: var(--faint); white-space: nowrap; }
.job p { margin-top: 12px; color: var(--muted); }
.now { display: inline-block; margin-left: 10px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-family: var(--mono); font-size: 11px; font-weight: 500; vertical-align: 3px; }
.bullets { margin-top: 14px; display: grid; gap: 8px; }
.bullets li { position: relative; padding-left: 20px; color: var(--muted); }
.bullets li::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 1px; background: var(--accent); }
.earlier { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; color: var(--muted); }
.earlier b { color: var(--text); font-weight: 500; }
.job .proof { margin-top: 10px; font-size: 14px; }

/* ---------- Process ---------- */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: phase; }
.process li { position: relative; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.process li::before { counter-increment: phase; content: "0" counter(phase); display: block; font-family: var(--mono); font-size: 13px; color: var(--accent-text); }
.process h3 { margin: 14px 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.process p { color: var(--muted); font-size: 15px; }
.process li:not(:last-child)::after { content: "→"; position: absolute; right: -14px; top: 28px; color: var(--faint); font-size: 14px; }

/* ---------- Recognition ---------- */
.rec-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 64px; align-items: start; }
.rec-photo { position: sticky; top: calc(var(--header-h) + 42px); border-radius: 18px; overflow: hidden; }
.rec-photo img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: 35% 50%; }
.awards li { display: grid; grid-template-columns: 72px 1fr; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.awards li:first-child { border-top: 1px solid var(--line); }
.yr { padding-top: 3px; font-family: var(--mono); font-size: 13px; color: var(--faint); }
.awards h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.place { color: var(--accent-text); }
.awards p { margin-top: 4px; color: var(--muted); font-size: 15px; }

/* ---------- Toolkit ---------- */
.stack-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.stack-grid div { background: var(--bg); padding: 26px; }
.stack-grid dt { font-family: var(--mono); font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.stack-grid dd { margin-top: 10px; font-size: 15.5px; line-height: 1.55; }

/* ---------- Testimonials (section stays hidden until real quotes are added) ---------- */
.quotes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.quote { padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.quote blockquote { font-size: 19px; line-height: 1.5; letter-spacing: -0.01em; }
.quote figcaption { margin-top: 18px; color: var(--muted); font-size: 14px; }
.quote figcaption b { color: var(--text); font-weight: 500; }

/* ---------- More about me: optional detail after the contact section ---------- */
.mp-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -28px 0 28px; }
.mp-filters button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.mp-filters button:hover { color: var(--text); border-color: var(--muted); }
.mp-filters button span { font-family: var(--mono); font-size: 12px; opacity: .7; }
.mp-filters button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.mp-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mp { display: flex; flex-direction: column; gap: 12px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.mp[hidden] { display: none; }
.mp.mp-in { animation: mp-in .35s ease both; }
@keyframes mp-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mp-top { display: flex; align-items: center; gap: 10px; }
.mp-ico { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.mp-ico svg { width: 18px; height: 18px; }
.mp-cat { font-family: var(--mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.mp h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.mp p { flex: 1; font-size: 15px; color: var(--muted); }
.mp-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.mp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-tags span { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 3px 9px; border: 1px solid var(--line-2); border-radius: 999px; }
.mp-link { font-size: 14px; color: var(--text); white-space: nowrap; border-radius: 4px; }
.mp-link:hover { color: var(--accent-text); }

.more-intro { padding-top: 56px; border-top: 1px solid var(--line); }
.more-intro p { margin-top: 12px; max-width: 560px; font-size: 18px; color: var(--muted); }
.more-intro + section { padding-top: 56px; }
main > section:last-child { padding-bottom: 120px; }

/* ---------- Photo gallery: pinned horizontal scroll with parallax ----------
   Without JS or with reduced motion it is a plain swipeable row. */
.gallery { position: relative; padding: 120px 0 0; }
.gallery-head { margin-bottom: 40px; }
.gallery-track { display: flex; gap: 20px; padding: 0 16px 8px; overflow-x: auto; scroll-snap-type: x mandatory; }
.g-item { flex: 0 0 auto; width: clamp(220px, 62vw, 340px); aspect-ratio: 3 / 4; margin: 0; border-radius: 18px; overflow: hidden; background: var(--surface); scroll-snap-align: center; }
.g-item picture, .g-item img { width: 100%; height: 100%; }
.g-item img { object-fit: cover; object-position: 50% 12%; }
.gallery-progress { display: none; }

.gallery.is-live { padding: 0; height: var(--gallery-h, 300vh); }
.gallery.is-live .gallery-sticky { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.gallery.is-live .gallery-head { margin-bottom: clamp(20px, 4vh, 44px); }
.gallery.is-live .gallery-track { overflow: visible; scroll-snap-type: none; padding: 0 max(16px, calc((100vw - 1200px) / 2 + 32px)); gap: clamp(16px, 2.4vw, 32px); will-change: transform; }
.gallery.is-live .g-item { width: clamp(200px, 26vw, 360px); max-height: 62vh; aspect-ratio: 3 / 4; will-change: transform, clip-path; box-shadow: 0 30px 60px rgba(0,0,0,.45); }
.gallery.is-live .g-item img { transform: scale(1.1); transform-origin: 50% 0; will-change: transform; }
.gallery.is-live .gallery-progress { display: block; margin-top: clamp(20px, 4vh, 40px); }
.gallery-progress span { display: block; height: 2px; width: 100%; background: var(--line-2); position: relative; overflow: hidden; border-radius: 2px; }
.gallery-progress span::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(var(--gallery-p, 0)); }

/* Gentle scroll zoom on single photos */
.js [data-parallax] img { transform: scale(var(--px-scale, 1.08)); transition: transform .1s linear; will-change: transform; }

/* ---------- Background ---------- */
.bg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.list-title { margin-bottom: 14px; font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.list-title + .plain + .list-title { margin-top: 36px; }
.plain li { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.plain li:first-child { border-top: 1px solid var(--line); }
.plain .sub { color: var(--muted); font-size: 14.5px; }
.plain a { color: var(--accent-text); font-size: 14px; white-space: nowrap; border-radius: 4px; }
.plain a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Contact ---------- */
.contact { padding: 140px 0 120px; }
.contact-card {
  background: var(--accent); color: var(--accent-ink); border-radius: 28px; padding: 64px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px;
}
.contact-card > * { min-width: 0; }
.contact-card h2 { margin: 0; color: var(--accent-ink); font-size: clamp(34px, 4.6vw, 60px); }
.contact-card h2 em { color: var(--accent-ink); }
.contact-intro p { margin-top: 18px; font-size: 18px; max-width: 520px; color: #ffffff; }
.book { margin-top: 32px; padding: 24px; border-radius: 18px; background: rgba(4,12,40,.16); }
.book h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.book p { margin: 6px 0 16px; font-size: 15px; color: #ffffff; }
.btn-ink { background: #0a1433; border-color: #0a1433; color: #ffffff; }
.btn-ink:hover { border-color: #0a1433; opacity: .9; }
.direct { margin-top: 28px; display: grid; gap: 4px; }
.direct a {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.32); font-size: 16px; font-weight: 500;
  overflow-wrap: anywhere; border-radius: 4px;
}
.direct a span:last-child { flex-shrink: 0; font-family: var(--mono); font-size: 13px; color: #ffffff; }
.direct a:hover { padding-left: 6px; }

.form-card { padding: 32px; border-radius: 20px; background: var(--bg); color: var(--text); }
.form-card h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.form-card .hint { margin-top: 6px; font-size: 14px; color: var(--muted); }
.form-card :focus-visible { outline-color: var(--accent-text); }
.field { margin-top: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.field .opt { color: var(--faint); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text);
  transition: border-color .15s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent-text); }
.field [aria-invalid="true"] { border-color: var(--error); }
.field-error { margin-top: 6px; font-size: 13.5px; color: var(--error); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-actions { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.form-note { font-size: 13px; color: var(--muted); }
.form-status { margin-top: 16px; padding: 14px 16px; border-radius: 10px; font-size: 15px; }
.form-status.ok { background: rgba(110,231,168,.1); border: 1px solid rgba(110,231,168,.4); color: var(--ok); }
.form-status.info { background: var(--info-bg); border: 1px solid var(--line-2); color: var(--text); }
.form-status.error { background: rgba(255,157,126,.08); border: 1px solid rgba(255,157,126,.4); color: var(--error); }
.form-status a { color: inherit; text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 13px; color: var(--faint); }
.chat-ready .site-footer { padding-bottom: 96px; } /* keep footer links clear of the chat button */
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { border-radius: 4px; }
.site-footer a:hover { color: var(--text); }

/* ---------- Chat launcher (Tidio loads only after a click) ---------- */
.chat-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 30;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 20px 0 16px; border-radius: 999px; cursor: pointer;
  background: var(--text); color: var(--bg); border: 0; font-weight: 600; font-size: 15px;
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
.chat-launcher svg { width: 20px; height: 20px; }
.chat-launcher:hover { transform: translateY(-1px); }
.chat-launcher[aria-busy="true"] { opacity: .75; cursor: progress; }
.chat-error { position: fixed; right: 20px; bottom: 84px; z-index: 30; max-width: 300px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 14px; color: var(--text); }
.chat-error a { color: var(--accent-text); text-decoration: underline; }

/* ---------- Inner pages: case studies, privacy, 404 ---------- */
.page-hero { padding: calc(var(--header-h) + 72px) 0 56px; border-bottom: 1px solid var(--line); }
.page-hero h1 { margin-top: 18px; font-size: clamp(38px, 5.6vw, 72px); line-height: 1; }
.page-hero .lead { font-size: 19px; }
.crumbs { font-family: var(--mono); font-size: 13px; color: var(--faint); }
.crumbs a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.cs-layout { display: grid; grid-template-columns: 280px 1fr; gap: 64px; padding: 64px 0 0; }
.cs-facts { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; display: grid; gap: 18px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cs-facts dt { font-family: var(--mono); font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.cs-facts dd { margin-top: 4px; font-size: 15px; }
.cs-facts a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.cs-body > section { padding: 0 0 56px; }
.cs-body h2 { margin-top: 10px; font-size: clamp(26px, 3vw, 36px); }
.cs-body p, .cs-body li { color: var(--muted); font-size: 17px; }
.cs-body p + p { margin-top: 14px; }
.cs-body .bullets { margin-top: 18px; }
.cs-figure { margin-top: 24px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.cs-figure figcaption { padding: 12px 16px; font-size: 14px; color: var(--muted); background: var(--surface); }
.results { margin-top: 20px; display: grid; gap: 12px; }
.results li { padding: 18px 20px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--surface); color: var(--text); }
.results li span { display: block; margin-top: 2px; color: var(--muted); font-size: 15px; }
.tag-list { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.arch { margin-top: 24px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; gap: 14px; }
.arch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.arch-label { width: 100%; font-family: var(--mono); font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.arch-node { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 14.5px; color: var(--text); }
.arch-node.key { border-color: var(--accent-text); }
.arch-flow { color: var(--faint); font-family: var(--mono); }
.cta-band { margin: 24px 0 120px; padding: 40px; border-radius: 24px; background: var(--accent); color: var(--accent-ink); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.cta-band p { font-size: clamp(22px, 2.6vw, 30px); font-weight: 600; letter-spacing: -0.02em; max-width: 640px; }
.prose { max-width: 760px; padding: 56px 0 120px; }
.prose h2 { margin-top: 48px; font-size: clamp(24px, 2.6vw, 30px); }
.prose p, .prose li { margin-top: 14px; color: var(--muted); font-size: 17px; }
.prose ul { margin-top: 8px; }
.prose ul li { position: relative; padding-left: 20px; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: .8em; width: 8px; height: 1px; background: var(--accent); }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.error-page { min-height: 100vh; display: grid; align-content: center; padding: calc(var(--header-h) + 40px) 0 80px; }
.error-page .code { font-family: var(--mono); font-size: 14px; color: var(--accent-text); }
.error-page h1 { margin-top: 18px; font-size: clamp(40px, 6vw, 72px); }
.error-page .actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .mp-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { gap: 20px; }
  .papers { grid-template-columns: 1fr; }
  .glance-list { grid-template-columns: repeat(2, 1fr); }
  .glance-list li:nth-child(3) { border-left: 0; padding-left: 0; }
  .glance-list li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-photo { max-width: 460px; }
  .hero-photo .caption { left: auto; right: -12px; }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .pipeline li::after { display: none; }
  .caps { grid-template-columns: 1fr 1fr; }
  .apps { grid-template-columns: 1fr; gap: 32px; }
  .exp-grid, .rec-grid { grid-template-columns: 1fr; gap: 40px; }
  .exp-side, .rec-photo { position: static; }
  .exp-side .photo { display: none; }
  .process { grid-template-columns: 1fr 1fr; }
  .process li::after { display: none; }
  .stack-grid { grid-template-columns: 1fr 1fr; }
  .proj.wide { grid-template-columns: 1fr; }
  .proj.wide .cover { min-height: 0; }
  .term { border-right: 0; border-bottom: 1px solid var(--line); }
  .proj.small { grid-column: span 6; display: grid; grid-template-columns: 260px 1fr; }
  .proj.small .cover { aspect-ratio: auto; height: 100%; min-height: 190px; border-right: 1px solid var(--line); }
  .contact-card { grid-template-columns: 1fr; padding: 48px 40px; }
  .cs-layout { grid-template-columns: 1fr; gap: 32px; }
  .cs-facts { position: static; grid-template-columns: 1fr 1fr; }
  .quotes { grid-template-columns: 1fr; }
}
/* Header collapses to the menu button below 1020px: the full name plus five links need desktop width */
@media (max-width: 1020px) {
  .js .menu-btn { display: grid; }
  .js .nav-links {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    max-height: calc(100vh - var(--header-h)); max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 20px;
  }
  .js .nav-links.open { display: flex; }
  .js .nav-links a { padding: 14px 0; font-size: 17px; color: var(--text); border-bottom: 1px solid var(--line); }
  .js .nav-links .nav-cta { margin-top: 16px; text-align: center; border-bottom: 0; }
  /* Without JavaScript: the links stay visible and wrap under the brand. */
  html:not(.js) .site-header { position: absolute; }
  html:not(.js) .nav { height: auto; padding: 12px 0; flex-wrap: wrap; }
  html:not(.js) .nav-links { flex-wrap: wrap; gap: 10px 18px; }
  .js .nav-links { padding-left: 32px; padding-right: 32px; }
}
@media (max-width: 720px) {
  .mp-grid { grid-template-columns: 1fr; }
  .mp-filters { margin-top: -20px; }
  .js .nav-links { padding-left: 16px; padding-right: 16px; }
  .nav { gap: 10px; }
  .brand { gap: 8px; }
  .brand span { font-size: 15px; line-height: 1.15; }
  .wrap { padding: 0 16px; }
  .hero { padding-top: calc(var(--header-h) + 44px); }
  .hero-photo .caption { right: 12px; bottom: 16px; }
  section { padding-top: 88px; }
  .head { margin-bottom: 36px; }
  .feature, .apps { padding: 28px 20px; border-radius: 18px; }
  .feature-top { grid-template-columns: 1fr; gap: 16px; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .caps, .apps-list, .process { grid-template-columns: 1fr; }
  .initiatives li { grid-template-columns: 40px 1fr; gap: 6px 12px; }
  .initiatives li p { grid-column: 2; }
  .callout { flex-direction: column; align-items: flex-start; gap: 10px; }
  .job { padding-left: 24px; }
  .job-head { flex-direction: column; gap: 4px; }
  .projects { grid-template-columns: 1fr; }
  .proj, .proj.small, .proj.wide { grid-column: auto; }
  .proj.small { display: flex; }
  .proj.small .cover { aspect-ratio: 16 / 10; height: auto; min-height: 0; border-right: 0; }
  .proj.wide .body { padding: 28px; }
  .term { padding: 22px; font-size: 12.5px; }
  .awards li { grid-template-columns: 1fr; gap: 4px; }
  .stack-grid { grid-template-columns: 1fr; }
  .gallery { padding-top: 88px; }
  .gallery.is-live .g-item { width: 68vw; max-height: 58vh; }
  .bg-grid { grid-template-columns: 1fr; gap: 40px; }
  .plain li { flex-direction: column; gap: 2px; }
  .contact { padding: 96px 0 72px; }
  .contact-card { padding: 32px 18px; border-radius: 20px; gap: 32px; }
  .form-card { padding: 22px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .cs-facts { grid-template-columns: 1fr; }
  .cta-band { padding: 28px 20px; margin-bottom: 72px; }
  /* Phones: a compact round chat button that covers as little content as possible */
  .chat-launcher { right: 12px; bottom: 12px; width: 48px; min-height: 48px; height: 48px; padding: 0; justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
  .chat-launcher > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .chat-ready .site-footer { padding-bottom: 76px; }
}
@media (max-width: 480px) {
  .paper { padding: 24px 20px; }
  .p-meta > div { grid-template-columns: 1fr; gap: 2px; }
  .glance-list { grid-template-columns: 1fr; }
  .glance-list li, .glance-list li:nth-child(3) { border-left: 0; padding: 20px 0; }
  .glance-list li + li { border-top: 1px solid var(--line); }
  .mark { width: 36px; height: 36px; font-size: 11.5px; }
  .pipeline { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .brand span { font-size: 14.5px; }
  .hero-actions .btn { width: 100%; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse { animation: none; }
  .ticker-track { animation: none; width: auto; flex-wrap: wrap; row-gap: 10px; padding: 0 16px; }
  .ticker-track li[aria-hidden="true"] { display: none; }
  .ticker-toggle { display: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js [data-parallax] img { transform: none; }
  .js .timeline .job, .js .timeline .job .bullets li, .js .timeline .job p, .js .timeline .job .tags { opacity: 1; transform: none; transition: none; }
  .mp.mp-in { animation: none; }
  .js .hero h1 .ln, .js .hero .status, .js .hero .hero-sub, .js .hero .hero-actions, .js .hero-photo .frame, .js .hero-photo .caption, .js .pipeline.play li, .js .pipeline.play li::after { animation: none; }
  h1 em::after { animation: none; transform: scaleX(1); }
  .scroll-progress { display: none; }
  .timeline::after { display: none; }
  .js .paper .p-meta > div, .js .paper .p-links { opacity: 1; transform: none; transition: none; }
  .js .paper.in .p-pub { animation: none; }
  .proj:hover, .proj:hover .cover img, .btn-accent:hover { transform: none; }
}

/* ---------- Print: readable on paper, nothing hidden by animations ---------- */
@media print {
  :root, :root[data-theme="light"] { --accent-text: #1d4ed8; --term-bg: #fff; --accent-soft: #fff; --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #111; --muted: #333; --faint: #555; --line: #ccc; --line-2: #bbb; --accent: #1d4ed8; --accent-ink: #111; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .js .reveal, .js .timeline .job, .js .timeline .job .bullets li, .js .timeline .job p, .js .timeline .job .tags, .js .paper .p-meta > div, .js .paper .p-links { opacity: 1 !important; transform: none !important; transition: none !important; }
  .timeline::after { display: none; }
  h1 em::after { display: none; }
  .theme-toggle, .site-header, .menu-btn, .ticker, .gallery, .chat-launcher, .chat-error, .skip-link, .hero-photo, .exp-side .photo, .rec-photo, .hero-actions, .callout, .form-card, .book, #testimonials { display: none !important; }
  section, .contact { padding-top: 28px; padding-bottom: 0; break-inside: auto; }
  h1, h2, h3, h4 { break-after: avoid; color: #111; }
  .hero { padding: 0 0 16px; }
  .hero-grid, .exp-grid, .rec-grid, .bg-grid, .contact-card, .apps, .feature-top { display: block; }
  .feature, .apps, .proj, .cap, .process li, .contact-card, .stack-grid div { border: 1px solid #ccc; background: #fff !important; color: #111; box-shadow: none; }
  .contact-card h2, .contact-card h2 em, .contact-intro p { color: #111; }
  .projects, .caps, .pipeline, .process, .stack-grid { display: block; }
  .proj, .cap, .pipeline li, .process li { margin-bottom: 10px; break-inside: avoid; }
  .proj .cover, .term, .xlate, .rev { display: none; }
  .proj:hover { transform: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; word-break: break-all; }
  .proj h4 a::after { position: static; content: ""; }
  .direct a span:last-child { display: none; }
}
