/* ==========================================================================
   Tasib Ali — portfolio
   v3 "iOS" — Apple platform design language: true-black grouped backgrounds,
   #1C1C1E cards, SF system type, systemBlue→indigo tints, pill controls,
   frosted bars, iMessage chat. No frameworks, no color-mix, no build step.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* backgrounds (iOS dark, grouped) */
  --bg-0: #000000;
  --bg-1: #060608;
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --glass: rgba(22, 22, 24, 0.72);

  /* separators & fills (iOS system values) */
  --border: rgba(84, 84, 88, 0.34);
  --border-strong: rgba(84, 84, 88, 0.62);
  --fill: rgba(120, 120, 128, 0.22);
  --fill-2: rgba(120, 120, 128, 0.34);

  /* labels */
  --text: #f5f5f7;
  --muted: rgba(235, 235, 245, 0.62);
  --faint: rgba(235, 235, 245, 0.32);

  /* system colors (dark variants) — brand red, from tasibali.com */
  --accent: #ff453a;
  --accent-2: #ff375f;
  --teal: #64d2ff;
  --mint: #30d158;
  --amber: #ff9f0a;
  --red: #ff453a;

  /* tints */
  --tint: rgba(255, 69, 58, 0.15);
  --tint-strong: rgba(255, 69, 58, 0.30);
  --mint-dim: rgba(48, 209, 88, 0.42);
  --amber-dim: rgba(255, 159, 10, 0.55);
  --red-dim: rgba(255, 69, 58, 0.45);

  --grad: linear-gradient(135deg, #ff453a, #ff375f);
  --on-accent: #ffffff;
  --glow: 0 0 28px rgba(255, 69, 58, 0.20);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 8px 26px rgba(0, 0, 0, 0.35);

  /* SF on Apple devices, graceful elsewhere */
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Menlo", monospace;

  --nav-h: 56px;
  --radius: 20px;
  --radius-sm: 14px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg-0: #f2f2f7;
  --bg-1: #ececf1;
  --card: #ffffff;
  --card-2: #f2f2f7;
  --glass: rgba(249, 249, 251, 0.76);

  --border: rgba(60, 60, 67, 0.16);
  --border-strong: rgba(60, 60, 67, 0.29);
  --fill: rgba(120, 120, 128, 0.13);
  --fill-2: rgba(120, 120, 128, 0.20);

  --text: #1d1d1f;
  --muted: rgba(60, 60, 67, 0.66);
  --faint: rgba(60, 60, 67, 0.34);

  --accent: #e0281c;
  --accent-2: #e01a4f;
  --teal: #30b0c7;
  --mint: #248a46;
  --amber: #c93400;
  --red: #e0281c;

  --tint: rgba(224, 40, 28, 0.11);
  --tint-strong: rgba(224, 40, 28, 0.22);
  --mint-dim: rgba(36, 138, 70, 0.45);
  --amber-dim: rgba(255, 149, 0, 0.6);
  --red-dim: rgba(224, 40, 28, 0.45);

  --grad: linear-gradient(135deg, #e0281c, #e01a4f);
  --on-accent: #ffffff;
  --glow: 0 0 28px rgba(224, 40, 28, 0.14);
  --shadow: 0 22px 50px rgba(20, 30, 60, 0.14);
  --shadow-soft: 0 6px 22px rgba(20, 30, 60, 0.10);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-0);
  overflow-x: hidden;
  transition: background-color 0.45s ease, color 0.45s ease;
  -webkit-font-smoothing: antialiased;
}

img, svg { vertical-align: middle; }
a { color: var(--accent); text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
::selection { background: var(--tint-strong); }

.mono { font-family: var(--font-mono); }
.container { max-width: 1140px; margin: 0 auto; padding: 0 28px; }
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 300;
  background: var(--card); color: var(--text);
  padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border);
  transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 12px; }

section { scroll-margin-top: calc(var(--nav-h) + 34px); }

/* ---------- Ambient layers ---------- */
.aurora {
  position: fixed; inset: 0; z-index: -2;
  overflow: hidden; pointer-events: none;
}
.aurora i {
  position: absolute; border-radius: 50%;
  filter: blur(95px) hue-rotate(var(--hue, 0deg));
  opacity: 0.2;
  will-change: transform;
}
.aurora i:nth-child(1) {
  width: 55vw; height: 55vw; top: -24vw; left: -12vw;
  background: radial-gradient(circle, rgba(255, 69, 58, 0.42), transparent 65%);
  animation: drift-a 28s ease-in-out infinite alternate;
}
.aurora i:nth-child(2) {
  width: 48vw; height: 48vw; bottom: -20vw; right: -14vw;
  background: radial-gradient(circle, rgba(255, 55, 95, 0.36), transparent 65%);
  animation: drift-b 34s ease-in-out infinite alternate;
}
.aurora i:nth-child(3) {
  width: 34vw; height: 34vw; top: 38vh; left: 55vw;
  background: radial-gradient(circle, rgba(255, 159, 10, 0.2), transparent 65%);
  animation: drift-c 40s ease-in-out infinite alternate;
}
[data-theme="light"] .aurora i { opacity: 0.3; }

.spotlight {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 30%),
              rgba(255, 69, 58, 0.06), transparent 72%);
  opacity: 0;
  transition: opacity 0.6s ease;
}
[data-theme="light"] .spotlight {
  background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 30%),
              rgba(224, 40, 28, 0.045), transparent 72%);
}
.spotlight.on { opacity: 1; }

main { position: relative; z-index: 1; }

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

/* ---------- Nav: floating frosted pill (iOS toolbar) ---------- */
.nav {
  position: fixed; top: 12px; left: 50%; z-index: 200;
  transform: translateX(-50%);
  width: min(1080px, calc(100vw - 24px));
}
.nav-inner {
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 10px 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.nav.scrolled .nav-inner {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  backdrop-filter: blur(22px) saturate(1.8);
  border-color: var(--border);
  box-shadow: var(--shadow-soft);
}
.brand {
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  color: var(--text); display: inline-flex; align-items: center;
}
.brand-prompt { color: var(--mint); }
.brand-path { color: var(--muted); }
.brand-cursor {
  display: inline-block; width: 8px; height: 15px; margin-left: 4px;
  background: var(--accent); border-radius: 1.5px;
  animation: blink 1.1s steps(1) infinite;
}

.nav-links { display: flex; gap: 2px; }
.nav-links a {
  color: var(--muted); font-size: 13.5px; font-weight: 500;
  padding: 8px 13px; border-radius: 999px;
  transition: color 0.25s ease, background-color 0.25s ease;
}
.nav-links a:hover { color: var(--text); background: var(--fill); }
.nav-links a.active { color: var(--accent); background: var(--tint); }
.nav-links a.active::after { content: none; }

.nav-actions { display: flex; align-items: center; gap: 6px; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 37px; height: 37px; border-radius: 50%;
  background: var(--fill); border: none;
  color: var(--muted); cursor: pointer;
  transition: color 0.25s ease, background-color 0.25s ease, transform 0.35s var(--ease);
}
.theme-toggle:hover { color: var(--text); background: var(--fill-2); transform: rotate(24deg) scale(1.06); }
.icon-sun { display: none; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

.nav-burger {
  display: none;
  width: 37px; height: 37px; border-radius: 50%;
  background: var(--fill); border: none;
  cursor: pointer; padding: 11px 10px;
  flex-direction: column; justify-content: space-between;
}
.nav-burger span {
  display: block; height: 1.6px; width: 100%;
  background: var(--text); border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s ease;
}
.nav-burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- Buttons (iOS pills) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: 999px;
  font-family: var(--font-body); font-size: 15px; font-weight: 600;
  letter-spacing: -0.01em;
  border: none; cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s ease,
              background-color 0.25s ease, color 0.25s ease, filter 0.25s ease;
  will-change: transform;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: var(--grad); color: var(--on-accent);
  box-shadow: var(--glow), var(--shadow-soft);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: var(--tint); color: var(--accent);
}
.btn-ghost:hover { background: var(--tint-strong); transform: translateY(-1px); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--nav-h) + 72px) 0 72px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; }
#particles { position: absolute; inset: 0; width: 100%; height: 100%; }

.grid-overlay {
  position: absolute; inset: -10% 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 40%, black 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 85% 65% at 50% 40%, black 0%, transparent 72%);
  opacity: 0.35;
}

.orb {
  position: absolute; border-radius: 50%;
  filter: blur(85px) hue-rotate(var(--hue, 0deg));
  opacity: 0.3;
  will-change: transform;
  pointer-events: none;
}
.orb-a { width: 500px; height: 500px; top: -10%; right: -6%; background: radial-gradient(circle, rgba(255,69,58,0.34), transparent 65%); }
.orb-b { width: 440px; height: 440px; bottom: -14%; left: -8%; background: radial-gradient(circle, rgba(255,55,95,0.28), transparent 65%); }
.orb-c { width: 280px; height: 280px; top: 34%; left: 38%; background: radial-gradient(circle, rgba(255,159,10,0.16), transparent 65%); }
[data-theme="light"] .orb { opacity: 0.24; }

.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 52px; align-items: center; width: 100%;
}

.hero-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12.5px; letter-spacing: 0.05em;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--fill);
  margin: 0 0 24px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
  animation: pulse 2.4s ease-in-out infinite;
  flex: none;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 8.5vw, 5.8rem);
  font-weight: 700; line-height: 1.0;
  letter-spacing: -0.03em;
  margin: 0 0 22px;
}
.hero-lede {
  font-size: clamp(1.05rem, 2vw, 1.26rem);
  color: var(--muted);
  line-height: 1.6;
  max-width: 56ch;
  margin: 0 0 26px;
}
.hero-lede strong { color: var(--text); font-weight: 600; }

.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 34px; }
.chip {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--muted);
  padding: 7px 14px; border-radius: 999px;
  background: var(--fill);
  transition: color 0.25s ease, background-color 0.25s ease, transform 0.35s var(--ease);
}
.chip:hover { color: var(--accent); background: var(--tint); transform: translateY(-3px); }
.chip-gold { color: var(--amber); background: rgba(255, 159, 10, 0.14); }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.hero-meta { font-size: 13px; color: var(--faint); margin: 0; }

/* Terminal — always dark, like a real terminal */
.hero-term { min-width: 0; perspective: 1200px; }
.term {
  position: relative;
  background: rgba(18, 18, 20, 0.82);
  border: 1px solid rgba(84, 84, 88, 0.5);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  overflow: hidden;
  cursor: text;
  transition: transform 0.5s var(--ease), box-shadow 0.5s ease, border-color 0.3s ease;
}
.term:hover { transform: translateY(-4px); }
.term:focus-within { border-color: rgba(10, 132, 255, 0.6); }

.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(84, 84, 88, 0.4);
  background: rgba(255, 255, 255, 0.04);
}
.term-dot { width: 12px; height: 12px; border-radius: 50%; }
.term-dot.red { background: #ff5f57; }
.term-dot.yellow { background: #febc2e; }
.term-dot.green { background: #28c840; }
.term-title { margin-left: 10px; font-size: 12px; color: rgba(235, 235, 245, 0.4); }
.term-live {
  margin-left: auto; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: #30d158;
  border: 1px solid rgba(48, 209, 88, 0.4);
  border-radius: 999px; padding: 2px 9px;
  animation: pulse 2.4s ease-in-out infinite;
}
.term-body {
  margin: 0; padding: 18px;
  font-family: var(--font-mono);
  font-size: 12.8px; line-height: 1.8;
  min-height: 300px; max-height: 300px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
  color: rgba(235, 235, 245, 0.62);
  scrollbar-width: thin;
}
.term-body .t-prompt { color: #30d158; font-weight: 600; }
.term-body .t-cmd { color: #f5f5f7; }
.term-body .t-ok { color: #30d158; }
.term-body .t-accent { color: #64d2ff; }
.term-body .t-dim { color: rgba(235, 235, 245, 0.35); }
.term-body .t-cursor {
  display: inline-block; width: 8px; height: 14px;
  background: #64d2ff; border-radius: 1.5px; vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}
.term-input {
  position: absolute; left: -9999px; top: 0;
  width: 1px; height: 1px; opacity: 0;
}
.term-hint {
  position: absolute; right: 14px; bottom: 12px;
  font-size: 11px; color: #ffffff;
  background: var(--grad);
  border-radius: 999px; padding: 6px 13px;
  box-shadow: var(--shadow-soft);
  animation: bob-soft 2.6s ease-in-out infinite;
  pointer-events: none;
}
.term-hint b { font-weight: 700; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  color: var(--faint);
  animation: bob 2.6s ease-in-out infinite;
}
.scroll-hint:hover { color: var(--accent); }

/* ---------- Marquee ---------- */
.marquee {
  position: relative;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 15px 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}
.marquee-track {
  display: inline-flex; align-items: center; gap: 26px;
  white-space: nowrap;
  animation: marquee 56s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-size: 13px; color: var(--faint); letter-spacing: 0.04em; transition: color 0.25s ease; }
.marquee-track span:hover { color: var(--accent); }
.marquee-track i { font-style: normal; font-size: 9px; color: var(--tint-strong); }

/* ---------- Sections ---------- */
.section { position: relative; padding: 120px 0; overflow: hidden; }
.section-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.section-kicker {
  font-size: 12.5px; letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.3rem);
  font-weight: 700; letter-spacing: -0.025em;
  margin: 0 0 16px;
}
.section-sub { color: var(--muted); margin: 0 0 50px; max-width: 62ch; font-size: 1.02rem; }
.section-sub strong { color: var(--text); }

.watermark {
  position: absolute; top: 40px; right: -1%;
  font-size: clamp(4rem, 12vw, 9rem); font-weight: 600;
  color: transparent;
  -webkit-text-stroke: 1px var(--border);
  user-select: none;
}
.glyph {
  position: absolute;
  font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 600;
  color: var(--border-strong);
  opacity: 0.45; user-select: none;
}
.orb-about { width: 520px; height: 520px; top: 10%; right: -14%; background: radial-gradient(circle, rgba(255,55,95,0.18), transparent 65%); }
.orb-platform { width: 560px; height: 560px; top: 0%; left: -16%; background: radial-gradient(circle, rgba(255,69,58,0.15), transparent 65%); }
.orb-skills { width: 480px; height: 480px; bottom: -10%; left: -12%; background: radial-gradient(circle, rgba(255,69,58,0.13), transparent 65%); }
.orb-exp { width: 540px; height: 540px; top: 30%; right: -16%; background: radial-gradient(circle, rgba(255,159,10,0.11), transparent 65%); }
.orb-proj { width: 500px; height: 500px; top: -6%; left: -12%; background: radial-gradient(circle, rgba(255,55,95,0.15), transparent 65%); }
.orb-contact { width: 540px; height: 540px; bottom: -18%; right: -10%; background: radial-gradient(circle, rgba(255,69,58,0.13), transparent 65%); }

/* Reveal on scroll — blur-to-sharp (gated on .js) */
html.js .reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.99);
  filter: blur(6px);
  transition: opacity 0.85s var(--ease-expo), transform 0.85s var(--ease-expo), filter 0.85s var(--ease-expo);
  transition-delay: var(--d, 0s);
}
html.js .reveal.visible { opacity: 1; transform: none; filter: none; }

/* ---------- Tilt cards (3D + glare) ---------- */
.tilt { transform-style: preserve-3d; position: relative; }
.tilt::after {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%),
              rgba(255, 255, 255, 0.08), transparent 55%);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.tilt:hover::after { opacity: 1; }
[data-theme="light"] .tilt::after {
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%),
              rgba(0, 122, 255, 0.07), transparent 55%);
}

/* ---------- Cards (iOS grouped) ---------- */
.pillar, .stat, .skill-card, .tl-card, .proj-card, .cert-card, .edu-card,
.map-card, .contact-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
[data-theme="light"] .pillar, [data-theme="light"] .stat,
[data-theme="light"] .skill-card, [data-theme="light"] .tl-card,
[data-theme="light"] .proj-card, [data-theme="light"] .cert-card,
[data-theme="light"] .edu-card, [data-theme="light"] .map-card,
[data-theme="light"] .contact-form { border-color: transparent; box-shadow: var(--shadow-soft); }

/* ---------- About ---------- */
.about-grid {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 60px; align-items: start;
}
.about-text p { color: var(--muted); margin: 0 0 18px; }
.about-text p strong { color: var(--text); }

.pillars {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; margin-top: 32px;
}
.pillar {
  padding: 20px;
  border-radius: var(--radius-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s ease, background-color 0.3s ease;
}
.pillar:hover { background: var(--card-2); box-shadow: var(--shadow-soft); }
[data-theme="light"] .pillar:hover { background: var(--card); }
.pillar h3 { margin: 0 0 6px; font-size: 13px; color: var(--accent); font-weight: 600; }
.pillar p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.6; }

.about-side { display: flex; flex-direction: column; }
.about-stats { display: grid; gap: 14px; }
.stat {
  padding: 24px 26px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s ease;
}
.stat:hover { box-shadow: var(--glow), var(--shadow-soft); }
.stat-num {
  display: block;
  font-family: var(--font-display); font-size: 2.8rem; font-weight: 700;
  line-height: 1.1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 13.5px; color: var(--muted); }

/* ---------- Platform map ---------- */
.map-card {
  box-shadow: var(--shadow-soft);
  padding: 18px 18px 22px;
}
.map-wrap { overflow-x: auto; }
#platformMap { width: 100%; min-width: 660px; height: auto; display: block; }

.pm-grad-a { stop-color: var(--accent); }
.pm-grad-b { stop-color: var(--accent-2); }

.pm-path {
  fill: none; stroke-width: 1.6;
  stroke: var(--border-strong);
  transition: stroke 0.5s ease, opacity 0.5s ease;
}
.pm-path.active {
  stroke: url(#pmGrad); stroke-width: 2;
  stroke-dasharray: 6 7;
  animation: dashflow 1.4s linear infinite;
}
.pm-path.standby { stroke: var(--border-strong); stroke-dasharray: 3 7; opacity: 0.55; }
.pm-path.dead { opacity: 0.18; animation: none; stroke: var(--red); stroke-dasharray: 2 6; }

.pm-circle, .pm-box {
  fill: var(--card-2);
  stroke: var(--border-strong); stroke-width: 1;
  transition: stroke 0.5s ease, fill 0.5s ease;
}
[data-theme="light"] .pm-circle, [data-theme="light"] .pm-box { fill: var(--card-2); }
.pm-label { fill: var(--text); font-family: var(--font-display); font-size: 14px; font-weight: 600; }
.pm-sub { fill: var(--muted); font-family: var(--font-mono); font-size: 10.5px; }
.pm-ico { fill: var(--accent); font-size: 17px; }
.pm-az rect {
  fill: var(--tint);
  stroke: var(--tint-strong);
  stroke-width: 1;
  transition: fill 0.5s ease, stroke 0.5s ease;
}
.pm-az text { fill: var(--accent); font-family: var(--font-mono); font-size: 10.5px; }
.pm-kpi-label { fill: var(--faint); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
.pm-kpi-value { fill: var(--text); font-family: var(--font-display); font-size: 17px; font-weight: 600; }

.pm-region .pm-region-box { stroke: var(--mint-dim); }
.pm-region.standby .pm-region-box { stroke: var(--border-strong); }
.pm-region.impaired .pm-region-box { stroke: var(--amber-dim); }
.pm-region.impaired .pm-az rect { fill: rgba(255, 159, 10, 0.12); stroke: var(--amber-dim); }
.pm-region.impaired .pm-az text { fill: var(--amber); }
.pm-region.promoted .pm-region-box { stroke: var(--mint); }

#mapBHState, #mapEUState { transition: fill 0.4s ease; }
.pm-region.impaired #mapBHState { fill: var(--amber); }
.pm-region.promoted #mapEUState { fill: var(--mint); }

.pm-packet { fill: var(--accent); }
.pm-packet.alt { fill: var(--teal); }

.map-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  padding: 16px 10px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.map-status { margin: 0; font-size: 12.5px; color: var(--muted); flex: 1; min-width: 240px; }
.map-status.ok { color: var(--mint); }
.map-status.warn { color: var(--amber); }
.map-note { margin: 18px 4px 0; font-size: 11.5px; color: var(--faint); }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.skill-card {
  padding: 24px;
  transition: transform 0.45s var(--ease), box-shadow 0.45s ease;
}
.skill-card:hover { box-shadow: var(--shadow-soft), var(--glow); }
.skill-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px; color: var(--accent);
}
.skill-head h3 {
  margin: 0; font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 600; color: var(--text);
  letter-spacing: -0.01em;
}
.skill-note {
  margin-left: auto; font-size: 10.5px; font-weight: 600;
  color: var(--mint);
  background: rgba(48, 209, 88, 0.14);
  padding: 3px 10px; border-radius: 999px;
}
[data-theme="light"] .skill-note { background: rgba(52, 199, 89, 0.14); }

.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags span {
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--muted);
  background: var(--fill);
  padding: 5px 11px; border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.3s var(--ease);
  cursor: default;
}
.tags span:hover { color: var(--accent); background: var(--tint); transform: translateY(-2px); }
.tags .tag-soft { opacity: 0.68; }

/* ---------- Experience / timeline ---------- */
.timeline {
  list-style: none; margin: 0; padding: 0;
  position: relative;
  --tl: 0;
}
.timeline::before {
  content: ""; position: absolute; top: 6px; bottom: 6px; left: 8px;
  width: 2px; border-radius: 2px;
  background: var(--fill-2);
}
.timeline::after {
  content: ""; position: absolute; top: 6px; left: 8px;
  width: 2px; border-radius: 2px;
  height: calc(var(--tl) * (100% - 12px));
  background: linear-gradient(var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--tint-strong);
}
.tl-item { position: relative; padding: 0 0 36px 46px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-marker {
  position: absolute; left: 0; top: 6px; z-index: 1;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg-0);
  border: 2px solid var(--border-strong);
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}
.tl-marker::after {
  content: ""; position: absolute; inset: 4px;
  border-radius: 50%; background: var(--border-strong);
  transition: background-color 0.5s ease, transform 0.5s var(--ease);
  transform: scale(0.6);
}
.tl-item.lit .tl-marker {
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--tint-strong);
}
.tl-item.lit .tl-marker::after { background: var(--accent); transform: scale(1); }

.tl-card {
  padding: 26px 28px;
  transition: transform 0.45s var(--ease), box-shadow 0.45s ease;
}
.tl-card:hover { transform: translateX(8px); box-shadow: var(--shadow-soft); }
.tl-date { font-size: 12px; color: var(--accent); letter-spacing: 0.05em; font-weight: 600; }
.tl-card h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.28rem; margin: 6px 0 2px; letter-spacing: -0.015em;
}
.tl-org { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.tl-card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14.5px; }
.tl-card ul li { margin-bottom: 8px; }
.tl-card ul li::marker { color: var(--accent); }
.tl-card ul strong { color: var(--text); }
.tl-tags { margin-top: 14px; }

/* ---------- Projects ---------- */
.projects-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.proj-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 26px;
  transition: transform 0.45s var(--ease), box-shadow 0.45s ease;
}
.proj-card:hover { box-shadow: var(--shadow-soft), var(--glow); }
.proj-card.featured {
  border-color: var(--tint-strong);
  background: linear-gradient(165deg, var(--tint), var(--card) 60%);
}
[data-theme="light"] .proj-card.featured { border: 1px solid var(--tint-strong); }
.proj-kicker { font-size: 11px; letter-spacing: 0.09em; color: var(--accent); margin: 0; text-transform: uppercase; font-weight: 600; }
.proj-card h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.16rem; line-height: 1.32; margin: 0; letter-spacing: -0.015em;
}
.proj-card p:not(.proj-kicker) { color: var(--muted); font-size: 14px; margin: 0; flex: 1; line-height: 1.6; }

/* ---------- Certifications ---------- */
.certs-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.cert-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 32px 22px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s ease;
}
.cert-card:hover { box-shadow: var(--shadow-soft); }
.cert-card.placeholder { border: 1px dashed var(--border-strong); opacity: 0.7; box-shadow: none; }
.cert-badge {
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--accent);
  background: var(--tint);
}
.cert-card h3 { margin: 6px 0 0; font-size: 1rem; font-family: var(--font-display); font-weight: 600; }
.cert-card p { margin: 0; font-size: 12px; color: var(--faint); }

/* ---------- Education ---------- */
.education { padding-top: 30px; }
.edu-card {
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 28px 30px;
}
.edu-card h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.edu-card .tl-org { margin-bottom: 8px; }
.edu-fyp { margin: 0; color: var(--faint); font-size: 13.5px; }
.edu-badges { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Contact (iOS inset grouped list) ---------- */
.contact-grid {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 44px; align-items: start;
}
.contact-channels {
  display: grid; gap: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
[data-theme="light"] .contact-channels { border-color: transparent; box-shadow: var(--shadow-soft); }
.channel {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 13.5px; line-height: 1.5;
  transition: background-color 0.2s ease;
  margin: 0;
}
.channel:last-child { border-bottom: none; }
a.channel:hover { background: var(--fill); }
a.channel::after {
  content: "›";
  margin-left: auto;
  font-size: 20px; line-height: 1;
  color: var(--faint);
}
.channel svg { color: var(--accent); flex: none; }
.channel strong { color: var(--text); font-size: 14px; }

.contact-form {
  padding: 30px;
  box-shadow: var(--shadow-soft);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; color: var(--muted); }
.field input, .field textarea {
  font-family: var(--font-body); font-size: 15px;
  color: var(--text);
  background: var(--fill);
  border: 1px solid transparent; border-radius: 12px;
  padding: 13px 15px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 4px var(--tint);
}
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--red); }

/* honeypot — visually removed, still in DOM for bots */
.hp-field {
  position: absolute !important;
  left: -9999px !important; top: -9999px !important;
  height: 1px; width: 1px; overflow: hidden;
}

#cfSubmit { width: 100%; }
#cfSubmit:disabled { opacity: 0.6; cursor: wait; transform: none !important; }

.form-status { min-height: 22px; margin: 12px 0 0; font-size: 13.5px; }
.form-status.ok { color: var(--mint); }
.form-status.err { color: var(--red); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.footer p { margin: 0; font-size: 12.5px; color: var(--faint); }
.footer-status { display: inline-flex; align-items: center; gap: 8px; }
#sessUptime { font-variant-numeric: tabular-nums; color: var(--muted); }

/* ---------- Chat widget (iMessage) ---------- */
.chat-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 240;
  width: 58px; height: 58px; border-radius: 50%;
  border: none;
  background: var(--grad); color: var(--on-accent);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: var(--glow), var(--shadow-soft);
  transition: transform 0.4s var(--ease), box-shadow 0.3s ease;
}
.chat-fab:hover { transform: translateY(-4px) scale(1.05); }
.chat-fab:active { transform: scale(0.94); }
.chat-fab .fab-close { display: none; }
.chat-fab[aria-expanded="true"] .fab-close { display: block; }
.chat-fab[aria-expanded="true"] .fab-open { display: none; }

.chat-panel {
  position: fixed; right: 24px; bottom: 96px; z-index: 240;
  width: min(394px, calc(100vw - 32px));
  height: min(604px, calc(100dvh - 132px));
  display: flex; flex-direction: column;
  background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(1.8);
  backdrop-filter: blur(26px) saturate(1.8);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(0.96);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  pointer-events: none;
}
.chat-panel.open { opacity: 1; transform: none; pointer-events: auto; }

.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
}
.chat-avatar {
  width: 38px; height: 38px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--grad); color: var(--on-accent);
  font-weight: 600; font-size: 14px;
}
.chat-title { display: flex; flex-direction: column; line-height: 1.3; }
.chat-title strong { font-family: var(--font-display); font-size: 15px; }
.chat-sub {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
}
.chat-close {
  margin-left: auto;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--fill); border: none; color: var(--muted);
  cursor: pointer; display: grid; place-items: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.chat-close:hover { color: var(--text); background: var(--fill-2); }

.chat-log {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin;
}
.msg {
  max-width: 84%;
  padding: 10px 15px;
  border-radius: 20px;
  font-size: 14.5px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
  animation: msg-in 0.35s var(--ease-expo);
}
.msg.bot {
  align-self: flex-start;
  background: #26262a;
  border-bottom-left-radius: 6px;
  color: #f5f5f7;
}
[data-theme="light"] .msg.bot { background: #e9e9eb; color: #1d1d1f; }
.msg.user {
  align-self: flex-end;
  background: linear-gradient(180deg, #ff6961, #ff453a);
  color: #ffffff;
  border-bottom-right-radius: 6px;
}
[data-theme="light"] .msg.user { background: linear-gradient(180deg, #f4443a, #e0281c); }
.msg.err { background: rgba(255, 69, 58, 0.14); color: var(--red); }

.typing { display: inline-flex; gap: 5px; padding: 14px; align-self: flex-start; }
.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  animation: typing 1.2s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

.chat-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 16px 12px;
}
.chat-chips button {
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  color: var(--accent);
  background: var(--tint); border: none;
  border-radius: 999px; padding: 8px 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.3s var(--ease);
}
.chat-chips button:hover { background: var(--tint-strong); transform: translateY(-2px); }

.chat-input {
  display: flex; gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.chat-input input {
  flex: 1;
  font-family: var(--font-body); font-size: 14.5px;
  color: var(--text);
  background: var(--fill);
  border: 1px solid transparent; border-radius: 999px;
  padding: 11px 17px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}
.chat-input input:focus {
  outline: none; border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 4px var(--tint);
}
.chat-send {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--grad); color: var(--on-accent);
  display: grid; place-items: center; cursor: pointer;
  transition: transform 0.3s var(--ease), opacity 0.2s ease;
}
.chat-send:hover { transform: scale(1.06); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.chat-note {
  margin: 0; padding: 0 16px 12px;
  font-size: 10.5px; color: var(--faint); text-align: center;
}

/* ---------- Geometric brand squares (nod to tasibali.com) ---------- */
.geo {
  position: absolute;
  border-radius: 8px;
  pointer-events: none;
  will-change: transform;
}
.geo.fill { background: var(--tint); }
.geo.line { border: 2px solid var(--tint-strong); }
.geo-h1 { width: 130px; height: 130px; top: 16%; right: 12%; transform: rotate(18deg); }
.geo-h2 { width: 54px; height: 54px; top: 64%; right: 30%; transform: rotate(-12deg); }
.geo-h3 { width: 84px; height: 84px; bottom: 12%; left: 8%; transform: rotate(24deg); }
.geo-a1 { width: 110px; height: 110px; top: 12%; left: -30px; transform: rotate(14deg); }
.geo-s1 { width: 140px; height: 140px; top: 8%; right: -40px; transform: rotate(-16deg); }
.geo-s2 { width: 60px; height: 60px; bottom: 14%; left: 4%; transform: rotate(22deg); }
.geo-c1 { width: 120px; height: 120px; top: 14%; left: -34px; transform: rotate(-14deg); }
@media (max-width: 640px) { .geo { display: none; } }

/* ---------- Portrait card ---------- */
.portrait {
  position: relative;
  margin: 0 0 14px;
}
.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  padding: 3px; /* gradient ring thickness */
  background: var(--grad);
  box-shadow: var(--glow), var(--shadow-soft);
  overflow: hidden;
}
.portrait-frame img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;          /* any photo size/ratio auto-crops to fit */
  object-position: center;
  border-radius: calc(var(--radius) - 3px);
  filter: grayscale(18%) saturate(1.02);
  transform: scale(1.001);
  transition: filter 0.6s ease, transform 0.8s var(--ease);
}
.portrait:hover .portrait-frame img { filter: none; transform: scale(1.035); }
.portrait figcaption {
  margin-top: 10px;
  font-size: 12px;
  color: var(--faint);
  text-align: center;
}
.portrait figcaption .p-prompt { color: var(--mint); font-weight: 600; }
.portrait .geo-p1 { width: 74px; height: 74px; top: -20px; right: -22px; transform: rotate(16deg); z-index: -1; }
.portrait .geo-p2 { width: 46px; height: 46px; bottom: 18px; left: -20px; transform: rotate(-14deg); z-index: -1; }

/* ---------- Services ---------- */
.services-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.svc-card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.45s var(--ease), box-shadow 0.45s ease;
}
[data-theme="light"] .svc-card { border-color: transparent; box-shadow: var(--shadow-soft); }
.svc-card:hover { box-shadow: var(--shadow-soft), var(--glow); }
.svc-ico {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--tint);
  color: var(--accent);
}
.svc-num {
  position: absolute; top: 20px; right: 22px;
  font-size: 11px; color: var(--faint); letter-spacing: 0.08em;
}
.svc-card h3 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 1.06rem; font-weight: 600; line-height: 1.35;
  letter-spacing: -0.01em;
}
.svc-card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.6; flex: 1; }
.svc-cta {
  margin-top: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 22px 26px;
  background: linear-gradient(165deg, var(--tint), var(--card) 60%);
  border: 1px solid var(--tint-strong);
  border-radius: var(--radius);
}
.svc-cta p { margin: 0; color: var(--text); font-weight: 500; }
.svc-cta span { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
@media (max-width: 1024px) { .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .services-grid { grid-template-columns: 1fr; } }

/* ---------- Keyframes ---------- */
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }
@keyframes bob-soft { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes typing { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-4px); opacity: 1; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes dashflow { to { stroke-dashoffset: -13; } }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes drift-a {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(9vw, 7vh) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate(0, 0) scale(1.08); }
  to { transform: translate(-8vw, -6vh) scale(0.96); }
}
@keyframes drift-c {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-10vw, 8vh) scale(1.18); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .skills-grid, .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { grid-template-columns: 1fr; gap: 42px; }
  .hero-term { max-width: 640px; }
}

@media (max-width: 900px) {
  .nav-burger { display: flex; }
  .nav-links {
    position: absolute; top: calc(var(--nav-h) + 10px); left: 0; right: 0;
    flex-direction: column; gap: 2px;
    padding: 12px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    backdrop-filter: blur(24px) saturate(1.8);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    transform: translateY(-8px) scale(0.98); opacity: 0; pointer-events: none;
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 13px 16px; font-size: 15px; border-radius: 14px; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-stats { position: static; grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .section { padding: 84px 0; }
  .skills-grid, .projects-grid, .certs-grid { grid-template-columns: 1fr; }
  .pillars, .form-row { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .hero { padding-top: calc(var(--nav-h) + 44px); }
  .hero-ctas .btn { flex: 1 1 auto; }
  .term-body { min-height: 250px; max-height: 250px; font-size: 11.5px; }
  .chat-panel { right: 16px; bottom: 90px; }
  .chat-fab { right: 16px; bottom: 18px; }
  .glyph, .watermark { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html.js .reveal { opacity: 1; transform: none; filter: none; }
  [data-parallax] { transform: none !important; }
  .marquee-track { animation: none; }
  .spotlight { display: none; }
  .aurora i { animation: none; }
  .pm-path.active { animation: none; }
}
