/* ==========================================================================
   Muhammad Jalal Khan — portfolio
   ========================================================================== */

:root {
  --bg:        #070b14;
  --bg-soft:   #0a1020;
  --panel:     #0f1a2e;
  --panel-2:   #142441;
  --line:      rgba(150, 180, 235, .13);
  --line-2:    rgba(150, 180, 235, .24);
  --text:      #e9eefb;
  --muted:     #93a4c3;
  --muted-2:   #6d7f9e;
  --accent:    #4da3ff;
  --accent-2:  #8b6bff;
  --accent-3:  #2fe0c0;
  --warn:      #fbbf24;
  --danger:    #f87171;

  /* Surfaces — overridden wholesale by the light theme below. */
  --fill-weak:  rgba(255, 255, 255, .04);
  --fill:       rgba(255, 255, 255, .05);
  --fill-soft:  rgba(255, 255, 255, .07);
  --fill-2:     rgba(255, 255, 255, .09);
  --fill-3:     rgba(255, 255, 255, .18);
  --card-1:     rgba(20, 36, 65, .58);
  --card-2:     rgba(15, 26, 46, .52);
  --float-bg:   rgba(15, 26, 46, .92);
  --sunken:     rgba(7, 11, 20, .6);
  --header-bg:       rgba(7, 11, 20, .72);
  --header-bg-solid: rgba(7, 11, 20, .92);
  --nav-mobile-bg:   rgba(8, 13, 24, .98);
  --lb-bg:      rgba(4, 7, 14, .95);
  --on-accent:  #05101e;

  /* Always dark: these sit on top of photographs in both themes. */
  --scrim:      rgba(7, 11, 20, .82);
  --on-scrim:   #e9eefb;

  --glow-1: rgba(77, 163, 255, .16);
  --glow-2: rgba(139, 107, 255, .13);
  --glow-3: rgba(47, 224, 192, .07);

  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow:    0 20px 50px -25px rgba(0, 0, 0, .85);
  --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, .95);

  --container: 1180px;
  --font:      "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:      "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ------------------------------------------------------------ light theme */

:root[data-theme="light"] {
  --bg:        #f6f8fc;
  --bg-soft:   #ffffff;
  --panel:     #ffffff;
  --panel-2:   #eef2f9;
  --line:      rgba(23, 43, 77, .12);
  --line-2:    rgba(23, 43, 77, .22);
  --text:      #101b2f;
  --muted:     #4d5f7c;
  --muted-2:   #6f809b;
  --accent:    #1668d6;
  --accent-2:  #6841e0;
  --accent-3:  #0d9b83;
  --warn:      #b45309;
  --danger:    #dc2626;

  --fill-weak:  rgba(23, 43, 77, .035);
  --fill:       rgba(23, 43, 77, .05);
  --fill-soft:  rgba(23, 43, 77, .07);
  --fill-2:     rgba(23, 43, 77, .1);
  --fill-3:     rgba(23, 43, 77, .16);
  --card-1:     rgba(255, 255, 255, .96);
  --card-2:     rgba(248, 250, 253, .96);
  --float-bg:   rgba(255, 255, 255, .96);
  --sunken:     #ffffff;
  --header-bg:       rgba(246, 248, 252, .78);
  --header-bg-solid: rgba(246, 248, 252, .95);
  --nav-mobile-bg:   rgba(255, 255, 255, .99);
  --lb-bg:      rgba(16, 27, 47, .92);
  --on-accent:  #ffffff;

  --glow-1: rgba(22, 104, 214, .09);
  --glow-2: rgba(104, 65, 224, .07);
  --glow-3: rgba(13, 155, 131, .05);

  --shadow:    0 18px 40px -22px rgba(23, 43, 77, .28);
  --shadow-lg: 0 34px 70px -34px rgba(23, 43, 77, .34);
}

:root[data-theme="light"] a:hover { color: #0f4fa8; }
:root[data-theme="light"] .skip-link { color: #fff; }
:root[data-theme="light"] ::selection { background: rgba(22, 104, 214, .2); }

/* The hero badge and result panel are tinted; warm them up for light mode. */
:root[data-theme="light"] .hero-badge {
  background: rgba(13, 155, 131, .1); border-color: rgba(13, 155, 131, .32);
}
:root[data-theme="light"] .pulse { background: var(--accent-3); }
:root[data-theme="light"] .case-section.result {
  background: linear-gradient(150deg, rgba(13, 155, 131, .08), rgba(22, 104, 214, .05));
  border-color: rgba(13, 155, 131, .26);
}
:root[data-theme="light"] .metric-chip {
  background: rgba(22, 104, 214, .06); border-color: rgba(22, 104, 214, .18);
}
:root[data-theme="light"] .cta-band,
:root[data-theme="light"] .contact-cta {
  background: linear-gradient(140deg, rgba(22, 104, 214, .07), rgba(104, 65, 224, .05));
}
:root[data-theme="light"] .service-card .service-icon {
  background: linear-gradient(140deg, rgba(22, 104, 214, .12), rgba(104, 65, 224, .1));
}
:root[data-theme="light"] .site-footer { background: rgba(255, 255, 255, .7); }
:root[data-theme="light"] .stars .icon { color: #d97706; fill: #d97706; }

/* ------------------------------------------------------------------ reset */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient background wash — fixed so it does not scroll with content. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 600px at 78% -8%,  var(--glow-1), transparent 62%),
    radial-gradient(760px 520px at 6% 12%,   var(--glow-2), transparent 60%),
    radial-gradient(700px 700px at 50% 108%, var(--glow-3), transparent 62%);
}

img, svg, video { max-width: 100%; display: block; }
img { height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: #86c2ff; }

h1, h2, h3, h4 { line-height: 1.18; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.022em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.65rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.15rem; font-weight: 700; }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

ul { margin: 0; padding: 0; list-style: none; }

::selection { background: rgba(77, 163, 255, .32); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 12px; z-index: 200;
  background: var(--accent); color: #04101f; padding: 10px 18px;
  border-radius: 8px; font-weight: 700;
}
.skip-link:focus { left: 16px; }

.icon { width: 1.15em; height: 1.15em; flex: none; }

/* ---------------------------------------------------------------- layout */

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }

section { padding: clamp(64px, 9vw, 118px) 0; position: relative; }
section + section { padding-top: 0; }

.section-head { max-width: 660px; margin-bottom: clamp(34px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .74rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}
.section-head.center .eyebrow::before { display: none; }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  box-shadow: 0 12px 30px -12px rgba(77, 163, 255, .8);
}
.btn-primary:hover { color: var(--on-accent); box-shadow: 0 18px 40px -14px rgba(77, 163, 255, .95); }

.btn-ghost {
  background: var(--fill-weak);
  border-color: var(--line-2);
  color: var(--text);
}
.btn-ghost:hover { background: var(--fill-2); border-color: var(--accent); color: var(--text); }

.btn-sm { padding: 9px 16px; font-size: .86rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  background: var(--header-bg-solid);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: 74px; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent); font-weight: 800; font-size: .92rem; letter-spacing: .02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: .98rem; font-weight: 700; }
.brand-text small { font-size: .74rem; color: var(--muted); }

.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  padding: 8px 13px; border-radius: 999px; color: var(--muted);
  font-size: .9rem; font-weight: 600; transition: color .18s, background .18s;
}
.site-nav a:hover, .site-nav a.active { color: var(--text); background: var(--fill-soft); }

.header-actions { display: flex; align-items: center; gap: 10px; position: relative; }

/* --------------------------------------------------------- theme toggle */

/* Held for a single frame while switching theme — see main.js. */
.theme-swap .site-header,
.theme-swap .floating-card,
.theme-swap .badge,
.theme-swap .lightbox { backdrop-filter: none !important; }

.theme-toggle {
  position: relative; width: 40px; height: 40px; flex: none;
  display: grid; place-items: center; border-radius: 11px; cursor: pointer;
  background: var(--fill); border: 1px solid var(--line); color: var(--muted);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .icon { width: 19px; height: 19px; grid-area: 1 / 1; transition: transform .4s cubic-bezier(.34, 1.4, .5, 1), opacity .25s ease; }
.theme-toggle .icon-moon { opacity: 0; transform: rotate(-70deg) scale(.4); }
:root[data-theme="light"] .theme-toggle .icon-sun  { opacity: 0; transform: rotate(70deg) scale(.4); }
:root[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: none; }

/* The small confirmation bubble that appears after switching. */
.theme-tip {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 120;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 9px 14px; border-radius: 11px;
  background: var(--float-bg); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); color: var(--text);
  font-size: .82rem; font-weight: 600;
  opacity: 0; transform: translateY(-6px) scale(.96); pointer-events: none;
  transition: opacity .22s ease, transform .22s cubic-bezier(.34, 1.4, .5, 1);
}
.theme-tip::before {
  content: ""; position: absolute; top: -5px; right: 15px; width: 9px; height: 9px;
  background: var(--float-bg); border-left: 1px solid var(--line-2);
  border-top: 1px solid var(--line-2); transform: rotate(45deg);
}
.theme-tip.show { opacity: 1; transform: none; }
.theme-tip .icon { width: 15px; height: 15px; color: var(--accent); }

.nav-toggle {
  display: none; width: 42px; height: 42px; border-radius: 11px;
  background: var(--fill); border: 1px solid var(--line);
  cursor: pointer; padding: 0; place-items: center; gap: 5px;
}
.nav-toggle span {
  display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text);
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ------------------------------------------------------------------ hero */

.hero { padding-top: clamp(48px, 7vw, 84px); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(32px, 5vw, 68px); align-items: center;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 15px 7px 11px; border-radius: 999px;
  background: rgba(47, 224, 192, .1); border: 1px solid rgba(47, 224, 192, .3);
  color: var(--accent-3); font-size: .82rem; font-weight: 600; margin-bottom: 22px;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-3);
  box-shadow: 0 0 0 0 rgba(47, 224, 192, .7); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 9px rgba(47, 224, 192, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 224, 192, 0); }
}

.hero h1 { margin-bottom: 14px; }
.hero h1 .gradient {
  background: linear-gradient(120deg, var(--accent) 10%, var(--accent-2) 55%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-role {
  font-size: clamp(1.05rem, 2.2vw, 1.32rem); font-weight: 700;
  color: var(--text); margin-bottom: 16px;
}
.hero-role .sep { color: var(--muted-2); margin: 0 10px; }
.hero-tagline { font-size: 1.06rem; color: var(--muted); max-width: 56ch; margin-bottom: 14px; }
.hero-intro   { color: var(--muted); max-width: 60ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 26px; }

.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: .9rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta .icon { color: var(--accent); }

/* Portrait */
.hero-visual { position: relative; justify-self: center; width: min(100%, 400px); }
.portrait {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line-2); box-shadow: var(--shadow-lg);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
}
.portrait img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: center 12%; }
.portrait::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 52%, var(--scrim));
}
.portrait-glow {
  position: absolute; inset: -14% -10% -6%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(77, 163, 255, .38), transparent 72%);
  filter: blur(18px);
}
.portrait-caption {
  position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  font-size: .84rem; color: var(--on-scrim);
}
.portrait-caption .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-3); flex: none; }

.floating-card {
  position: absolute; z-index: 3;
  background: var(--float-bg); backdrop-filter: blur(10px);
  border: 1px solid var(--line-2); border-radius: 14px;
  padding: 11px 15px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 11px;
  animation: float 6s ease-in-out infinite;
}
.floating-card .icon { width: 20px; height: 20px; color: var(--accent); }
.floating-card b { display: block; font-size: .95rem; line-height: 1.2; }
.floating-card small { color: var(--muted); font-size: .72rem; }
.fc-1 { top: 14%; left: -34px; }
.fc-2 { bottom: 20%; right: -28px; animation-delay: -3s; }
@keyframes float {
  50% { transform: translateY(-11px); }
}

/* Stats strip */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin-top: clamp(44px, 6vw, 68px);
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.stat { background: var(--bg-soft); padding: 24px 22px; text-align: center; }
.stat b {
  display: block; font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 800; line-height: 1.1;
  background: linear-gradient(120deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { display: block; color: var(--muted); font-size: .84rem; margin-top: 6px; }

/* ----------------------------------------------------------------- cards */

.card {
  background: linear-gradient(165deg, var(--card-1), var(--card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }

/* ----------------------------------------------------------------- about */

.about-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); gap: clamp(28px, 5vw, 60px); align-items: start; }
.about-text p { color: var(--muted); }
.about-text p strong, .about-text b { color: var(--text); }

.highlight-list { display: grid; gap: 13px; }
.highlight-list li {
  display: flex; gap: 12px; align-items: flex-start;
  color: var(--muted); font-size: .95rem; line-height: 1.6;
}
.highlight-list .icon {
  color: var(--accent-3); margin-top: 4px; width: 17px; height: 17px;
  flex: none; padding: 3px; border-radius: 50%;
  background: rgba(47, 224, 192, .12);
}

.info-card { display: grid; gap: 16px; }
.info-row { display: flex; gap: 13px; align-items: flex-start; }
.info-row .icon { color: var(--accent); margin-top: 3px; width: 19px; height: 19px; }
.info-row small { display: block; color: var(--muted-2); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
.info-row span, .info-row a { font-size: .95rem; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.info-row a:hover { color: var(--accent); }

/* -------------------------------------------------------------- services */

.service-card { position: relative; overflow: hidden; }
.service-card .service-icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(140deg, rgba(77, 163, 255, .2), rgba(139, 107, 255, .16));
  border: 1px solid var(--line-2); color: var(--accent); margin-bottom: 18px;
}
.service-card .service-icon .icon { width: 22px; height: 22px; }
.service-card h3 { margin-bottom: 9px; }
.service-card p { color: var(--muted); font-size: .93rem; margin: 0; }
.service-card::after {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 190px; height: 190px;
  background: radial-gradient(closest-side, rgba(77, 163, 255, .17), transparent);
  opacity: 0; transition: opacity .3s ease;
}
.service-card:hover::after { opacity: 1; }

/* -------------------------------------------------------------- projects */

.filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 30px; }
.filter-btn {
  padding: 9px 17px; border-radius: 999px; cursor: pointer;
  background: var(--fill-weak); border: 1px solid var(--line);
  color: var(--muted); font: inherit; font-size: .87rem; font-weight: 600;
  transition: all .18s ease;
}
.filter-btn:hover { color: var(--text); border-color: var(--line-2); }
.filter-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: var(--on-accent);
}
.filter-btn .count { opacity: .65; font-size: .8em; margin-left: 4px; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }

.project-card {
  display: flex; flex-direction: column; overflow: hidden; padding: 0;
  background: linear-gradient(165deg, var(--card-1), var(--card-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.project-card:hover { transform: translateY(-5px); border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.project-card.is-hidden { display: none; }

.project-thumb {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(150deg, var(--panel-2), var(--panel));
  border-bottom: 1px solid var(--line);
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .5s ease; }
.project-card:hover .project-thumb img { transform: scale(1.045); }
.project-thumb-empty { display: grid; place-items: center; height: 100%; color: var(--accent); }
.project-thumb-empty .icon { width: 42px; height: 42px; opacity: .5; }

.project-badges { position: absolute; top: 13px; left: 13px; display: flex; gap: 7px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: var(--scrim); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .18); color: var(--on-scrim);
}
.badge-featured { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); border-color: transparent; }
.badge-draft { background: rgba(251, 191, 36, .9); color: #2a1c00; border-color: transparent; }

.project-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.project-cat {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 9px;
}
.project-card h3 { font-size: 1.13rem; margin-bottom: 8px; }
.project-card h3 a { color: var(--text); }
.project-card h3 a:hover { color: var(--accent); }
.project-summary { color: var(--muted); font-size: .9rem; margin-bottom: 16px; }

.metric-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.metric-chip {
  padding: 6px 11px; border-radius: 8px; font-size: .76rem; line-height: 1.35;
  background: rgba(77, 163, 255, .09); border: 1px solid rgba(77, 163, 255, .22);
}
.metric-chip b { display: block; font-family: var(--mono); color: var(--accent); font-size: .84rem; }
.metric-chip span { color: var(--muted); }

.tool-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.tool-tag {
  padding: 4px 10px; border-radius: 6px; font-size: .74rem; font-weight: 600;
  background: var(--fill); border: 1px solid var(--line); color: var(--muted);
}

.project-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  font-weight: 700; font-size: .9rem; color: var(--accent);
}
.project-link .icon { transition: transform .2s ease; }
.project-card:hover .project-link .icon { transform: translateX(4px); }

.empty-note {
  padding: 44px 24px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: var(--radius);
}

/* ---------------------------------------------------------------- skills */

.skill-group h3 { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; font-size: 1rem; }
.skill-group h3 .icon { color: var(--accent); width: 19px; height: 19px; }
.skill-row { margin-bottom: 14px; }
.skill-row:last-child { margin-bottom: 0; }
.skill-label { display: flex; justify-content: space-between; font-size: .87rem; margin-bottom: 6px; }
.skill-label span { color: var(--text); font-weight: 600; }
.skill-label em { color: var(--muted-2); font-style: normal; font-family: var(--mono); font-size: .78rem; }
.skill-bar { height: 6px; border-radius: 99px; background: var(--fill-soft); overflow: hidden; }
.skill-fill {
  height: 100%; border-radius: 99px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1.1s cubic-bezier(.22, 1, .36, 1);
}

/* ------------------------------------------------------------ experience */

.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
}
.timeline-item { position: relative; padding-bottom: 34px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -32px; top: 7px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.timeline-item.current::before { background: var(--accent-3); border-color: var(--accent-3); box-shadow: 0 0 0 5px rgba(47, 224, 192, .17); }

.tl-date {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono);
  font-size: .76rem; color: var(--accent); margin-bottom: 7px; letter-spacing: .03em;
}
.timeline-item h3 { margin-bottom: 4px; font-size: 1.12rem; }
.tl-company { color: var(--muted); font-size: .93rem; margin-bottom: 13px; }
.tl-company b { color: var(--text); }
.tl-type {
  display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px;
  font-size: .7rem; font-weight: 700; background: var(--fill);
  border: 1px solid var(--line); color: var(--muted);
}
.tl-list li {
  position: relative; padding-left: 20px; margin-bottom: 9px;
  color: var(--muted); font-size: .93rem; line-height: 1.65;
}
.tl-list li::before {
  content: ""; position: absolute; left: 3px; top: .68em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .75;
}

.edu-card { display: flex; gap: 16px; }
.edu-card .icon-wrap {
  width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: rgba(139, 107, 255, .15); border: 1px solid var(--line-2); color: var(--accent-2);
}
.edu-card h3 { font-size: 1rem; margin-bottom: 3px; }
.edu-card .edu-meta { color: var(--muted); font-size: .88rem; margin-bottom: 8px; }
.edu-card p { color: var(--muted); font-size: .89rem; margin: 0; }

/* ---------------------------------------------------------- certificates */

.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 20px; }
.cert-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.cert-thumb {
  aspect-ratio: 4 / 3; background: #fff; overflow: hidden; cursor: zoom-in;
  border-bottom: 1px solid var(--line);
}
.cert-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .4s ease; }
.cert-card:hover .cert-thumb img { transform: scale(1.04); }
.cert-body { padding: 17px 18px 19px; display: flex; flex-direction: column; flex: 1; }
.cert-body h3 { font-size: .96rem; margin-bottom: 5px; line-height: 1.35; }
.cert-issuer { color: var(--muted); font-size: .83rem; margin-bottom: 14px; }
.cert-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.cert-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px; font-size: .78rem; font-weight: 700;
  background: var(--fill); border: 1px solid var(--line); color: var(--muted);
}
.cert-links a:hover { color: var(--text); border-color: var(--accent); }
.cert-links .icon { width: 14px; height: 14px; }

/* ---------------------------------------------------------- testimonials */

.testimonial-card { display: flex; flex-direction: column; }
.testimonial-card .quote-icon { color: var(--accent); opacity: .35; width: 30px; height: 30px; margin-bottom: 12px; }
.testimonial-card blockquote { margin: 0 0 18px; color: var(--muted); font-size: .96rem; line-height: 1.75; }
.stars { display: flex; gap: 3px; margin-bottom: 14px; }
.stars .icon { width: 15px; height: 15px; color: var(--warn); fill: var(--warn); }
.testi-person { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.testi-person img, .testi-avatar {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none;
  display: grid; place-items: center; font-weight: 800; color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.testi-person b { display: block; font-size: .93rem; }
.testi-person small { color: var(--muted); font-size: .8rem; }

/* --------------------------------------------------------------- contact */

.contact-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 52px); align-items: start; }

.contact-panel { display: grid; gap: 22px; }
.contact-cta {
  display: flex; align-items: center; gap: 14px; padding: 17px 19px;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(77, 163, 255, .11), rgba(139, 107, 255, .07));
  color: var(--text); transition: border-color .2s, transform .2s;
}
.contact-cta:hover { border-color: var(--accent); transform: translateX(3px); color: var(--text); }
.contact-cta .icon-wrap {
  width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: rgba(77, 163, 255, .16); color: var(--accent);
}
.contact-cta b { display: block; font-size: .95rem; }
.contact-cta small { color: var(--muted); font-size: .82rem; }

form .field { margin-bottom: 17px; }
form label { display: block; font-size: .86rem; font-weight: 700; margin-bottom: 7px; }
form label .req { color: var(--danger); }
.input, input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="date"], input[type="number"], select, textarea {
  width: 100%; padding: 12px 15px; font: inherit; font-size: .95rem;
  color: var(--text); background: var(--sunken);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .18s, box-shadow .18s;
}
textarea { resize: vertical; min-height: 132px; line-height: 1.6; }
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 163, 255, .18);
}
::placeholder { color: var(--muted-2); }
select option { background: var(--panel); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-note { color: var(--muted-2); font-size: .82rem; margin-top: 12px; }
.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; }

.alert {
  padding: 14px 17px; border-radius: var(--radius-sm); margin-bottom: 20px;
  font-size: .92rem; display: flex; gap: 11px; align-items: flex-start;
}
.alert .icon { margin-top: 3px; flex: none; }
.alert-success { background: rgba(47, 224, 192, .11); border: 1px solid rgba(47, 224, 192, .35); color: #9df3e2; }
.alert-error   { background: rgba(248, 113, 113, .11); border: 1px solid rgba(248, 113, 113, .35); color: #fca5a5; }
.alert-info    { background: rgba(77, 163, 255, .11); border: 1px solid rgba(77, 163, 255, .35); color: #a9cffd; }

/* ---------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid var(--line); margin-top: clamp(60px, 8vw, 100px); background: var(--sunken); }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1.3fr 1fr; gap: 34px;
  padding: clamp(40px, 6vw, 62px) 24px clamp(28px, 4vw, 40px);
}
.footer-tag { color: var(--muted); font-size: .9rem; margin: 16px 0 0; max-width: 34ch; }
.footer-col h3 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted-2); margin-bottom: 15px;
}
.footer-col li { margin-bottom: 9px; }
.footer-col a, .footer-col li { color: var(--muted); font-size: .9rem; }
.footer-col a:hover { color: var(--accent); }

.social-row { display: flex; gap: 10px; flex-wrap: wrap; }
.social-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--fill); border: 1px solid var(--line); color: var(--muted);
  transition: all .2s ease;
}
.social-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 20px 24px; border-top: 1px solid var(--line);
  color: var(--muted-2); font-size: .85rem;
}
.footer-bottom p { margin: 0; }
.to-top { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 600; }
.to-top:hover { color: var(--accent); }

/* --------------------------------------------------------- project page */

.project-hero { padding-top: 44px; }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--muted-2); font-size: .85rem; margin-bottom: 22px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

.project-hero h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); margin-bottom: 12px; }
.project-subtitle { color: var(--accent); font-size: 1.02rem; font-weight: 600; margin-bottom: 20px; }
.project-meta-row { display: flex; flex-wrap: wrap; gap: 10px 26px; color: var(--muted); font-size: .9rem; margin-bottom: 26px; }
.project-meta-row span { display: inline-flex; align-items: center; gap: 7px; }
.project-meta-row .icon { color: var(--accent); width: 16px; height: 16px; }

.metric-band {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin: 30px 0 40px;
}
.metric-band .metric { background: var(--bg-soft); padding: 20px; }
.metric-band .metric b {
  display: block; font-family: var(--mono); font-size: 1.32rem; font-weight: 700;
  color: var(--accent); line-height: 1.25; margin-bottom: 5px;
}
.metric-band .metric span { color: var(--muted); font-size: .82rem; }

.case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(28px, 5vw, 54px); align-items: start; }

.case-section { margin-bottom: 42px; scroll-margin-top: 100px; }
.case-section h2 {
  font-size: 1.4rem; display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.case-section h2 .num {
  font-family: var(--mono); font-size: .78rem; color: var(--accent);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 9px; font-weight: 500;
}
.case-section p { color: var(--muted); }
.case-section.result {
  padding: 26px; border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(47, 224, 192, .08), rgba(77, 163, 255, .05));
  border: 1px solid rgba(47, 224, 192, .24);
}
.case-section.result h2 .num { border-color: rgba(47, 224, 192, .4); color: var(--accent-3); }

.stack-list { display: grid; gap: 13px; }
.stack-list li { display: flex; gap: 12px; color: var(--muted); font-size: .93rem; line-height: 1.6; }
.stack-list .icon { color: var(--accent); margin-top: 4px; width: 16px; height: 16px; flex: none; }
.stack-list b { color: var(--text); }

.case-aside { position: sticky; top: 96px; display: grid; gap: 18px; }
.aside-card h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); margin-bottom: 14px; }

.gallery { display: grid; gap: 18px; margin-bottom: 42px; }
.gallery-main {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: var(--panel); cursor: zoom-in; box-shadow: var(--shadow);
}
.gallery-main img { width: 100%; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.gallery-thumbs button {
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--panel); cursor: pointer; aspect-ratio: 16 / 10;
  transition: border-color .2s, transform .2s;
}
.gallery-thumbs button:hover { transform: translateY(-2px); }
.gallery-thumbs button.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(77, 163, 255, .3); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.project-nav {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 34px; border-top: 1px solid var(--line); margin-top: 20px;
}
.project-nav a { display: flex; align-items: center; gap: 11px; color: var(--muted); font-weight: 600; font-size: .92rem; }
.project-nav a:hover { color: var(--accent); }
.project-nav small { display: block; color: var(--muted-2); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; }

.cta-band {
  margin-top: clamp(48px, 7vw, 80px); padding: clamp(32px, 5vw, 52px);
  border-radius: var(--radius-lg); text-align: center;
  background: linear-gradient(140deg, rgba(77, 163, 255, .14), rgba(139, 107, 255, .1));
  border: 1px solid var(--line-2);
}
.cta-band h2 { margin-bottom: 12px; }
.cta-band p { color: var(--muted); max-width: 52ch; margin: 0 auto 26px; }
.cta-actions { display: flex; gap: 13px; justify-content: center; flex-wrap: wrap; }

/* -------------------------------------------------------------- lightbox */

.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: var(--lb-bg); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 4vh 5vw;
}
.lightbox[hidden] { display: none; }
.lb-figure { margin: 0; max-width: 100%; max-height: 92vh; display: flex; flex-direction: column; gap: 12px; }
.lb-figure img {
  max-width: 100%; max-height: 84vh; object-fit: contain;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel);
}
.lb-figure figcaption { text-align: center; color: var(--muted); font-size: .87rem; }
.lb-close, .lb-nav {
  position: absolute; width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  background: var(--fill-soft); border: 1px solid var(--line-2); color: var(--text);
  display: grid; place-items: center; transition: background .2s, transform .2s;
}
.lb-close:hover, .lb-nav:hover { background: var(--fill-3); }
.lb-close { top: 20px; right: 22px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-nav .icon { width: 22px; height: 22px; }

/* ------------------------------------------------------------ animations */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.22, 1, .36, 1); }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; width: min(100%, 320px); }
  .floating-card { display: none; }
  .about-grid, .contact-grid, .case-layout { grid-template-columns: 1fr; }
  .case-aside { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .site-nav {
    position: fixed; inset: 74px 0 auto; flex-direction: column; gap: 2px;
    background: var(--nav-mobile-bg); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line); padding: 14px 20px 22px;
    transform: translateY(-120%); transition: transform .3s ease; visibility: hidden;
  }
  .site-nav.open { transform: none; visibility: visible; }
  .site-nav a { padding: 12px 14px; font-size: .98rem; }
  .nav-toggle { display: grid; }
  .header-actions .btn-ghost { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .brand-text small { display: none; }
  .hero-actions .btn { flex: 1; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .metric-band { grid-template-columns: repeat(2, 1fr); }
}

/* ------------------------------------------------------------------ print */

@media print {
  body { background: #fff; color: #000; }
  body::before, .site-header, .site-footer, .hero-actions, .lightbox, .cta-band, .filters { display: none !important; }
  .card, .project-card { border: 1px solid #ccc; box-shadow: none; }
  a { color: #000; }
}
