/* ============================================
   Israrullah Zaheer — Portfolio
   Redesigned 2026: Modern Glassmorphism + Gradient
   ============================================ */

:root {
  /* Dark theme (default) */
  --bg: #070a12;
  --bg-elev: #0c0f1a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --ink: #edecea;
  --ink-soft: #9296a0;
  --ink-quiet: #6e7180;
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.06);

  /* Gradient accent system */
  --accent: #6366f1;
  --accent-alt: #a855f7;
  --accent-teal: #22d3ee;
  --accent-glow: rgba(99, 102, 241, 0.2);
  --accent-glow-alt: rgba(168, 85, 247, 0.15);

  --gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #22d3ee 100%);
  --gradient-h: linear-gradient(90deg, #6366f1 0%, #a855f7 50%, #22d3ee 100%);
  --gradient-text: linear-gradient(90deg, #818cf8, #c084fc, #67e8f9);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter Tight', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  --max-w: 1280px;
  --pad-x: clamp(1.25rem, 4vw, 4rem);
  --nav-h: 68px;
}

[data-theme="light"] {
  --bg: #f2f0eb;
  --bg-elev: #e8e4d9;
  --bg-card: rgba(255, 255, 255, 0.65);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --ink: #111116;
  --ink-soft: #44444f;
  --ink-quiet: #888892;
  --line: rgba(0, 0, 0, 0.09);
  --line-soft: rgba(0, 0, 0, 0.05);
  --accent: #4f46e5;
  --accent-alt: #9333ea;
  --accent-teal: #0891b2;
  --accent-glow: rgba(79, 70, 229, 0.12);
  --accent-glow-alt: rgba(147, 51, 234, 0.08);
  --gradient-text: linear-gradient(90deg, #4f46e5, #9333ea, #0891b2);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { background: none; border: none; cursor: pointer; color: inherit; font: inherit; }
em { font-style: italic; }

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

/* Scroll offset for fixed nav */
section[id] { scroll-margin-top: var(--nav-h); }

/* ============================================
   CUSTOM CURSOR (pointer devices only)
   ============================================ */
.cursor-dot,
.cursor-ring { display: none; }

@media (pointer: fine) {
  body { cursor: none; }

  .cursor-dot {
    display: block;
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
    mix-blend-mode: screen;
  }

  .cursor-ring {
    display: block;
    position: fixed;
    width: 38px;
    height: 38px;
    border: 1.5px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    opacity: 0.45;
    transition: width 0.3s ease, height 0.3s ease, border-color 0.2s ease, opacity 0.2s ease;
  }

  body.cursor-hover .cursor-dot {
    width: 14px;
    height: 14px;
    background: var(--accent-alt);
  }
  body.cursor-hover .cursor-ring {
    width: 58px;
    height: 58px;
    opacity: 0.25;
    border-color: var(--accent-alt);
  }
}

/* ============================================
   SCROLL PROGRESS BAR
   ============================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--gradient-h);
  z-index: 200;
  transition: width 0.08s linear;
}

/* ============================================
   GRAIN OVERLAY
   ============================================ */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.028;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%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");
}

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  padding: 0 var(--pad-x);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  max-width: var(--max-w);
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.nav-mark {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
  flex-shrink: 0;
}
.mark-bracket { color: var(--accent); font-weight: 400; }
.mark-text { color: var(--ink); }

.nav-links {
  display: flex;
  gap: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.nav-links a {
  color: var(--ink-quiet);
  position: relative;
  transition: color 0.2s ease;
  padding: 0.25rem 0;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1px;
  background: var(--gradient-h);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); transform-origin: left; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.theme-toggle {
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
  transition: all 0.25s ease;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
  transform: rotate(18deg);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}
.hamburger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ink-soft);
  transition: all 0.3s ease;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
}

/* ============================================
   MOBILE NAV
   ============================================ */
.mobile-nav {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: min(360px, 90vw);
  background: var(--bg-elev);
  border-left: 1px solid var(--line);
  z-index: 150;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 2rem;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.7, 0, 0.3, 1);
}
.mobile-nav.open { transform: translateX(0); }

.mobile-nav-close {
  align-self: flex-end;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  margin-bottom: 2rem;
  transition: all 0.2s ease;
}
.mobile-nav-close:hover { color: var(--ink); border-color: var(--ink); }

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}
.mobile-nav-links a {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  font-weight: 300;
  color: var(--ink-soft);
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.2s ease, padding-left 0.3s ease;
  font-variation-settings: "opsz" 60;
}
.mobile-nav-links a:hover { color: var(--ink); padding-left: 0.5rem; }

.mobile-nav-footer {
  padding-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-quiet);
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: 100vh;
  padding: calc(var(--nav-h) + 4rem) var(--pad-x) 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

@media (max-width: 760px) {
  .hero { padding-top: calc(var(--nav-h) + 1.5rem); }
}

/* Animated gradient orbs */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0;
}
.orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.14) 0%, transparent 70%);
  top: -15%; left: -8%;
  animation: orbFade 2s ease forwards 0.3s, orbFloat1 20s ease-in-out infinite 2.3s;
}
.orb-2 {
  width: 550px; height: 550px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.11) 0%, transparent 70%);
  top: 15%; right: -6%;
  animation: orbFade 2s ease forwards 0.6s, orbFloat2 24s ease-in-out infinite 2.6s;
}
.orb-3 {
  width: 450px; height: 450px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.08) 0%, transparent 70%);
  bottom: 5%; left: 25%;
  animation: orbFade 2s ease forwards 0.9s, orbFloat3 28s ease-in-out infinite 2.9s;
}
@keyframes orbFade { to { opacity: 1; } }
@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(45px, 35px) scale(1.04); }
  66%  { transform: translate(-25px, 55px) scale(0.97); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40%  { transform: translate(-55px, 25px) scale(1.06); }
  70%  { transform: translate(25px, -35px) scale(0.96); }
}
@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  30%  { transform: translate(35px, -45px) scale(1.03); }
  60%  { transform: translate(-45px, 25px) scale(0.98); }
}

.hero-grid {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding-top: 2rem;
  position: relative;
  z-index: 1;
}
.hero-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
@media (min-width: 960px) {
  .hero-grid {
    flex-direction: row;
    align-items: center;
    gap: 5rem;
  }
  .hero-content {
    flex: 1;
    min-width: 0;
    gap: 1.4rem;
  }
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: var(--ink-quiet);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.meta-row { display: inline-flex; gap: 0.5rem; align-items: center; }
.meta-key { color: var(--ink-quiet); }
.meta-val { color: var(--ink-soft); }
.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 0.35rem;
  box-shadow: 0 0 8px #22c55e, 0 0 20px rgba(34, 197, 94, 0.3);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #22c55e, 0 0 20px rgba(34, 197, 94, 0.3); }
  50%       { opacity: 0.35; box-shadow: 0 0 4px #22c55e; }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 12vw, 11rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-variation-settings: "opsz" 144;
}
.title-line { display: block; }
.title-line.italic {
  font-style: italic;
  font-weight: 300;
  color: var(--ink);
  padding-left: clamp(2rem, 8vw, 6rem);
}
.title-period {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  transform: translateY(-0.05em);
}

.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(0.8125rem, 1.3vw, 0.9375rem);
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  margin-top: 0.25rem;
}

.hero-lede {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  line-height: 1.5;
  max-width: 42rem;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 14;
}

.link-underline {
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.link-underline:hover { color: var(--accent); border-color: transparent; }

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.btn {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.875rem 1.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #818cf8, #c084fc, #67e8f9);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -8px rgba(99, 102, 241, 0.45), 0 0 0 4px var(--accent-glow);
}
.btn-primary svg {
  position: relative;
  z-index: 1;
  transition: transform 0.25s ease;
}
.btn-primary:hover svg { transform: translateX(4px); }
.btn-ghost {
  border-color: var(--line);
  color: var(--ink-soft);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--ink);
  background: var(--accent-glow);
  box-shadow: 0 0 18px var(--accent-glow);
}

.hero-stats {
  display: flex;
  gap: clamp(2rem, 6vw, 5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line-soft);
  margin-top: 0.5rem;
}
.stat-num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  font-variation-settings: "opsz" 144;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-quiet);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
}

/* ---- Hero entrance animations ---- */
@keyframes heroContentIn {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-meta   { animation: heroContentIn 0.7s cubic-bezier(0.16,1,0.3,1) forwards 0.05s; opacity: 0; }
.hero-title  { animation: heroContentIn 0.9s cubic-bezier(0.16,1,0.3,1) forwards 0.15s; opacity: 0; }
.hero-role   { animation: heroContentIn 0.7s cubic-bezier(0.16,1,0.3,1) forwards 0.28s; opacity: 0; }
.hero-lede   { animation: heroContentIn 0.7s cubic-bezier(0.16,1,0.3,1) forwards 0.38s; opacity: 0; }
.hero-cta    { animation: heroContentIn 0.7s cubic-bezier(0.16,1,0.3,1) forwards 0.48s; opacity: 0; }
.hero-stats  { animation: heroContentIn 0.7s cubic-bezier(0.16,1,0.3,1) forwards 0.58s; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .hero-meta, .hero-title, .hero-role, .hero-lede, .hero-cta, .hero-stats,
  .hero-visual, .hero-badge-certs, .hero-badge-years, .hero-badge-status {
    animation: none;
    opacity: 1;
  }
}

/* ---- Hero visual (right panel, desktop only) ---- */
.hero-visual {
  display: none;
}

@media (min-width: 960px) {
  .hero-visual {
    display: flex;
    width: 360px;
    flex-shrink: 0;
    position: relative;
    align-items: center;
    justify-content: center;
    min-height: 460px;
  }
}

/* Portrait card — not a circle */
.hero-photo-ring {
  width: 280px;
  height: 376px;
  border-radius: 24px;
  padding: 2px;
  background: var(--gradient);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.hero-photo-ring:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 64px rgba(99, 102, 241, 0.28);
}
.hero-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 8%;
  border-radius: 22px;
  display: block;
  background: var(--bg-card);
}
/* Subtle light-leak shimmer on the card */
.hero-photo-ring::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 22px;
  background: linear-gradient(
    160deg,
    rgba(255,255,255,0.07) 0%,
    transparent 40%,
    transparent 60%,
    rgba(255,255,255,0.02) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.hero-badge {
  position: absolute;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
  z-index: 3;
}
.hero-badge-certs {
  top: 5%;
  right: -14%;
}
.hero-badge-years {
  top: 43%;
  left: -18%;
}
.hero-badge-status {
  bottom: 7%;
  right: -12%;
  flex-direction: row;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
}
.badge-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}
.badge-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--ink-quiet);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Glow behind the portrait card */
.hero-visual::before {
  content: '';
  position: absolute;
  width: 310px;
  height: 410px;
  border-radius: 28px;
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.16) 0%, transparent 70%);
  filter: blur(40px);
  z-index: 0;
}

/* Entrance animations for hero visual (desktop) */
@keyframes heroVisualIn {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes badgeIn {
  from { opacity: 0; transform: scale(0.8) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@media (min-width: 960px) {
  .hero-visual {
    animation: heroVisualIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.25s;
    opacity: 0;
  }
  .hero-badge-certs  { animation: badgeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.7s;  opacity: 0; }
  .hero-badge-years  { animation: badgeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.9s;  opacity: 0; }
  .hero-badge-status { animation: badgeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 1.1s;  opacity: 0; }
}

/* Marquee */
.hero-marquee {
  margin-top: 4rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: var(--bg-elev);
  position: relative;
  z-index: 1;
}
.hero-marquee::before,
.hero-marquee::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 8rem;
  z-index: 2;
  pointer-events: none;
}
.hero-marquee::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-elev), transparent);
}
.hero-marquee::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-elev), transparent);
}
.marquee-track {
  display: inline-flex;
  gap: 2rem;
  white-space: nowrap;
  animation: marquee 40s linear infinite;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--ink-soft);
}
.marquee-track span:nth-child(even) {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: normal;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============================================
   SECTIONS — shared
   ============================================ */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 8rem) var(--pad-x);
}
.section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.section-num {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}
.section-label {
  color: var(--ink-soft);
  position: relative;
  padding-left: 1.5rem;
}
.section-label::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 1rem;
  height: 1px;
  background: var(--ink-quiet);
}

/* ============================================
   ABOUT
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: auto 1.5fr 1fr;
    gap: 4rem;
    align-items: start;
  }
}
.big-statement {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 60;
}
.big-statement em {
  font-style: italic;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 400;
}
.about-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.65;
}
.about-body strong { color: var(--ink); font-weight: 500; }

.languages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
}
.lang {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}
.lang:hover { border-color: var(--accent); color: var(--accent); }
.lang-learning {
  border-style: dashed;
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}
.lang em { font-style: italic; opacity: 0.8; }

/* ============================================
   SKILLS
   ============================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  border-top: 1px solid var(--line-soft);
  padding-top: 3rem;
}
.skill-col {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.skill-col:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: var(--bg-card-hover);
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(99, 102, 241, 0.1);
}
.skill-col h3 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.skill-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.skill-col li {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: color 0.2s ease;
}
.skill-col li:hover { color: var(--ink); }

.skill-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-quiet);
}
.skill-dot-5 { background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }
.skill-dot-4 { background: var(--accent-alt); opacity: 0.8; }
.skill-dot-3 { background: var(--accent-teal); opacity: 0.65; }

/* ============================================
   WORK / PROJECTS
   ============================================ */
.project {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 2rem;
  row-gap: 0.75rem;
  padding: 2.5rem 1.25rem;
  border-top: 1px solid var(--line);
  position: relative;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  border-radius: 0;
}
.project::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gradient);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  border-radius: 2px;
}
.project:last-child { border-bottom: 1px solid var(--line); }
.project:hover {
  background: var(--bg-card);
  border-radius: 14px;
  padding-left: 2rem;
  box-shadow: 0 12px 36px -10px rgba(0, 0, 0, 0.25);
}
.project:hover::before { transform: scaleY(1); }

.project-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.05em;
  grid-row: 1;
  align-self: start;
  padding-top: 0.4rem;
}
.project-meta {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-quiet);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tag {
  color: var(--ink-soft);
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  backdrop-filter: blur(8px);
}
.year { font-style: italic; }

.project-title {
  grid-column: 2;
  grid-row: 2;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 60;
}
.project-client {
  font-style: italic;
  font-weight: 300;
  color: var(--ink-quiet);
  font-size: 0.85em;
}
.project-desc {
  grid-column: 2;
  grid-row: 3;
  font-size: 0.925rem;
  color: var(--ink-soft);
  line-height: 1.65;
  max-width: 56rem;
  margin-top: 0.35rem;
}
.project-concept .project-title::after {
  content: '◆';
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 0.55em;
  margin-left: 0.5rem;
  vertical-align: middle;
}

@media (max-width: 600px) {
  .project {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-left: 1rem;
  }
  .project-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}

/* ============================================
   CERTIFICATIONS
   ============================================ */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.cert {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 130px;
  position: relative;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.cert:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.3);
}
.cert-year {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-quiet);
  letter-spacing: 0.1em;
}
.cert-name {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.3;
  color: var(--ink);
  font-weight: 400;
  flex: 1;
  font-variation-settings: "opsz" 14;
}
.cert-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.cert-recent {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.08) 100%);
  border-color: rgba(99, 102, 241, 0.2);
}
.cert-recent::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-h);
}
.cert-issuer {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-top: 0.25rem;
}
.cert-placeholder {
  border-style: dashed;
  border-color: var(--line);
  opacity: 0.5;
}
.cert-name-placeholder {
  font-style: italic;
  color: var(--ink-quiet);
}
.cert-note {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-quiet);
  text-align: right;
}

/* ============================================
   ABOUT — CAREER TIMELINE
   ============================================ */
.career-timeline {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  max-width: var(--max-w);
}
.career-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 2.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--ink-quiet) 70%, transparent);
  opacity: 0.35;
}
.exp-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.25rem 0;
  position: relative;
}
.exp-dot {
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-quiet);
  background: var(--bg);
  margin-top: 0.3rem;
  position: relative;
  z-index: 1;
}
.exp-dot-active {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse 2.2s ease-in-out infinite;
}
.exp-content {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.exp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-quiet);
  letter-spacing: 0.06em;
}
.exp-period { color: var(--ink-soft); }
.exp-company {
  color: var(--ink-quiet);
  padding-left: 0.75rem;
  border-left: 1px solid var(--line);
}
.exp-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 14;
}

/* ============================================
   CONTACT
   ============================================ */
.contact-headline {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 3rem;
  max-width: 42rem;
  font-variation-settings: "opsz" 144;
}
.contact-headline em {
  font-style: italic;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 400;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  position: relative;
  transition: all 0.4s cubic-bezier(0.7, 0, 0.3, 1);
  overflow: hidden;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
}
.contact-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient);
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.7, 0, 0.3, 1);
  z-index: 0;
}
.contact-card:hover::before { transform: translateY(0); }
.contact-card:hover { border-color: transparent; }
.contact-card:hover * {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.contact-card > * { position: relative; z-index: 1; }

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-quiet);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.contact-value {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--ink);
  font-weight: 400;
  font-variation-settings: "opsz" 14;
  word-break: break-all;
}
.contact-arrow {
  font-family: var(--font-mono);
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  align-self: flex-end;
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}
.contact-card:hover .contact-arrow { transform: translateX(4px) translateY(-4px); }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 2rem var(--pad-x);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-quiet);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: var(--max-w);
  margin: 0 auto;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-row { display: flex; gap: 0.75rem; align-items: center; }
.footer-sep { opacity: 0.4; }
.footer-social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.footer-icon {
  color: var(--ink-quiet);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.footer-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ============================================
   SECTION ALT — alternating bg rhythm
   ============================================ */
.section-alt {
  background: var(--bg-elev);
  box-shadow: 0 0 0 100vmax var(--bg-elev);
  clip-path: inset(0 -100vmax);
}

/* ============================================
   BTN — CV DOWNLOAD
   ============================================ */
.btn-cv {
  background: linear-gradient(var(--bg), var(--bg)) padding-box,
              var(--gradient) border-box;
  border: 1.5px solid transparent;
  color: var(--ink-soft);
}
.btn-cv:hover {
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.35);
}
.btn-cv svg {
  transition: transform 0.25s ease;
}
.btn-cv:hover svg { transform: translateX(2px) translateY(-2px); }

/* ============================================
   NAV — CV LINK
   ============================================ */
.nav-links .nav-cv {
  color: var(--accent);
  opacity: 0.85;
  padding: 0.2rem 0.65rem;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 4px;
  background: var(--accent-glow);
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
}
.nav-links .nav-cv:hover {
  opacity: 1;
  box-shadow: 0 0 12px var(--accent-glow);
}
.nav-links .nav-cv::after { display: none; }

/* Mobile nav CV link */
.mobile-nav-cv {
  display: block;
  margin-top: 0.75rem;
  color: var(--accent);
  font-size: 0.72rem;
  transition: color 0.2s ease;
}
.mobile-nav-cv:hover { color: var(--accent-alt); }

/* ============================================
   ABOUT — AVATAR
   ============================================ */
.about-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.avatar-ring {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  padding: 3px;
  background: var(--gradient);
  flex-shrink: 0;
  animation: avatarGlow 3s ease-in-out infinite alternate;
}
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  border-radius: 50%;
  display: block;
  background: var(--bg-card);
}
.avatar-status {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: 0.05em;
}
.avatar-location {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--ink-quiet);
  letter-spacing: 0.05em;
}
@keyframes avatarGlow {
  from { box-shadow: 0 0 18px var(--accent-glow); }
  to   { box-shadow: 0 0 36px var(--accent-glow-alt); }
}

/* ============================================
   WORK — PROJECT ACTIONS
   ============================================ */
.project-actions {
  grid-column: 2;
  grid-row: 4;
  display: flex;
  gap: 1.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.project-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.project-link:hover {
  color: var(--accent-alt);
  border-bottom-color: var(--accent-alt);
}
.project-link-disabled {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-quiet);
  font-style: italic;
}
@media (max-width: 600px) {
  .project-actions { margin-top: 0.25rem; }
}

/* ============================================
   SKILLS — MASTERY LEGEND
   ============================================ */
.skill-legend {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-quiet);
  letter-spacing: 0.05em;
}
.skill-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

/* ============================================
   FLOATING CTA
   ============================================ */
.floating-cta {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 90;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.floating-cta.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.floating-cta-btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  letter-spacing: 0.02em;
}
.floating-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 90;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.4s ease;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in { opacity: 1; transform: none; }

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

/* Hero meta row — tighter gap on narrow screens */
@media (max-width: 600px) {
  .hero-meta { gap: 0.75rem 1rem; }
}

/* Hero CTA — stack buttons full-width on very small screens */
@media (max-width: 480px) {
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; justify-content: center; }
}

/* Hero marquee — less top gap on mobile */
@media (max-width: 600px) {
  .hero-marquee { margin-top: 2rem; }
}

/* Section head — tighter bottom gap on mobile */
@media (max-width: 600px) {
  .section-head { margin-bottom: 2rem; }
}

/* Skills legend — center on mobile */
@media (max-width: 600px) {
  .skill-legend { justify-content: center; flex-wrap: wrap; gap: 1rem; }
}

/* Contact value — smaller font on very small screens */
@media (max-width: 480px) {
  .contact-value { font-size: 0.9rem; }
}

/* Footer top — stack vertically on mobile */
@media (max-width: 600px) {
  .footer-top { flex-direction: column; align-items: flex-start; }
}

/* ============================================
   REDUCE MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .orb    { opacity: 0.06 !important; animation: none !important; }
  .marquee-track { animation: none; }
}
