/* =====================================================================
   TECH LORD — Stylesheet
   ===================================================================== */
:root {
  --bg: #08090D;
  --bg2: #11131B;
  --purple: #8B5CF6;
  --blue: #3B82F6;
  --white: #FFFFFF;
  --grey: #A1A1AA;
  --line: rgba(255, 255, 255, .09);
  --glass: rgba(255, 255, 255, .045);
  --grad: linear-gradient(120deg, var(--purple), var(--blue));
  --radius: 20px;
  --head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--white);
  font: 400 16px/1.7 var(--body); overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--head); margin: 0; line-height: 1.12; letter-spacing: -.02em; }
p { margin: 0 0 1rem; color: var(--grey); }
ul, ol { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--purple); color: #fff; }
.ico { width: 1.25em; height: 1.25em; flex: none; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--purple); padding: 10px 16px; border-radius: 10px; transition: top .2s; }
.skip:focus { top: 12px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 300; background: var(--bg);
  display: grid; place-content: center; justify-items: center; gap: 28px;
  transition: opacity .6s var(--ease), visibility .6s;
  animation: loaderFallback .1s 4s forwards; /* hides even if JS fails */
}
.loader.done { opacity: 0; visibility: hidden; }
@keyframes loaderFallback { to { opacity: 0; visibility: hidden; } }
.loader-mark {
  width: 84px; height: 84px; display: grid; place-items: center; font: 700 28px var(--head);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--grad); animation: pulse 1.4s ease-in-out infinite;
}
.loader-mark span { display: grid; place-items: center; width: 78px; height: 78px; background: var(--bg);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.loader-bar { width: 160px; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 40%; background: var(--grad); border-radius: 3px; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes pulse { 50% { transform: scale(1.07); filter: drop-shadow(0 0 18px rgba(139, 92, 246, .7)); } }

/* ---------- Background ---------- */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -3; }
.aurora { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .28; will-change: transform; }
.aurora i:nth-child(1) { width: 520px; height: 520px; background: var(--purple); top: -140px; left: -120px; animation: drift1 24s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { width: 480px; height: 480px; background: var(--blue); top: 30%; right: -160px; animation: drift2 28s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { width: 420px; height: 420px; background: #6d28d9; bottom: -160px; left: 25%; opacity: .2; animation: drift1 32s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(120px, 90px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-140px, -60px) scale(1.2); } }
.grid-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 20%, #000 10%, transparent 70%);
}
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); z-index: 120; }

/* ---------- Buttons ---------- */
.btn {
  --p: 0;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; font: 600 15px/1 var(--head); letter-spacing: .01em;
  border: 1px solid transparent; cursor: pointer; overflow: hidden; isolation: isolate;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s, background .3s;
}
.btn .ico { transition: transform .3s var(--ease); }
.btn:hover .ico { transform: translate(2px, -2px); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 30px -8px rgba(139, 92, 246, .7); }
.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(-120%); transition: transform .7s var(--ease); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -8px rgba(59, 130, 246, .75); }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-ghost { background: var(--glass); border-color: rgba(255, 255, 255, .18); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn-ghost:hover { border-color: var(--purple); background: rgba(139, 92, 246, .12); transform: translateY(-2px); }
.btn-sm { padding: 11px 20px; font-size: 14px; }
.btn-block { width: 100%; padding: 17px; letter-spacing: .08em; }

/* ---------- Navigation ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--nav-h); transition: background .3s, backdrop-filter .3s, border-color .3s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: rgba(8, 9, 13, .72); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-color: var(--line); }
.nav-in { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { width: 38px; height: 38px; filter: drop-shadow(0 0 8px rgba(139, 92, 246, .55)); transition: transform .6s var(--ease); }
.logo:hover .logo-mark { transform: rotate(60deg); }
.logo-text { font: 700 20px var(--head); letter-spacing: .12em; }
.logo-text b { font-weight: 700; margin-left: .35em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.links { display: flex; align-items: center; gap: 4px; }
.links a:not(.btn) { position: relative; padding: 8px 14px; font-size: 15px; color: var(--grey); transition: color .25s; }
.links a:not(.btn)::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; background: var(--grad); border-radius: 2px; transform: scaleX(0); transition: transform .35s var(--ease); }
.links a:not(.btn):hover, .links a.active:not(.btn) { color: #fff; }
.links a:not(.btn):hover::after, .links a.active:not(.btn)::after { transform: scaleX(1); }
.nav-cta { margin-left: 10px; }
.burger { display: none; width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); cursor: pointer; position: relative; z-index: 110; }
.burger span { position: absolute; left: 13px; right: 13px; height: 2px; background: #fff; border-radius: 2px; transition: transform .35s var(--ease), opacity .2s, top .35s var(--ease); }
.burger span:nth-child(1) { top: 16px; } .burger span:nth-child(2) { top: 22px; } .burger span:nth-child(3) { top: 28px; }
.burger.open span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { top: 22px; transform: rotate(-45deg); }

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(80px, 11vw, 140px) 0; }
.section-tight { padding-top: 20px; }
.sec-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 60px); }
.kicker { display: inline-flex; align-items: center; gap: 10px; font: 600 13px var(--head); letter-spacing: .22em; text-transform: uppercase; color: var(--purple); margin-bottom: 14px; }
.kicker::before { content: ""; width: 28px; height: 2px; background: var(--grad); }
.title { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 700; }
.sub, .lead { font-size: 1.1rem; }
.lead { color: #d4d4d8; }
.sub { margin-top: 18px; }

/* ---------- Reveal animation ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--nav-h) + 30px) 0 90px; }
.hero-in { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 13px; color: #d4d4d8; margin-bottom: 22px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.hero-title { font-size: clamp(3.6rem, 11vw, 8rem); font-weight: 700; letter-spacing: -.04em; line-height: .95; margin-bottom: 26px; }
.line { display: block; overflow: hidden; padding-bottom: .08em; }
.word-in { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease); }
.ready .word-in { transform: none; }
.line:nth-child(2) .word-in { transition-delay: .12s; }
.grad.word-in { display: inline-block; filter: drop-shadow(0 0 26px rgba(139, 92, 246, .35)); }
.hero-tag { font: 600 clamp(1.15rem, 2.4vw, 1.6rem)/1.35 var(--head); color: #fff; margin-bottom: 16px; max-width: 560px; }
.hero-intro { max-width: 540px; font-size: 1.08rem; margin-bottom: 32px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-visual { position: relative; min-height: 440px; display: grid; place-items: center; perspective: 1000px; }
.orb { position: absolute; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(139, 92, 246, .55), rgba(59, 130, 246, .25) 55%, transparent 72%); filter: blur(30px); animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: .8; } }
.code-win { position: relative; width: min(100%, 440px); border-radius: 18px; background: rgba(17, 19, 27, .8); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 30px 80px -20px rgba(139, 92, 246, .5), inset 0 1px 0 rgba(255, 255, 255, .1); transition: transform .2s ease-out; transform-style: preserve-3d; }
.code-bar { display: flex; align-items: center; gap: 7px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.code-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ef4444; }
.code-bar i:nth-child(2) { background: #f59e0b; } .code-bar i:nth-child(3) { background: #22c55e; }
.code-bar span { margin-left: 10px; font-size: 12px; color: var(--grey); font-family: ui-monospace, Menlo, Consolas, monospace; }
.code { margin: 0; padding: 20px 22px 24px; font: 14px/1.85 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #e4e4e7; overflow: hidden; white-space: pre; }
.c-k { color: #c4a7ff; } .c-v { color: #7cb7ff; } .c-p { color: #93c5fd; } .c-s { color: #86efac; }
.caret { display: inline-block; width: 8px; height: 1.1em; margin-left: 3px; vertical-align: text-bottom; background: var(--purple); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.float { position: absolute; width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: rgba(17, 19, 27, .75); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 12px 30px -10px rgba(59, 130, 246, .6); color: #c4b5fd; font-size: 24px; animation: floaty 7s ease-in-out infinite; }
.f1 { top: 2%; left: 4%; } .f2 { top: 8%; right: 2%; animation-delay: -2s; color: #93c5fd; }
.f3 { bottom: 6%; left: 0; animation-delay: -4s; color: #93c5fd; } .f4 { bottom: 12%; right: 6%; animation-delay: -1s; } .f5 { top: 46%; right: -10px; animation-delay: -3s; width: 48px; height: 48px; font-size: 20px; }
@keyframes floaty { 50% { transform: translateY(-16px) rotate(4deg); } }
.scroll-ind { position: absolute; bottom: 26px; left: 50%; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--grey); font-size: 11px; letter-spacing: .25em; text-transform: uppercase; }
.mouse { width: 24px; height: 38px; border: 2px solid rgba(255, 255, 255, .3); border-radius: 14px; position: relative; }
.mouse i { position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 3px; background: var(--grad); animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(36px, 6vw, 90px); align-items: center; }
.about-visual { display: grid; place-items: center; perspective: 900px; }
.id-card { position: relative; width: min(100%, 400px); aspect-ratio: 1; display: grid; place-items: center; transition: transform .2s ease-out; transform-style: preserve-3d; }
.ring { position: absolute; border-radius: 50%; border: 1px dashed rgba(139, 92, 246, .55); }
.r1 { inset: 0; animation: spin 40s linear infinite; }
.r2 { inset: 12%; border-color: rgba(59, 130, 246, .5); animation: spin 28s linear infinite reverse; }
.r3 { inset: 24%; border-style: solid; border-color: rgba(255, 255, 255, .1); }
@keyframes spin { to { transform: rotate(360deg); } }
.id-core { width: 46%; aspect-ratio: 1; display: grid; place-items: center; font: 700 clamp(2.4rem, 7vw, 3.6rem) var(--head); border-radius: 30%; background: var(--grad); box-shadow: 0 0 70px rgba(139, 92, 246, .6), inset 0 0 30px rgba(255, 255, 255, .2); animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(3deg); } }
.chip { position: absolute; padding: 8px 16px; border-radius: 999px; font: 500 13px var(--body); background: rgba(17, 19, 27, .8); border: 1px solid rgba(255, 255, 255, .15); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: floaty 8s ease-in-out infinite; }
.c1 { top: 10%; left: -2%; } .c2 { top: 52%; right: -4%; animation-delay: -3s; } .c3 { bottom: 8%; left: 8%; animation-delay: -5s; }
.about-copy p { max-width: 600px; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; }
.pillars li { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); transition: transform .3s var(--ease), border-color .3s; }
.pillars li:hover { transform: translateY(-4px); border-color: rgba(139, 92, 246, .6); }
.pillars span { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: rgba(139, 92, 246, .16); color: #c4b5fd; }
.pillars b { display: block; font: 600 15px var(--head); }
.pillars small { color: var(--grey); font-size: 12px; line-height: 1.4; display: block; }

/* ---------- Cards (skills / services) ---------- */
.cards { display: grid; gap: 20px; }
.skills-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.services-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card {
  position: relative; padding: 28px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); overflow: hidden; isolation: isolate;
  transition: transform .4s var(--ease), border-color .4s, box-shadow .4s;
}
.card::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(139, 92, 246, .22), transparent 60%); }
.card:hover { transform: translateY(-6px); border-color: rgba(139, 92, 246, .55); box-shadow: 0 24px 60px -24px rgba(139, 92, 246, .55); }
.card:hover::before { opacity: 1; }
.card-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 20px; font-size: 26px; background: linear-gradient(135deg, rgba(139, 92, 246, .25), rgba(59, 130, 246, .2)); border: 1px solid rgba(139, 92, 246, .35); color: #ddd6fe; transition: transform .5s var(--ease); }
.card:hover .card-ico { transform: rotate(-8deg) scale(1.1); }
.card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.card p { margin: 0; font-size: .97rem; }
.card-num { position: absolute; top: 20px; right: 24px; font: 700 14px var(--head); color: rgba(255, 255, 255, .18); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag { padding: 5px 12px; border-radius: 999px; font-size: 12px; background: rgba(59, 130, 246, .14); border: 1px solid rgba(59, 130, 246, .35); color: #bfdbfe; }

/* ---------- Projects ---------- */
.projects { display: grid; gap: 30px; }
.project { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(18px, 3vw, 34px); border-radius: 28px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); position: relative; overflow: hidden; transition: border-color .4s, box-shadow .4s; }
.project::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--grad); opacity: .35; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; transition: opacity .4s; }
.project:hover::before { opacity: 1; }
.project:hover { box-shadow: 0 40px 90px -40px rgba(139, 92, 246, .6); }
.project:nth-child(even) .preview { order: 2; }
.preview { display: block; border-radius: 16px; background: #0b0c12; border: 1px solid rgba(255, 255, 255, .12); overflow: hidden; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .8); transition: transform .5s var(--ease); transform: perspective(1200px) rotateY(-3deg) rotateX(1deg); }
.project:nth-child(even) .preview { transform: perspective(1200px) rotateY(3deg) rotateX(1deg); }
.project:hover .preview { transform: perspective(1200px) rotateY(0) rotateX(0) translateY(-6px) scale(1.015); }
.pv-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #14161f; border-bottom: 1px solid var(--line); }
.pv-bar i { width: 9px; height: 9px; border-radius: 50%; background: #3f3f46; flex: none; }
.pv-url { flex: 1; margin-left: 10px; padding: 4px 12px; border-radius: 8px; background: rgba(255, 255, 255, .06); font-size: 12px; color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-body { position: relative; aspect-ratio: 16 / 10; background: #0b0c12; }
.pv-body img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pv-fallback { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 20px; background: radial-gradient(circle at 30% 20%, rgba(139, 92, 246, .45), transparent 55%), radial-gradient(circle at 80% 90%, rgba(59, 130, 246, .4), transparent 55%), #0d0e15; overflow: hidden; }
.pv-fallback::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 28px 28px; opacity: .6; }
.pv-fallback > * { position: relative; }
.pv-word { font: 700 clamp(1.6rem, 4.6vw, 2.8rem) var(--head); letter-spacing: .08em; }
.pv-dom { font-size: 13px; color: #c4b5fd; padding: 6px 14px; border: 1px solid rgba(196, 181, 253, .35); border-radius: 999px; background: rgba(0, 0, 0, .3); }
.pv-live { position: absolute; top: 12px; right: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .08em; background: rgba(0, 0, 0, .6); border: 1px solid rgba(255, 255, 255, .15); }
.pv-live .dot { width: 6px; height: 6px; }
.pj-label { font: 600 12px var(--head); letter-spacing: .22em; text-transform: uppercase; color: var(--purple); margin-bottom: 10px; }
.pj-title { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 14px; }
.pj-desc { font-size: 1.05rem; margin-bottom: 22px; }
.pj-link { font-size: 13px; color: #93c5fd; margin-top: 16px; display: inline-flex; align-items: center; gap: 6px; word-break: break-all; }
.projects.multi { grid-template-columns: 1fr; }

/* ---------- Timeline ---------- */
.timeline { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.timeline::before { content: ""; position: absolute; left: 6%; right: 6%; top: 34px; height: 2px; background: var(--line); }
.timeline::after { content: ""; position: absolute; left: 6%; top: 34px; height: 2px; width: calc(88% * var(--tl, 0)); background: var(--grad); box-shadow: 0 0 14px rgba(139, 92, 246, .8); }
.step { position: relative; text-align: center; padding: 0 6px; }
.step-node { position: relative; z-index: 1; width: 70px; height: 70px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: var(--bg2); border: 2px solid var(--line); color: var(--grey); transition: all .6s var(--ease); }
.step.in .step-node { border-color: var(--purple); color: #fff; background: linear-gradient(135deg, rgba(139, 92, 246, .35), rgba(59, 130, 246, .3)); box-shadow: 0 0 30px rgba(139, 92, 246, .55); }
.step-num { font: 700 13px var(--head); letter-spacing: .2em; color: var(--purple); margin-bottom: 6px; }
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { font-size: .92rem; margin: 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 28px; align-items: start; }
.contact-cards { display: grid; gap: 14px; }
.c-card { position: relative; display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); overflow: hidden; isolation: isolate; transition: transform .35s var(--ease), border-color .35s, box-shadow .35s; }
.c-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(120deg, var(--c1), var(--c2)); opacity: .0; transition: opacity .35s; }
.c-card:hover { transform: translateX(6px); border-color: var(--c1); box-shadow: 0 0 0 1px var(--c1), 0 14px 40px -14px var(--c1); }
.c-card:hover::before { opacity: .14; }
.c-ico { width: 52px; height: 52px; border-radius: 15px; flex: none; display: grid; place-items: center; font-size: 24px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 8px 22px -8px var(--c1); }
.c-txt { flex: 1; min-width: 0; }
.c-txt b { display: block; font: 600 16px var(--head); }
.c-txt small { display: block; color: var(--grey); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-arrow { color: var(--grey); transition: color .3s, transform .3s var(--ease); }
.c-card:hover .c-arrow { color: #fff; transform: translate(3px, -3px); }
.glass { background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: 24px; }
.form { padding: clamp(22px, 3.5vw, 38px); box-shadow: 0 30px 80px -40px rgba(139, 92, 246, .6); }
.form h3 { font-size: 1.5rem; margin-bottom: 22px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 8px; color: #d4d4d8; }
.field input, .field textarea { width: 100%; padding: 14px 16px; border-radius: 14px; background: rgba(8, 9, 13, .6); border: 1px solid var(--line); color: #fff; font-size: 16px; /* 16px stops iOS zoom */ transition: border-color .25s, box-shadow .25s, background .25s; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #71717a; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 4px rgba(139, 92, 246, .22); background: rgba(8, 9, 13, .9); }
.field.invalid input, .field.invalid textarea { border-color: #f87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, .15); }
.err { display: block; min-height: 0; margin-top: 6px; font-size: 12.5px; color: #fca5a5; }
.notice { margin-top: 18px; padding: 16px 18px; border-radius: 14px; font-size: 14px; line-height: 1.6; background: rgba(59, 130, 246, .12); border: 1px solid rgba(59, 130, 246, .4); color: #dbeafe; animation: rise .5s var(--ease); }
.notice b { color: #fff; }
.notice a, .notice button { color: #93c5fd; text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; font-size: inherit; }
.notice .row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Socials ---------- */
.socials { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.soc { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 12px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); text-align: center; transition: transform .35s var(--ease), border-color .35s, box-shadow .35s; }
.soc .ico { width: 30px; height: 30px; color: #d4d4d8; transition: color .3s, transform .4s var(--ease); }
.soc b { font: 600 15px var(--head); }
.soc small { color: var(--grey); font-size: 12px; min-height: 18px; }
a.soc:hover { transform: translateY(-6px); border-color: var(--purple); box-shadow: 0 18px 40px -18px rgba(139, 92, 246, .8); }
a.soc:hover .ico { color: #fff; transform: scale(1.18) rotate(-6deg); }
.soc.off { opacity: .5; cursor: default; border-style: dashed; }

/* ---------- Footer ---------- */
.footer { position: relative; margin-top: 60px; padding: 70px 0 28px; background: linear-gradient(180deg, transparent, rgba(17, 19, 27, .9) 30%); border-top: 1px solid var(--line); overflow: hidden; }
.footer::before { content: ""; position: absolute; top: -1px; left: 20%; right: 20%; height: 1px; background: var(--grad); box-shadow: 0 0 30px 4px rgba(139, 92, 246, .7); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 40px; }
.foot-brand p { margin: 16px 0 20px; max-width: 320px; font-style: italic; }
.foot-social { display: flex; flex-wrap: wrap; gap: 10px; }
.foot-social a, .foot-social span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); color: #d4d4d8; transition: all .3s var(--ease); }
.foot-social a:hover { background: var(--grad); color: #fff; transform: translateY(-4px); border-color: transparent; }
.foot-social span { opacity: .35; }
.foot-col { display: flex; flex-direction: column; gap: 8px; }
.foot-col h4 { font-size: 14px; letter-spacing: .15em; text-transform: uppercase; margin-bottom: 8px; }
.foot-col a { color: var(--grey); font-size: 15px; transition: color .25s, transform .25s; width: fit-content; word-break: break-all; }
.foot-col a:hover { color: #fff; transform: translateX(4px); }
.foot-bottom { margin-top: 50px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.foot-bottom p { margin: 0; font-size: 14px; }
.to-top { width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 20px; transition: all .3s var(--ease); }
.to-top:hover { background: var(--grad); transform: translateY(-4px); box-shadow: 0 10px 28px -8px rgba(139, 92, 246, .8); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .timeline { grid-template-columns: 1fr; gap: 0; padding-left: 12px; }
  .timeline::before { left: 47px; right: auto; top: 20px; bottom: 20px; width: 2px; height: auto; }
  .timeline::after { left: 47px; top: 20px; width: 2px; height: calc((100% - 40px) * var(--tl, 0)); }
  .step { display: grid; grid-template-columns: 70px 1fr; gap: 0 22px; text-align: left; padding: 0 0 34px; align-items: start; }
  .step-node { margin: 0; grid-row: span 3; }
  .step-num { align-self: end; margin-top: 4px; }
}
@media (max-width: 900px) {
  .burger { display: block; }
  .links {
    position: fixed; inset: 0; z-index: 105; flex-direction: column; justify-content: center; gap: 6px;
    background: rgba(8, 9, 13, .96); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
    clip-path: circle(0 at calc(100% - 44px) 36px); visibility: hidden;
    transition: clip-path .7s var(--ease), visibility .7s;
  }
  .links.open { clip-path: circle(150% at calc(100% - 44px) 36px); visibility: visible; }
  .links a:not(.btn) { font: 600 clamp(1.6rem, 7vw, 2.2rem) var(--head); color: #fff; padding: 10px 20px; opacity: 0; transform: translateY(24px); transition: opacity .5s var(--ease), transform .5s var(--ease), color .25s; }
  .links.open a:not(.btn) { opacity: 1; transform: none; }
  .links.open a:nth-child(1) { transition-delay: .15s; } .links.open a:nth-child(2) { transition-delay: .2s; } .links.open a:nth-child(3) { transition-delay: .25s; }
  .links.open a:nth-child(4) { transition-delay: .3s; } .links.open a:nth-child(5) { transition-delay: .35s; } .links.open a:nth-child(6) { transition-delay: .4s; }
  .links a:not(.btn)::after { display: none; }
  .nav-cta { margin: 18px 0 0; padding: 16px 38px; font-size: 16px; opacity: 0; transition: opacity .5s .45s; }
  .links.open .nav-cta { opacity: 1; }
  .hero-in, .about-grid, .contact-grid, .project { grid-template-columns: 1fr; }
  .hero { padding-bottom: 110px; }
  .hero-visual { min-height: 380px; order: 2; margin-top: 10px; }
  .project:nth-child(even) .preview { order: 0; }
  .about-visual { order: 2; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 32px); }
  .pillars { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; }
  .float { width: 46px; height: 46px; font-size: 20px; border-radius: 14px; }
  .f5 { display: none; }
  .code { font-size: 12.5px; padding: 16px; }
  .services-grid, .skills-grid { grid-template-columns: 1fr; }
  .scroll-ind { display: none; }
  .foot-grid { grid-template-columns: 1fr; }
  .foot-bottom { flex-direction: column-reverse; text-align: center; }
  .c-card:hover { transform: none; }
  .chip { font-size: 12px; padding: 6px 12px; }
  .c1 { left: 0; } .c2 { right: 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .word-in { transform: none; }
}

/* ---------- Overflow safety ---------- */
html, body { overflow-x: clip; }
.hero, .section { overflow-x: clip; }
.hero-in > *, .about-grid > *, .contact-grid > *, .project > * { min-width: 0; }
.orb { max-width: 90vw; max-height: 90vw; }

/* Socials: tidy 4x2 grid */
.socials { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 600px) { .socials { grid-template-columns: repeat(2, 1fr); } }
