/* ==========================================================================
   Muhammad Usama — portfolio (2026-11 redesign)
   Dark-first, lime + violet accents. All motion respects reduced-motion.
   ========================================================================== */

:root {
  --bg: #08090c;
  --bg-2: #0d0f14;
  --card: #12141b;
  --card-2: #171a23;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);
  --text: #ecedf2;
  --muted: #8b90a5;
  --accent: #c8ff2e;          /* fills */
  --accent-ink: #c8ff2e;      /* accent used as text on bg */
  --on-accent: #0a0b0d;
  --violet: #7b61ff;
  --glow: rgba(200, 255, 46, .18);
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);

  --live: #34d399; --staging: #fbbf24; --local: #60a5fa; --archive: #c084fc; --github: #a3a3a3; --down: #f87171;

  --f-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --r: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f3ee;
  --bg-2: #ebe9e2;
  --card: #ffffff;
  --card-2: #f7f6f2;
  --line: rgba(10, 11, 14, .09);
  --line-2: rgba(10, 11, 14, .18);
  --text: #0d0e12;
  --muted: #5d6070;
  --accent: #c8ff2e;
  --accent-ink: #4b2fe0;
  --violet: #5b3df5;
  --glow: rgba(91, 61, 245, .12);
  --shadow: 0 30px 70px -25px rgba(20, 20, 40, .25);
  --live: #059669; --staging: #b45309; --local: #2563eb; --archive: #9333ea; --down: #dc2626;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 200; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.skip-link:focus { top: 16px; }
.mono { font-family: var(--f-mono); font-size: .82rem; letter-spacing: .02em; }
.muted { color: var(--muted); }
.center { text-align: center; display: flex; justify-content: center; margin-top: 40px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Intro curtain ---------- */
.intro { position: fixed; inset: 0; z-index: 300; background: var(--bg); display: grid; place-items: center; transition: transform .9s var(--ease-out) .1s, opacity .4s ease .7s; }
.intro-inner { display: grid; gap: 18px; justify-items: center; }
.intro-mark { font: 800 clamp(48px, 9vw, 96px)/1 var(--f-display); letter-spacing: -.04em; animation: introIn .7s var(--ease-out) both; }
.intro-mark b, .logo b, .dot-accent { color: var(--accent-ink); }
.intro-bar { width: 140px; height: 2px; background: var(--line); overflow: hidden; border-radius: 2px; }
.intro-bar i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; animation: introBar .9s var(--ease) both; }
.is-loaded .intro { transform: translateY(-100%); opacity: 0; pointer-events: none; }
@keyframes introIn { from { opacity: 0; transform: translateY(20px) scale(.96); } }
@keyframes introBar { from { transform: scaleX(0); } }

/* ---------- Cursor ---------- */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .has-cursor, .has-cursor a, .has-cursor button, .has-cursor [data-cursor] { cursor: none; }
  .has-cursor input, .has-cursor textarea { cursor: text; }
  .has-cursor .cursor { display: block; opacity: 0; transition: opacity .3s; }
  .cursor-dot, .cursor-ring { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 250; border-radius: 50%; will-change: transform; }
  .cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
  .cursor-ring { width: 36px; height: 36px; margin: -18px 0 0 -18px; border: 1.5px solid var(--line-2); display: grid; place-items: center; transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background-color .35s, border-color .35s; }
  .cursor.hover .cursor-ring { width: 56px; height: 56px; margin: -28px 0 0 -28px; border-color: var(--accent); background: var(--glow); }
  .cursor.label .cursor-ring { width: 88px; height: 88px; margin: -44px 0 0 -44px; background: var(--accent); border-color: var(--accent); }
  .cursor.label .cursor-dot { opacity: 0; }
  .cursor-label { font: 600 12px var(--f-body); color: var(--on-accent); opacity: 0; transform: scale(.6); transition: .25s var(--ease); white-space: nowrap; }
  .cursor.label .cursor-label { opacity: 1; transform: none; }
  .cursor.down .cursor-ring { transform-origin: center; scale: .85; }
}

/* ---------- Progress + nav ---------- */
.scroll-progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 120; }
.scroll-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--accent)); transform-origin: left; transform: scaleX(0); }

.nav {
  position: fixed; top: 14px; left: 50%; z-index: 100; translate: -50% 0;
  width: min(calc(100% - 24px), 1100px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 10px 10px 20px; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 1px solid var(--line); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  transition: transform .5s var(--ease-out), background-color .4s;
}
.nav.hidden { transform: translateY(-140%); }
.logo { font: 800 22px/1 var(--f-display); letter-spacing: -.04em; display: inline-block; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { position: relative; padding: 8px 14px; border-radius: 999px; font-size: .9rem; color: var(--muted); transition: color .25s, background-color .25s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--line); }
.nav-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--card); transition: border-color .25s, transform .25s var(--ease); }
.icon-btn:hover { border-color: var(--line-2); }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }
.menu-btn { display: none; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.menu-btn span { width: 16px; height: 1.5px; background: currentColor; transition: transform .35s var(--ease); }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

.mobile-menu { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; flex-direction: column; justify-content: center; padding: 100px var(--gutter) 40px; gap: 28px; }
.mobile-menu[hidden] { display: none; }
.mobile-menu:not([hidden]) { animation: menuIn .5s var(--ease-out); }
.mobile-menu nav { display: grid; gap: 4px; }
.mobile-menu a { font: 600 clamp(34px, 9vw, 54px)/1.15 var(--f-display); letter-spacing: -.03em; opacity: 0; transform: translateY(24px); animation: rise .6s var(--ease-out) forwards; }
.mobile-menu a:nth-child(2) { animation-delay: .05s } .mobile-menu a:nth-child(3) { animation-delay: .1s } .mobile-menu a:nth-child(4) { animation-delay: .15s } .mobile-menu a:nth-child(5) { animation-delay: .2s } .mobile-menu a:nth-child(6) { animation-delay: .25s }
@keyframes menuIn { from { clip-path: circle(0 at calc(100% - 40px) 40px); } to { clip-path: circle(150% at calc(100% - 40px) 40px); } }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Buttons / chips ---------- */
.btn { --bx: 0px; --by: 0px; display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem; position: relative; overflow: hidden; isolation: isolate; transition: transform .3s var(--ease), box-shadow .3s, background-color .3s, color .3s, border-color .3s; }
.btn-sm { padding: 10px 18px; font-size: .88rem; }
.btn-accent { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 30px -10px rgba(200, 255, 46, .55); }
.btn-accent::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--text); transform: translateY(101%); transition: transform .45s var(--ease-out); border-radius: inherit; }
.btn-accent:hover { color: var(--bg); }
.btn-accent:hover::before { transform: none; }
.btn-ghost { border: 1px solid var(--line-2); background: color-mix(in srgb, var(--card) 60%, transparent); }
.btn-ghost:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.full { grid-column: 1 / -1; justify-content: center; }

.chip { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: .82rem; color: var(--muted); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 110px 0 80px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.grid-bg { position: absolute; inset: -2px; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 64px 64px; mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 75%); }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; animation: drift 18s ease-in-out infinite alternate; }
.b1 { width: 520px; height: 520px; background: var(--violet); top: -160px; right: -120px; opacity: .35; }
.b2 { width: 420px; height: 420px; background: var(--accent); bottom: -220px; left: -140px; opacity: .14; animation-delay: -6s; }
@keyframes drift { to { transform: translate(-60px, 50px) scale(1.12); } }
.spot { position: absolute; inset: 0; background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 30%), var(--glow), transparent 60%); transition: opacity .4s; }

.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero-title { font: 800 clamp(52px, 8.2vw, 124px)/.9 var(--f-display); letter-spacing: -.05em; margin: 22px 0 22px; }
.split { white-space: nowrap; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .outline { color: transparent; -webkit-text-stroke: 1.5px var(--text); transition: color .5s var(--ease); }
.hero-title .outline:hover { color: var(--text); }
.char { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease-out); transition-delay: calc(var(--ci) * 35ms + .55s); }
.is-loaded .char { transform: none; }
.hero-title .char:hover { color: var(--accent-ink); -webkit-text-stroke-color: var(--accent-ink); transition-delay: 0s; transition-duration: .2s; }
.hero-sub { font: 500 clamp(19px, 2.1vw, 26px)/1.4 var(--f-display); letter-spacing: -.01em; margin: 0 0 14px; max-width: 34ch; }
.rotator { color: var(--accent-ink); position: relative; white-space: nowrap; }
.rotator::after { content: ''; display: inline-block; width: 2px; height: 1em; background: currentColor; margin-left: 3px; vertical-align: -.12em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-role { color: var(--muted); margin: 0 0 30px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 8px 36px; margin: 36px 0 0; justify-content: start; }
.hero-stats div { display: grid; }
.hero-stats dt { order: 2; font-size: .8rem; color: var(--muted); }
.hero-stats dd { margin: 0; font: 700 clamp(26px, 3vw, 36px)/1.1 var(--f-display); letter-spacing: -.03em; }

.hero-copy > * { opacity: 0; transform: translateY(20px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.is-loaded .hero-copy > * { opacity: 1; transform: none; }
.is-loaded .hero-copy > :nth-child(1) { transition-delay: .5s } .is-loaded .hero-copy > :nth-child(3) { transition-delay: 1s } .is-loaded .hero-copy > :nth-child(4) { transition-delay: 1.1s } .is-loaded .hero-copy > :nth-child(5) { transition-delay: 1.2s } .is-loaded .hero-copy > :nth-child(6) { transition-delay: 1.3s }
.hero-title { opacity: 1 !important; transform: none !important; }

.hero-visual { position: relative; height: 520px; perspective: 1400px; opacity: 0; transform: translateX(40px); transition: opacity 1.2s var(--ease-out) .9s, transform 1.2s var(--ease-out) .9s; }
.is-loaded .hero-visual { opacity: 1; transform: none; }
.deck { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(var(--ry, -14deg)) rotateX(var(--rx, 8deg)); transition: transform .8s var(--ease-out); }
.deck-card { position: absolute; width: 78%; aspect-ratio: 16 / 10.4; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); background: var(--card); box-shadow: var(--shadow); transition: transform .9s var(--ease-out); }
.deck-card img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.deck-card:nth-child(1) { left: 0; top: 4%; transform: translateZ(-80px); }
.deck-card:nth-child(2) { left: 14%; top: 24%; transform: translateZ(0); }
.deck-card:nth-child(3) { left: 24%; top: 46%; transform: translateZ(90px); }
.float-chip { position: absolute; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-2); font: 500 .8rem var(--f-mono); box-shadow: var(--shadow); animation: float 6s ease-in-out infinite; z-index: 2; }
.fc1 { top: -4%; left: 26%; } .fc2 { top: 40%; left: -6%; animation-delay: -1.5s; color: var(--accent-ink); } .fc3 { bottom: 8%; right: -4%; animation-delay: -3s; } .fc4 { bottom: -4%; left: 18%; animation-delay: -4.5s; }
@keyframes float { 50% { transform: translateY(-14px); } }
.term { position: absolute; right: -4%; top: 6%; width: 290px; z-index: 3; background: color-mix(in srgb, var(--bg-2) 88%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; transform: translateZ(140px); }
.term-bar { display: flex; gap: 6px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); font: .7rem var(--f-mono); color: var(--muted); }
.term-bar i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; } .term-bar span { margin-left: 6px; }
.term pre { margin: 0; padding: 12px 14px 14px; font: .74rem/1.65 var(--f-mono); min-height: 150px; white-space: pre-wrap; color: var(--text); }
.term .k { color: var(--accent-ink); } .term .s { color: var(--live); } .term .c { color: var(--muted); }

.scroll-cue { position: absolute; bottom: 26px; left: 50%; translate: -50% 0; width: 24px; height: 38px; border: 1.5px solid var(--line-2); border-radius: 12px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--accent); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(-4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--line); padding: 22px 0; overflow: hidden; background: var(--bg-2); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; width: max-content; gap: 48px; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font: 600 clamp(20px, 2.4vw, 30px)/1 var(--f-display); letter-spacing: -.02em; color: var(--muted); display: inline-flex; align-items: center; gap: 48px; white-space: nowrap; transition: color .3s; }
.marquee-track span:hover { color: var(--text); }
.marquee-track span::after { content: '✦'; font-size: .55em; color: var(--accent-ink); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: clamp(90px, 12vw, 160px) 0; position: relative; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.sec-head { margin-bottom: clamp(40px, 6vw, 70px); max-width: 760px; }
.sec-head-row { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 30px; flex-wrap: wrap; }
.kicker { display: inline-flex; gap: 12px; align-items: center; margin: 0 0 18px; font: 500 .8rem var(--f-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.kicker span { color: var(--accent-ink); }
.kicker::after { content: ''; width: 40px; height: 1px; background: var(--line-2); }
h2 { font: 700 clamp(38px, 6vw, 76px)/.98 var(--f-display); letter-spacing: -.045em; margin: 0; }
h2 em, .big-cta em { font-style: normal; color: var(--muted); }
.lede { color: var(--muted); font-size: 1.08rem; max-width: 56ch; margin: 22px 0 0; }

[data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- Featured ---------- */
.featured { display: grid; grid-template-columns: repeat(12, 1fr); gap: 22px; }
.feat { grid-column: span 6; position: relative; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); overflow: hidden; transform-style: preserve-3d; transition: border-color .4s, transform .6s var(--ease-out), box-shadow .5s; text-align: left; display: flex; flex-direction: column; }
.feat:nth-child(5n + 1) { grid-column: span 7; } .feat:nth-child(5n + 2) { grid-column: span 5; } .feat:nth-child(5n + 3) { grid-column: span 5; } .feat:nth-child(5n + 4) { grid-column: span 7; } .feat:nth-child(5n) { grid-column: span 12; }
.feat:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.feat-media { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: var(--card-2); }
.feat:nth-child(5n) .feat-media { aspect-ratio: 21 / 8; }
.feat-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transform: scale(1.04); transition: transform 1.2s var(--ease-out), object-position 4s ease; }
.feat:hover .feat-media img { transform: scale(1.09); object-position: bottom; }
.feat-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, color-mix(in srgb, var(--card) 85%, transparent)); }
.shine { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(500px circle at var(--px, 50%) var(--py, 50%), rgba(255, 255, 255, .12), transparent 45%); opacity: 0; transition: opacity .4s; }
.feat:hover .shine, .card:hover .shine { opacity: 1; }
.feat-body { padding: 22px 24px 26px; display: grid; gap: 10px; transform: translateZ(30px); }
.feat-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.feat h3 { font: 700 clamp(22px, 2.3vw, 30px)/1.1 var(--f-display); letter-spacing: -.03em; margin: 0; }
.feat p { margin: 0; color: var(--muted); font-size: .95rem; }
.feat .arrow { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; transition: transform .5s var(--ease-out), background-color .3s, color .3s; }
.feat:hover .arrow { transform: rotate(-45deg); background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.status { display: inline-flex; align-items: center; gap: 7px; font: 500 .72rem var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--c); }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.s-live { --c: var(--live); } .s-staging { --c: var(--staging); } .s-local { --c: var(--local); } .s-archive { --c: var(--archive); } .s-github { --c: var(--github); } .s-down { --c: var(--down); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 10px; border-radius: 999px; font-size: .74rem; border: 1px solid var(--line); color: var(--muted); background: var(--bg-2); }

/* ---------- Workflows ---------- */
.flows { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; counter-reset: flow; }
.flow { grid-column: span 2; position: relative; padding: 28px 26px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); overflow: hidden; display: grid; gap: 14px; align-content: start; counter-increment: flow; }
.flow:nth-child(4), .flow:nth-child(5) { grid-column: span 3; }
.flow::before { content: '0' counter(flow); font: 500 .75rem var(--f-mono); color: var(--muted); }
.flow h3 { font: 700 1.35rem/1.15 var(--f-display); letter-spacing: -.02em; margin: 0; }
.flow p { margin: 0; color: var(--muted); font-size: .93rem; }
.impact { justify-self: start; font: 600 .78rem var(--f-mono); padding: 6px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.flow-line { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); transform: translateX(-100%); }
.flow:hover .flow-line { animation: flowline 1.4s var(--ease) infinite; }
@keyframes flowline { to { transform: translateX(100%); } }

/* spotlight border on bento + flows */
.glow { position: relative; }
.glow::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: radial-gradient(320px circle at var(--px, -100px) var(--py, -100px), var(--accent), transparent 45%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .35s; }
.glow:hover::after { opacity: 1; }

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.bento-cell { grid-column: span 2; padding: 26px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); display: grid; gap: 18px; align-content: start; }
.bento-cell:nth-child(1), .bento-cell:nth-child(2) { grid-column: span 3; }
.bento-cell h3 { margin: 0; font: 700 1.2rem var(--f-display); letter-spacing: -.02em; display: flex; align-items: center; gap: 12px; }
.bento-cell h3 svg { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); color: var(--accent-ink); flex: none; }
.bento-cell .tag { font-size: .8rem; padding: 6px 12px; color: var(--text); transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--ease); }
.bento-cell .tag:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); transform: translateY(-2px); }

/* ---------- Archive ---------- */
.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 50px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); min-width: min(360px, 100%); color: var(--muted); transition: border-color .25s, box-shadow .25s; }
.search:focus-within { border-color: var(--accent-ink); box-shadow: 0 0 0 4px var(--glow); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; height: 100%; }
kbd { font: .72rem var(--f-mono); padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line-2); }
.filters { display: grid; gap: 12px; margin-bottom: 18px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: .87rem; color: var(--muted); transition: all .3s var(--ease); display: inline-flex; gap: 8px; align-items: center; }
.pill small { font: .72rem var(--f-mono); opacity: .7; }
.pill:hover { color: var(--text); border-color: var(--line-2); }
.pill[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.pills-sm .pill { padding: 6px 12px; font-size: .8rem; }
.count { color: var(--muted); margin: 18px 0; }
.archive { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card { position: relative; border-radius: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--line); text-align: left; display: flex; flex-direction: column; transition: border-color .3s, transform .5s var(--ease-out), box-shadow .4s; animation: cardIn .6s var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 12) * 35ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.card:hover { border-color: var(--line-2); transform: translateY(-6px); box-shadow: var(--shadow); }
.card-media { aspect-ratio: 16 / 10.4; overflow: hidden; background: var(--card-2); position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .9s var(--ease-out); }
.card:hover .card-media img { transform: scale(1.07); }
.card-body { padding: 16px 18px 18px; display: grid; gap: 6px; }
.card h3 { margin: 0; font: 600 1.05rem/1.25 var(--f-display); letter-spacing: -.01em; }
.card .meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .78rem; color: var(--muted); }
.card .badge { position: absolute; top: 10px; left: 10px; z-index: 2; padding: 5px 10px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(8px); }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
::view-transition-group(*) { animation-duration: .45s; animation-timing-function: var(--ease-out); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 40px; position: relative; display: grid; gap: 22px; }
.tl-line { position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-line i { position: absolute; inset: 0; background: linear-gradient(var(--accent), var(--violet)); transform-origin: top; transform: scaleY(var(--p, 0)); }
.job { position: relative; padding: 26px 28px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; transition: border-color .3s, transform .5s var(--ease-out); }
.job:hover { border-color: var(--line-2); transform: translateX(6px); }
.job::before { content: ''; position: absolute; left: -36px; top: 32px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 0 5px var(--bg); }
.job h3 { margin: 0; font: 700 1.3rem/1.2 var(--f-display); letter-spacing: -.02em; }
.job .co { color: var(--accent-ink); font-weight: 600; }
.job .when { font: .8rem var(--f-mono); color: var(--muted); text-align: right; white-space: nowrap; }
.job p { grid-column: 1 / -1; margin: 6px 0 4px; color: var(--muted); }
.job .tags { grid-column: 1 / -1; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(40px, 6vw, 90px); align-items: start; }
.about-photo { position: sticky; top: 110px; border-radius: 22px; overflow: hidden; border: 1px solid var(--line-2); transform-style: preserve-3d; transition: transform .6s var(--ease-out); }
.about-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter .8s, transform 1.2s var(--ease-out); }
.about-photo:hover img { filter: grayscale(0); transform: scale(1.04); }
.photo-tag { position: absolute; left: 14px; bottom: 14px; display: inline-flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 75%, transparent); backdrop-filter: blur(8px); }
.about-text p { font-size: 1.07rem; color: var(--muted); margin: 0 0 18px; }
.about-text strong { color: var(--text); font-weight: 600; }
.facts { margin-top: 34px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.fact { padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.fact dt { font: .72rem var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.fact dd { margin: 0; font-weight: 600; }
.fact dd small { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; margin-top: 2px; }

/* ---------- Contact ---------- */
.contact { text-align: center; padding-bottom: 40px; overflow: hidden; }
.contact .lede { margin-inline: auto; }
.center-k { justify-content: center; }
.center-k::after { display: none; }
.big-cta { font-size: clamp(48px, 10vw, 140px); line-height: .9; }
.contact-actions { margin: 44px 0 26px; display: flex; justify-content: center; }
.email-btn { position: relative; display: grid; gap: 6px; padding: 24px 40px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--card); transition: border-color .3s, transform .3s var(--ease); }
.email-btn .mono { font-size: clamp(16px, 3vw, 28px); color: var(--text); letter-spacing: 0; }
.copy-hint { font-size: .78rem; color: var(--muted); }
.email-btn:hover { border-color: var(--accent-ink); }
.socials { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.social { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 500; font-size: .92rem; transition: transform .3s var(--ease), border-color .3s, background-color .3s, color .3s; }
.social svg { width: 18px; height: 18px; }
.social:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.form { max-width: 720px; margin: 60px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; text-align: left; }
.form label { display: grid; gap: 8px; font-size: .82rem; color: var(--muted); }
.form input, .form textarea { width: 100%; padding: 15px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); font: inherit; outline: 0; resize: vertical; transition: border-color .25s, box-shadow .25s; }
.form input:focus, .form textarea:focus { border-color: var(--accent-ink); box-shadow: 0 0 0 4px var(--glow); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 110px; padding-top: 26px; border-top: 1px solid var(--line); font-size: .85rem; }
.footer a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- FAB / toast ---------- */
.fab { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: inline-flex; align-items: center; gap: 10px; padding: 13px 20px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: 0 14px 40px -10px rgba(0, 0, 0, .6); transform: translateY(120px); transition: transform .6s var(--ease-out); }
.fab.show { transform: none; }
.fab .pulse { background: var(--on-accent); box-shadow: none; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 260; translate: -50% 0; padding: 12px 20px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; font-size: .9rem; opacity: 0; transform: translateY(20px); transition: .45s var(--ease-out); pointer-events: none; }
.toast.show { opacity: 1; transform: none; }

/* ---------- Modal ---------- */
.modal { width: min(1080px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line-2); border-radius: 22px; background: var(--card); color: var(--text); box-shadow: 0 40px 120px rgba(0, 0, 0, .6); overflow: hidden; }
.modal::backdrop { background: rgba(5, 6, 9, .7); backdrop-filter: blur(6px); }
.modal[open] { animation: modalIn .55s var(--ease-out); }
.modal[open]::backdrop { animation: fade .4s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(40px) scale(.96); } }
@keyframes fade { from { opacity: 0; } }
.modal-inner { display: grid; grid-template-columns: 1.25fr 1fr; max-height: calc(100dvh - 26px); }
.m-media { background: var(--bg-2); display: grid; align-content: start; gap: 10px; padding: 14px; overflow: auto; }
.m-media > img { width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.m-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.m-thumbs button { width: 84px; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; border: 2px solid transparent; opacity: .6; transition: .25s; padding: 0; }
.m-thumbs button[aria-current="true"], .m-thumbs button:hover { opacity: 1; border-color: var(--accent); }
.m-thumbs img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.m-body { padding: 34px 32px 28px; overflow: auto; display: grid; gap: 14px; align-content: start; }
.m-body h3 { font: 700 clamp(26px, 3vw, 36px)/1.05 var(--f-display); letter-spacing: -.03em; margin: 0; }
.m-body p { margin: 0; color: var(--muted); }
.m-status { font: .8rem var(--f-mono); }
.m-high { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.m-high li { padding-left: 22px; position: relative; font-size: .95rem; }
.m-high li::before { content: '→'; position: absolute; left: 0; color: var(--accent-ink); }
.m-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }
.m-nav { display: flex; gap: 8px; }
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; background: var(--card); border: 1px solid var(--line-2); transition: transform .4s var(--ease-out); }
.modal-close:hover { transform: rotate(90deg); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { height: 420px; max-width: 640px; width: 100%; margin: 10px auto 0; }
  .nav-links { display: none; }
  .menu-btn { display: flex; }
  .featured .feat { grid-column: span 6 !important; }
  .featured .feat:nth-child(5n) { grid-column: span 12 !important; }
  .flows .flow { grid-column: span 3 !important; }
  .bento-cell { grid-column: span 3 !important; }
  .about { grid-template-columns: 1fr; }
  .about-photo { position: relative; top: 0; max-width: 360px; }
}
@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  .hero { padding-top: 110px; }
  .hero-stats { grid-template-columns: repeat(2, auto); gap: 18px 36px; }
  .hero-visual { height: 300px; }
  .term { width: 200px; right: 0; top: 0; }
  .term pre { min-height: 120px; font-size: .66rem; }
  .float-chip { font-size: .7rem; padding: 6px 10px; }
  .featured .feat, .featured .feat:nth-child(5n) { grid-column: 1 / -1 !important; }
  .feat:nth-child(5n) .feat-media { aspect-ratio: 16 / 10; }
  .flows .flow, .bento-cell { grid-column: 1 / -1 !important; }
  .archive { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card-body { padding: 12px 12px 14px; }
  .card h3 { font-size: .92rem; }
  
  .search { min-width: 100%; }
  .pills { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter); scrollbar-width: none; }
  .pills::-webkit-scrollbar { display: none; }
  .pill { white-space: nowrap; }
  .timeline { padding-left: 28px; }
  .tl-line { left: 5px; }
  .job { grid-template-columns: 1fr; padding: 20px; }
  .job::before { left: -29px; }
  .job .when { text-align: left; }
  .facts { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .email-btn { padding: 20px 22px; width: 100%; }
  .modal-inner { grid-template-columns: 1fr; overflow: auto; }
  .m-media, .m-body { overflow: visible; }
  .m-body { padding: 24px 20px; }
}
@media (max-width: 400px) {
  .archive { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .char { transform: none; }
}
.form label.full { justify-content: stretch; }
[hidden] { display: none !important; }

/* ---------- Mouse guide ---------- */
.mg { position: fixed; left: 12px; bottom: 6px; z-index: 85; width: var(--mw, 96px); height: var(--mh, 130px); will-change: transform; pointer-events: none; transition: opacity .5s; }
.mg.bye { opacity: 0; }
.mg-body { position: absolute; inset: 0; padding: 0; pointer-events: auto; }
.mg-sprite { position: absolute; inset: 0; background-repeat: no-repeat; image-rendering: auto; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
.mg-shadow { position: absolute; left: 22%; right: 22%; bottom: 2px; height: 8px; border-radius: 50%; background: rgba(0,0,0,.28); filter: blur(3px); z-index: -1; }
.mg-body:hover .mg-sprite { animation: mgHop .45s var(--ease-out); }
@keyframes mgHop { 40% { translate: 0 -8px; } }
.mg-bubble { position: absolute; left: 50%; bottom: calc(100% - 4px); translate: -24px 0; width: max-content; max-width: 230px; padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: var(--text); color: var(--bg); font: 600 .82rem/1.35 var(--f-body); box-shadow: var(--shadow); opacity: 0; transform: translateY(8px) scale(.92); transform-origin: bottom left; transition: opacity .3s, transform .4s var(--ease-out); pointer-events: none; }
.mg.talk .mg-bubble { opacity: 1; transform: none; }
.mg-close { position: absolute; top: 2px; right: -10px; width: 26px; height: 26px; border-radius: 50%; font-size: 10px; background: var(--card); border: 1px solid var(--line-2); color: var(--muted); opacity: 0; transition: opacity .25s; pointer-events: auto; }
.mg:hover .mg-close, .mg-close:focus-visible { opacity: 1; }
.mg.zz::after { content: 'z'; position: absolute; right: 8px; top: 6px; font: 700 14px var(--f-display); color: var(--muted); animation: zz 2s ease-in-out infinite; }
@keyframes zz { 0% { opacity: 0; transform: translate(0, 6px) scale(.7); } 50% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -16px) scale(1.2); } }
.mg-restore { position: fixed; left: 14px; bottom: 14px; z-index: 85; width: 42px; height: 42px; border-radius: 50%; background: var(--card); border: 1px solid var(--line-2); font-size: 20px; box-shadow: var(--shadow); }
@media (max-width: 720px) {
  .mg-bubble { max-width: 180px; font-size: .74rem; padding: 8px 11px; }
  .mg-close { opacity: 1; width: 26px; height: 26px; }
}
.mg.chips .mg-bubble { pointer-events: auto; }
.mg-chips { display: none; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.mg.chips .mg-chips { display: flex; }
.mg-chips button { padding: 4px 8px; border-radius: 999px; background: var(--bg); color: var(--text); font: 600 .72rem var(--f-body); transition: background-color .2s, color .2s; }
.mg-chips button:hover { background: var(--accent); color: var(--on-accent); }
.mg-text { display: block; }

/* ---------- Certifications ---------- */
.certs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.cert { border-radius: var(--r); background: var(--card); border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; transition: border-color .3s, transform .5s var(--ease-out), box-shadow .4s; }
.cert:hover { border-color: var(--line-2); transform: translateY(-5px); box-shadow: var(--shadow); }
.cert-media { padding: 0; display: block; background: #f3f3f3; aspect-ratio: 64 / 45; overflow: hidden; }
.cert-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .8s var(--ease-out); }
.cert:hover .cert-media img { transform: scale(1.05); }
.cert-body { padding: 16px 18px 18px; display: grid; gap: 8px; flex: 1; align-content: start; }
.cert-body h3 { margin: 0; font: 600 1.02rem/1.3 var(--f-display); letter-spacing: -.01em; }
.cert-verify { margin-top: 4px; font-weight: 600; font-size: .88rem; color: var(--accent-ink); }
.cert-verify:hover { text-decoration: underline; text-underline-offset: 3px; }
.cert-modal { width: min(1100px, calc(100% - 24px)); padding: 0; }
.cert-modal img { width: 100%; max-height: calc(100dvh - 120px); object-fit: contain; background: #fff; display: block; }
.cert-modal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; font-size: .9rem; color: var(--muted); flex-wrap: wrap; }
