/* ==========================================================================
   Shailendra Kumar — Portfolio
   ========================================================================== */
:root {
  --bg: #0b0d17;
  --bg-2: #10132280;
  --surface: #131729;
  --surface-2: #1a1f36;
  --border: rgba(255, 255, 255, .08);
  --text: #eceef8;
  --muted: #9ba1bf;
  --accent: #ff7a18;
  --accent-2: #ff3d77;
  --accent-3: #7c5cff;
  --grad: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent-3) 100%);
  --radius: 18px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --header-h: 78px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.is-loading { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
::selection { background: var(--accent-2); color: #fff; }

main { overflow-x: clip; }
.container { width: min(1180px, 100% - 40px); margin-inline: auto; }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: gradShift 6s linear infinite;
}
@keyframes gradShift { to { background-position: 200% center; } }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: grid; place-content: center; gap: 22px; justify-items: center;
  transition: clip-path 1s var(--ease);
  clip-path: inset(0 0 0 0);
}
.preloader.done { clip-path: inset(0 0 100% 0); }
.preloader__name { display: flex; gap: 6px; font-size: 56px; font-weight: 800; letter-spacing: 4px; }
.preloader__name span { display: inline-block; opacity: 0; transform: translateY(40px); animation: preIn .7s var(--ease) forwards; }
.preloader__name span:nth-child(2) { animation-delay: .12s; }
.preloader__name span:nth-child(3) { animation-delay: .24s; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes preIn { to { opacity: 1; transform: none; } }
.preloader__bar { width: 160px; height: 3px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.preloader__bar i { display: block; height: 100%; width: 0; background: var(--grad); animation: preBar 1.1s var(--ease) .2s forwards; }
@keyframes preBar { to { width: 100%; } }

/* ---------- Scroll progress / cursor ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  background: var(--grad); transform-origin: 0 50%; transform: scaleX(0);
  z-index: 200;
}
.cursor, .cursor-dot {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 999;
  border-radius: 50%; transform: translate(-50%, -50%);
  opacity: 0; transition: opacity .3s, width .3s var(--ease), height .3s var(--ease), background .3s, border-color .3s;
}
.cursor { width: 38px; height: 38px; border: 1.5px solid rgba(255, 255, 255, .5); }
.cursor-dot { width: 6px; height: 6px; background: var(--accent); }
.cursor.hover { width: 64px; height: 64px; background: rgba(255, 122, 24, .12); border-color: var(--accent); }
body.has-cursor .cursor, body.has-cursor .cursor-dot { opacity: 1; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 28px; border-radius: 999px;
  font-weight: 600; font-size: 16px; letter-spacing: .2px;
  transition: transform .3s var(--ease), box-shadow .3s, background .3s, color .3s;
  overflow: hidden; isolation: isolate; white-space: nowrap;
}
.btn--sm { padding: 10px 20px; font-size: 15px; }
.btn--lg { padding: 18px 36px; font-size: 18px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--grad); background-size: 150% auto; color: #fff; box-shadow: 0 10px 30px -10px rgba(255, 61, 119, .6); }
.btn--primary:hover { background-position: right center; box-shadow: 0 16px 40px -10px rgba(255, 61, 119, .8); }
.btn--ghost { border: 1.5px solid var(--border); background: rgba(255, 255, 255, .03); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--header-h);
  display: flex; align-items: center;
  transition: background .4s, height .4s var(--ease), box-shadow .4s, transform .4s var(--ease);
}
.header.scrolled {
  height: 66px;
  background: rgba(11, 13, 23, .75);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--border);
}
.header.hidden { transform: translateY(-100%); }
.header__inner { display: flex; align-items: center; gap: 30px; }
.logo { font-size: 26px; font-weight: 800; letter-spacing: 1px; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav__link {
  position: relative; padding: 8px 14px; font-size: 15px; font-weight: 500; color: var(--muted);
  transition: color .3s;
}
.nav__link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px;
  background: var(--grad); border-radius: 2px;
  transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease);
}
.nav__link:hover, .nav__link.active { color: var(--text); }
.nav__link:hover::after, .nav__link.active::after { transform: scaleX(1); transform-origin: left; }
.burger { display: none; width: 42px; height: 42px; position: relative; margin-left: auto; }
.burger span { position: absolute; left: 10px; right: 10px; 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; }
.burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 30px) 0 80px;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; width: 720px; height: 720px; right: -200px; top: -200px;
  background: radial-gradient(circle, rgba(124, 92, 255, .22), transparent 65%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; width: 600px; height: 600px; left: -250px; bottom: -250px;
  background: radial-gradient(circle, rgba(255, 122, 24, .15), transparent 65%);
  pointer-events: none;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero__hello { font-size: 20px; color: var(--muted); margin-bottom: 8px; }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out infinite; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.hero__title { font-size: clamp(46px, 7.4vw, 96px); line-height: 1.02; font-weight: 800; letter-spacing: -2px; margin-bottom: 18px; }
.line { display: block; overflow: hidden; padding-bottom: .06em; }
.line__inner { display: inline-block; transform: translateY(110%); transition: transform 1.1s var(--ease); }
.loaded .line__inner { transform: none; }
.loaded .line:nth-child(2) .line__inner { transition-delay: .12s; }
.hero__role { font-family: "JetBrains Mono", monospace; font-size: clamp(16px, 2vw, 21px); color: var(--muted); margin-bottom: 16px; min-height: 1.6em; }
.typed { color: var(--accent); font-weight: 600; }
.caret { color: var(--accent); animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.hero__lead { max-width: 520px; color: var(--muted); margin-bottom: 32px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 36px; }
.hero__social { display: flex; gap: 12px; }
.hero__social a {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(255, 255, 255, .03);
  transition: transform .3s var(--ease), background .3s, border-color .3s;
}
.hero__social a:hover { transform: translateY(-4px); background: var(--accent); border-color: var(--accent); }
.hero__social svg { width: 18px; height: 18px; fill: currentColor; }

.hero__visual { position: relative; aspect-ratio: 1 / 1.03; max-width: 520px; justify-self: end; width: 100%; }
.blob {
  position: absolute; inset: 12% 8% 0 8%;
  background: var(--grad); background-size: 200% 200%;
  border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
  animation: morph 9s ease-in-out infinite, gradShift 8s linear infinite;
  filter: saturate(1.1);
  box-shadow: 0 30px 90px -20px rgba(255, 61, 119, .55);
}
@keyframes morph {
  0%, 100% { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; }
  33% { border-radius: 63% 37% 45% 55% / 55% 62% 38% 45%; }
  66% { border-radius: 38% 62% 35% 65% / 62% 38% 62% 38%; }
}
.ring { position: absolute; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .18); }
.ring--1 { inset: 2% -4% -6% -4%; animation: spin 40s linear infinite; }
.ring--2 { inset: 18% 2% 6% 2%; border-style: solid; border-color: rgba(255, 255, 255, .06); animation: spin 28s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero__photo {
  position: absolute; inset: auto 0 0 0; width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 75%, transparent 100%);
  z-index: 1;
}
.chip {
  position: absolute; z-index: 2; padding: 10px 16px; border-radius: 14px;
  background: rgba(19, 23, 41, .8); border: 1px solid var(--border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow); white-space: nowrap;
}
.chip--1 { top: 16%; left: -6%; }
.chip--2 { top: 6%; right: 2%; animation-delay: -2s; }
.chip--3 { bottom: 30%; right: -8%; animation-delay: -4s; }
.hero__badge {
  position: absolute; z-index: 2; left: -4%; bottom: 10%;
  display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: 16px;
  background: rgba(19, 23, 41, .85); border: 1px solid var(--border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow);
  animation-delay: -3s;
}
.hero__badge strong { font-size: 34px; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__badge small { font-size: 13px; color: var(--muted); line-height: 1.3; }
.float { animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

.scroll-down {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 2;
  width: 26px; height: 42px; border: 2px solid rgba(255, 255, 255, .3); border-radius: 20px;
}
.scroll-down span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; background: var(--accent); border-radius: 2px; animation: scrollDot 1.8s var(--ease) infinite; }
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden; padding: 22px 0; border-block: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(255, 122, 24, .06), rgba(124, 92, 255, .06));
  transform: rotate(-1.5deg) scale(1.03);
}
.marquee__track { display: flex; gap: 34px; width: max-content; animation: marquee 30s linear infinite; }
.marquee__track span { font-size: 28px; font-weight: 700; color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .5); white-space: nowrap; transition: color .3s; }
.marquee__track span:hover { color: var(--text); }
.marquee__track i { font-style: normal; color: var(--accent); font-size: 20px; align-self: center; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: 120px 0; position: relative; }
.section--alt { background: linear-gradient(180deg, transparent, rgba(19, 23, 41, .7) 15%, rgba(19, 23, 41, .7) 85%, transparent); }
.section__head { text-align: center; max-width: 680px; margin: 0 auto 60px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: "JetBrains Mono", monospace; font-size: 14px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--grad); }
.section__title { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.12; font-weight: 800; letter-spacing: -1px; margin-bottom: 16px; }
.section__sub { color: var(--muted); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: .9fr 1.1fr; gap: 70px; align-items: center; }
.about__media { position: relative; }
.about__frame {
  position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 4 / 4.6;
  background: var(--surface); border: 1px solid var(--border);
  transform-style: preserve-3d;
}
.about__frame::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 70%, rgba(255, 61, 119, .45), transparent 60%), linear-gradient(160deg, rgba(124, 92, 255, .35), transparent 60%);
}
.about__frame img { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 108%; max-width: none; }
.about__exp {
  position: absolute; right: -24px; bottom: 40px; padding: 20px 24px; border-radius: 18px;
  background: var(--grad); color: #fff; box-shadow: 0 20px 40px -10px rgba(255, 61, 119, .6);
  display: flex; flex-direction: column; animation: float 6s ease-in-out infinite;
}
.about__exp strong { font-size: 38px; line-height: 1; }
.about__exp span { font-size: 14px; opacity: .9; }
.about__content > p { color: var(--muted); margin-bottom: 26px; }
.status { font-style: normal; color: #3ddc97; display: inline-flex; align-items: center; gap: 8px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 0 rgba(61, 220, 151, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat {
  padding: 18px 14px; border-radius: 16px; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .4s var(--ease), border-color .3s;
}
.stat:hover { transform: translateY(-6px); border-color: rgba(255, 122, 24, .4); }
.stat strong { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 13px; color: var(--muted); }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.skills__rings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.ring-skill {
  position: relative; aspect-ratio: 1; padding: 22px; border-radius: 24px;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .4s var(--ease);
}
.ring-skill:hover { transform: translateY(-6px) rotate(-1deg); }
.ring-skill svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-skill circle { fill: none; stroke-width: 8; stroke: var(--surface-2); }
.ring-skill circle.bar {
  stroke: var(--accent); stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.8s var(--ease);
}
.ring-skill:nth-child(2) circle.bar { stroke: var(--accent-2); }
.ring-skill:nth-child(3) circle.bar { stroke: var(--accent-3); }
.ring-skill:nth-child(4) circle.bar { stroke: #3ddc97; }
.ring-skill__label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-skill__label strong { font-size: 30px; font-weight: 800; line-height: 1; }
.ring-skill__label span { font-size: 14px; color: var(--muted); }
.skills__bars { display: grid; gap: 28px; }
.bar-skill__top { display: flex; justify-content: space-between; margin-bottom: 10px; font-weight: 500; }
.bar-skill__top b { font-family: "JetBrains Mono", monospace; font-weight: 600; color: var(--accent); font-size: 15px; }
.bar-skill__track { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.bar-skill__track i {
  display: block; height: 100%; width: 0; border-radius: 8px; background: var(--grad);
  position: relative; transition: width 1.6s var(--ease);
}
.bar-skill__track i::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: translateX(-100%); animation: shine 2.8s ease-in-out infinite 1.6s;
}
@keyframes shine { to { transform: translateX(100%); } }

/* ---------- Timeline ---------- */
.timeline { position: relative; max-width: 980px; margin: 0 auto; }
.timeline__line { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--surface-2); }
.timeline__line i { position: absolute; inset: 0 0 auto; height: 0; background: var(--grad); box-shadow: 0 0 12px var(--accent-2); }
.tl-item { position: relative; width: 50%; padding: 0 50px 50px 0; }
.tl-item:nth-of-type(even) { margin-left: 50%; padding: 0 0 50px 50px; }
.tl-item__dot {
  position: absolute; top: 26px; right: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent); z-index: 1;
  box-shadow: 0 0 0 6px rgba(255, 122, 24, .15);
}
.tl-item__dot--edu { border-color: var(--accent-3); box-shadow: 0 0 0 6px rgba(124, 92, 255, .15); }
.tl-item:nth-of-type(even) .tl-item__dot { right: auto; left: -9px; }
.tl-item__card {
  padding: 28px 30px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .4s var(--ease), border-color .3s, box-shadow .4s;
}
.tl-item__card:hover { transform: translateY(-6px); border-color: rgba(255, 122, 24, .35); box-shadow: var(--shadow); }
.tl-item__date { display: inline-block; font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--accent); padding: 4px 12px; border-radius: 999px; background: rgba(255, 122, 24, .1); margin-bottom: 12px; }
.tl-item__card h3 { font-size: 21px; line-height: 1.3; margin-bottom: 4px; }
.tl-item__org { color: var(--muted); font-size: 15px; margin-bottom: 12px; }
.tl-item__card ul li, .tl-item__card > p:last-child { color: var(--muted); font-size: 15px; }
.tl-item__card ul li { position: relative; padding-left: 18px; margin-bottom: 6px; }
.tl-item__card ul li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service {
  position: relative; padding: 36px 30px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border); overflow: hidden;
  transform-style: preserve-3d; transition: border-color .3s, box-shadow .4s;
}
.service::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .4s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 122, 24, .14), transparent 40%);
}
.service:hover { border-color: rgba(255, 122, 24, .35); box-shadow: var(--shadow); }
.service:hover::before { opacity: 1; }
.service__icon {
  width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(255, 122, 24, .18), rgba(124, 92, 255, .18));
  transition: transform .5s var(--ease), background .4s;
}
.service:hover .service__icon { transform: rotate(-8deg) scale(1.08); background: var(--grad); }
.service__icon svg { width: 28px; height: 28px; fill: none; stroke: var(--text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.service h3 { font-size: 21px; margin-bottom: 10px; }
.service p { color: var(--muted); font-size: 15.5px; }

/* ---------- Portfolio ---------- */
.filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 44px; }
.filter {
  padding: 10px 22px; border-radius: 999px; font-size: 15px; font-weight: 500;
  border: 1px solid var(--border); color: var(--muted); background: rgba(255, 255, 255, .02);
  transition: all .3s var(--ease);
}
.filter:hover { color: var(--text); border-color: rgba(255, 255, 255, .25); }
.filter.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 10px 24px -10px rgba(255, 61, 119, .7); }
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.project {
  position: relative; border-radius: 24px; overflow: hidden; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  transition: opacity .5s var(--ease), transform .5s var(--ease), border-color .3s;
}
.project.is-hidden { display: none; }
.project.is-leaving { opacity: 0; transform: scale(.92); }
.project:hover { border-color: rgba(255, 122, 24, .4); }
.project__img { aspect-ratio: 16 / 10; overflow: hidden; background: #fff; }
.project__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.project:hover .project__img img { transform: scale(1.08); }
.project--wide { grid-column: 1 / -1; }
.project--wide .project__img { aspect-ratio: 21 / 8; }

/* Logo covers for projects without a screenshot */
.project__img--gen, .modal__img--gen {
  position: relative; isolation: isolate;
  background: var(--cover);
  display: grid; place-items: center; padding: 6% 12% 16%;
}
.project__img--gen::before, .modal__img--gen::before {
  content: ""; position: absolute; z-index: -1; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--glow, rgba(255, 122, 24, .25)), transparent 65%);
  animation: glow 5s ease-in-out infinite;
}
@keyframes glow { 0%, 100% { transform: scale(.85); opacity: .7; } 50% { transform: scale(1.1); opacity: 1; } }
.project__img--gen .logo-img, .modal__img--gen .logo-img {
  width: auto; height: auto; max-width: 70%; max-height: 72%; object-fit: contain;
  transition: transform 1s var(--ease), filter .6s;
  animation: logoFloat 6s ease-in-out infinite;
}
@keyframes logoFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.project--wide .project__img--gen .logo-img { max-width: 34%; }
.project:hover .project__img--gen .logo-img { transform: scale(1.1); filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .18)); }
.modal__img--gen { padding: 12%; }
.modal__img--gen .logo-img { max-width: 80%; max-height: 80%; }


.project__info {
  position: absolute; inset: auto 0 0 0; padding: 70px 28px 24px;
  background: linear-gradient(to top, rgba(11, 13, 23, .96) 30%, transparent);
  transform: translateY(30px); transition: transform .5s var(--ease);
}
.project:hover .project__info { transform: none; }
.project__tag { display: inline-block; font-family: "JetBrains Mono", monospace; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); margin-bottom: 4px; }
.project__info h3 { font-size: 26px; line-height: 1.2; }
.project__more { display: inline-block; margin-top: 10px; font-size: 15px; color: var(--muted); opacity: 0; transition: opacity .4s .05s; }
.project__more b { display: inline-block; color: var(--accent); transition: transform .3s var(--ease); }
.project:hover .project__more { opacity: 1; }
.project:hover .project__more b { transform: translateX(5px); }

/* ---------- CTA ---------- */
.cta { padding: 40px 0 0; }
.cta__inner {
  position: relative; text-align: center; padding: 80px 40px; border-radius: 32px; overflow: hidden;
  background: radial-gradient(circle at 20% 0%, rgba(255, 122, 24, .25), transparent 50%), radial-gradient(circle at 80% 100%, rgba(124, 92, 255, .3), transparent 50%), var(--surface);
  border: 1px solid var(--border);
}
.cta__inner h2 { font-size: clamp(30px, 4.4vw, 50px); line-height: 1.15; margin-bottom: 14px; letter-spacing: -1px; }
.cta__inner p { color: var(--muted); margin-bottom: 32px; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; align-items: start; }
.contact__cards { display: grid; gap: 16px; }
.c-card {
  display: flex; align-items: center; gap: 18px; padding: 20px 22px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .4s var(--ease), border-color .3s;
  word-break: break-word;
}
a.c-card:hover { transform: translateX(8px); border-color: rgba(255, 122, 24, .4); }
.c-card small { display: block; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.c-card__icon { flex: none; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(255, 122, 24, .18), rgba(124, 92, 255, .18)); }
.c-card__icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.form { padding: 40px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); display: grid; gap: 20px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; padding: 22px 18px 10px; border-radius: 14px;
  background: var(--bg); border: 1.5px solid var(--border); color: var(--text);
  font: inherit; font-size: 16px; resize: vertical; outline: none;
  transition: border-color .3s, box-shadow .3s;
}
.field label {
  position: absolute; left: 18px; top: 17px; color: var(--muted); pointer-events: none;
  transition: transform .3s var(--ease), font-size .3s, color .3s; transform-origin: 0 0;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 122, 24, .12); }
.field input:focus + label, .field textarea:focus + label,
.field input:not(:placeholder-shown) + label, .field textarea:not(:placeholder-shown) + label {
  transform: translateY(-11px); font-size: 12px; color: var(--accent);
}
.field.invalid input, .field.invalid textarea { border-color: #ff4d6d; animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.is-sending .spinner { display: inline-block; }
.is-sending { pointer-events: none; opacity: .85; }
.form__status { min-height: 1.5em; font-size: 15px; text-align: center; }
.form__status.ok { color: #3ddc97; }
.form__status.err { color: #ff6b81; }

/* ---------- Footer ---------- */
.footer { padding: 50px 0; margin-top: 60px; border-top: 1px solid var(--border); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer p { color: var(--muted); font-size: 15px; }
.footer__social { display: flex; gap: 22px; }
.footer__social a { color: var(--muted); font-size: 15px; transition: color .3s; }
.footer__social a:hover { color: var(--accent); }

.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 90; width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; color: #fff; background: var(--grad);
  box-shadow: 0 10px 30px -10px rgba(255, 61, 119, .7);
  opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none;
  transition: opacity .4s, transform .4s var(--ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-4px); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 20px; visibility: hidden; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(5, 6, 12, .75); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity .4s; }
.modal__box {
  position: relative; width: min(860px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  border-radius: 26px; background: var(--surface); border: 1px solid var(--border);
  display: grid; grid-template-columns: 1.1fr 1fr;
  opacity: 0; transform: translateY(40px) scale(.96); transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.modal.open { visibility: visible; }
.modal.open .modal__backdrop { opacity: 1; }
.modal.open .modal__box { opacity: 1; transform: none; }
.modal__img { background: #fff; min-height: 260px; }
.modal__img img { width: 100%; height: 100%; object-fit: cover; }
.modal__body { padding: 36px 32px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.modal__body h3 { font-size: 28px; line-height: 1.2; }
.modal__body p { color: var(--muted); }
.modal__stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.modal__stack span { padding: 5px 12px; border-radius: 999px; font-size: 13px; border: 1px solid var(--border); background: var(--bg); }
.modal__close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(11, 13, 23, .8); font-size: 26px; line-height: 1; transition: transform .3s var(--ease), background .3s;
}
.modal__close:hover { transform: rotate(90deg); background: var(--accent-2); }

/* ---------- Reveal animations ---------- */
.reveal-up, .reveal-left, .reveal-right, .reveal-scale {
  opacity: 0; transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal-up { transform: translateY(50px); }
.reveal-left { transform: translateX(-60px); }
.reveal-right { transform: translateX(60px); }
.reveal-scale { transform: scale(.9); }
.in-view { opacity: 1; transform: none; }
/* Keep hover transforms working after reveal */
.stat.in-view:hover, .tl-item__card:hover { transform: translateY(-6px); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .nav {
    position: fixed; inset: 0 0 0 auto; width: min(320px, 85vw);
    flex-direction: column; justify-content: center; gap: 4px; padding: 40px;
    background: rgba(13, 15, 28, .97); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--border);
    transform: translateX(100%); transition: transform .5s var(--ease);
  }
  .nav.open { transform: none; }
  .nav__link { font-size: 22px; padding: 12px 0; }
  .nav__link::after { left: 0; right: auto; width: 40px; }
  .burger { display: block; z-index: 2; }
  .header__cta { display: none; }
  .services { grid-template-columns: repeat(2, 1fr); }
  .about { gap: 50px; }
}
@media (max-width: 860px) {
  body { font-size: 16px; }
  .section { padding: 90px 0; }
  .hero__grid, .about, .skills, .contact { grid-template-columns: 1fr; }
  .hero__text { text-align: center; }
  .hero__lead { margin-inline: auto; }
  .hero__actions, .hero__social { justify-content: center; }
  .hero__visual { justify-self: center; max-width: 400px; order: -1; }
  .about__media { max-width: 420px; margin-inline: auto; width: 100%; }
  .about__exp { right: -10px; }
  .timeline__line { left: 9px; }
  .tl-item, .tl-item:nth-of-type(even) { width: 100%; margin-left: 0; padding: 0 0 36px 44px; }
  .tl-item__dot, .tl-item:nth-of-type(even) .tl-item__dot { left: 0; right: auto; }
  .reveal-left, .reveal-right { transform: translateY(40px); }
  .modal__box { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .services, .projects { grid-template-columns: 1fr; }
  .project--wide .project__img { aspect-ratio: 16 / 10; }
  .stats { grid-template-columns: repeat(2, 1fr); }

  .form { padding: 26px 20px; }
  .form__row { grid-template-columns: 1fr; }
  .chip--1 { left: 0; }
  .chip--3 { right: 0; }
  .hero__badge { left: 0; }
  .cta__inner { padding: 60px 22px; }
  .footer__inner { flex-direction: column; text-align: center; }
  .project__info { transform: none; }
  .project__more { opacity: 1; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal-up, .reveal-left, .reveal-right, .reveal-scale, .line__inner { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
}

/* ==========================================================================
   Developer theme layer
   ========================================================================== */
:root {
  --code-kw: #c792ea;
  --code-str: #c3e88d;
  --code-prop: #82aaff;
  --code-num: #f78c6c;
  --code-fn: #ffcb6b;
  --code-com: #637090;
}
/* Subtle blueprint grid behind everything */
body {
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 48px 48px;
  background-attachment: fixed;
}
.logo { font-family: "JetBrains Mono", monospace; font-size: 22px; letter-spacing: 0; }
.logo i { font-style: normal; color: var(--accent); font-weight: 400; transition: color .3s; }
.logo:hover i { color: var(--accent-2); }
.nav__link em { font-style: normal; font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--accent); margin-right: 5px; }
.eyebrow { text-transform: none; letter-spacing: .5px; }

/* Hero terminal touches */
.hero__hello { font-family: "JetBrains Mono", monospace; font-size: 16px; }
.prompt { color: #3ddc97; margin-right: 6px; }
.kw { color: var(--code-kw); }
.str { color: var(--code-str); }
.hero__role .typed { color: var(--code-str); }
.hero__role .caret { color: var(--code-str); }
.chip { font-family: "JetBrains Mono", monospace; font-size: 13px; }
.chip i { font-style: normal; color: var(--accent); }

/* Code editor card */
.editor {
  margin-bottom: 36px; border-radius: 16px; overflow: hidden;
  background: #0d1020; border: 1px solid var(--border);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(124, 92, 255, .08);
}
.editor__bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: #151931; border-bottom: 1px solid var(--border); }
.editor__bar > i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.editor__bar > i:nth-child(2) { background: #febc2e; }
.editor__bar > i:nth-child(3) { background: #28c840; }
.editor__tab {
  margin-left: 14px; padding: 4px 14px; border-radius: 8px 8px 0 0;
  font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--text);
  background: #0d1020; border-bottom: 2px solid var(--accent);
}
.editor__status { margin-left: auto; font-size: 13px; }
.editor__code {
  margin: 0; padding: 18px 0 20px; overflow-x: auto;
  font-family: "JetBrains Mono", monospace; font-size: 14px; line-height: 1.85;
  counter-reset: line; tab-size: 2;
}
.editor__code .ln { display: block; padding: 0 20px 0 0; white-space: pre; counter-increment: line; }
.editor__code .ln::before {
  content: counter(line); display: inline-block; width: 44px; padding-right: 16px; margin-right: 4px;
  text-align: right; color: var(--code-com); user-select: none;
}
.editor__code .ln:hover { background: rgba(255, 255, 255, .03); }
.var { color: var(--code-fn); }
.prop { color: var(--code-prop); }
.num, .bool { color: var(--code-num); }
.fn { color: var(--code-fn); }
a.str:hover { text-decoration: underline; }
/* Lines "type in" one after another when the editor scrolls into view */
.editor .ln { opacity: 0; transform: translateX(-12px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.editor.in-view .ln { opacity: 1; transform: none; }
.editor.in-view .ln:nth-child(1) { transition-delay: .15s; }
.editor.in-view .ln:nth-child(2) { transition-delay: .25s; }
.editor.in-view .ln:nth-child(3) { transition-delay: .35s; }
.editor.in-view .ln:nth-child(4) { transition-delay: .45s; }
.editor.in-view .ln:nth-child(5) { transition-delay: .55s; }
.editor.in-view .ln:nth-child(6) { transition-delay: .65s; }
.editor.in-view .ln:nth-child(7) { transition-delay: .75s; }
.editor.in-view .ln:nth-child(8) { transition-delay: .85s; }
.editor.in-view .ln:nth-child(9) { transition-delay: .95s; }
.editor.in-view .ln:nth-child(10) { transition-delay: 1.05s; }
.editor.in-view .ln:last-child::after { content: "▍"; color: var(--accent); margin-left: 4px; animation: blink 1s steps(1) infinite; }

@media (max-width: 600px) {
  .editor__code { font-size: 12px; }
  .editor__code .ln::before { width: 32px; padding-right: 10px; }
  .editor__status { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .editor .ln { opacity: 1; transform: none; }
}
@media (max-width: 1180px) and (min-width: 1025px) {
  .nav__link { padding: 8px 10px; }
  .nav__link em { display: none; }
}
