/* ==========================================================================
   Salman — Portfolio
   1. Tokens   2. Base   3. Layout & utilities   4. Buttons
   5. Nav      6. Hero   7. Marquee   8. About   9. Skills
   10. Portfolio   11. Modal   12. Services   13. Contact   14. Footer
   15. Motion & responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --bg: #0a0b10;
  --bg-2: #0f1118;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f6;
  --muted: #9aa1b5;
  --faint: #5d6377;
  --accent: #c6f432;
  --accent-2: #7c5cff;
  --accent-3: #22d3ee;
  --on-accent: #0a0b10;
  --grad: linear-gradient(100deg, var(--accent) 0%, var(--accent-3) 45%, var(--accent-2) 100%);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
  --glass: rgba(14, 16, 24, 0.72);
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --nav-h: 76px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f5f5f0;
  --bg-2: #ecece5;
  --surface: rgba(10, 12, 30, 0.035);
  --surface-2: rgba(10, 12, 30, 0.06);
  --border: rgba(10, 12, 30, 0.1);
  --border-strong: rgba(10, 12, 30, 0.2);
  --text: #0e1020;
  --muted: #555b70;
  --faint: #8a8fa0;
  --accent: #5b3df5;
  --accent-2: #5b3df5;
  --accent-3: #0891b2;
  --on-accent: #ffffff;
  --grad: linear-gradient(100deg, #5b3df5 0%, #0891b2 55%, #16a34a 100%);
  --shadow: 0 24px 50px -28px rgba(20, 20, 60, 0.35);
  --glass: rgba(245, 245, 240, 0.78);
  color-scheme: light;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link { position: fixed; left: 16px; top: -60px; z-index: 1000; padding: 10px 16px; background: var(--accent); color: var(--on-accent); border-radius: 10px; font-weight: 600; transition: top .2s; }
.skip-link:focus { top: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { text-align: center; padding: 20px; color: var(--muted); }

/* 3. Layout & utilities ---------------------------------------------------- */
.container { width: min(1240px, 100% - 48px); margin-inline: auto; }
.section { padding: clamp(72px, 10vw, 124px) 0; position: relative; }
.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head--split { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.section-head--split .section-sub { max-width: 380px; margin: 0; }
.section-tag { font: 500 13px/1 var(--font-mono); color: var(--accent); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 18px; }
.section-title { font-size: clamp(34px, 5.4vw, 64px); font-weight: 600; }
.section-sub { color: var(--muted); font-size: 17px; margin-top: 18px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 14px; color: var(--muted); margin-bottom: 26px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent); }
.link-arrow svg { transition: transform .3s var(--ease); }
.link-arrow:hover svg { transform: translateX(5px); }
.link-btn { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Spotlight hover (mouse-follow glow) */
.spotlight { position: relative; isolation: isolate; }
.spotlight::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--c, var(--accent)) 16%, transparent), transparent 60%);
}
.spotlight:hover::before { opacity: 1; }

/* 4. Buttons --------------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: 15px; line-height: 1;
  border: 1px solid transparent; background: var(--btn-bg); white-space: nowrap;
  transition: transform .35s var(--ease), background-color .3s, border-color .3s, box-shadow .3s, color .3s;
  will-change: transform;
}
.btn svg { font-size: 18px; transition: transform .35s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--primary { --btn-bg: var(--accent); color: var(--on-accent); box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn--primary:hover { box-shadow: 0 16px 40px -12px color-mix(in srgb, var(--accent) 85%, transparent); }
.btn--ghost { background: transparent; border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--text); }
.btn--sm { padding: 10px 18px; font-size: 14px; }
.btn--lg { padding: 17px 28px; font-size: 16px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* 5. Nav ------------------------------------------------------------------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 100; padding: 14px 0; transition: padding .4s var(--ease); }
.nav__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 10px 12px 10px 22px; border-radius: 999px; border: 1px solid transparent;
  transition: background-color .4s, border-color .4s, box-shadow .4s, padding .4s var(--ease), width .4s var(--ease);
}
.nav.is-scrolled { padding: 10px 0; }
.nav.is-scrolled .nav__inner {
  background: var(--glass); border-color: var(--border); box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  padding-block: 6px; width: min(1080px, 100% - 32px);
}
.nav__logo { display: inline-flex; align-items: center; gap: 10px; font: 700 20px/1 var(--font-display); }
.logo-mark { font: 500 13px/1 var(--font-mono); padding: 8px 9px; border-radius: 10px; background: var(--accent); color: var(--on-accent); transition: transform .5s var(--ease); }
.nav__logo:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }
.logo-dot { color: var(--accent); }
.nav__links { display: flex; gap: 4px; }
.nav__links a { position: relative; padding: 9px 14px; font-size: 15px; color: var(--muted); border-radius: 999px; transition: color .25s, background-color .25s; }
.nav__links a:hover { color: var(--text); }
.nav__links a.is-active { color: var(--text); background: var(--surface-2); }
.nav__actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); font-size: 18px; transition: transform .5s var(--ease), background-color .3s; }
.theme-toggle:hover { transform: rotate(25deg); background: var(--surface-2); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
.nav__burger { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); position: relative; }
.nav__burger span { position: absolute; left: 13px; right: 13px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .4s var(--ease), top .4s var(--ease); }
.nav__burger span:first-child { top: 17px; }
.nav__burger span:last-child { top: 25px; }
.nav__burger[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }
.mobile-menu { position: fixed; inset: 0; z-index: -1; background: var(--bg); padding: calc(var(--nav-h) + 30px) 24px 40px; display: flex; }
.mobile-menu[hidden] { display: none; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.mobile-menu a:not(.btn) { font: 600 clamp(30px, 9vw, 44px)/1.2 var(--font-display); padding: 6px 0; opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease), transform .5s var(--ease), color .2s; }
.mobile-menu a:not(.btn):hover { color: var(--accent); }
.mobile-menu .btn { margin-top: 26px; opacity: 0; transition: opacity .5s .3s; }
.mobile-menu.is-open a { opacity: 1; transform: none; }
.mobile-menu.is-open a:nth-child(2) { transition-delay: .04s; } .mobile-menu.is-open a:nth-child(3) { transition-delay: .08s; }
.mobile-menu.is-open a:nth-child(4) { transition-delay: .12s; } .mobile-menu.is-open a:nth-child(5) { transition-delay: .16s; }
.mobile-menu.is-open a:nth-child(6) { transition-delay: .2s; }

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

/* 6. Hero ------------------------------------------------------------------ */
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--nav-h) + 50px) 0 90px; position: relative; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.blob--1 { width: 520px; height: 520px; background: var(--accent-2); top: -120px; right: -80px; animation: drift 18s ease-in-out infinite alternate; }
.blob--2 { width: 420px; height: 420px; background: var(--accent-3); bottom: -160px; left: -120px; opacity: .28; animation: drift 22s ease-in-out infinite alternate-reverse; }
:root[data-theme="light"] .blob { opacity: .22; }
@keyframes drift { to { transform: translate(-60px, 60px) scale(1.12); } }
.grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  opacity: .6;
}
.hero__inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(40px, 5vw, 80px); align-items: center; }
.hero__inner > *, .about__grid > *, .contact__grid > * { min-width: 0; }
.hero__title { font-size: clamp(42px, 6.4vw, 84px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; margin-bottom: 26px; }
.hero__lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); max-width: 560px; margin-bottom: 34px; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 48px; }
.hero__stats { display: flex; gap: clamp(24px, 4vw, 48px); list-style: none; padding: 0; margin: 0; }
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats strong { font: 700 clamp(30px, 3.5vw, 40px)/1 var(--font-display); }
.hero__stats strong::after { content: "+"; color: var(--accent); }
.hero__stats span { font-size: 14px; color: var(--muted); margin-top: 6px; }

.hero__visual { position: relative; perspective: 1200px; }
.devbox { position: relative; transform-style: preserve-3d; transition: transform .6s var(--ease); }
.editor, .preview { border: 1px solid var(--border-strong); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.editor { background: #0d0f16; color: #d6dbe8; width: 88%; position: relative; z-index: 2; transform: translateZ(40px); }
.editor__bar, .preview__bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.editor__tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.editor__tabs::-webkit-scrollbar { display: none; }
.tab { font: 400 12px/1 var(--font-mono); padding: 7px 10px; border-radius: 8px; color: #7d8499; white-space: nowrap; transition: color .2s, background-color .2s; }
.tab:hover { color: #d6dbe8; }
.tab.is-active { color: #fff; background: rgba(255,255,255,.08); }
.editor__code { margin: 0; padding: 18px 20px 22px; min-height: 250px; font: 400 13px/1.7 var(--font-mono); white-space: pre-wrap; word-break: break-word; }
.caret { display: inline-block; width: 8px; height: 16px; background: #c6f432; vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tok-k { color: #c792ea; } .tok-s { color: #c3e88d; } .tok-f { color: #82aaff; } .tok-c { color: #5c6680; font-style: italic; } .tok-t { color: #f07178; } .tok-n { color: #f78c6c; }

.preview { position: absolute; right: 0; bottom: -64px; width: 62%; background: #fff; color: #111; z-index: 3; transform: translateZ(80px); }
.preview__bar { border-color: #eee; background: #f7f7f8; }
.preview__url { flex: 1; font: 400 11px/1 var(--font-mono); color: #777; background: #fff; border: 1px solid #eee; padding: 6px 10px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview__body { padding: 14px; min-height: 190px; display: grid; gap: 8px; align-content: start; }
.pv { border-radius: 6px; opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.pv.in { opacity: 1; transform: none; }
.pv-nav { height: 12px; display: flex; justify-content: space-between; align-items: center; }
.pv-nav b { width: 40px; height: 10px; border-radius: 3px; background: #111; }
.pv-nav i { display: flex; gap: 5px; } .pv-nav i::before, .pv-nav i::after, .pv-nav em { content: ""; width: 20px; height: 6px; border-radius: 3px; background: #ccc; display: block; }
.pv-hero { height: 58px; padding: 10px; color: #fff; font: 700 13px/1.2 var(--font-display); display: flex; align-items: end; }
.pv-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pv-card { height: 46px; background: #f0f0f3; border-radius: 6px; position: relative; overflow: hidden; }
.pv-card::after { content: ""; position: absolute; left: 6px; right: 40%; bottom: 6px; height: 5px; border-radius: 3px; background: #c9c9d1; }
.pv-btn { height: 20px; width: 90px; border-radius: 99px; }
.pv-chart { height: 60px; display: flex; align-items: end; gap: 5px; padding: 6px; background: #f5f5f8; }
.pv-chart span { flex: 1; border-radius: 3px 3px 0 0; }

.float-chip {
  position: absolute; z-index: 4; padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--glass); border: 1px solid var(--border-strong); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow); animation: float 6s ease-in-out infinite;
}
.float-chip--1 { top: -18px; right: 8%; transform: translateZ(100px); }
.float-chip--2 { bottom: 40px; left: -12px; animation-delay: -3s; transform: translateZ(100px); }
@keyframes float { 50% { translate: 0 -10px; } }

.scroll-hint { position: absolute; left: 50%; bottom: 28px; width: 26px; height: 42px; border: 2px solid var(--border-strong); border-radius: 20px; translate: -50% 0; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--text); animation: scroll 1.8s var(--ease) infinite; }
@keyframes scroll { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* 7. Marquee --------------------------------------------------------------- */
.marquee { border-block: 1px solid var(--border); overflow: hidden; padding: 22px 0; background: var(--bg-2); }
.marquee__track { display: flex; width: max-content; gap: 48px; animation: marquee 40s linear infinite; }
.marquee span { font: 600 clamp(22px, 3vw, 34px)/1 var(--font-display); color: var(--faint); display: inline-flex; align-items: center; gap: 48px; white-space: nowrap; transition: color .3s; }
.marquee span::after { content: "✦"; font-size: .55em; color: var(--accent); }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee span:hover { color: var(--text); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* 8. About ----------------------------------------------------------------- */
.about__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.about__intro p { color: var(--muted); font-size: 17px; }
.about__intro .section-title { margin-bottom: 28px; }
.about__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat-card { padding: 28px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: transform .5s var(--ease), border-color .3s; }
.stat-card:nth-child(even) { transform: translateY(32px); }
.stat-card:hover { border-color: var(--border-strong); }
.stat-card strong { display: block; font: 700 clamp(40px, 5vw, 56px)/1 var(--font-display); margin-bottom: 12px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-card span { color: var(--muted); font-size: 15px; }

/* 9. Skills ---------------------------------------------------------------- */
.skills { background: var(--bg-2); border-block: 1px solid var(--border); }
.skill-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 44px 22px; }
.skill-group { grid-column: 1 / -1; min-width: 0; }
.skill-group--half { grid-column: auto; }
.skill-group--half .skill-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.skill-group h3 { font-size: 22px; display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.skill-group__num { font: 500 12px/1 var(--font-mono); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--border-strong); color: var(--accent); }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.skill-card {
  padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  transition: transform .45s var(--ease), border-color .3s, background-color .3s; overflow: hidden;
}
.skill-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.skill-card__icon {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; margin-bottom: 18px;
  font: 600 15px/1 var(--font-mono); color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); transition: transform .5s var(--ease);
}
:root[data-theme="light"] .skill-card__icon { color: color-mix(in srgb, var(--c) 65%, #000); }
.skill-card:hover .skill-card__icon { transform: rotate(-8deg) scale(1.1); }
.skill-card h4 { font-size: 19px; margin-bottom: 6px; }
.skill-card p { margin: 0; font-size: 14px; color: var(--muted); }

/* 10. Portfolio ------------------------------------------------------------ */
.toolbar { position: sticky; top: calc(var(--nav-h) - 4px); z-index: 20; margin-bottom: 30px; padding: 14px; border-radius: 22px; border: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px -2px 12px; scroll-snap-type: x proximity; mask-image: linear-gradient(90deg, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); }
.filters::-webkit-scrollbar { display: none; }
.filter {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; scroll-snap-align: start;
  border: 1px solid var(--border); transition: color .25s, background-color .25s, border-color .25s;
}
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter small { font: 500 11px/1 var(--font-mono); padding: 3px 6px; border-radius: 99px; background: var(--surface-2); color: var(--faint); transition: inherit; }
.filter[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.filter[aria-selected="true"] small { background: color-mix(in srgb, var(--bg) 15%, transparent); color: var(--bg); }
.toolbar__row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { flex: 1 1 280px; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); transition: border-color .25s, box-shadow .25s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.search svg { color: var(--faint); font-size: 18px; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 15px; }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.search kbd { font: 500 12px/1 var(--font-mono); padding: 4px 7px; border-radius: 6px; border: 1px solid var(--border-strong); color: var(--faint); }
.select { position: relative; }
.select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select select { appearance: none; -webkit-appearance: none; height: 46px; padding: 0 40px 0 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; cursor: pointer; }
.select select option { background: var(--bg); color: var(--text); }
.result-count { margin: 0 4px 0 auto; font: 500 13px/1 var(--font-mono); color: var(--muted); white-space: nowrap; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip-x { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 12px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); font-size: 13px; }
.chip-x svg { font-size: 13px; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px; }
.card {
  --tilt-x: 0deg; --tilt-y: 0deg;
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  overflow: hidden; transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)); transition: transform .5s var(--ease), border-color .3s, box-shadow .4s, opacity .45s var(--ease), translate .45s var(--ease);
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); translate: 0 -6px; }
.card.is-entering { opacity: 0; translate: 0 18px; }
.card__media { position: relative; aspect-ratio: 16 / 10.5; overflow: hidden; background: var(--bg-2); cursor: pointer; }
.card__ph { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, hsl(var(--h) 60% 22%), hsl(calc(var(--h) + 50) 60% 14%)); }
.card__ph span { font: 700 44px/1 var(--font-display); color: rgba(255,255,255,.85); letter-spacing: -0.03em; }
.card__ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); translate: -100% 0; animation: shimmer 1.8s infinite; }
.card__media.is-loaded .card__ph::after { display: none; }
@keyframes shimmer { to { translate: 100% 0; } }
.card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; opacity: 0; transform: scale(1.02); transition: opacity .6s var(--ease), transform 1.2s var(--ease); }
.card__media.is-loaded img { opacity: 1; }
.card:hover .card__media img { transform: scale(1.08); }
.card__overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 16px; background: linear-gradient(180deg, transparent 30%, rgba(5, 6, 10, .85)); opacity: 0; transition: opacity .4s var(--ease); }
.card:hover .card__overlay, .card:focus-within .card__overlay { opacity: 1; }
.card__overlay .badges { transform: translateY(12px); transition: transform .5s var(--ease); }
.card:hover .card__overlay .badges { transform: none; }
.card__type { position: absolute; top: 12px; left: 12px; z-index: 2; padding: 6px 11px; border-radius: 99px; font-size: 12px; font-weight: 600; background: rgba(10, 11, 16, .72); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.12); }
.card__feat { position: absolute; top: 12px; right: 12px; z-index: 2; padding: 6px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--accent); color: var(--on-accent); }
.card__body { display: flex; flex-direction: column; flex: 1; padding: 20px 20px 18px; }
.card__meta { display: flex; justify-content: space-between; gap: 10px; font: 500 12px/1.3 var(--font-mono); color: var(--faint); margin-bottom: 10px; }
.card__title { font-size: 21px; margin-bottom: 8px; }
.card__title button { text-align: left; transition: color .2s; }
.card__title button:hover { color: var(--accent); }
.card__desc { font-size: 14.5px; color: var(--muted); margin-bottom: 16px; flex: 1; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.card__overlay .badge { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(6px); }
.badge--wordpress { --b: #21759b; } .badge--woocommerce { --b: #96588a; } .badge--shopify { --b: #95bf47; } .badge--elementor { --b: #e2498a; } .badge--react { --b: #61dafb; } .badge--next { --b: #aaa; }
.card__body .badge[class*="badge--"] { border-color: color-mix(in srgb, var(--b) 45%, transparent); background: color-mix(in srgb, var(--b) 12%, transparent); }
.card__actions { display: flex; gap: 8px; margin-top: 18px; }
.card__actions .btn { flex: 1; padding: 11px 14px; font-size: 14px; }
.card__actions .btn--primary svg { font-size: 15px; }
.card__actions .btn:hover svg { transform: translate(2px, -2px); }

.empty { text-align: center; padding: 60px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); }
.empty__title { font: 600 22px/1.2 var(--font-display); color: var(--text); }
.load-more { display: flex; justify-content: center; margin-top: 40px; }

/* 11. Modal ---------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(4, 5, 8, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fade .35s var(--ease); }
.modal__panel {
  position: relative; width: min(1120px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: auto; overscroll-behavior: contain;
  border-radius: 26px; background: var(--bg); border: 1px solid var(--border-strong); box-shadow: 0 40px 120px -30px rgba(0,0,0,.8);
  animation: pop .5s var(--ease);
}
.modal.is-closing .modal__panel { animation: pop-out .3s var(--ease) forwards; }
.modal.is-closing .modal__backdrop { animation: fade .3s reverse forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(30px) scale(.97); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(20px) scale(.98); } }
.modal__close { position: sticky; top: 16px; float: right; margin: 16px 16px -60px 0; z-index: 5; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--glass); border: 1px solid var(--border-strong); backdrop-filter: blur(10px); font-size: 20px; transition: transform .4s var(--ease); }
.modal__close:hover { transform: rotate(90deg); }
.modal__content { display: grid; grid-template-columns: 1.35fr 1fr; align-items: start; }
.modal__content > * { min-width: 0; }
.gallery { position: sticky; top: 0; align-self: start; padding: 22px; border-right: 1px solid var(--border); background: var(--bg-2); }
.gallery__stage { position: relative; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); aspect-ratio: 16 / 11; }
.gallery__stage.is-mobile { aspect-ratio: 16 / 11; background: radial-gradient(circle at 50% 30%, var(--surface-2), var(--bg-2)); }
.gallery__stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .5s var(--ease); }
.gallery__stage.is-mobile img { left: 50%; width: auto; height: 92%; top: 4%; translate: -50% 0; aspect-ratio: 390 / 844; border-radius: 18px; border: 6px solid #111; box-shadow: var(--shadow); }
.gallery__stage img.is-loaded { opacity: 1; }
.gallery__stage .card__ph { z-index: 0; }
.gallery__nav { position: absolute; top: 50%; translate: 0 -50%; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--border-strong); z-index: 2; transition: transform .3s var(--ease); }
.gallery__nav:hover { transform: scale(1.08); }
.gallery__nav--prev { left: 12px; } .gallery__nav--next { right: 12px; }
.gallery__thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.gallery__thumb { flex: 0 0 auto; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border); font-size: 13px; color: var(--muted); transition: all .25s; }
.gallery__thumb[aria-current="true"] { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.detail { padding: 34px 32px 30px; }
.detail__type { font: 500 12px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.detail h2 { font-size: clamp(24px, 2.6vw, 34px); margin: 12px 0 14px; padding-right: 40px; }
.detail__desc { color: var(--muted); }
.detail__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 24px 0; padding: 18px 0; border-block: 1px solid var(--border); }
.detail__facts dt { font: 500 11px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.detail__facts dd { margin: 0; font-size: 14.5px; }
.detail h3 { font-size: 15px; font-family: var(--font-body); font-weight: 600; margin: 22px 0 12px; }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.features li { display: flex; gap: 10px; font-size: 14.5px; color: var(--muted); }
.features li::before { content: ""; flex: 0 0 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 18%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 11px no-repeat; }
.detail__links { display: flex; flex-wrap: wrap; gap: 8px; }
.detail__links a { font-size: 13px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border); transition: border-color .2s, color .2s; }
.detail__links a:hover { border-color: var(--accent); color: var(--accent); }
.detail__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.detail__pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); }
.detail__pager button { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; max-width: 48%; transition: color .2s; }
.detail__pager button:hover { color: var(--text); }
.detail__pager span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.modal-open { overflow: hidden; }

/* 12. Services ------------------------------------------------------------- */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-flow: dense; gap: 16px; }
.bento__item {
  --c: var(--accent);
  display: flex; flex-direction: column; padding: 26px; min-height: 200px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); overflow: hidden;
  transition: transform .5s var(--ease), border-color .3s;
}
.bento__item:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.bento__item--wide { grid-column: span 2; }
.bento__item--xl { grid-column: span 2; background: linear-gradient(160deg, color-mix(in srgb, var(--accent-2) 16%, transparent), var(--surface) 60%); }
.bento__icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 14px; font-size: 22px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: auto; color: var(--accent); transition: transform .5s var(--ease), background-color .3s, color .3s; }
.bento__item:hover .bento__icon { transform: rotate(-10deg) scale(1.08); background: var(--accent); color: var(--on-accent); }
.bento__item h3 { font-size: 20px; margin: 26px 0 8px; }
.bento__item--xl h3 { font-size: clamp(26px, 3vw, 36px); }
.bento__item p { margin: 0; font-size: 14.5px; color: var(--muted); }
.bento__item--xl p { font-size: 17px; max-width: 420px; }
.bento__count { margin-top: 16px; font: 500 12px/1 var(--font-mono); color: var(--accent); }
.bento__count:empty { display: none; }
.process { list-style: none; padding: 0; margin: 64px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.process li { position: relative; padding: 24px 0 0; border-top: 1px solid var(--border-strong); }
.process li::before { content: ""; position: absolute; top: -1px; left: 0; width: 0; height: 1px; background: var(--grad); transition: width 1.2s var(--ease); }
.process li.is-visible::before { width: 100%; }
.process span { font: 500 12px/1 var(--font-mono); color: var(--accent); }
.process h4 { font-size: 20px; margin: 10px 0 6px; }
.process p { font-size: 14.5px; color: var(--muted); margin: 0; }

/* 13. Contact -------------------------------------------------------------- */
.contact { background: var(--bg-2); border-top: 1px solid var(--border); overflow: hidden; }
.contact::before { content: ""; position: absolute; width: 600px; height: 600px; right: -200px; top: -200px; border-radius: 50%; background: var(--accent-2); filter: blur(120px); opacity: .18; pointer-events: none; }
.contact__grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(40px, 6vw, 90px); align-items: start; position: relative; }
.contact__title { font-size: clamp(38px, 5.6vw, 72px); margin-bottom: 24px; }
.contact__intro > p { color: var(--muted); font-size: 17px; }
.contact__links { list-style: none; padding: 0; margin: 34px 0 0; display: grid; gap: 10px; }
.contact__links a { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); transition: transform .4s var(--ease), border-color .3s; }
.contact__links a:hover { transform: translateX(6px); border-color: var(--accent); }
.contact__links .ci { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); font: 600 13px/1 var(--font-mono); color: var(--accent); }
.contact__links small { display: block; font-size: 12px; color: var(--faint); }
.contact__links b { font-weight: 500; font-size: 15px; }
.contact__links a[data-placeholder] b { color: var(--muted); font-style: italic; }
.contact-form { padding: clamp(24px, 4vw, 40px); border-radius: 26px; background: var(--surface); border: 1px solid var(--border); display: grid; gap: 18px; backdrop-filter: blur(10px); }
.field { position: relative; border: 0; margin: 0; padding: 0; min-width: 0; }
.field input, .field textarea {
  width: 100%; padding: 24px 16px 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); outline: none; resize: vertical;
  transition: border-color .25s, box-shadow .25s;
}
.field textarea { min-height: 140px; }
.field > label { position: absolute; left: 17px; top: 17px; color: var(--faint); pointer-events: none; transform-origin: 0 0; transition: transform .25s var(--ease), color .25s; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { transform: translateY(-10px) scale(.78); color: var(--accent); }
.field.is-invalid input, .field.is-invalid textarea { border-color: #f43f5e; }
.field__error { display: block; font-size: 13px; color: #f43f5e; margin-top: 6px; min-height: 0; }
.field__error:empty { display: none; }
.field--chips legend { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-block; padding: 9px 14px; border-radius: 99px; border: 1px solid var(--border); font-size: 13.5px; color: var(--muted); transition: all .25s var(--ease); }
.chips label:hover span { border-color: var(--border-strong); color: var(--text); }
.chips input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-status { margin: 0; font-size: 14px; color: var(--muted); min-height: 1em; }
.form-status.is-success { color: #22c55e; }
.form-status.is-error { color: #f43f5e; }
.form-fallback { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.form-fallback .btn { color: var(--text); }

/* 14. Footer --------------------------------------------------------------- */
.footer { padding: 34px 0; border-top: 1px solid var(--border); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer p { margin: 0; color: var(--faint); font-size: 14px; }
.to-top { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border-strong); font-size: 18px; transition: transform .4s var(--ease), background-color .3s; }
.to-top:hover { transform: translateY(-4px); background: var(--surface-2); }

/* Custom cursor */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .has-cursor .cursor { display: block; }
  .cursor__dot, .cursor__ring { position: fixed; left: 0; top: 0; z-index: 999; pointer-events: none; border-radius: 50%; }
  .cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
  .cursor__ring { width: 36px; height: 36px; margin: -18px 0 0 -18px; border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background-color .3s, border-color .3s, opacity .3s; }
  .cursor.is-hover .cursor__ring { width: 60px; height: 60px; margin: -30px 0 0 -30px; background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: transparent; }
  .cursor.is-view .cursor__ring { width: 84px; height: 84px; margin: -42px 0 0 -42px; background: var(--accent); border-color: transparent; }
  .cursor.is-view .cursor__ring::after { content: "View"; position: absolute; inset: 0; display: grid; place-items: center; font: 600 13px/1 var(--font-body); color: var(--on-accent); }
  .cursor.is-hidden { opacity: 0; }
}

/* 15. Motion & responsive -------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.stat-card.reveal.is-visible:nth-child(even) { transform: translateY(32px); }
.no-js .reveal { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .bento { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  :root { --nav-h: 68px; }
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: block; }
  .hero__inner, .about__grid, .contact__grid { grid-template-columns: 1fr; }
  .hero__visual { max-width: 560px; margin: 10px auto 70px; width: 100%; }
  .modal__content { grid-template-columns: 1fr; }
  .gallery { position: relative; border-right: 0; border-bottom: 1px solid var(--border); }
  .process { grid-template-columns: 1fr 1fr; }
  .skill-group--half { grid-column: 1 / -1; }
  .toolbar { position: relative; top: auto; }
}
@media (max-width: 720px) {
  .container { width: calc(100% - 32px); }
  .bento { grid-template-columns: 1fr 1fr; }
  .bento__item--xl { grid-column: span 2; }
  .bento__item--wide { grid-column: auto; }
  .project-grid { grid-template-columns: 1fr; }
  .br-lg { display: none; }
  .hero__ctas .btn { flex: 1 1 100%; }
  .about__cards { gap: 12px; }
  .stat-card { padding: 22px 18px; }
  .stat-card:nth-child(even), .stat-card.reveal.is-visible:nth-child(even) { transform: none; }
  .toolbar { padding: 12px; border-radius: 18px; }
  .select, .select select { width: 100%; }
  .select { flex: 1 1 auto; }
  .result-count { margin: 4px 0 0; width: 100%; }
  .search kbd { display: none; }
  .editor__code { font-size: 11.5px; min-height: 210px; padding: 14px; }
  .preview { width: 70%; bottom: -54px; }
  .float-chip--2 { left: 0; bottom: 20px; }
  .modal { padding: 0; align-items: end; }
  .modal__panel { border-radius: 24px 24px 0 0; max-height: 94dvh; }
  .gallery { padding: 14px; }
  .detail { padding: 24px 20px 28px; }
  .detail__facts { grid-template-columns: 1fr; }
  .detail__actions .btn { flex: 1 1 100%; }
  .card__overlay { display: none; }
}
@media (max-width: 460px) {
  .bento { grid-template-columns: 1fr; }
  .bento__item--xl { grid-column: auto; }
  .process { grid-template-columns: 1fr; }
  .hero__stats { gap: 20px; }
  .card__actions { flex-direction: column; }
}

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