/* ============================================================
   MANZAR ABBAS — PORTFOLIO
   Aesthetic: editorial-dark · chartreuse accent · grain + mesh
   ============================================================ */

:root {
  /* ---- structural tokens (theme-independent) ---- */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 26px;

  --font-display: "Syne", "Trebuchet MS", sans-serif;
  --font-body: "Outfit", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);   /* gentle overshoot */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1180px;
}

/* ============================================================
   THEMES — premium DARK (lifted slate) + premium LIGHT (ivory)
   ============================================================ */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #14171e;            /* lifted slate — not black */
  --bg-soft: #191d25;
  --surface: #1d222b;
  --surface-2: #242a35;
  --line: #343b48;
  --line-soft: #272d39;

  --txt: #eef0f5;
  --txt-dim: #abb2c1;
  --txt-mut: #7b8290;

  --accent: #f5c451;        /* champagne gold (fills / decoration) */
  --accent-ink: #f5c451;    /* gold for text — reads on dark */
  --accent-deep: #d6a228;
  --accent-2: #a99bff;      /* violet companion */
  --accent-3: #5ad1e6;      /* cool cyan */
  --accent-glow: rgba(245, 196, 81, 0.30);
  --on-accent: #14171e;     /* text on gold fills */

  --glass-bg: rgba(20, 23, 30, 0.72);
  --grain-op: 0.04;

  --grad-accent: linear-gradient(120deg, #f7d271 0%, #f5c451 45%, #d6a228 100%);
  --grad-iris: linear-gradient(120deg, #f5c451, #a99bff 55%, #5ad1e6);
  --grad-head: linear-gradient(120deg, #f5c451, #a99bff 45%, #5ad1e6 62%, #f5c451);

  --shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.46);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f0;            /* soft warm ivory */
  --bg-soft: #eeeee7;
  --surface: #ffffff;
  --surface-2: #f3f3ed;
  --line: #e3e3da;
  --line-soft: #ebebe2;

  --txt: #1b1e24;
  --txt-dim: #535965;
  --txt-mut: #8a909c;

  --accent: #c7951c;        /* deeper gold — holds up on white */
  --accent-ink: #8a6308;    /* deep gold for text / links */
  --accent-deep: #a87b12;
  --accent-2: #6353c9;      /* deeper violet for text */
  --accent-3: #15879c;      /* deeper cyan */
  --accent-glow: rgba(199, 149, 28, 0.22);
  --on-accent: #211a05;     /* dark text on gold fills */

  --glass-bg: rgba(255, 255, 255, 0.72);
  --grain-op: 0.02;

  --grad-accent: linear-gradient(120deg, #e6b23a 0%, #d49b1f 50%, #b9850f 100%);
  --grad-iris: linear-gradient(120deg, #c7951c, #6353c9 55%, #15879c);
  --grad-head: linear-gradient(120deg, #b8860b, #6353c9 50%, #b8860b);

  --shadow-sm: 0 10px 26px rgba(60, 55, 40, 0.10);
  --shadow-lg: 0 26px 60px rgba(60, 55, 40, 0.13);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(245, 196, 81, 0.06), transparent 60%),
    radial-gradient(90% 50% at 100% 0%, rgba(154, 140, 255, 0.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--txt);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: var(--grain-op, 0.04);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent); color: var(--on-accent); }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- Section scaffolding ---------- */
section { padding: 120px 0; position: relative; scroll-margin-top: 84px; }

/* premium focus states (keyboard users only) */
a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.eyebrow::before {
  content: "";
  width: 34px; height: 1px;
  background: var(--accent);
}

.sec-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.sec-title em {
  font-style: normal;
  background: var(--grad-head);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
  animation: gradientShift 7s linear infinite;
}

.sec-intro { color: var(--txt-dim); max-width: 560px; font-size: 1.05rem; }

/* ---------- Navbar ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  transition: background 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 28px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 10px;
}
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent-glow); }
.nav-links { display: flex; align-items: center; gap: 30px; position: relative; }
.nav-links a {
  font-size: 0.95rem; color: var(--txt-dim);
  position: relative; z-index: 1; transition: color 0.25s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; background: var(--accent); transition: width 0.3s var(--ease);
}
.nav-links a:hover { color: var(--txt); }

/* Sliding glass pill that glides under the hovered / active link */
.nav-indicator {
  position: absolute; top: 50%; left: 0; width: 0; height: 36px;
  transform: translateY(-50%); border-radius: 100px; z-index: 0;
  background: rgba(245, 196, 81, 0.10);
  border: 1px solid rgba(245, 196, 81, 0.22);
  box-shadow: inset 0 0 18px rgba(245, 196, 81, 0.12), 0 6px 18px rgba(245, 196, 81, 0.08);
  opacity: 0; pointer-events: none;
  transition: left 0.42s var(--ease-spring), width 0.42s var(--ease-spring), opacity 0.3s var(--ease);
}
.nav-cta {
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 1px;
  border: 1px solid var(--line); padding: 9px 16px; border-radius: 100px;
  color: var(--txt) !important; transition: all 0.3s var(--ease);
}
.nav-cta:hover { background: var(--accent); color: var(--on-accent) !important; border-color: var(--accent); }
.nav-cta::after { display: none; }
.nav-resume {
  border-color: rgba(245,196,81,0.5); color: var(--accent-ink) !important;
  background: rgba(245,196,81,0.07);
}
.nav-resume:hover { background: var(--grad-accent); color: var(--on-accent) !important; border-color: transparent; }
.burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: 0; }
.burger span { width: 26px; height: 2px; background: var(--txt); transition: 0.3s; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding-top: 90px; padding-bottom: 60px;
  position: relative; overflow: hidden;
}
.mesh {
  position: absolute; inset: -20%;
  z-index: 0; filter: blur(70px); opacity: 0.5;
  background:
    radial-gradient(40% 40% at 75% 28%, rgba(245,196,81,0.32), transparent 70%),
    radial-gradient(38% 38% at 18% 68%, rgba(154,140,255,0.26), transparent 70%),
    radial-gradient(34% 34% at 60% 82%, rgba(90,209,230,0.20), transparent 70%);
  animation: float 18s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-3%, 2%) scale(1.08); }
}
.grid-bg {
  position: absolute; inset: 0; z-index: 0; opacity: 0.4;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 75%);
}

.hero-inner {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 60px; align-items: center;
  width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px;
}
.hero-status {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 1px;
  color: var(--txt-dim); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 100px; margin-bottom: 28px;
}
.hero-status .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow); animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(245,196,81,0.5); }
  70% { box-shadow: 0 0 0 12px rgba(245,196,81,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,196,81,0); }
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.7rem, 7vw, 5.4rem);
  line-height: 0.98; letter-spacing: -0.03em; margin-bottom: 22px;
}
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .accent {
  background: var(--grad-head);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
  animation: gradientShift 6s linear infinite;
}
.hero .role {
  font-family: var(--font-mono); color: var(--accent-2);
  font-size: clamp(0.95rem, 2vw, 1.15rem); letter-spacing: 1px; margin-bottom: 20px;
}
.hero .tagline { color: var(--txt-dim); font-size: 1.12rem; max-width: 480px; margin-bottom: 36px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.98rem;
  padding: 14px 26px; border-radius: 100px; cursor: pointer;
  transition: all 0.3s var(--ease); border: 1px solid transparent;
}
.btn-primary { background: var(--grad-accent); color: var(--on-accent); box-shadow: 0 8px 24px rgba(245,196,81,0.18); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 38px var(--accent-glow); }
.btn-ghost { border-color: var(--line); color: var(--txt); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-3px); }
.btn-resume {
  border-color: rgba(245,196,81,0.45); color: var(--accent-ink);
  background: rgba(245,196,81,0.06);
}
.btn-resume:hover {
  border-color: var(--accent); transform: translateY(-3px);
  background: rgba(245,196,81,0.12); box-shadow: 0 14px 34px var(--accent-glow);
}
.btn-resume svg { width: 17px; height: 17px; }

.hero-socials { display: flex; gap: 14px; align-items: center; }
.hero-socials a {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--txt-dim);
  transition: all 0.3s var(--ease);
}
.hero-socials a:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); transform: translateY(-3px); }
.hero-socials svg { width: 19px; height: 19px; }

/* hero portrait (right) */
.portrait-wrap { position: relative; justify-self: end; }
.portrait {
  position: relative; width: min(400px, 40vw); aspect-ratio: 5 / 6;
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 40px 90px rgba(0,0,0,0.55);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  transform-style: preserve-3d; will-change: transform;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.portrait:hover img { transform: scale(1.05); }
.portrait::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(11,12,14,0.6));
}
.portrait-ring {
  position: absolute; inset: -16px; border: 1px solid var(--accent);
  border-radius: calc(var(--r-lg) + 16px); opacity: 0.35; z-index: -1;
}
.portrait-badge {
  position: absolute; bottom: 18px; left: 18px; z-index: 3;
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 1px;
  color: #eef0f5;
  background: rgba(11,12,14,0.7); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12); padding: 8px 13px; border-radius: 100px;
}
.portrait-badge b { color: var(--accent); }
.float-chip {
  position: absolute; z-index: 4; font-family: var(--font-mono);
  font-size: 0.78rem; background: var(--surface); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 12px; box-shadow: 0 14px 30px rgba(0,0,0,0.4);
  animation: bob 5s ease-in-out infinite;
}
.float-chip.c1 { top: 8%; left: -34px; }
.float-chip.c2 { bottom: 22%; right: -36px; animation-delay: 1.4s; }
.float-chip span { color: var(--accent); }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ============================================================
   LANDING + NAV ANIMATIONS
   ============================================================ */
@keyframes gradientShift { 0% { background-position: 0% 50%; } 100% { background-position: 250% 50%; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes navDrop { from { opacity: 0; transform: translateY(-100%); } to { opacity: 1; transform: none; } }
@keyframes lineRise { from { opacity: 0; transform: translateY(110%) skewY(6deg); } to { opacity: 1; transform: none; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.92) translateY(20px); } 100% { opacity: 1; transform: none; } }
@keyframes shine { 0% { transform: translateX(-160%) skewX(-18deg); } 60%, 100% { transform: translateX(260%) skewX(-18deg); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes scrollDot { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(16px); opacity: 0; } }
@keyframes cueFade { from { opacity: 0; } to { opacity: 0.85; } }

/* Navbar entrance + staggered links */
.nav { animation: navDrop 0.9s var(--ease) both; }
.nav-links a, .nav-links .nav-cta { animation: fadeDown 0.6s var(--ease) both; }
.nav-links > *:nth-child(1) { animation-delay: 0.25s; }
.nav-links > *:nth-child(2) { animation-delay: 0.32s; }
.nav-links > *:nth-child(3) { animation-delay: 0.39s; }
.nav-links > *:nth-child(4) { animation-delay: 0.46s; }
.nav-links > *:nth-child(5) { animation-delay: 0.53s; }
.nav-links > *:nth-child(6) { animation-delay: 0.60s; }
.nav-links > *:nth-child(7) { animation-delay: 0.67s; }
.nav-links > *:nth-child(8) { animation-delay: 0.74s; }
.brand .dot { animation: pulse 2.2s infinite; }

/* Hero copy: staggered entrance (containers only, so child hovers stay intact) */
.hero-status { animation: fadeUp 0.7s var(--ease) both; animation-delay: 0.35s; }
.hero h1 .line { display: block; animation: lineRise 0.9s var(--ease) both; }
.hero h1 .line:nth-child(1) { animation-delay: 0.45s; }
.hero h1 .line:nth-child(2) { animation-delay: 0.58s; }
.hero h1 .line:nth-child(3) { animation-delay: 0.71s; }
.hero h1 .line:nth-child(4) { animation-delay: 0.84s; }
.hero .role { animation: fadeUp 0.7s var(--ease) both; animation-delay: 0.7s; }
.hero .tagline { animation: fadeUp 0.7s var(--ease) both; animation-delay: 0.85s; }
.hero-actions { animation: fadeUp 0.7s var(--ease) both; animation-delay: 1s; }
.hero-socials { animation: fadeUp 0.7s var(--ease) both; animation-delay: 1.15s; }
.portrait-wrap { animation: popIn 1.1s var(--ease) both; animation-delay: 0.5s; }

/* Blinking terminal caret on the typed role */
.hero .role::after {
  content: "_"; margin-left: 4px; color: var(--accent);
  animation: blink 1.05s step-end infinite;
}

/* Portrait ring: gentle breathing (no rotation) */
.portrait-ring { animation: ringBreathe 5.5s ease-in-out infinite; }
@keyframes ringBreathe {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.018); }
}

/* Shine sweep across the primary button */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: 0; width: 45%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: shine 4.5s ease-in-out infinite; animation-delay: 1.8s; pointer-events: none;
}

/* Scroll cue at bottom of hero */
.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 3;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 3px;
  text-transform: uppercase; color: var(--txt-mut);
  animation: cueFade 1s var(--ease) both; animation-delay: 1.5s;
}
.scroll-cue .mouse {
  width: 22px; height: 36px; border: 1.5px solid var(--line); border-radius: 12px;
  position: relative;
}
.scroll-cue .mouse::before {
  content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 7px; border-radius: 3px; background: var(--accent);
  animation: scrollDot 1.6s var(--ease) infinite;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* ---------- About / stats ---------- */
.about-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 60px; align-items: start; }
.about-text p { color: var(--txt-dim); font-size: 1.12rem; margin-bottom: 18px; }
.about-text .lead { color: var(--txt); font-size: 1.25rem; font-weight: 500; }
.stats { display: grid; gap: 16px; }
.stat {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 26px; background: var(--surface);
  display: flex; align-items: baseline; gap: 16px;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.stat:hover { border-color: var(--accent); transform: translateX(6px); }
.stat .num { font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; color: var(--accent-ink); line-height: 1; }
.stat .lbl { color: var(--txt-dim); font-size: 1rem; }

/* ---------- Experience timeline ---------- */
.timeline { position: relative; margin-top: 56px; --tl-progress: 0; }
/* dim track */
.timeline::before {
  content: ""; position: absolute; left: 12px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
/* gold fill that grows as you scroll the section */
.timeline::after {
  content: ""; position: absolute; left: 12px; top: 6px; width: 2px;
  height: calc((100% - 12px) * var(--tl-progress));
  background: linear-gradient(var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent-glow);
  transition: height 0.15s linear;
}
.tl-item { position: relative; padding-left: 56px; padding-bottom: 50px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: 5px; top: 6px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--line);
  box-shadow: 0 0 0 4px rgba(245,196,81,0);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), transform 0.4s var(--ease-spring);
  z-index: 1;
}
.tl-item.in::before {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(245,196,81,0.14), 0 0 16px var(--accent-glow);
}
.tl-item:hover::before { transform: scale(1.35); box-shadow: 0 0 0 5px rgba(245,196,81,0.18), 0 0 22px var(--accent-glow); }
.tl-item:hover .tl-role { color: var(--accent-ink); }
.tl-role { transition: color 0.3s var(--ease); }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px; margin-bottom: 6px; }
.tl-role { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; }
.tl-period { font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent-ink); margin-left: auto; }
.tl-company { color: var(--accent-2); font-weight: 500; margin-bottom: 12px; }
.tl-company .mode { color: var(--txt-mut); font-family: var(--font-mono); font-size: 0.8rem; }
.tl-tech {
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--txt-mut);
  margin-bottom: 14px; padding: 8px 0; border-top: 1px dashed var(--line-soft);
  border-bottom: 1px dashed var(--line-soft);
}
.tl-points { list-style: none; display: grid; gap: 8px; }
.tl-points li { color: var(--txt-dim); padding-left: 22px; position: relative; }
.tl-points li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }

/* ---------- Projects ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 22px; margin-top: 56px; }
.proj-card {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 30px 26px; overflow: hidden;
  --mx: 50%; --my: 0%;
  background:
    radial-gradient(260px 260px at var(--mx) var(--my), rgba(245,196,81,0.14), transparent 60%),
    linear-gradient(160deg, var(--surface-2), var(--surface) 55%);
  transition: transform 0.45s var(--ease-out), border-color 0.45s, box-shadow 0.45s;
  transform-style: preserve-3d; will-change: transform;
  display: flex; flex-direction: column;
}
/* animated gradient top edge */
.proj-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  background-size: 250% 100%;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
/* soft inner ring highlight on hover */
.proj-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(245,196,81,0); transition: box-shadow 0.45s var(--ease);
}
.proj-card:hover { border-color: rgba(245,196,81,0.4); box-shadow: 0 30px 64px rgba(0,0,0,0.55); }
.proj-card:hover::before { transform: scaleX(1); animation: gradientShift 4s linear infinite; }
.proj-card:hover::after { box-shadow: inset 0 0 0 1px rgba(245,196,81,0.25); }
.proj-card:hover .proj-title { color: var(--accent-ink); }
.proj-title { transition: color 0.3s var(--ease); }
/* tags lift on card hover, staggered */
.proj-card .tag { transition: transform 0.35s var(--ease-spring), background 0.25s, border-color 0.25s, color 0.25s; }
.proj-card:hover .tag { transform: translateY(-2px); border-color: rgba(245,196,81,0.3); }
.proj-card:hover .tag:nth-child(2) { transition-delay: 0.04s; }
.proj-card:hover .tag:nth-child(3) { transition-delay: 0.08s; }
.proj-card:hover .tag:nth-child(4) { transition-delay: 0.12s; }
.proj-index { font-family: var(--font-mono); font-size: 0.8rem; color: var(--txt-mut); margin-bottom: 18px; }
.proj-title { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; margin-bottom: 12px; line-height: 1.15; }
.proj-desc { color: var(--txt-dim); font-size: 0.98rem; margin-bottom: 20px; flex: 1; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tag {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.5px;
  padding: 5px 11px; border-radius: 100px; background: var(--surface-2);
  border: 1px solid var(--line-soft); color: var(--txt-dim);
}
.proj-link {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent-ink);
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
}
.proj-link svg { width: 15px; height: 15px; transition: transform 0.3s; }
.proj-link:hover svg { transform: translate(3px, -3px); }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 56px; }
.skill-cat {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 26px;
  background: var(--surface); transition: border-color 0.3s;
}
.skill-cat:hover { border-color: var(--accent); }
.skill-cat h3 {
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent-ink); margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.skill-cat h3::before { content: "//"; color: var(--txt-mut); }
.skill-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-size: 0.9rem; padding: 7px 14px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line-soft);
  transition: all 0.25s var(--ease);
}
.chip:hover { background: var(--accent); color: var(--on-accent); transform: translateY(-2px); }

/* ---------- Education ---------- */
.edu-list { display: grid; gap: 20px; margin-top: 56px; }
.edu-card {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 32px;
  background: var(--surface); display: grid; grid-template-columns: auto 1fr auto; gap: 24px;
  align-items: center; transition: border-color 0.3s, transform 0.3s var(--ease);
}
.edu-card:hover { border-color: var(--accent); transform: translateX(6px); }
.edu-icon {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--accent);
}
.edu-icon svg { width: 26px; height: 26px; }
.edu-degree { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }
.edu-school { color: var(--accent-2); margin: 4px 0; }
.edu-detail { color: var(--txt-dim); font-size: 0.95rem; }
.edu-meta { text-align: right; }
.edu-period { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent-ink); }
.edu-loc { color: var(--txt-mut); font-size: 0.85rem; }

/* ---------- Certifications ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 56px; }
.cert-card {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px 24px;
  background: var(--surface); display: flex; align-items: center; gap: 16px;
  transition: all 0.3s var(--ease);
}
.cert-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.cert-mark {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 10px;
  background: rgba(245,196,81,0.10); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--accent);
}
.cert-mark svg { width: 21px; height: 21px; }
.cert-name { font-weight: 600; font-size: 0.98rem; line-height: 1.3; }
.cert-issuer { font-family: var(--font-mono); font-size: 0.78rem; color: var(--txt-mut); margin-top: 3px; }

/* ---------- Contact / footer ---------- */
.contact {
  text-align: center; padding: 130px 0;
  background:
    radial-gradient(60% 80% at 50% 0%, rgba(245,196,81,0.09), transparent 70%);
}
.contact h2 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.2rem, 7vw, 4.6rem); line-height: 1; letter-spacing: -0.03em; margin-bottom: 26px;
}
.contact h2 em {
  font-style: normal;
  background: var(--grad-head); background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  color: var(--accent-ink);
  animation: gradientShift 7s linear infinite;
}
.contact-mail {
  display: inline-block; font-family: var(--font-mono); font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--accent-ink); border-bottom: 2px solid transparent; transition: border-color 0.3s; margin-bottom: 36px;
}
.contact-mail:hover { border-color: var(--accent); }
.contact-meta { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; color: var(--txt-dim); font-family: var(--font-mono); font-size: 0.9rem; }
.footer {
  border-top: 1px solid var(--line-soft); padding: 36px 0;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  color: var(--txt-mut); font-size: 0.88rem;
}
.footer .brand { font-size: 1.05rem; }
.to-top {
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--txt-dim);
  display: inline-flex; align-items: center; gap: 8px; transition: color 0.3s;
}
.to-top:hover { color: var(--accent-ink); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; gap: 50px; }
  .portrait-wrap { justify-self: center; order: -1; }
  .portrait { width: min(320px, 72vw); }
  .float-chip.c1 { left: -10px; }
  .float-chip.c2 { right: -10px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .nav-links { display: none; }
  .burger { display: flex; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 100%; right: 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
    padding: 22px 28px; gap: 18px; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  section { padding: 84px 0; }
  .wrap { padding: 0 18px; }
  .hero-inner { padding: 0 18px; }
  .edu-card { grid-template-columns: 1fr; text-align: left; }
  .edu-meta { text-align: left; }
  .tl-period { margin-left: 0; }
}

/* ============================================================
   PREMIUM SYSTEM — preloader · progress · background · polish
   ============================================================ */

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  background: var(--bg);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.preloader.done { opacity: 0; visibility: hidden; }
.pre-mark { position: relative; width: 66px; height: 66px; display: grid; place-items: center; }
.pre-mark span { font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; color: var(--accent); }
.pre-ring { position: absolute; inset: 0; width: 66px; height: 66px; transform-origin: center; animation: preSpin 0.9s linear infinite; }
.pre-ring circle { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 138; stroke-dashoffset: 46; opacity: 0.85; }
@keyframes preSpin { to { transform: rotate(360deg); } }
.pre-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 6px; color: var(--txt-mut); animation: blink 1.8s ease-in-out infinite; }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--grad-iris); background-size: 200% auto;
  z-index: 1100; box-shadow: 0 0 14px var(--accent-glow);
  transition: width 0.1s linear; animation: gradientShift 6s linear infinite;
}

/* ---------- Layered background system ---------- */
.bg-system { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-grid {
  position: absolute; inset: -2px;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 58px 58px; opacity: 0.22;
  mask-image: radial-gradient(130% 90% at 50% 0%, #000 25%, transparent 80%);
  -webkit-mask-image: radial-gradient(130% 90% at 50% 0%, #000 25%, transparent 80%);
  animation: gridDrift 24s linear infinite;
}
@keyframes gridDrift { to { background-position: 58px 58px; } }
.bg-orb { position: absolute; border-radius: 50%; filter: blur(95px); }
.orb-1 { width: 520px; height: 520px; top: -12%; right: -8%; background: radial-gradient(circle, #f5c451, transparent 70%); opacity: 0.16; animation: orbFloat 24s ease-in-out infinite; }
.orb-2 { width: 460px; height: 460px; bottom: -14%; left: -10%; background: radial-gradient(circle, #9a8cff, transparent 70%); opacity: 0.15; animation: orbFloat 28s ease-in-out infinite reverse; }
.orb-3 { width: 380px; height: 380px; top: 42%; left: 56%; background: radial-gradient(circle, #5ad1e6, transparent 70%); opacity: 0.10; animation: orbFloat 32s ease-in-out infinite; }
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(4%, -3%) scale(1.08); }
  66% { transform: translate(-3%, 4%) scale(0.94); }
}
.bg-beam { position: absolute; top: -30%; width: 1px; height: 160%; filter: blur(1px); opacity: 0; }
.beam-1 { left: 24%; background: linear-gradient(transparent, var(--accent), transparent); animation: beamSweep 15s ease-in-out infinite; }
.beam-2 { left: 72%; background: linear-gradient(transparent, var(--accent-2), transparent); animation: beamSweep 19s ease-in-out infinite 4s; }
@keyframes beamSweep {
  0%, 100% { opacity: 0; transform: translateX(-30px) rotate(8deg); }
  50% { opacity: 0.28; transform: translateX(30px) rotate(8deg); }
}
.bg-vignette { position: absolute; inset: 0; background: radial-gradient(125% 80% at 50% 28%, transparent 52%, rgba(0,0,0,0.42)); }

/* ---------- Hero cursor-reactive glow + parallax ---------- */
.hero-glow {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(440px 440px at var(--mx, 70%) var(--my, 32%), rgba(245,196,81,0.12), transparent 62%);
  transition: background 0.25s ease;
}
.grid-bg { will-change: transform; transition: transform 0.4s var(--ease-out); }

/* ---------- Availability badge polish ---------- */
.hero-status { position: relative; overflow: hidden; backdrop-filter: blur(6px); background: rgba(245,196,81,0.04); }
.hero-status::after {
  content: ""; position: absolute; top: 0; left: 0; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(245,196,81,0.18), transparent);
  animation: shine 5s ease-in-out infinite; animation-delay: 2.5s;
}

/* ---------- Portrait premium polish ---------- */
/* Holographic scan line that sweeps down the photo (no rotation) */
.portrait-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 16%; z-index: 2;
  pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(to bottom,
    transparent, rgba(245,196,81,0.16) 42%, rgba(245,196,81,0.5) 50%,
    rgba(245,196,81,0.16) 58%, transparent);
  animation: portraitScan 4.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes portraitScan {
  0% { transform: translateY(-130%); opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translateY(760%); opacity: 0; }
}

/* Flowing gradient aura that breathes around the photo (no rotation) */
.portrait-aura {
  position: absolute; inset: -2px; z-index: -1;
  border-radius: calc(var(--r-lg) + 2px);
  background: linear-gradient(130deg,
    var(--accent), var(--accent-2), var(--accent-3), var(--accent-2), var(--accent));
  background-size: 300% 300%;
  filter: blur(12px); opacity: 0.45;
  animation: auraFlow 7s ease-in-out infinite;
}
@keyframes auraFlow {
  0%, 100% { background-position: 0% 50%; opacity: 0.4; transform: scale(1); }
  50% { background-position: 100% 50%; opacity: 0.62; transform: scale(1.03); }
}
.portrait-wrap:hover .portrait-aura { opacity: 0.8; }

/* Viewfinder corner brackets that open up on hover */
.frame-corner {
  position: absolute; width: 22px; height: 22px; z-index: 4; pointer-events: none;
  border: 0 solid var(--accent); opacity: 0.85;
  transition: top 0.4s var(--ease), left 0.4s var(--ease), right 0.4s var(--ease),
    bottom 0.4s var(--ease), opacity 0.4s var(--ease);
}
.frame-corner.tl { top: 13px; left: 13px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 7px; }
.frame-corner.tr { top: 13px; right: 13px; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 7px; }
.frame-corner.bl { bottom: 13px; left: 13px; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 7px; }
.frame-corner.br { bottom: 13px; right: 13px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 7px; }
.portrait-wrap:hover .frame-corner { opacity: 1; }
.portrait-wrap:hover .frame-corner.tl { top: 9px; left: 9px; }
.portrait-wrap:hover .frame-corner.tr { top: 9px; right: 9px; }
.portrait-wrap:hover .frame-corner.bl { bottom: 9px; left: 9px; }
.portrait-wrap:hover .frame-corner.br { bottom: 9px; right: 9px; }

.float-chip { backdrop-filter: blur(6px); }
.float-chip.c3 { bottom: 5%; left: -28px; animation-delay: 2.3s; }

/* ---------- Navigation active indicator ---------- */
.nav-links a.active { color: var(--txt); }
.nav-links a.active::after { width: 100%; }
.brand:hover .dot { box-shadow: 0 0 22px var(--accent); }
@media (max-width: 920px) { .nav-indicator { display: none; } }

/* ---------- Elegant section dividers ---------- */
main > section + section::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(640px, 78%); height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 35%, var(--accent-2) 50%, var(--line) 65%, transparent);
  opacity: 0.6;
}
main > section + section::after {
  content: ""; position: absolute; top: -2.5px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ---------- Tone down heavy effects on small screens ---------- */
@media (max-width: 760px) {
  .bg-orb { filter: blur(70px); }
  .orb-1 { width: 340px; height: 340px; }
  .orb-2 { width: 300px; height: 300px; }
  .orb-3 { display: none; }
  .bg-beam { display: none; }
  .float-chip.c3 { display: none; }
}

/* respect reduced motion for the new layers too */
@media (prefers-reduced-motion: reduce) {
  .preloader { display: none !important; }
  .bg-grid, .bg-orb, .bg-beam, .scroll-progress,
  .hero-status::after, .portrait-ring, .portrait-aura, .portrait-scan { animation: none !important; }
}

/* ============================================================
   THEME TOGGLE + LIGHT-MODE REFINEMENTS
   ============================================================ */
.nav-cluster { display: flex; align-items: center; gap: 16px; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--line); background: transparent; cursor: pointer;
  color: var(--txt-dim); display: grid; place-items: center;
  transition: color 0.25s, border-color 0.25s, background 0.25s, transform 0.35s var(--ease-spring);
}
.theme-toggle:hover {
  color: var(--accent-ink); border-color: var(--accent);
  background: rgba(245,196,81,0.07); transform: rotate(18deg);
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .ic-sun { display: none; }
[data-theme="light"] .theme-toggle .ic-sun { display: block; }
[data-theme="light"] .theme-toggle .ic-moon { display: none; }

/* Smooth cross-fade when switching themes */
body, .nav, .nav.scrolled, .surface, .proj-card, .skill-cat, .edu-card,
.cert-card, .stat, .float-chip, .modal {
  transition: background-color 0.5s var(--ease), border-color 0.5s var(--ease), color 0.5s var(--ease);
}

/* Light mode: keep the ambient effects tasteful & professional */
[data-theme="light"] .mesh { opacity: 0.34; }
[data-theme="light"] .bg-orb { filter: blur(105px); }
[data-theme="light"] .orb-1 { opacity: 0.12; }
[data-theme="light"] .orb-2 { opacity: 0.10; }
[data-theme="light"] .orb-3 { opacity: 0.07; }
[data-theme="light"] .bg-vignette {
  background: radial-gradient(125% 80% at 50% 28%, transparent 60%, rgba(70,62,40,0.05));
}
[data-theme="light"] .grid-bg { opacity: 0.5; }
[data-theme="light"] .portrait { box-shadow: 0 30px 70px rgba(60,55,40,0.16); }
[data-theme="light"] .proj-card:hover { box-shadow: 0 28px 56px rgba(60,55,40,0.14); }
[data-theme="light"] .float-chip { box-shadow: 0 12px 26px rgba(60,55,40,0.10); }
[data-theme="light"] .nav-links.open { box-shadow: 0 20px 50px rgba(60,55,40,0.14); }
[data-theme="light"] .hero-status { background: rgba(199,149,28,0.07); }
[data-theme="light"] .btn-primary { box-shadow: 0 8px 22px rgba(199,149,28,0.22); }

@media (max-width: 920px) {
  .nav-cluster { gap: 10px; }
}
