/* =========================================================
   Ahsan Raza · Portfolio
   Apple-style glass UI. No framework, no build step.
   ========================================================= */

/* ---------- tokens ---------- */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 28px;
  --radius-sm: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --maxw: 1240px;
  --gutter: clamp(16px, 5vw, 48px);

  --a1: #5B8CFF;
  --a2: #A855F7;
  --a3: #22D3EE;
  --a4: #FF5C93;
  --ok: #34D399;
}

:root,
[data-theme="dark"] {
  --bg: #05060B;
  --text: #F4F6FB;
  --muted: rgba(224, 230, 255, .66);
  --faint: rgba(224, 230, 255, .42);
  --glass: rgba(255, 255, 255, .045);
  --glass-strong: rgba(255, 255, 255, .095);
  --stroke: rgba(255, 255, 255, .11);
  --stroke-hi: rgba(255, 255, 255, .26);
  --shadow: 0 30px 80px -24px rgba(0, 0, 0, .65);
  --blob-op: .5;
  --glare: rgba(255, 255, 255, .14);
  --chip: rgba(255, 255, 255, .06);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #EDF0F7;
  --text: #0B0D14;
  --muted: rgba(22, 28, 48, .68);
  --faint: rgba(22, 28, 48, .45);
  --glass: rgba(255, 255, 255, .42);
  --glass-strong: rgba(255, 255, 255, .72);
  --stroke: rgba(255, 255, 255, .8);
  --stroke-hi: rgba(255, 255, 255, 1);
  --shadow: 0 30px 70px -26px rgba(40, 52, 96, .28);
  --blob-op: .42;
  --glare: rgba(255, 255, 255, .55);
  --chip: rgba(255, 255, 255, .55);
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: color-mix(in srgb, var(--a2) 45%, transparent); }
:focus-visible { outline: 2px solid var(--a3); outline-offset: 3px; border-radius: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- ambient layers ---------- */
.aurora {
  position: fixed; inset: -25vmax; z-index: -3; pointer-events: none;
  filter: blur(90px) saturate(130%); opacity: var(--blob-op);
  transition: opacity .8s var(--ease);
}
.aurora span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; will-change: transform; }
.aurora .b1 { background: radial-gradient(circle, var(--a1) 0, transparent 62%); top: 5%; left: 15%; animation: drift-a 26s var(--ease) infinite alternate; }
.aurora .b2 { background: radial-gradient(circle, var(--a2) 0, transparent 62%); top: 25%; right: 5%; animation: drift-b 32s var(--ease) infinite alternate; }
.aurora .b3 { background: radial-gradient(circle, var(--a3) 0, transparent 62%); bottom: 0; left: 30%; animation: drift-c 38s var(--ease) infinite alternate; }
.aurora .b4 { background: radial-gradient(circle, var(--a4) 0, transparent 62%); bottom: 15%; right: 30%; opacity: .7; animation: drift-d 30s var(--ease) infinite alternate; }
@keyframes drift-a { to { transform: translate(18vmax, 22vmax) scale(1.25); } }
@keyframes drift-b { to { transform: translate(-24vmax, 14vmax) scale(.85); } }
@keyframes drift-c { to { transform: translate(-14vmax, -24vmax) scale(1.2); } }
@keyframes drift-d { to { transform: translate(22vmax, -12vmax) scale(1.1); } }

.vignette {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, transparent 40%, color-mix(in srgb, var(--bg) 70%, transparent) 100%);
}
.grain {
  position: fixed; inset: -50%; z-index: -1; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
[data-theme="light"] .grain { opacity: .05; }
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
}
.cursor-glow {
  position: fixed; left: 0; top: 0; z-index: -1; width: 640px; height: 640px; margin: -320px 0 0 -320px;
  border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--a1) 22%, transparent), transparent 62%);
  transition: opacity .6s var(--ease);
  will-change: transform;
}
.has-pointer .cursor-glow { opacity: 1; }
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--a3), var(--a1), var(--a2), var(--a4));
}

/* ---------- glass ---------- */
.glass {
  position: relative;
  background: linear-gradient(160deg, var(--glass-strong), var(--glass) 60%);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--stroke-hi), inset 0 -1px 0 rgba(255, 255, 255, .03), var(--shadow);
  border-radius: var(--radius);
}
/* cursor spotlight + lit edge */
.spot::before,
.spot::after { content: ""; position: absolute; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s var(--ease); }
.spot::before { inset: 0; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--glare), transparent 42%); }
.spot::after {
  inset: -1px; padding: 1px;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .75), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.spot:hover::before, .spot:hover::after { opacity: 1; }

/* ---------- layout ---------- */
.section { position: relative; max-width: var(--maxw); margin: 0 auto; padding: clamp(80px, 12vw, 150px) var(--gutter) 0; }
.sec-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 13px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: linear-gradient(90deg, var(--a3), var(--a2)); }
h2 {
  font-size: clamp(36px, 5.6vw, 68px); line-height: 1.02; letter-spacing: -.035em; font-weight: 700; margin-top: 18px;
}
h2 .dim { color: var(--faint); }
.sec-head p { margin-top: 18px; font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); max-width: 620px; }
.grad {
  background: linear-gradient(90deg, var(--a3), var(--a1), var(--a2), var(--a4), var(--a3));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 8s linear infinite;
}
@keyframes shine { to { background-position: -200% center; } }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 26px; border-radius: 999px; font-weight: 600; font-size: 16px; letter-spacing: -.01em;
  transition: transform .5s var(--spring), box-shadow .4s var(--ease), background .4s var(--ease);
  will-change: transform; overflow: hidden; isolation: isolate;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--a1), var(--a2)); box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--a2) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(135deg, var(--a3), var(--a1) 40%, var(--a2) 70%, var(--a4));
  background-size: 300% 300%; opacity: 0; transition: opacity .4s var(--ease); animation: flow 6s linear infinite;
}
.btn-primary:hover::before { opacity: 1; }
@keyframes flow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.btn-ghost { background: var(--chip); border: 1px solid var(--stroke); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: inset 0 1px 0 var(--stroke-hi); }
.btn-ghost:hover { background: var(--glass-strong); }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn .ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255, 255, 255, .45); animation: ripple .7s var(--ease) forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ---------- nav ---------- */
.nav-wrap { position: fixed; top: 14px; left: 0; right: 0; z-index: 50; display: flex; justify-content: center; padding: 0 12px; pointer-events: none; }
.nav {
  pointer-events: auto; display: flex; align-items: center; gap: 6px; height: 60px; padding: 0 8px 0 10px; border-radius: 999px;
  animation: drop-in 1s var(--ease) .1s both;
}
@keyframes drop-in { from { opacity: 0; transform: translateY(-30px) scale(.9); filter: blur(10px); } }
.brand {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; letter-spacing: -.02em; color: #fff;
  background: conic-gradient(from 210deg, var(--a3), var(--a1), var(--a2), var(--a4), var(--a3));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 6px 18px -6px color-mix(in srgb, var(--a2) 80%, transparent);
}
.links { position: relative; display: flex; align-items: center; margin: 0 6px; }
.links a { position: relative; z-index: 1; padding: 10px 16px; font-size: 14.5px; font-weight: 500; color: var(--muted); transition: color .3s var(--ease); }
.links a:hover, .links a.active { color: var(--text); }
.links .indicator {
  position: absolute; top: 50%; left: 0; height: 38px; width: 0; translate: 0 -50%; border-radius: 999px; z-index: 0; opacity: 0;
  background: var(--glass-strong); border: 1px solid var(--stroke); box-shadow: inset 0 1px 0 var(--stroke-hi);
  transition: left .55s var(--spring), width .55s var(--spring), opacity .3s;
}
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: color .3s, background .3s, transform .5s var(--spring); }
.icon-btn:hover { color: var(--text); background: var(--chip); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .sun { display: none; }
[data-theme="light"] .theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: none; }
.menu-btn { display: none; }
.mobile-menu {
  position: fixed; top: 84px; left: 12px; right: 12px; z-index: 49; padding: 10px; display: grid; gap: 4px;
  opacity: 0; transform: translateY(-12px) scale(.97); pointer-events: none; transition: opacity .35s var(--ease), transform .45s var(--spring);
}
.mobile-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.mobile-menu a { padding: 14px 16px; border-radius: 14px; font-weight: 600; font-size: 17px; }
.mobile-menu a:hover { background: var(--chip); }

/* theme switch: the new theme grows out of the toggle as a circle */
.theme-vt::view-transition-old(root), .theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
/* project popup: the poster morphs from the card into the popup */
::view-transition-group(shot) { animation-duration: .7s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
.modal.vt[open] { animation: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; max-width: var(--maxw); margin: 0 auto; min-height: 100svh;
  display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: clamp(24px, 4vw, 64px);
  padding: 130px var(--gutter) 90px;
}
.badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted);
  animation: rise 1s var(--ease) .15s both;
}
.dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: ping 2s var(--ease) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.8); opacity: 0; } }
.hero-name {
  margin-top: 26px; font-size: clamp(58px, 9.4vw, 132px); line-height: .9; letter-spacing: -.055em; font-weight: 800;
  perspective: 600px;
}
.hero-name .word { display: inline-block; white-space: nowrap; }
.hero-name .ch { display: inline-block; opacity: 0; transform-origin: 50% 100%; animation: ch-in 1.1s var(--ease) both; animation-delay: calc(var(--i) * 55ms + 250ms); }
@keyframes ch-in { from { opacity: 0; transform: translateY(.55em) rotateX(-70deg) scale(.9); filter: blur(14px); } to { opacity: 1; transform: none; filter: blur(0); } }
.hero-role { margin-top: 22px; font-size: clamp(22px, 2.6vw, 32px); font-weight: 650; letter-spacing: -.025em; animation: rise 1s var(--ease) .9s both; }
.hero-lead { margin-top: 16px; max-width: 560px; font-size: clamp(16px, 1.5vw, 19px); color: var(--muted); animation: rise 1s var(--ease) 1.05s both; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; animation: rise 1s var(--ease) 1.2s both; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); filter: blur(8px); } }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 44px; max-width: 560px; }
.stat { padding: 16px 18px; border-radius: 20px; animation: rise 1s var(--ease) both; }
.stat:nth-child(1) { animation-delay: 1.35s; }
.stat:nth-child(2) { animation-delay: 1.45s; }
.stat:nth-child(3) { animation-delay: 1.55s; }
.stat b { display: block; font-size: clamp(26px, 3vw, 34px); font-weight: 750; letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat > span { font-size: 13.5px; color: var(--faint); }

/* portrait */
.hero-visual { position: relative; aspect-ratio: 4 / 5; width: 100%; max-width: 520px; justify-self: end; perspective: 1400px; animation: portrait-in 1.6s var(--ease) .35s both; }
@keyframes portrait-in { from { opacity: 0; transform: translateY(40px) scale(.92); filter: blur(24px); } }
.stage3d { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .9s var(--ease); }
.portrait { position: absolute; inset: 7% 4% 0; border-radius: 48px; overflow: hidden; transform: translateZ(0); }
.portrait::before {
  content: ""; position: absolute; inset: -40%; z-index: 0; opacity: .6; animation: spin 18s linear infinite;
  background:
    radial-gradient(38% 38% at 30% 30%, color-mix(in srgb, var(--a3) 85%, transparent), transparent 70%),
    radial-gradient(40% 40% at 72% 34%, color-mix(in srgb, var(--a2) 85%, transparent), transparent 70%),
    radial-gradient(42% 42% at 66% 74%, color-mix(in srgb, var(--a4) 75%, transparent), transparent 70%),
    radial-gradient(40% 40% at 28% 72%, color-mix(in srgb, var(--a1) 85%, transparent), transparent 70%);
}
.portrait::after {
  content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .22) 45%, transparent 60%);
  background-size: 250% 100%; animation: sheen 7s var(--ease) 2.2s infinite;
}
@keyframes sheen { 0% { background-position: 150% 0; } 35%, 100% { background-position: -100% 0; } }
@keyframes spin { to { transform: rotate(1turn); } }
.portrait img { position: absolute; z-index: 1; bottom: 0; left: 50%; width: 96%; translate: -50% 0; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .35)); }
/* flat ellipse behind the portrait: a tilted 3D ring would slice through the portrait plane and leave a seam */
.orbit { position: absolute; left: -8%; right: -8%; top: 30%; height: 46%; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--text) 20%, transparent); transform: translateZ(-80px); pointer-events: none; }
/* parallax uses `translate`, entrance uses opacity/scale/filter, idle bob uses `transform`: they compose without fighting */
.chip-float {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 11px 15px; border-radius: 18px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  translate: calc(var(--px, 0) * var(--depth, 20) * 1px) calc(var(--py, 0) * var(--depth, 20) * 1px) 60px;
  transition: translate .9s var(--ease);
  animation: chip-in 1.1s var(--spring) both, bob 6s ease-in-out infinite;
}
.chip-float .ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.chip-float .ico svg { width: 16px; height: 16px; }
.chip-float small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.c1 { top: 12%; left: -8%; --depth: 34; animation-delay: 1.4s, 0s; }
.c2 { top: 40%; right: -9%; --depth: 22; animation-delay: 1.55s, -1.5s; }
.c3 { bottom: 20%; left: -12%; --depth: 28; animation-delay: 1.7s, -3s; }
.c4 { bottom: 4%; right: -2%; --depth: 40; animation-delay: 1.85s, -4.5s; }
@keyframes chip-in { from { opacity: 0; scale: .6; filter: blur(12px); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.mini-wave { display: flex; align-items: center; gap: 2px; height: 16px; }
.mini-wave i { width: 3px; border-radius: 2px; background: #fff; animation: wave 1s ease-in-out infinite; }
.mini-wave i:nth-child(2) { animation-delay: -.2s; }
.mini-wave i:nth-child(3) { animation-delay: -.4s; }
.mini-wave i:nth-child(4) { animation-delay: -.6s; }
.scroll-cue { position: absolute; left: 50%; bottom: 26px; translate: -50% 0; width: 26px; height: 42px; border-radius: 14px; border: 1.5px solid var(--faint); animation: rise 1s var(--ease) 2s both; }
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--text); animation: wheel 1.8s var(--ease) infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- marquee ---------- */
.marquee {
  position: relative; margin-top: 10px; padding: 18px 0; overflow: hidden;
  -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee .track { display: flex; gap: 14px; width: max-content; animation: marquee 48s linear infinite; }
.marquee.rev .track { animation-direction: reverse; animation-duration: 56s; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 7px)); } }
.tech {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px; white-space: nowrap;
  font: 500 15px var(--mono); color: var(--muted); background: var(--chip); border: 1px solid var(--stroke);
}
.tech i { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--a3), var(--a2)); }

/* ---------- bento ---------- */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tile { padding: 28px; display: flex; flex-direction: column; min-height: 300px; overflow: hidden; transition: transform .7s var(--spring); }
.tile.wide { grid-column: span 2; }
.tile:hover { transform: translateY(-6px); }
.tile .vis { position: relative; flex: 1; min-height: 130px; display: grid; place-items: center; margin-bottom: 18px; }
.tile h3 { font-size: 21px; letter-spacing: -.02em; font-weight: 700; }
.tile p { margin-top: 8px; color: var(--muted); font-size: 15px; }
.tile .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tile .tags span { font: 500 12px var(--mono); padding: 5px 10px; border-radius: 999px; background: var(--chip); border: 1px solid var(--stroke); color: var(--muted); }

/* tile: apps (fanned phones) */
.phones { position: relative; width: 240px; height: 150px; }
.phones .ph {
  position: absolute; bottom: 0; left: 50%; width: 82px; height: 150px; margin-left: -41px; border-radius: 18px; padding: 6px;
  background: linear-gradient(160deg, var(--glass-strong), var(--glass)); border: 1px solid var(--stroke); box-shadow: inset 0 1px 0 var(--stroke-hi), 0 18px 40px -16px rgba(0, 0, 0, .5);
  transition: transform .8s var(--spring);
}
.phones .ph::before { content: ""; position: absolute; inset: 6px; border-radius: 13px; background: var(--g); opacity: .9; }
.phones .ph::after { content: attr(data-l); position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font: 600 11px var(--font); color: #fff; }
.phones .p1 { --g: linear-gradient(160deg, var(--a3), var(--a1)); transform: rotate(-14deg) translateX(-62px); }
.phones .p2 { --g: linear-gradient(160deg, var(--a1), var(--a2)); z-index: 1; transform: translateY(-8px); }
.phones .p3 { --g: linear-gradient(160deg, var(--a2), var(--a4)); transform: rotate(14deg) translateX(62px); }
.tile:hover .p1 { transform: rotate(-20deg) translateX(-88px) translateY(-6px); }
.tile:hover .p2 { transform: translateY(-18px) scale(1.04); }
.tile:hover .p3 { transform: rotate(20deg) translateX(88px) translateY(-6px); }

/* tile: calls */
.call { display: flex; align-items: center; gap: 0; }
.call .av { position: relative; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; z-index: 1; }
.call .av::before, .call .av::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor; opacity: .5; animation: ring 2.4s var(--ease) infinite; }
.call .av::after { animation-delay: 1.2s; }
@keyframes ring { from { transform: scale(1); opacity: .55; } to { transform: scale(1.9); opacity: 0; } }
.call .a { background: linear-gradient(135deg, var(--a3), var(--a1)); color: var(--a3); }
.call .b { background: linear-gradient(135deg, var(--a2), var(--a4)); color: var(--a4); }
.call .av span { color: #fff; position: relative; }
.call .line { position: relative; width: 90px; height: 2px; background: repeating-linear-gradient(90deg, var(--faint) 0 6px, transparent 6px 12px); }
.call .line i { position: absolute; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--a3); box-shadow: 0 0 12px var(--a3); animation: packet 1.8s linear infinite; }
.call .line i:nth-child(2) { background: var(--a4); box-shadow: 0 0 12px var(--a4); animation-direction: reverse; animation-delay: -.9s; }
@keyframes packet { from { left: -4px; } to { left: calc(100% - 4px); } }
.timer { position: absolute; bottom: 0; left: 50%; translate: -50% 0; white-space: nowrap; font: 500 12px var(--mono); color: var(--ok); display: flex; align-items: center; gap: 6px; }
.timer::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

/* tile: voice waveform */
.wave { display: flex; align-items: center; gap: 4px; height: 90px; }
.wave i { width: 5px; height: 100%; border-radius: 4px; background: linear-gradient(var(--a3), var(--a2)); transform-origin: 50% 50%; animation: wave 1.2s ease-in-out infinite; animation-delay: calc(var(--i) * -90ms); }
@keyframes wave { 0%, 100% { transform: scaleY(.18); } 50% { transform: scaleY(var(--h, .9)); } }

/* tile: smart glasses */
.glasses { position: relative; width: 190px; height: 110px; display: grid; place-items: center; color: var(--text); }
.glasses svg { width: 170px; height: 80px; }
.glasses .scan { position: absolute; left: 6px; right: 6px; height: 2px; top: 20%; background: linear-gradient(90deg, transparent, var(--a3), transparent); box-shadow: 0 0 16px var(--a3); animation: scan 2.6s var(--ease) infinite; }
@keyframes scan { 0%, 100% { top: 22%; opacity: 0; } 15% { opacity: 1; } 50% { top: 74%; opacity: 1; } 65% { opacity: 0; } }
.say { position: absolute; bottom: -4px; font: 500 12px var(--mono); padding: 6px 10px; border-radius: 999px; background: var(--chip); border: 1px solid var(--stroke); color: var(--muted); }

/* tile: secure chat */
.chat { width: 100%; max-width: 230px; display: grid; gap: 8px; }
.chat .m { padding: 9px 12px; border-radius: 16px; font-size: 13px; max-width: 85%; opacity: 0; animation: msg 6s var(--ease) infinite; }
.chat .m.in { background: var(--chip); border: 1px solid var(--stroke); border-bottom-left-radius: 6px; }
.chat .m.out { justify-self: end; color: #fff; background: linear-gradient(135deg, var(--a1), var(--a2)); border-bottom-right-radius: 6px; animation-delay: 1s; }
.chat .m.typing { display: flex; gap: 4px; padding: 12px 14px; width: max-content; animation-delay: 2s; }
.chat .m.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.chat .m.typing i:nth-child(2) { animation-delay: .15s; }
.chat .m.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes msg { 0% { opacity: 0; transform: translateY(10px) scale(.95); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes blink { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.lock { position: absolute; top: 0; right: 4px; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.lock svg { width: 17px; height: 17px; }

/* tile: team lead (kanban) */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 420px; }
.col { position: relative; border-radius: 14px; padding: 10px; min-height: 120px; background: var(--chip); border: 1px solid var(--stroke); }
.col b { display: block; font: 500 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.card-k { height: 22px; border-radius: 7px; margin-bottom: 6px; background: color-mix(in srgb, var(--text) 10%, transparent); }
.card-k.mv { position: absolute; left: 10px; right: 10px; top: 32px; background: linear-gradient(90deg, var(--a1), var(--a2)); box-shadow: 0 8px 20px -8px var(--a2); animation: kanban 7s var(--ease) infinite; }
@keyframes kanban {
  0%, 12% { transform: translateX(0); }
  30%, 45% { transform: translateX(calc(100% + 30px)); }
  63%, 85% { transform: translateX(calc(200% + 60px)); background: linear-gradient(90deg, var(--ok), var(--a3)); }
  100% { transform: translateX(calc(200% + 60px)); opacity: 0; }
}

/* ---------- work ---------- */
.filters { position: relative; display: inline-flex; gap: 2px; padding: 5px; border-radius: 999px; margin-bottom: 30px; }
.filters button { position: relative; z-index: 1; padding: 10px 18px; border-radius: 999px; font-size: 14.5px; font-weight: 600; color: var(--muted); transition: color .3s; }
.filters button[aria-selected="true"] { color: var(--text); }
.filters .pill { position: absolute; top: 5px; bottom: 5px; left: 5px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--stroke); box-shadow: inset 0 1px 0 var(--stroke-hi), 0 6px 18px -8px rgba(0, 0, 0, .4); transition: left .55s var(--spring), width .55s var(--spring); }
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { padding: 12px; border-radius: 26px; transform-style: preserve-3d; transition: transform .6s var(--ease), opacity .5s var(--ease); cursor: pointer; text-align: left; width: 100%; }
.card.is-hidden { display: none; }
.card .shot { position: relative; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: #0A0F1E; }
.card .shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.card:hover .shot img { transform: scale(1.06); }
.card .shot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0, 0, 0, .35)); opacity: 0; transition: opacity .5s; }
.card:hover .shot::after { opacity: 1; }
.card .open {
  position: absolute; right: 12px; bottom: 12px; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fff;
  background: rgba(10, 12, 20, .45); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .2);
  opacity: 0; transform: translateY(8px); transition: opacity .4s var(--ease), transform .5s var(--spring);
}
.card:hover .open, .card:focus-visible .open { opacity: 1; transform: none; }
.card .body { padding: 16px 8px 8px; }
.card .cat { font: 500 11.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.card h3 { margin-top: 6px; font-size: 19px; line-height: 1.25; letter-spacing: -.02em; font-weight: 700; }
.card p { margin-top: 6px; font-size: 14px; color: var(--muted); }

/* ---------- modal ---------- */
.modal {
  margin: auto; width: min(980px, calc(100vw - 24px)); max-height: calc(100svh - 24px); padding: 0; overflow: hidden;
  color: var(--text); border-radius: 30px; background: linear-gradient(160deg, var(--glass-strong), var(--glass) 70%);
}
[data-theme="dark"] .modal { background: linear-gradient(160deg, rgba(30, 34, 52, .78), rgba(12, 14, 24, .78)); }
[data-theme="light"] .modal { background: linear-gradient(160deg, rgba(255, 255, 255, .86), rgba(240, 243, 250, .82)); }
.modal[open] { animation: pop .6s var(--spring); }
.modal::backdrop { background: rgba(4, 6, 12, .45); -webkit-backdrop-filter: blur(10px) saturate(120%); backdrop-filter: blur(10px) saturate(120%); animation: fade .4s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(30px) scale(.94); filter: blur(10px); } }
@keyframes fade { from { opacity: 0; } }
.modal .inner { display: grid; grid-template-columns: 1.15fr 1fr; max-height: calc(100svh - 24px); }
.modal .m-shot { position: relative; background: #0A0F1E; min-height: 320px; }
.modal .m-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 84% 50%; }
.modal .m-body { padding: 34px 32px 30px; overflow-y: auto; }
.modal .m-body .cat { font: 500 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.modal h3 { margin-top: 8px; font-size: clamp(24px, 2.6vw, 30px); line-height: 1.12; letter-spacing: -.03em; }
.modal .stack { margin-top: 6px; color: var(--muted); font-size: 15px; }
.modal .role { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--chip); border: 1px solid var(--stroke); }
.modal .role::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.modal .desc { margin-top: 18px; display: grid; gap: 12px; font-size: 15.5px; color: var(--muted); }
.modal .desc b { color: var(--text); font-weight: 650; }
.modal .skills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.modal .skills span { font: 500 12.5px var(--mono); padding: 7px 12px; border-radius: 999px; background: var(--chip); border: 1px solid var(--stroke); }
.modal .close { position: absolute; top: 14px; right: 14px; z-index: 2; background: rgba(10, 12, 20, .45); color: #fff; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .2); }
.modal .close:hover { transform: rotate(90deg); background: rgba(10, 12, 20, .65); }
.modal .nav-row { display: flex; gap: 10px; margin-top: 26px; }

/* ---------- experience ---------- */
.timeline { position: relative; padding-left: 46px; }
.jobs { list-style: none; display: grid; gap: 18px; }
.timeline .rail { position: absolute; left: 14px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--stroke); overflow: hidden; }
.timeline .rail i { position: absolute; inset: 0; transform-origin: 50% 0; transform: scaleY(var(--fill, 0)); background: linear-gradient(var(--a3), var(--a1), var(--a2), var(--a4)); }
.job { position: relative; padding: 24px 26px; display: grid; grid-template-columns: 190px 1fr; gap: 6px 24px; }
.job::before {
  content: ""; position: absolute; left: -39px; top: 30px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--faint); transition: border-color .5s, box-shadow .5s, background .5s;
}
.job.in::before { border-color: var(--a3); background: var(--a3); box-shadow: 0 0 0 6px color-mix(in srgb, var(--a3) 20%, transparent), 0 0 18px var(--a3); }
.job .when { font: 500 13px var(--mono); color: var(--faint); padding-top: 4px; }
.job .when .now { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--ok); }
.job .when .now::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.job h3 { font-size: 20px; letter-spacing: -.02em; }
.job .org { color: var(--muted); font-size: 15px; margin-top: 2px; }
.job ul { grid-column: 2; margin-top: 10px; display: grid; gap: 6px; padding-left: 18px; color: var(--muted); font-size: 15px; }
.job ul li::marker { color: var(--a3); }
.edu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; padding-left: 46px; }
.edu .glass { padding: 22px 24px; }
.edu b { display: block; font-size: 17px; letter-spacing: -.01em; }
.edu span { color: var(--muted); font-size: 14.5px; }

/* ---------- contact ---------- */
.contact { position: relative; padding: clamp(36px, 6vw, 72px); border-radius: 40px; overflow: hidden; text-align: center; }
.contact::before {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), transparent 0 60%, var(--a3), var(--a1), var(--a2), var(--a4), transparent 95%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: border-spin 6s linear infinite;
}
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes border-spin { to { --ang: 360deg; } }
.contact h2 { max-width: 820px; margin-left: auto; margin-right: auto; }
.contact p.lead { margin: 20px auto 0; max-width: 560px; color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); }
.contact .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }
.contact .meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin-top: 30px; font-size: 14px; color: var(--faint); }
.contact .meta span { display: inline-flex; align-items: center; gap: 8px; }
.contact .meta svg { width: 16px; height: 16px; }
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 80; translate: -50% 0; padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  opacity: 0; transform: translateY(16px) scale(.96); pointer-events: none; transition: opacity .35s var(--ease), transform .5s var(--spring);
}
.toast.show { opacity: 1; transform: none; }

footer { max-width: var(--maxw); margin: 0 auto; padding: 60px var(--gutter) 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--faint); font-size: 14px; }
footer a:hover { color: var(--text); }

/* ---------- reveal on scroll ---------- */
/* reveal animates translate/scale (not transform) so hover lifts and 3D tilt keep working */
.js .reveal { opacity: 0; translate: 0 46px; scale: .97; filter: blur(12px); }
.js .reveal, .js .reveal.in {
  transition-property: opacity, translate, scale, filter, transform;
  transition-duration: 1.1s, 1.1s, 1.1s, 1.1s, .7s;
  transition-timing-function: var(--ease), var(--ease), var(--ease), var(--ease), var(--spring);
  transition-delay: var(--d, 0s), var(--d, 0s), var(--d, 0s), var(--d, 0s), 0s;
}
.js .reveal.in { opacity: 1; translate: 0 0; scale: 1; filter: none; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .links, .nav .btn-sm { display: none; }
  .menu-btn { display: grid; }
  .hero { grid-template-columns: 1fr; padding-top: 120px; text-align: left; }
  .hero-visual { justify-self: center; max-width: 420px; order: -1; margin-bottom: 6px; }
  .modal .inner { display: block; overflow-y: auto; }
  .modal .m-shot { min-height: 0; }
  .modal .m-shot img { position: static; height: auto; object-fit: contain; }
  .modal .m-body { overflow: visible; }
  .job { grid-template-columns: 1fr; }
  .job ul { grid-column: 1; }
}
@media (max-width: 640px) {
  .bento, .work-grid, .edu { grid-template-columns: 1fr; }
  .tile.wide { grid-column: auto; }
  .stats { gap: 8px; }
  .stat { padding: 12px 12px; }
  .stat span { font-size: 12px; }
  .hero-visual { max-width: 300px; }
  .c1 { top: 3%; left: -6%; } .c2 { top: auto; bottom: 24%; right: -8%; } .c3 { bottom: -3%; left: -8%; } .c4 { display: none; }
  .chip-float { font-size: 12.5px; padding: 9px 12px; }
  .chip-float .ico { width: 26px; height: 26px; }
  .timeline, .edu { padding-left: 34px; }
  .timeline .rail { left: 9px; }
  .job::before { left: -32px; }
  .job { padding: 20px; }
  .filters { display: flex; overflow-x: auto; max-width: 100%; }
  .filters button { padding: 10px 14px; white-space: nowrap; }
  .scroll-cue { display: none; }
  .glass { -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; translate: 0 0; scale: 1; filter: none; }
  .cursor-glow, .grain { display: none; }
}
