/* =========================================================
   Khushnoor - Portfolio
   Theme: Blue & Black  |  Light / Dark
   ========================================================= */

:root {
  --bg: #04060c;
  --bg-2: #070b16;
  --surface: rgba(14, 22, 44, 0.55);
  --surface-solid: #0b1222;
  --surface-2: rgba(22, 36, 72, 0.45);
  --border: rgba(80, 130, 255, 0.16);
  --border-strong: rgba(80, 140, 255, 0.38);
  --text: #e8eeff;
  --text-2: #a4b2d4;
  --text-3: #6b7a9e;
  --accent: #2f7bff;
  --accent-2: #00c2ff;
  --accent-3: #6a5cff;
  --accent-soft: rgba(47, 123, 255, 0.14);
  --glow: 0 0 40px rgba(47, 123, 255, 0.35);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8);
  --grad: linear-gradient(120deg, #2f7bff 0%, #00c2ff 55%, #6a5cff 100%);
  --grid-line: rgba(80, 130, 255, 0.06);
  --header-bg: rgba(4, 6, 12, 0.6);
  --radius: 18px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f3f6fd;
  --bg-2: #e9eef9;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface-2: rgba(232, 240, 255, 0.8);
  --border: rgba(20, 60, 160, 0.12);
  --border-strong: rgba(29, 91, 255, 0.35);
  --text: #0a1226;
  --text-2: #3d4a68;
  --text-3: #6d7a98;
  --accent: #1d5bff;
  --accent-2: #0096d6;
  --accent-3: #5a46e8;
  --accent-soft: rgba(29, 91, 255, 0.09);
  --glow: 0 0 40px rgba(29, 91, 255, 0.18);
  --shadow: 0 20px 50px -24px rgba(20, 40, 100, 0.35);
  --grad: linear-gradient(120deg, #1d5bff 0%, #0096d6 55%, #5a46e8 100%);
  --grid-line: rgba(20, 60, 160, 0.06);
  --header-bg: rgba(243, 246, 253, 0.7);
  color-scheme: light;
}

*, *::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.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--accent), var(--accent-3)); border-radius: 10px; border: 2px solid var(--bg); }

/* ---------- Background layers ---------- */
#bg3d {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: -2; pointer-events: none;
}
.bg-grid {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}
.bg-glow {
  position: fixed; z-index: -3; pointer-events: none; border-radius: 50%;
  filter: blur(90px); opacity: .5;
}
.bg-glow.g1 { width: 520px; height: 520px; background: var(--accent); top: -180px; left: -160px; opacity: .22; animation: float-glow 18s ease-in-out infinite; }
.bg-glow.g2 { width: 460px; height: 460px; background: var(--accent-3); bottom: -200px; right: -140px; opacity: .18; animation: float-glow 22s ease-in-out infinite reverse; }
:root[data-theme="light"] .bg-glow { opacity: .14; }
@keyframes float-glow { 50% { transform: translate(80px, 60px) scale(1.15); } }

/* ---------- Layout ---------- */
.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
section { position: relative; padding: 110px 0; }
.section-sm { padding: 70px 0; }
main { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-2);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.section-head { margin-bottom: 56px; max-width: 720px; }
.section-head.center { text-align: center; margin-inline: auto; }
.section-head.center .eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; }
h2.title { font-size: clamp(2rem, 4.5vw, 3.3rem); margin-top: 14px; }
.lead { color: var(--text-2); font-size: 1.08rem; margin-top: 16px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--text-2); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s, color .3s, border-color .3s;
  overflow: hidden; isolation: isolate; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; transition: transform .35s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px var(--accent); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform .8s var(--ease);
}
.btn-primary:hover::after { transform: translateX(100%); }
.btn-primary:hover { box-shadow: 0 16px 40px -10px var(--accent); }
.btn-ghost { border: 1px solid var(--border-strong); background: var(--surface); backdrop-filter: blur(10px); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .4s, backdrop-filter .4s, border-color .4s, transform .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { background: var(--header-bg); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); border-color: var(--border); }
.site-header.hide { transform: translateY(-100%); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-size: 1.1rem; box-shadow: var(--glow);
  transform-style: preserve-3d; animation: logo-spin 8s var(--ease) infinite;
}
@keyframes logo-spin { 0%, 70% { transform: rotateY(0); } 85%, 100% { transform: rotateY(360deg); } }
.logo span.dot { color: var(--accent-2); }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav-links a {
  position: relative; padding: 8px 14px; border-radius: 999px; font-size: .93rem; color: var(--text-2);
  transition: color .3s, background .3s;
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-2); transform: translateX(-50%); box-shadow: 0 0 10px var(--accent-2);
}
.nav-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  position: relative; width: 64px; height: 34px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
}
.theme-toggle .knob {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center; color: #fff;
  transition: transform .5s var(--ease); box-shadow: 0 4px 12px -2px var(--accent);
}
.theme-toggle .knob svg { width: 15px; height: 15px; }
:root[data-theme="light"] .theme-toggle .knob { transform: translateX(30px) rotate(360deg); }
.theme-toggle .ico-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ico-sun { display: block; }
:root[data-theme="light"] .theme-toggle .ico-moon { display: none; }

.burger { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); position: relative; }
.burger span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .4s var(--ease), opacity .3s; }
.burger span:nth-child(1) { top: 14px; } .burger span:nth-child(2) { top: 20px; } .burger span:nth-child(3) { top: 26px; }
.menu-open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; }
.menu-open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 99; background: var(--bg);
  display: flex; flex-direction: column; justify-content: center; padding: 100px 28px 40px;
  clip-path: circle(0% at calc(100% - 40px) 38px); transition: clip-path .7s var(--ease);
  pointer-events: none;
}
.menu-open .mobile-menu { clip-path: circle(150% at calc(100% - 40px) 38px); pointer-events: auto; }
.mobile-menu a {
  display: flex; align-items: baseline; gap: 16px; padding: 12px 0; font-family: var(--font-display);
  font-size: clamp(2rem, 9vw, 3rem); font-weight: 700; border-bottom: 1px solid var(--border);
  opacity: 0; transform: translateY(30px); transition: opacity .5s, transform .5s var(--ease), color .3s;
}
.mobile-menu a small { font-family: var(--mono); font-size: .8rem; color: var(--accent-2); }
.mobile-menu a.active, .mobile-menu a:hover { color: var(--accent); }
.menu-open .mobile-menu a { opacity: 1; transform: none; }
.menu-open .mobile-menu a:nth-child(1) { transition-delay: .15s; }
.menu-open .mobile-menu a:nth-child(2) { transition-delay: .2s; }
.menu-open .mobile-menu a:nth-child(3) { transition-delay: .25s; }
.menu-open .mobile-menu a:nth-child(4) { transition-delay: .3s; }
.menu-open .mobile-menu a:nth-child(5) { transition-delay: .35s; }
.menu-open .mobile-menu a:nth-child(6) { transition-delay: .4s; }

/* ---------- Preloader & page transition ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 1000; background: var(--bg);
  display: grid; place-items: center; transition: opacity .6s var(--ease), visibility .6s;
}
.preloader.done { opacity: 0; visibility: hidden; }
.loader-cube { width: 54px; height: 54px; position: relative; transform-style: preserve-3d; animation: cube-rot 2.2s var(--ease) infinite; }
.loader-cube div { position: absolute; inset: 0; border: 2px solid var(--accent); background: var(--accent-soft); }
.loader-cube div:nth-child(1) { transform: translateZ(27px); }
.loader-cube div:nth-child(2) { transform: rotateY(180deg) translateZ(27px); }
.loader-cube div:nth-child(3) { transform: rotateY(90deg) translateZ(27px); border-color: var(--accent-2); }
.loader-cube div:nth-child(4) { transform: rotateY(-90deg) translateZ(27px); border-color: var(--accent-2); }
.loader-cube div:nth-child(5) { transform: rotateX(90deg) translateZ(27px); border-color: var(--accent-3); }
.loader-cube div:nth-child(6) { transform: rotateX(-90deg) translateZ(27px); border-color: var(--accent-3); }
@keyframes cube-rot { 0% { transform: rotateX(-25deg) rotateY(0); } 100% { transform: rotateX(-25deg) rotateY(360deg); } }
.loader-text { margin-top: 26px; font-family: var(--mono); font-size: .8rem; letter-spacing: .3em; color: var(--text-2); text-align: center; }

.page-wipe {
  position: fixed; inset: 0; z-index: 999; pointer-events: none;
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.page-wipe span { background: var(--grad); transform: scaleY(0); transform-origin: bottom; transition: transform .45s var(--ease); }
.page-wipe span:nth-child(2) { transition-delay: .04s; } .page-wipe span:nth-child(3) { transition-delay: .08s; }
.page-wipe span:nth-child(4) { transition-delay: .12s; } .page-wipe span:nth-child(5) { transition-delay: .16s; }
.leaving .page-wipe span { transform: scaleY(1); }

/* ---------- Cursor ---------- */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 1001; border-radius: 50%; }
.cursor-dot { width: 6px; height: 6px; background: var(--accent-2); margin: -3px 0 0 -3px; }
.cursor-ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1.5px solid var(--accent);
  transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background .3s, opacity .3s;
}
.cursor-ring.hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: var(--accent-soft); }
@media (hover: none), (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 101; background: var(--grad); transform-origin: left; transform: scaleX(0); }

/* ---------- Reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
[data-reveal="left"] { transform: translateX(-50px); }
[data-reveal="right"] { transform: translateX(50px); }
[data-reveal="zoom"] { transform: scale(.9); }
[data-reveal="flip"] { transform: perspective(900px) rotateX(25deg) translateY(40px); transform-origin: top; }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 120px 0 80px; }
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.status-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px 7px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-strong); backdrop-filter: blur(10px);
  font-size: .85rem; color: var(--text-2);
}
.status-pill .pulse { width: 9px; height: 9px; border-radius: 50%; background: #22d37a; box-shadow: 0 0 0 0 rgba(34,211,122,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34,211,122,0); } 100% { box-shadow: 0 0 0 0 rgba(34,211,122,0); } }
.hero h1 { font-size: clamp(2.8rem, 8vw, 6.2rem); margin: 22px 0 10px; letter-spacing: -0.04em; }
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span { display: inline-block; transform: translateY(110%); animation: rise 1.1s var(--ease) forwards; }
.hero h1 .line:nth-child(2) > span { animation-delay: .12s; }
@keyframes rise { to { transform: none; } }
.hero .role { font-family: var(--font-display); font-size: clamp(1.2rem, 2.6vw, 1.75rem); color: var(--text-2); min-height: 1.6em; }
.typed { color: var(--text); }
.typed-caret { display: inline-block; width: 3px; height: 1em; background: var(--accent-2); margin-left: 4px; vertical-align: -0.12em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero p.lead { max-width: 560px; }
.hero .btn-row { margin-top: 34px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 40px; color: var(--text-3); font-size: .9rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { width: 16px; height: 16px; color: var(--accent); }

.hero-card-stack { position: relative; height: 460px; perspective: 1200px; }
.code-card {
  position: absolute; left: -10px; bottom: -30px; width: min(340px, 100%); z-index: 1;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow);
  transform: rotateY(-14deg) rotateX(8deg); transform-style: preserve-3d;
  animation: card-float 7s ease-in-out infinite; font-family: var(--mono); font-size: .8rem;
}
@keyframes card-float { 50% { transform: rotateY(-8deg) rotateX(4deg) translateY(-14px); } }
.code-card .bar { display: flex; gap: 7px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.code-card .bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.code-card .bar i:nth-child(2) { background: #febc2e; } .code-card .bar i:nth-child(3) { background: #28c840; }
.code-card .bar b { margin-left: auto; font-weight: 400; color: var(--text-3); font-size: .75rem; }
.code-card pre { padding: 18px 20px; line-height: 1.8; color: var(--text-2); white-space: pre-wrap; }
.tk-k { color: #c678dd; } .tk-f { color: var(--accent-2); } .tk-s { color: #4ade80; } .tk-c { color: var(--text-3); } .tk-v { color: #f59e0b; }
:root[data-theme="light"] .tk-k { color: #8b2fc9; } :root[data-theme="light"] .tk-s { color: #0f8a43; } :root[data-theme="light"] .tk-v { color: #b45309; }

.float-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border-strong); backdrop-filter: blur(14px);
  font-size: .85rem; font-weight: 600; box-shadow: var(--shadow); animation: chip-float 6s ease-in-out infinite; z-index: 2;
}
.float-chip svg { width: 20px; height: 20px; color: var(--accent-2); }
.float-chip.c1 { top: 10px; left: 10px; }
.float-chip.c2 { top: 70px; right: -10px; animation-delay: -2s; }
.float-chip.c3 { bottom: 40px; right: 0; animation-delay: -4s; }
@keyframes chip-float { 50% { transform: translateY(-16px); } }

.scroll-cue { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-3); font-size: .72rem; letter-spacing: .25em; font-family: var(--mono); }
.scroll-cue .mouse { width: 24px; height: 38px; border: 2px solid var(--text-3); border-radius: 14px; position: relative; }
.scroll-cue .mouse::after { content: ""; position: absolute; top: 7px; left: 50%; width: 3px; height: 7px; background: var(--accent-2); border-radius: 3px; transform: translateX(-50%); animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding: 170px 0 60px; }
.page-hero h1 { font-size: clamp(2.6rem, 7vw, 5rem); margin-top: 16px; letter-spacing: -0.035em; }
.page-hero .lead { max-width: 680px; }
.breadcrumb { display: flex; gap: 8px; font-family: var(--mono); font-size: .8rem; color: var(--text-3); margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- Cards ---------- */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: border-color .4s, box-shadow .4s, transform .4s var(--ease);
  transform-style: preserve-3d;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--glow); }
.card .glare {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), rgba(80, 150, 255, .16), transparent 40%);
}
.card:hover .glare { opacity: 1; }
.card-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent-soft); border: 1px solid var(--border-strong); color: var(--accent-2); margin-bottom: 20px;
  transform: translateZ(30px);
}
.card-icon svg { width: 24px; height: 24px; }
.card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.card p { color: var(--text-2); font-size: .96rem; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface-solid); padding: 34px 26px; text-align: center; }
.stat .num { font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 700; }
.stat .lbl { color: var(--text-2); font-size: .9rem; margin-top: 4px; }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; padding: 26px 0; border-block: 1px solid var(--border); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 56px; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { display: inline-flex; align-items: center; gap: 56px; font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 700; color: var(--text-3); white-space: nowrap; transition: color .3s; }
.marquee-track span:hover { color: var(--accent); }
.marquee-track span::after { content: "✦"; color: var(--accent); font-size: .7em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Project cards ---------- */
.project-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project-visual {
  position: relative; height: 230px; overflow: hidden; border-bottom: 1px solid var(--border);
  background: radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 60%), var(--bg-2);
}
.project-visual .pv-num { position: absolute; top: 18px; left: 22px; font-family: var(--mono); font-size: .8rem; color: var(--text-3); }
.project-visual .pv-tag { position: absolute; top: 14px; right: 16px; padding: 5px 12px; border-radius: 999px; font-size: .75rem; background: var(--surface); border: 1px solid var(--border-strong); color: var(--accent-2); }
.mini-ui {
  position: absolute; left: 50%; top: 58%; width: 78%; height: 72%;
  transform: translate(-50%, -50%) perspective(800px) rotateX(22deg) rotateZ(-6deg);
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow); transition: transform .8s var(--ease); padding: 12px; display: grid; gap: 8px;
  grid-template-columns: 26% 1fr; grid-template-rows: 14px 1fr;
}
.project-card:hover .mini-ui { transform: translate(-50%, -54%) perspective(800px) rotateX(8deg) rotateZ(0) scale(1.04); }
.mini-ui .mu-top { grid-column: 1 / -1; display: flex; gap: 5px; }
.mini-ui .mu-top i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.mini-ui .mu-side { border-radius: 6px; background: var(--accent-soft); display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.mini-ui .mu-side b { height: 6px; border-radius: 4px; background: var(--border-strong); }
.mini-ui .mu-side b:first-child { background: var(--accent); width: 70%; }
.mini-ui .mu-main { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 34% 1fr; gap: 6px; }
.mini-ui .mu-main b { border-radius: 6px; background: var(--accent-soft); border: 1px solid var(--border); }
.mini-ui .mu-main b.chart { grid-column: 1 / -1; position: relative; overflow: hidden; }
.mini-ui .mu-main b.chart::after { content: ""; position: absolute; inset: 30% 6% 10%; background: linear-gradient(to top, var(--accent) 0 0) bottom / 100% 0 no-repeat; clip-path: polygon(0 80%, 15% 55%, 30% 65%, 45% 30%, 60% 45%, 75% 15%, 90% 30%, 100% 10%, 100% 100%, 0 100%); background: linear-gradient(var(--accent), transparent); opacity: .7; }
.project-body { padding: 28px; display: flex; flex-direction: column; flex: 1; }
.project-body .cat { font-family: var(--mono); font-size: .75rem; color: var(--accent-2); letter-spacing: .1em; text-transform: uppercase; }
.project-body h3 { font-size: 1.45rem; margin: 10px 0 10px; }
.project-body p { flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tag { padding: 5px 12px; border-radius: 999px; font-size: .78rem; background: var(--accent-soft); border: 1px solid var(--border); color: var(--text-2); }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; font-weight: 600; color: var(--accent); }
.link-arrow svg { width: 18px; height: 18px; transition: transform .35s var(--ease); }
.project-card:hover .link-arrow svg, .link-arrow:hover svg { transform: translateX(6px); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.filter-btn { padding: 9px 20px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: .9rem; transition: all .3s var(--ease); }
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 24px -8px var(--accent); }
.project-grid .project-card { transition: opacity .4s, transform .5s var(--ease), border-color .4s, box-shadow .4s; }
.project-grid .project-card.hidden { display: none; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 0; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--border); transform: translateX(-50%); }
.timeline-progress { position: absolute; left: 50%; top: 0; width: 2px; background: var(--grad); transform: translateX(-50%); height: 0; box-shadow: 0 0 12px var(--accent); }
.tl-item { position: relative; width: 50%; padding: 0 56px 70px 0; }
.tl-item:nth-of-type(even) { margin-left: 50%; padding: 0 0 70px 56px; }
.tl-dot { position: absolute; top: 28px; right: -11px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); z-index: 2; transition: background .4s, box-shadow .4s; }
.tl-item:nth-of-type(even) .tl-dot { right: auto; left: -11px; }
.tl-item.in .tl-dot { background: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft), 0 0 20px var(--accent); }
.tl-card .tl-date { display: inline-flex; padding: 5px 12px; border-radius: 999px; font-family: var(--mono); font-size: .76rem; background: var(--accent-soft); color: var(--accent-2); border: 1px solid var(--border-strong); }
.tl-card h3 { font-size: 1.5rem; margin: 16px 0 4px; }
.tl-card .company { color: var(--accent); font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.tl-card ul { list-style: none; display: grid; gap: 10px; }
.tl-card li { position: relative; padding-left: 22px; color: var(--text-2); font-size: .95rem; }
.tl-card li::before { content: ""; position: absolute; left: 0; top: .65em; width: 8px; height: 8px; border-radius: 2px; background: var(--grad); transform: rotate(45deg); }

/* ---------- Skills ---------- */
.skills-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.tag-sphere { position: relative; width: 100%; aspect-ratio: 1; max-width: 520px; margin-inline: auto; }
.tag-sphere span {
  position: absolute; left: 50%; top: 50%; white-space: nowrap; font-family: var(--font-display); font-weight: 600;
  padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text); will-change: transform, opacity; cursor: default; transition: background .3s, color .3s;
}
.tag-sphere span:hover { background: var(--accent); color: #fff; }
.skill-cat h3 { display: flex; align-items: center; gap: 12px; }
.skill-cat h3 .card-icon { margin: 0; width: 44px; height: 44px; }
.skill-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.skill-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); font-weight: 500; font-size: .92rem;
  transition: transform .3s var(--ease), border-color .3s, color .3s;
}
.skill-chip:hover { transform: translateY(-4px); border-color: var(--accent); color: var(--accent); }
.skill-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 60px; align-items: center; }
.avatar-3d { position: relative; aspect-ratio: 1; max-width: 440px; margin-inline: auto; width: 100%; perspective: 1000px; }
.avatar-inner {
  position: absolute; inset: 0; border-radius: 32px; transform-style: preserve-3d; transition: transform .2s;
  background: var(--grad); padding: 2px; box-shadow: var(--shadow), var(--glow);
}
.avatar-face {
  width: 100%; height: 100%; border-radius: 30px; background: var(--surface-solid); display: grid; place-items: center;
  position: relative; overflow: hidden;
}
.avatar-face::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 28px 28px; }
.avatar-initial { font-family: var(--font-display); font-size: clamp(7rem, 18vw, 11rem); font-weight: 700; line-height: 1; transform: translateZ(60px); position: relative; }
.avatar-badge {
  position: absolute; padding: 10px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-strong);
  backdrop-filter: blur(12px); font-size: .85rem; font-weight: 600; box-shadow: var(--shadow); transform: translateZ(80px);
  display: flex; align-items: center; gap: 10px;
}
.avatar-badge svg { width: 18px; height: 18px; color: var(--accent-2); }
.avatar-badge.b1 { top: 8%; left: -6%; } .avatar-badge.b2 { bottom: 10%; right: -6%; }
.about-text p { color: var(--text-2); margin-bottom: 18px; font-size: 1.04rem; }
.info-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 28px 0 32px; }
.info-list div { padding: 14px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.info-list small { display: block; color: var(--text-3); font-size: .78rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.info-list strong { font-weight: 600; font-size: .95rem; word-break: break-word; }

.edu-card { display: flex; gap: 22px; align-items: flex-start; }
.edu-card .card-icon { flex-shrink: 0; margin: 0; }
.edu-card .when { font-family: var(--mono); font-size: .8rem; color: var(--accent-2); }

/* ---------- CTA ---------- */
.cta-box {
  position: relative; overflow: hidden; border-radius: 28px; padding: clamp(40px, 7vw, 80px); text-align: center;
  background: var(--surface); border: 1px solid var(--border-strong); backdrop-filter: blur(16px);
}
.cta-box::before { content: ""; position: absolute; width: 600px; height: 600px; border-radius: 50%; background: var(--accent); filter: blur(140px); opacity: .18; top: -300px; left: 50%; transform: translateX(-50%); }
.cta-box h2 { font-size: clamp(2rem, 5vw, 3.6rem); position: relative; }
.cta-box p { position: relative; color: var(--text-2); max-width: 560px; margin: 18px auto 34px; }
.cta-box .btn-row { justify-content: center; position: relative; }
.cta-ring { position: absolute; border: 1px solid var(--border-strong); border-radius: 50%; animation: spin 30s linear infinite; }
.cta-ring.r1 { width: 520px; height: 520px; right: -200px; bottom: -260px; border-style: dashed; }
.cta-ring.r2 { width: 340px; height: 340px; left: -160px; top: -160px; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 30px; }
.contact-item { display: flex; align-items: center; gap: 18px; padding: 22px; margin-bottom: 16px; }
.contact-item .card-icon { margin: 0; flex-shrink: 0; }
.contact-item small { display: block; color: var(--text-3); font-size: .8rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.contact-item strong { font-size: 1.02rem; word-break: break-word; }
.contact-item:hover strong { color: var(--accent); }
.form { display: grid; gap: 18px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { position: relative; }
.field input, .field textarea, .field select {
  width: 100%; padding: 22px 18px 10px; border-radius: 14px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: .98rem; outline: none;
  transition: border-color .3s, box-shadow .3s;
}
.field textarea { min-height: 160px; resize: vertical; }
.field label { position: absolute; left: 18px; top: 16px; color: var(--text-3); font-size: .95rem; pointer-events: none; transition: all .25s var(--ease); }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { top: 6px; font-size: .72rem; color: var(--accent-2); }
.form-note { font-size: .85rem; color: var(--text-3); }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 140%); z-index: 200; padding: 14px 22px; border-radius: 14px;
  background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); transition: transform .5s var(--ease);
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
}
.toast svg { width: 20px; height: 20px; color: #22d37a; flex-shrink: 0; }
.toast.show { transform: translate(-50%, 0); }

/* ---------- Project detail ---------- */
.pd-hero { padding: 160px 0 40px; }
.pd-hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 50px; align-items: center; }
.pd-hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); margin: 16px 0 18px; letter-spacing: -0.035em; }
.pd-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: 34px; }
.pd-meta div { background: var(--surface-solid); padding: 18px 20px; }
.pd-meta small { display: block; font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: 4px; }
.pd-meta strong { font-size: .95rem; }

.device { position: relative; perspective: 1400px; height: 420px; }
.device-screen {
  position: absolute; inset: 20px 0 40px; border-radius: 16px; background: var(--surface-solid);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow), var(--glow); overflow: hidden;
  transform: rotateY(-18deg) rotateX(10deg); transform-style: preserve-3d; transition: transform .25s;
}
.ds-bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ds-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.ds-bar i:nth-child(2) { background: #febc2e; } .ds-bar i:nth-child(3) { background: #28c840; }
.ds-bar .url { margin-left: 12px; flex: 1; height: 22px; border-radius: 6px; background: var(--accent-soft); font-family: var(--mono); font-size: .7rem; color: var(--text-3); display: flex; align-items: center; padding: 0 10px; overflow: hidden; white-space: nowrap; }
.ds-body { display: grid; grid-template-columns: 30% 1fr; height: calc(100% - 47px); }
.ds-side { border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.ds-side span { font-size: .72rem; padding: 7px 10px; border-radius: 8px; color: var(--text-2); display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; }
.ds-side span.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ds-side span::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: currentColor; flex-shrink: 0; }
.ds-main { padding: 16px; display: grid; gap: 10px; grid-template-rows: auto auto 1fr; }
.ds-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ds-kpi { padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.ds-kpi small { display: block; font-size: .62rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-kpi b { font-family: var(--font-display); font-size: 1rem; }
.ds-chart { height: 90px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: flex-end; gap: 6px; padding: 10px; }
.ds-chart i { flex: 1; border-radius: 4px 4px 0 0; background: var(--grad); transform-origin: bottom; animation: bar-grow 1.4s var(--ease) both; }
@keyframes bar-grow { from { transform: scaleY(0); } }
.ds-rows { display: grid; gap: 6px; align-content: start; }
.ds-rows div { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; background: var(--surface-2); font-size: .68rem; color: var(--text-2); }
.ds-rows div b { margin-left: auto; padding: 2px 8px; border-radius: 999px; font-size: .6rem; background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.device-shadow { position: absolute; left: 10%; right: 10%; bottom: 0; height: 30px; background: var(--accent); filter: blur(40px); opacity: .25; border-radius: 50%; }

.pd-section { padding: 70px 0; }
.pd-two { display: grid; grid-template-columns: 280px 1fr; gap: 50px; }
.pd-two .side-title { position: sticky; top: 110px; align-self: start; }
.pd-two .side-title .num { font-family: var(--mono); color: var(--accent-2); font-size: .85rem; }
.pd-two .side-title h2 { font-size: 2rem; margin-top: 8px; }
.pd-text p { color: var(--text-2); font-size: 1.06rem; margin-bottom: 16px; }
.problem-list { display: grid; gap: 14px; }
.problem-list div { display: flex; gap: 16px; padding: 18px 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.problem-list svg { width: 22px; height: 22px; color: var(--accent-2); flex-shrink: 0; margin-top: 2px; }
.problem-list p { margin: 0; color: var(--text-2); }

.feature-card { padding: 26px; }
.feature-card h4 { font-size: 1.1rem; margin-bottom: 8px; }

.flow { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.flow-node {
  flex: 1 1 150px; position: relative; padding: 22px 18px; text-align: center; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border-strong); backdrop-filter: blur(10px);
}
.flow-node .card-icon { margin: 0 auto 12px; }
.flow-node strong { display: block; font-family: var(--font-display); }
.flow-node small { color: var(--text-3); font-size: .8rem; display: block; margin-top: 4px; }
.flow-arrow { flex: 0 0 50px; display: grid; place-items: center; position: relative; }
.flow-arrow::before { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 12px); background-size: 24px 2px; animation: dash 1s linear infinite; }
.flow-arrow::after { content: ""; position: absolute; right: 4px; top: calc(50% - 5px); border: 5px solid transparent; border-left-color: var(--accent); }
@keyframes dash { to { background-position: 24px 0; } }

.cs-item { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin-bottom: 18px; }
.cs-item > div { padding: 24px 26px; background: var(--surface); }
.cs-item > div + div { border-left: 1px solid var(--border); background: var(--accent-soft); }
.cs-item small { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cs-item .ch small { color: #f87171; } .cs-item .so small { color: #22d37a; }
.cs-item p { color: var(--text-2); }

.impact-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.impact-list div { display: flex; gap: 14px; padding: 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.impact-list svg { width: 22px; height: 22px; color: #22d37a; flex-shrink: 0; margin-top: 2px; }
.impact-list p { color: var(--text-2); }

.stack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.stack-item { padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); transition: transform .3s var(--ease), border-color .3s; }
.stack-item:hover { transform: translateY(-5px); border-color: var(--accent); }
.stack-item strong { display: block; font-family: var(--font-display); }
.stack-item small { color: var(--text-3); font-size: .82rem; }

.pd-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pd-nav a { padding: 28px; }
.pd-nav a small { font-family: var(--mono); color: var(--text-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; }
.pd-nav a h3 { margin-top: 8px; transition: color .3s; }
.pd-nav a:hover h3 { color: var(--accent); }
.pd-nav a.next { text-align: right; }

/* ---------- Services (home) ---------- */
.service-card .num { position: absolute; top: 24px; right: 26px; font-family: var(--mono); font-size: .8rem; color: var(--text-3); }

/* ---------- Footer ---------- */
.site-footer { position: relative; z-index: 1; border-top: 1px solid var(--border); padding: 60px 0 30px; margin-top: 40px; background: linear-gradient(transparent, var(--accent-soft)); }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
.footer-big { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; max-width: 520px; line-height: 1.15; }
.footer-cols { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-cols h4 { font-family: var(--mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; font-weight: 500; }
.footer-cols a { display: block; color: var(--text-2); padding: 4px 0; transition: color .3s, transform .3s; }
.footer-cols a:hover { color: var(--accent); transform: translateX(4px); }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 50px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-3); font-size: .88rem; }
.to-top { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.to-top:hover { color: var(--accent); }
.to-top svg { width: 16px; height: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-card-stack { display: none; }
  .about-grid, .skills-layout, .contact-grid, .pd-hero-grid { grid-template-columns: 1fr; }
  .pd-two { grid-template-columns: 1fr; gap: 24px; }
  .pd-two .side-title { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .burger { display: block; }
  .nav-actions .btn { display: none; }
  .timeline::before, .timeline-progress { left: 11px; }
  .tl-item, .tl-item:nth-of-type(even) { width: 100%; margin-left: 0; padding: 0 0 50px 46px; }
  .tl-dot, .tl-item:nth-of-type(even) .tl-dot { left: 0; right: auto; }
  .flow { flex-direction: column; }
  .flow-node { flex: none; }
  .flow-arrow { flex: 0 0 40px; transform: rotate(90deg); }
  .cs-item { grid-template-columns: 1fr; }
  .cs-item > div + div { border-left: 0; border-top: 1px solid var(--border); }
}
@media (max-width: 640px) {
  section { padding: 80px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form .row, .info-list, .impact-list, .pd-nav { grid-template-columns: 1fr; }
  .pd-meta { grid-template-columns: 1fr; }
  .stat { padding: 26px 16px; }
  .card { padding: 24px; }
  .device { height: 320px; }
  .ds-side { display: none; }
  .ds-body { grid-template-columns: 1fr; }
  .avatar-badge.b1 { left: 0; } .avatar-badge.b2 { right: 0; }
  .pd-nav a.next { text-align: left; }
  .scroll-cue { display: none; }
  .btn { padding: 13px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- v2: logo, banners, client sites ---------- */
.logo-mark.img { padding: 0; overflow: hidden; background: #02040a; animation: none; border: 1px solid var(--border-strong); }
.logo-mark.img img { width: 100%; height: 100%; object-fit: cover; }
.project-visual.has-img { height: auto; aspect-ratio: 16 / 9; background: #03060f; }
.project-visual.has-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.project-card:hover .project-visual.has-img img { transform: scale(1.05); }
.pv-tag.wip, .status-badge.wip { color: #f5b942; border-color: rgba(245, 185, 66, .45); }
.status-badge { display: inline-flex; margin-left: 12px; padding: 3px 12px; border-radius: 999px; font-size: .75rem; font-family: var(--mono); color: #22d37a; border: 1px solid rgba(34, 211, 122, .45); background: var(--surface); vertical-align: middle; }
.pd-banner-wrap { padding: 20px 0 10px; }
.pd-banner { border-radius: 24px; overflow: hidden; border: 1px solid var(--border-strong); box-shadow: var(--shadow), var(--glow); }
.pd-banner img { width: 100%; height: auto; }
.device-note { position: absolute; right: 6px; bottom: 8px; font-family: var(--mono); font-size: .68rem; color: var(--text-3); }
.client-group { margin-bottom: 48px; }
.client-group-title { display: flex; align-items: center; gap: 12px; font-size: 1.35rem; margin-bottom: 20px; }
.client-group-title .card-icon { margin: 0; width: 42px; height: 42px; }
.client-card { padding: 24px; }
.client-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.client-top strong { font-family: var(--font-display); font-size: 1.08rem; line-height: 1.3; }
.client-top .tag { white-space: nowrap; flex-shrink: 0; }
.client-type { display: block; font-family: var(--mono); font-size: .74rem; color: var(--accent-2); margin: 8px 0 10px; text-transform: uppercase; letter-spacing: .06em; }
.client-card p { font-size: .9rem; }
.footer-logo { width: 240px; height: auto; margin-bottom: 18px; }
.about-logo { position: relative; width: 82%; height: auto; transform: translateZ(50px); }
@media (max-width: 640px) { .client-top { flex-direction: column; } }
.avatar-badge.b3 { top: 46%; right: -8%; } @media (max-width: 640px) { .avatar-badge.b3 { right: 0; } }

/* full transparent logo, swapped per theme */
.logo-full { height: 66px; width: auto; transition: transform .4s var(--ease), filter .4s; }
.logo:hover .logo-full { transform: scale(1.04); }
.logo-on-light { display: none; }
:root[data-theme="light"] .logo-on-dark { display: none; }
:root[data-theme="light"] .logo-on-light { display: block; }
.nav { height: 92px; }
@media (max-width: 640px) { .logo-full { height: 52px; } .nav { height: 76px; } }

/* ---------- About photo ---------- */
.about-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.avatar-face { isolation: isolate; }
.avatar-face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(4, 10, 30, .45), transparent 45%); pointer-events: none; }
.photo-polaroid {
  position: absolute; left: -18%; bottom: 6%; width: 34%; z-index: 0; margin: 0;
  padding: 8px 8px 30px; background: #f4f6fb; border-radius: 6px; box-shadow: var(--shadow);
  transform: rotate(-9deg) translateZ(-40px); transition: transform .6s var(--ease), z-index 0s .3s;
}
.photo-polaroid img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 3px; }
.photo-polaroid figcaption { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-family: var(--mono); font-size: .72rem; color: #3d4a68; }
.avatar-3d:hover .photo-polaroid { transform: rotate(-4deg) translate(-18%, 6%) scale(1.06); z-index: 3; transition: transform .6s var(--ease), z-index 0s; }
.avatar-inner { z-index: 1; }
.avatar-li {
  position: absolute; right: 18px; top: 18px; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: #0a66c2; color: #fff; box-shadow: 0 10px 24px -8px #0a66c2; transform: translateZ(90px); transition: transform .3s var(--ease);
}
.avatar-li svg { width: 22px; height: 22px; }
.avatar-li:hover { transform: translateZ(90px) scale(1.1); }
@media (max-width: 1024px) { .photo-polaroid { left: -10%; } }
@media (max-width: 640px) { .photo-polaroid { left: -3%; bottom: -12%; width: 30%; } }

/* =========================================================
   HOME - About (3D tech orbit)
   ========================================================= */
.h-about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.orbit-stage { position: relative; width: 100%; max-width: 580px; aspect-ratio: 1; margin-inline: auto; perspective: 1000px; touch-action: pan-y; }
.orbit-glow { position: absolute; inset: 18%; border-radius: 50%; background: radial-gradient(circle, var(--accent) 0%, transparent 70%); filter: blur(50px); opacity: .45; animation: glow-breathe 5s ease-in-out infinite; }
@keyframes glow-breathe { 50% { opacity: .25; transform: scale(1.1); } }
.orbit-path { position: absolute; left: 50%; top: 50%; border: 1.5px dashed var(--border-strong); border-radius: 50%; pointer-events: none; }
.orbit-path.p1 { width: 98%; height: 30.3%; transform: translate(-50%, -50%) rotate(-12deg); }
.orbit-path.p2 { width: 84%; height: 34.2%; transform: translate(-50%, -50%) rotate(28deg); border-color: rgba(106, 92, 255, .35); }
.orbit-photo {
  position: absolute; left: 22%; top: 22%; width: 56%; height: 56%; border-radius: 50%; z-index: 50;
  transform-style: preserve-3d; transition: transform .2s;
}
.orbit-photo img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); border-radius: 50%; object-fit: cover; object-position: center 30%; }
.orbit-photo-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent-3), transparent 70%, var(--accent)); animation: spin 6s linear infinite; box-shadow: 0 0 40px rgba(47, 123, 255, .45); }
.orb {
  position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 18px;
  display: grid; place-items: center; background: rgba(255, 255, 255, .94); border: 1px solid rgba(80, 140, 255, .4);
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .6), 0 0 20px rgba(47, 123, 255, .25); will-change: transform, opacity;
}
.orb img { width: 34px; height: 34px; }
.orbit-chip { position: absolute; z-index: 70; display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 14px; font-size: .82rem; font-weight: 600; background: var(--surface); border: 1px solid var(--border-strong); backdrop-filter: blur(12px); box-shadow: var(--shadow); animation: chip-float 6s ease-in-out infinite; }
.orbit-chip svg { width: 17px; height: 17px; color: var(--accent-2); }
.orbit-chip.c-a { top: 6%; right: 2%; }
.orbit-chip.c-b { bottom: 8%; left: 0; animation-delay: -3s; }
.about-points { display: grid; gap: 14px; margin: 28px 0 32px; }
.about-point { display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); transition: border-color .3s, transform .4s var(--ease); }
.about-point:hover { border-color: var(--accent); transform: translateX(8px); }
.about-point strong { font-family: var(--font-display); display: block; margin-bottom: 2px; }
.about-point p { color: var(--text-2); font-size: .93rem; }
.ap-ico { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 8px 20px -8px var(--accent); }
.ap-ico svg { width: 21px; height: 21px; }

/* =========================================================
   HOME - Skills (3D isometric stack)
   ========================================================= */
.h-skills-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.iso-stage { position: relative; height: 560px; display: grid; place-items: center; }
.iso-stack {
  --gap: 34px; --rx: 58deg; --rz: -42deg;
  position: relative; width: 330px; height: 330px; transform-style: preserve-3d;
  transform: translateY(70px) rotateX(var(--rx)) rotateZ(var(--rz)); transition: transform .6s var(--ease);
}
.iso-stack.exploded { --gap: 82px; }
.iso-layer {
  position: absolute; inset: 0; border-radius: 24px; transform-style: preserve-3d;
  background: linear-gradient(135deg, rgba(47, 123, 255, .26), rgba(0, 194, 255, .08) 60%, rgba(106, 92, 255, .2));
  border: 1.5px solid rgba(90, 160, 255, .55);
  box-shadow: inset 0 0 40px rgba(47, 123, 255, .25), 0 0 30px rgba(47, 123, 255, .18);
  transform: translateZ(calc(var(--z) * var(--gap)));
  transition: transform .9s var(--ease), background .4s, border-color .4s, box-shadow .4s;
}
.iso-layer::after { content: ""; position: absolute; inset: 0; border-radius: inherit; transform: translateZ(-10px); background: rgba(10, 30, 80, .55); border: 1px solid rgba(90, 160, 255, .25); }
.iso-layer.active { transform: translateZ(calc(var(--z) * var(--gap) + 46px)); border-color: var(--accent-2); background: linear-gradient(135deg, rgba(47, 123, 255, .45), rgba(0, 194, 255, .2)); box-shadow: inset 0 0 50px rgba(0, 194, 255, .35), 0 0 60px rgba(0, 194, 255, .45); }
.iso-label { position: absolute; left: 18px; bottom: 14px; display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #e8eeff; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.iso-label svg { width: 16px; height: 16px; color: var(--accent-2); }
.iso-tiles { position: absolute; inset: 20px 20px 50px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-content: start; transform-style: preserve-3d; }
.iso-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 1; border-radius: 14px; background: rgba(255, 255, 255, .93); box-shadow: 4px 4px 0 rgba(10, 30, 80, .55); transition: transform .5s var(--ease); }
.iso-layer.active .iso-tile { transform: translateZ(14px); }
.iso-tile img { width: 30px; height: 30px; }
.iso-tile b { font-size: .58rem; color: #0a1226; font-weight: 700; }
.iso-shadow { position: absolute; left: 50%; bottom: 40px; width: 380px; height: 90px; transform: translateX(-50%); background: radial-gradient(ellipse, rgba(47, 123, 255, .45), transparent 70%); filter: blur(18px); pointer-events: none; }
.stack-legend { display: grid; gap: 12px; }
.stack-key { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); transition: border-color .3s, transform .5s var(--ease), box-shadow .3s; }
.stack-key:hover, .stack-key.active { border-color: var(--accent); transform: translateX(10px); box-shadow: var(--glow); }
.sk-num { font-family: var(--mono); font-size: .78rem; color: var(--text-3); }
.sk-ico { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid var(--border-strong); color: var(--accent-2); transition: background .3s, color .3s; }
.stack-key.active .sk-ico { background: var(--grad); color: #fff; }
.sk-ico svg { width: 21px; height: 21px; }
.sk-text strong { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.sk-text small { color: var(--text-2); font-size: .86rem; }
:root[data-theme="light"] .iso-layer { background: linear-gradient(135deg, rgba(29, 91, 255, .2), rgba(0, 150, 214, .08) 60%, rgba(90, 70, 232, .16)); }
:root[data-theme="light"] .iso-layer::after { background: rgba(29, 91, 255, .18); }
:root[data-theme="light"] .iso-label { color: #0a1226; text-shadow: none; }

/* =========================================================
   HOME - Experience (3D flip timeline)
   ========================================================= */
.exp-track { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.exp-line { position: absolute; left: 0; right: 0; top: 11px; height: 2px; background: var(--border); overflow: hidden; }
.exp-pulse { position: absolute; top: 0; left: -30%; width: 30%; height: 100%; background: linear-gradient(90deg, transparent, var(--accent-2), transparent); animation: exp-run 3.2s linear infinite; }
@keyframes exp-run { to { left: 100%; } }
.exp-node { position: relative; display: flex; align-items: center; gap: 10px; height: 24px; margin-bottom: 26px; font-family: var(--mono); font-size: .82rem; color: var(--accent-2); }
.exp-node i { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 0 5px var(--accent-soft), 0 0 18px var(--accent); }
.exp-col:first-of-type .exp-node i { background: var(--accent-2); animation: pulse 2s infinite; }
.flip-card { position: relative; height: 380px; perspective: 1200px; outline: none; cursor: pointer; }
.flip-inner { position: relative; height: 100%; transform-style: preserve-3d; transition: transform .9s var(--ease); }
.flip-card:hover .flip-inner, .flip-card:focus-visible .flip-inner, .flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; border: 1px solid var(--border-strong); background: var(--surface-solid); box-shadow: var(--shadow); overflow: hidden; }
.flip-front::before { content: ""; position: absolute; width: 220px; height: 220px; right: -90px; top: -90px; border-radius: 50%; background: var(--accent); filter: blur(70px); opacity: .25; }
.flip-front::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 24px 24px; mask-image: linear-gradient(to top, #000, transparent 70%); -webkit-mask-image: linear-gradient(to top, #000, transparent 70%); pointer-events: none; }
.emblem { position: relative; z-index: 1; width: 64px; height: 64px; margin-bottom: 22px; filter: drop-shadow(0 10px 18px rgba(47, 123, 255, .45)); animation: emblem-spin 7s var(--ease) infinite; }
@keyframes emblem-spin { 0%, 75% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }
.flip-front .tl-date { position: relative; z-index: 1; align-self: flex-start; }
.flip-front h3 { position: relative; z-index: 1; font-size: 1.35rem; margin: 16px 0 6px; }
.exp-co { position: relative; z-index: 1; color: var(--accent); font-weight: 600; }
.flip-hint { position: relative; z-index: 1; margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-3); }
.flip-hint svg { width: 15px; height: 15px; color: var(--accent-2); }
.flip-back { transform: rotateY(180deg); background: linear-gradient(160deg, var(--surface-solid) 30%, var(--accent-soft)); }
.flip-back h4 { font-size: 1.1rem; margin-bottom: 14px; }
.flip-back ul { list-style: none; display: grid; gap: 10px; }
.flip-back li { position: relative; padding-left: 20px; color: var(--text-2); font-size: .9rem; }
.flip-back li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; border-radius: 2px; background: var(--grad); transform: rotate(45deg); }
.flip-back .tags { margin-top: auto; }
.flip-back .link-arrow { margin-top: 14px; }

@media (max-width: 1024px) {
  .h-about-grid, .h-skills-grid { grid-template-columns: 1fr; }
  .exp-track { grid-template-columns: repeat(2, 1fr); }
  .exp-line { display: none; }
  .iso-stage { height: 500px; }
}
@media (max-width: 640px) {
  .exp-track { grid-template-columns: 1fr; }
  .orbit-stage { max-width: 380px; }
  .orb { width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 13px; }
  .orb img { width: 26px; height: 26px; }
  .orbit-chip { font-size: .72rem; padding: 7px 11px; }
  .iso-stage { height: 430px; }
  .iso-stack { width: 250px; height: 250px; transform: translateY(60px) rotateX(var(--rx)) rotateZ(var(--rz)); }
  .iso-stack.exploded { --gap: 64px; }
  .iso-tiles { inset: 14px 14px 42px; gap: 8px; }
  .iso-tile img { width: 22px; height: 22px; }
  .iso-tile b { display: none; }
  .iso-shadow { width: 280px; bottom: 30px; }
  .flip-card { height: 360px; }
}
.flip-front .tl-date { display: inline-flex; padding: 5px 12px; border-radius: 999px; font-family: var(--mono); font-size: .76rem; background: var(--accent-soft); color: var(--accent-2); border: 1px solid var(--border-strong); }
.exp-logos { position: relative; z-index: 1; display: flex; gap: 8px; margin-top: 22px; }
.exp-logos span { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .94); box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .6); transition: transform .4s var(--ease); }
.flip-card:hover .exp-logos span { transform: translateY(-4px); }
.exp-logos span:nth-child(2) { transition-delay: .05s; } .exp-logos span:nth-child(3) { transition-delay: .1s; } .exp-logos span:nth-child(4) { transition-delay: .15s; }

/* new logo: keep the PNG as-is; outline its white letters on the light theme so they stay readable */
