/* ==========================================================================
   Yassine Naanani — Portfolio UI (2025)
   Modern, responsive, accessible. Designed for GitHub Pages.
   ========================================================================== */

:root {
  --bg: #0b0f1a;
  --bg-elev: rgba(255, 255, 255, 0.03);
  --card: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text: #e7e9ee;
  --muted: rgba(231, 233, 238, 0.72);

  --accent: #6c63ff;
  --accent-2: #22d3ee;
  --good: #10b981;

  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1120px;

  --header-h: 74px;
}

html[data-theme="light"] {
  --bg: #f7f8fc;
  --bg-elev: rgba(0, 0, 0, 0.03);
  --card: rgba(255, 255, 255, 0.75);
  --border: rgba(10, 14, 25, 0.12);
  --border-strong: rgba(10, 14, 25, 0.20);
  --text: #0b1220;
  --muted: rgba(11, 18, 32, 0.65);
  --shadow: 0 30px 80px rgba(10, 14, 25, 0.12);
}

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

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  background: radial-gradient(1400px 900px at 15% 12%, rgba(108, 99, 255, 0.24), transparent 58%),
    radial-gradient(1200px 820px at 88% 18%, rgba(34, 211, 238, 0.17), transparent 62%),
    radial-gradient(900px 760px at 55% 100%, rgba(16, 185, 129, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 30%),
    var(--bg);
  background-size: 200% 200%, 200% 200%, 200% 200%, 100% 100%;
  background-position: 0% 0%, 100% 0%, 0% 100%, 0% 0%;
  animation: bgShift 18s ease-in-out infinite alternate;
  overflow-x: hidden;
}

@keyframes bgShift {
  0% {
    background-position: 0% 0%, 100% 0%, 0% 100%, 0% 0%;
  }
  100% {
    background-position: 100% 100%, 0% 100%, 100% 0%, 0% 0%;
  }
}

/* Subtle grid overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.12;
  mask-image: radial-gradient(800px 500px at 50% 0%, #000 35%, transparent 70%);
}

/* Spotlight follows cursor (updated via JS, falls back to center) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(600px 420px at var(--mx, 50%) var(--my, 15%), rgba(108, 99, 255, 0.18), transparent 60%);
  opacity: 0.45;
}

#fx-cursor {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

/* Page transitions + scroll progress */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(1000px 620px at 20% 10%, rgba(108, 99, 255, 0.35), transparent 60%),
    radial-gradient(900px 600px at 85% 15%, rgba(34, 211, 238, 0.22), transparent 62%),
    radial-gradient(800px 560px at 55% 95%, rgba(16, 185, 129, 0.14), transparent 62%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.78));
  transition: opacity 260ms ease;
}

.page-transition.is-active {
  opacity: 1;
  pointer-events: auto;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1002;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}

.scroll-progress.is-hidden {
  opacity: 0;
}

.scroll-progress__bar {
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(var(--scroll-progress, 0));
  background: linear-gradient(90deg, rgba(108, 99, 255, 0.95), rgba(34, 211, 238, 0.92), rgba(16, 185, 129, 0.85));
  background-size: 220% 100%;
  animation: progressGlow 4s linear infinite;
}

@keyframes progressGlow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

/* Intro loader (explosion reveal) */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  pointer-events: auto;
  opacity: 1;
  --intro-p: 0;
  background: var(--bg);
}

.intro-overlay.is-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.intro-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.intro-ghosts {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.intro-ghost {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  transform-origin: 0 0;
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  opacity: 0;
  filter: saturate(1.08) contrast(1.05);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.42);
  will-change: transform, opacity, filter;
}

.intro-ghost::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.32));
  pointer-events: none;
  opacity: 0.85;
}

.intro-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 22px 18px;
}

.intro-mark {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: visible;
  background: radial-gradient(circle at 30% 30%, rgba(34, 211, 238, 0.28), rgba(108, 99, 255, 0.26));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 26px 78px rgba(108, 99, 255, 0.24);
  animation: introBreathe 980ms ease-in-out infinite alternate;
}

.intro-mark::before {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 999px;
  background: repeating-conic-gradient(from -90deg, rgba(255, 255, 255, 0.12) 0deg 2deg, rgba(255, 255, 255, 0) 2deg 12deg);
  opacity: 0.34;
  filter: blur(0.2px);
  transform-origin: 50% 50%;
  animation: introTicks 3.8s linear infinite;
  -webkit-mask: radial-gradient(farthest-side, rgba(0, 0, 0, 0) calc(100% - 10px), #000 calc(100% - 9px));
  mask: radial-gradient(farthest-side, rgba(0, 0, 0, 0) calc(100% - 10px), #000 calc(100% - 9px));
}

.intro-mark::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 999px;
  --_p: var(--intro-p, 0);
  --_a: calc(var(--_p) * 1turn);
  background: conic-gradient(
    from -90deg,
    rgba(34, 211, 238, 0.95) 0turn,
    rgba(108, 99, 255, 0.95) var(--_a),
    rgba(255, 255, 255, 0.12) var(--_a),
    rgba(255, 255, 255, 0.12) 1turn
  );
  opacity: 0.92;
  filter: drop-shadow(0 0 18px rgba(34, 211, 238, 0.26)) drop-shadow(0 0 22px rgba(108, 99, 255, 0.22));
  -webkit-mask: radial-gradient(farthest-side, rgba(0, 0, 0, 0) calc(100% - 10px), #000 calc(100% - 9px));
  mask: radial-gradient(farthest-side, rgba(0, 0, 0, 0) calc(100% - 10px), #000 calc(100% - 9px));
}

.intro-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  margin-top: -5px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(34, 211, 238, 0.92));
  box-shadow: 0 0 0 2px rgba(11, 15, 26, 0.85), 0 0 18px rgba(34, 211, 238, 0.36), 0 0 24px rgba(108, 99, 255, 0.22);
  transform-origin: 50% 50%;
  transform: rotate(calc(-90deg + var(--intro-p, 0) * 1turn)) translateY(-66px);
  animation: introDotPulse 540ms ease-in-out infinite alternate;
}

.intro-mark-text {
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 1.45rem;
  position: relative;
  z-index: 2;
}

.intro-line {
  color: rgba(231, 233, 238, 0.74);
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(231, 233, 238, 0.16), rgba(34, 211, 238, 0.14), rgba(108, 99, 255, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 14px 46px rgba(34, 211, 238, 0.10);
}

.intro-line.is-flash {
  animation: introLineFlash 260ms ease-out;
}

.intro-progress {
  width: min(340px, 82vw);
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
}

.intro-progress::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.10) 0 1px, rgba(255, 255, 255, 0) 1px 10px);
  opacity: 0.25;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.intro-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(var(--intro-p, 0));
  background: linear-gradient(90deg, rgba(108, 99, 255, 0.95), rgba(34, 211, 238, 0.92), rgba(16, 185, 129, 0.85));
  background-size: 220% 100%;
  animation: progressGlow 3.2s linear infinite;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.28), 0 0 28px rgba(108, 99, 255, 0.18);
  position: relative;
}

.intro-progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  transform: translateX(-70%);
  animation: introBusSweep 820ms ease-in-out infinite;
  opacity: 0.55;
  pointer-events: none;
}

.intro-percent {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight: 900;
  letter-spacing: 0.18em;
  font-size: 0.88rem;
  color: rgba(231, 233, 238, 0.78);
  text-shadow: 0 0 14px rgba(34, 211, 238, 0.18);
}

@keyframes introTicks {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes introDotPulse {
  from {
    filter: brightness(0.95);
    transform: rotate(calc(-90deg + var(--intro-p, 0) * 1turn)) translateY(-66px) scale(0.92);
  }
  to {
    filter: brightness(1.12);
    transform: rotate(calc(-90deg + var(--intro-p, 0) * 1turn)) translateY(-66px) scale(1.06);
  }
}

@keyframes introBusSweep {
  0% {
    transform: translateX(-70%);
  }
  60% {
    transform: translateX(110%);
  }
  100% {
    transform: translateX(110%);
  }
}

@keyframes introLineFlash {
  0% {
    filter: blur(0.6px) brightness(1.25);
    transform: translateY(-2px);
  }
  100% {
    filter: blur(0px) brightness(1);
    transform: translateY(0px);
  }
}

.intro-sub {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
  max-width: 52ch;
  line-height: 1.6;
}

.intro-overlay.is-exploding .intro-center {
  animation: introPop 520ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes introBreathe {
  from {
    transform: translateY(0) scale(1);
    filter: saturate(1.05);
  }
  to {
    transform: translateY(-3px) scale(1.03);
    filter: saturate(1.15);
  }
}

@keyframes introPop {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  70% {
    transform: translateY(-6px) scale(1.06);
    opacity: 1;
  }
  100% {
    transform: translateY(-16px) scale(1.10);
    opacity: 0;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

input,
textarea,
select,
option,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

.container {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  transform: translateY(-150%);
  transition: transform 180ms ease;
  z-index: 1200;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid rgba(108, 99, 255, 0.6);
  outline-offset: 2px;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  transition: height 260ms ease, border-color 260ms ease, background 260ms ease, backdrop-filter 260ms ease;
}

.site-header.is-hidden {
  height: 0;
  border-bottom-color: transparent;
  background: transparent;
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  overflow: hidden;
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: opacity 220ms ease, transform 220ms ease;
}

.site-header.is-hidden .header-inner {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  background: radial-gradient(60% 80% at 30% 20%, rgba(34, 211, 238, 0.55), transparent 60%),
    radial-gradient(70% 90% at 70% 40%, rgba(108, 99, 255, 0.65), transparent 55%),
    rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.brand-mark-sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.brand-name {
  font-weight: 600;
  letter-spacing: -0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.nav-list {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  --nav-x: 0px;
  --nav-w: 0px;
  --nav-h: 40px;
  --nav-o: 0;
}

.nav-list::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: var(--nav-w);
  height: var(--nav-h);
  transform: translate(var(--nav-x), -50%);
  border-radius: 14px;
  background: rgba(108, 99, 255, 0.14);
  border: 1px solid rgba(108, 99, 255, 0.28);
  opacity: var(--nav-o);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), width 260ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 180ms ease;
  pointer-events: none;
}

.nav-list a {
  color: var(--muted);
  font-weight: 500;
  padding: 10px 10px;
  border-radius: 12px;
  transition: background 180ms ease, color 180ms ease;
  position: relative;
  z-index: 1;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.nav-list a.is-active {
  color: var(--text);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

.nav-toggle-label {
  font-weight: 600;
}

.nav-toggle-bars {
  width: 18px;
  height: 12px;
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.nav-toggle-bars::before {
  top: 0;
}

.nav-toggle-bars::after {
  bottom: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: transform 150ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

/* Hover dock navigation (appears on scroll, expands on hover "Terminator" style) */
.nav-dock {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  transform: translateX(-50%) translateY(-14px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  z-index: 1100;
  width: 92px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: radial-gradient(520px 260px at var(--px, 50%) var(--py, 50%), rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(520px 260px at var(--px, 50%) var(--py, 50%), rgba(108, 99, 255, 0.10), transparent 66%),
    color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transition: opacity 220ms ease, transform 220ms ease, width 520ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 220ms ease;
}

.nav-dock.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.nav-dock.is-open {
  width: 760px;
  max-width: calc(100% - 24px);
  border-color: color-mix(in srgb, var(--accent-2) 45%, var(--border));
}

.nav-dock::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.05) 0px,
      rgba(255, 255, 255, 0.05) 1px,
      rgba(255, 255, 255, 0.0) 3px,
      rgba(255, 255, 255, 0.0) 6px
    ),
    radial-gradient(900px 520px at 20% 0%, rgba(34, 211, 238, 0.10), transparent 60%),
    radial-gradient(900px 520px at 90% 20%, rgba(108, 99, 255, 0.10), transparent 60%);
  opacity: 0;
  pointer-events: none;
}

.nav-dock::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -60%;
  width: 40%;
  height: 180%;
  background: linear-gradient(120deg, transparent, rgba(34, 211, 238, 0.18), transparent);
  transform: rotate(12deg);
  opacity: 0;
  pointer-events: none;
}

.nav-dock.is-open::before {
  opacity: 0.95;
  animation: dockScan 740ms ease;
}

.nav-dock.is-open::after {
  opacity: 1;
  animation: dockSweep 900ms ease;
}

@keyframes dockScan {
  0% {
    opacity: 0;
    filter: blur(8px);
  }
  30% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 0.95;
    filter: blur(0);
  }
}

@keyframes dockSweep {
  0% {
    transform: translateX(0) rotate(12deg);
  }
  100% {
    transform: translateX(420%) rotate(12deg);
  }
}

.nav-dock-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px;
  position: relative;
  z-index: 1;
}

.nav-dock.is-open .nav-dock-inner {
  gap: 10px;
}

.nav-dock-toggle {
  height: 42px;
  width: auto;
  min-width: 52px;
  padding: 0 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 60%, transparent);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

.nav-dock-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.nav-dock-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: radial-gradient(60% 80% at 30% 20%, rgba(34, 211, 238, 0.60), transparent 60%),
    radial-gradient(70% 90% at 70% 40%, rgba(108, 99, 255, 0.70), transparent 55%),
    rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.nav-dock-mini {
  font-weight: 900;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--muted);
  display: none;
  white-space: nowrap;
}

.nav-dock.is-open .nav-dock-mini {
  display: inline-block;
  animation: dockMiniIn 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes dockMiniIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0);
  }
}

.nav-dock-panel {
  flex: 0 0 auto;
  width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  opacity: 0;
  transform: translateX(-10px);
  pointer-events: none;
  transition: opacity 220ms ease 170ms, transform 220ms ease 170ms, width 0ms linear 220ms;
}

.nav-dock.is-open .nav-dock-panel {
  flex: 1 1 auto;
  width: auto;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  transition: opacity 220ms ease 170ms, transform 220ms ease 170ms, width 0ms linear 0ms;
}

.nav-dock-panel .theme-toggle {
  border-radius: 999px;
  flex: 0 0 auto;
}

.nav-dock-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-dock-list a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 55%, transparent);
  color: var(--muted);
  font-weight: 900;
  letter-spacing: -0.01em;
  font-size: 0.92rem;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
  will-change: transform;
  transform: translateY(0);
}

.nav-dock.is-open .nav-dock-list a {
  animation: dockItemIn 340ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

@keyframes dockItemIn {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.nav-dock-list a:hover,
.nav-dock-list a:focus-visible {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent-2) 40%, var(--border));
  transform: translateY(-1px);
  outline: none;
}

.nav-dock-list a.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.nav-dock-list i {
  opacity: 0.92;
}

@media (max-width: 820px) {
  .nav-dock {
    top: 10px;
  }

  .nav-dock.is-open {
    width: calc(100% - 20px);
  }

  .nav-dock-list a span {
    display: none;
  }
}

@media (max-width: 520px) {
  .brand-name {
    display: none;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(240px 170px at var(--px, 50%) var(--py, 50%), rgba(34, 211, 238, 0.20), transparent 60%);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
  z-index: 0;
}

.btn::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -120%;
  width: 70%;
  height: 220%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: rotate(12deg);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.btn:hover::before {
  opacity: 1;
}

.btn:hover::after {
  opacity: 1;
  animation: btnShine 900ms ease;
}

@keyframes btnShine {
  0% {
    transform: translateX(0) rotate(12deg);
  }
  100% {
    transform: translateX(340%) rotate(12deg);
  }
}

.btn-inner {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transform: translate3d(var(--dx, 0px), var(--dy, 0px), 0);
  will-change: transform;
  transition: transform 140ms ease;
}

.btn.magnetic:hover .btn-inner {
  transition: transform 50ms linear;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.btn:focus-visible {
  outline: 2px solid rgba(108, 99, 255, 0.55);
  outline-offset: 2px;
}

.btn-sm {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.85), rgba(34, 211, 238, 0.65));
  border-color: rgba(108, 99, 255, 0.45);
  box-shadow: 0 14px 40px rgba(108, 99, 255, 0.18);
}

.btn-primary:hover {
  border-color: rgba(34, 211, 238, 0.55);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
}

/* Hero */
.hero {
  padding: 56px 0 20px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 26px;
  align-items: start;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px 0;
  color: var(--muted);
  font-weight: 500;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, var(--accent-2), var(--accent));
  box-shadow: 0 0 0 6px rgba(108, 99, 255, 0.16);
}

.sep {
  opacity: 0.6;
}

h1 {
  margin: 0 0 14px 0;
  font-size: clamp(2.2rem, 3.6vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1.06;
}

.muted {
  color: var(--muted);
}

.hero-sub {
  margin: 0 0 20px 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.65;
  max-width: 60ch;
}

.hero-rotator {
  margin: 0 0 18px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-weight: 600;
}

.rotator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 800;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

/* (removed) hero metrics */

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

.hero-card {
  position: relative;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow);
  overflow: hidden;
  --rx: 0deg;
  --ry: 0deg;
  --ty: 0px;
  transform: translateY(var(--ty));
  transition: transform 160ms ease, border-color 160ms ease;
}

.hero-card.tilt {
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--ty));
  transform-style: preserve-3d;
  will-change: transform;
}

.hero-card:hover {
  --ty: -2px;
  border-color: rgba(108, 99, 255, 0.30);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  background: radial-gradient(420px 240px at var(--hx, 50%) var(--hy, 20%), rgba(108, 99, 255, 0.20), transparent 60%);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.hero-card:hover::after {
  opacity: 1;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(900px 220px at 30% 0%, rgba(108, 99, 255, 0.18), transparent 55%),
    radial-gradient(900px 240px at 90% 15%, rgba(34, 211, 238, 0.12), transparent 60%);
  pointer-events: none;
}

.hero-card-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
}

.hero-card-id .name {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-card-id .role {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 600;
}

.hero-card-id .link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-card-id .link:hover {
  color: var(--text);
}

.hero-card-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

/* Sections */
.section {
  padding: 56px 0;
}

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.grid {
  display: grid;
  gap: 14px;
}

.cards-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 16px 55px rgba(0, 0, 0, 0.20);
  transition: transform 160ms ease, border-color 160ms ease;
  position: relative;
  overflow: hidden;
  --rx: 0deg;
  --ry: 0deg;
  --ty: 0px;
  transform: translateY(var(--ty));
}

.card-link {
  display: block;
  color: inherit;
  cursor: pointer;
}

.card-link:focus-visible {
  outline: 2px solid rgba(108, 99, 255, 0.55);
  outline-offset: 2px;
}

.card.tilt {
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--ty));
  transform-style: preserve-3d;
  will-change: transform;
}

.card:hover {
  --ty: -2px;
  border-color: rgba(108, 99, 255, 0.30);
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  background: radial-gradient(420px 240px at var(--hx, 50%) var(--hy, 20%), rgba(34, 211, 238, 0.16), transparent 60%);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(108, 99, 255, 0.16);
  border: 1px solid rgba(108, 99, 255, 0.22);
  margin-bottom: 12px;
}

.card h3 {
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

/* Stack */
.stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stack-col {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}

.stack-col h3 {
  margin: 0 0 10px 0;
  font-size: 1.05rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

/* Projects */
.section-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.project-card {
  padding: 0;
}

.project-media {
  position: relative;
  aspect-ratio: 1200 / 630;
  border-bottom: 1px solid var(--border);
  --c1: 108 99 255;
  --c2: 34 211 238;
  background: radial-gradient(900px 420px at 20% 0%, rgb(var(--c1) / 0.24), transparent 55%),
    radial-gradient(720px 420px at 100% 35%, rgb(var(--c2) / 0.18), transparent 60%),
    linear-gradient(135deg, rgb(var(--c1) / 0.08), rgb(var(--c2) / 0.06)),
    rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.project-media::before {
  content: "";
  position: absolute;
  inset: -40% -40%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: translateX(-60%) rotate(12deg);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.project-card:hover .project-media::before {
  opacity: 1;
  animation: mediaShine 1000ms ease;
}

@keyframes mediaShine {
  0% {
    transform: translateX(-60%) rotate(12deg);
  }
  100% {
    transform: translateX(60%) rotate(12deg);
  }
}

.project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.55));
  opacity: 1;
  pointer-events: none;
  z-index: 1;
}

.project-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.03);
  filter: saturate(1.12) contrast(1.03);
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 0;
}

.project-media.is-fallback .project-img {
  display: none;
}

.project-cover-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.12);
  background: rgb(0 0 0 / 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgb(255 255 255 / 0.88);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.project-card:hover .project-img {
  transform: scale(1.08);
}

.project-body {
  padding: 16px 16px 18px;
}

.cards-3 .project-card.featured {
  grid-column: span 2;
}

@media (max-width: 980px) {
  .cards-3 .project-card.featured {
    grid-column: span 1;
  }
}

.project-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.project-title h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.project-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
}

.project-desc {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 12px 0;
}

.project-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag {
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Skeleton loader */
.skeleton {
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.1s infinite;
}

.skeleton-line {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  margin: 10px 0;
}

.skeleton-thumb {
  aspect-ratio: 1200 / 630;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid var(--border);
}

/* Certifications */
.cert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.cert-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.cert-stat {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-weight: 800;
}

.cert-stat strong {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: -0.02em;
}

.cert-filters {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.86rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  outline: none;
}

.field textarea {
  resize: vertical;
  min-height: 140px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(108, 99, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.14);
}

.cert-count {
  justify-self: end;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-weight: 800;
}

/* Backwards-compatible: skeleton layout uses .project-body inside cert cards */
.cert-card .project-body {
  padding: 16px 16px 18px;
}

.cert-card {
  padding: 0;
  overflow: hidden;
}

.cert-media {
  position: relative;
  height: 96px;
  border-bottom: 1px solid var(--border);
  --c1: 108 99 255;
  --c2: 34 211 238;
  background: radial-gradient(900px 320px at 20% 0%, rgb(var(--c1) / 0.26), transparent 55%),
    radial-gradient(720px 320px at 100% 40%, rgb(var(--c2) / 0.20), transparent 60%),
    linear-gradient(135deg, rgb(var(--c1) / 0.10), rgb(var(--c2) / 0.08)),
    rgba(255, 255, 255, 0.02);
}

.cert-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.10), rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.cert-badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.14);
  background: rgb(0 0 0 / 0.30);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgb(255 255 255 / 0.92);
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  max-width: calc(100% - 28px);
}

.cert-badge-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgb(255 255 255 / 0.10);
  border: 1px solid rgb(255 255 255 / 0.14);
  flex: 0 0 auto;
}

.cert-badge-icon i {
  font-size: 1.05rem;
}

.cert-badge-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cert-body {
  padding: 16px 16px 18px;
}

.cert-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cert-title h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.cert-issued {
  color: var(--muted);
  font-weight: 900;
  font-size: 0.9rem;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.cert-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cert-pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.82rem;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.cert-pill.is-expired {
  border-color: rgba(244, 114, 182, 0.35);
  background: rgba(244, 114, 182, 0.08);
  color: rgba(255, 255, 255, 0.86);
}

.cert-skills {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cert-links {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cert-empty {
  padding: 18px;
}

.cert-empty h3 {
  margin: 0 0 6px 0;
}

.cert-empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 980px) {
  .cert-filters {
    grid-template-columns: 1fr;
  }

  .cert-count {
    justify-self: start;
  }
}

.w-40 {
  width: 40%;
}

.w-45 {
  width: 45%;
}

.w-50 {
  width: 50%;
}

.w-55 {
  width: 55%;
}

.w-60 {
  width: 60%;
}

.w-65 {
  width: 65%;
}

.w-70 {
  width: 70%;
}

.w-80 {
  width: 80%;
}

.w-90 {
  width: 90%;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
  align-items: start;
}

.contact-cards {
  display: grid;
  gap: 12px;
}

.contact-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  position: relative;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease;
  --rx: 0deg;
  --ry: 0deg;
  --ty: 0px;
  transform: translateY(var(--ty));
}

.contact-card:hover {
  --ty: -1px;
  border-color: rgba(34, 211, 238, 0.30);
}

.contact-card.tilt {
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--ty));
  transform-style: preserve-3d;
  will-change: transform;
}

.contact-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  background: radial-gradient(380px 220px at var(--hx, 50%) var(--hy, 30%), rgba(108, 99, 255, 0.14), transparent 60%);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.contact-card:hover::before {
  opacity: 1;
}

.contact-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.18);
}

.contact-label {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.86rem;
}

.contact-value {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.contact-form {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}

.contact-form:hover {
  border-color: rgba(108, 99, 255, 0.22);
}

.contact-form label {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.contact-form span {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  font: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(231, 233, 238, 0.50);
  font-weight: 650;
}

html[data-theme="light"] input,
html[data-theme="light"] textarea {
  background: rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: rgba(11, 18, 32, 0.42);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(108, 99, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.12);
}

input:focus::placeholder,
textarea:focus::placeholder {
  color: rgba(231, 233, 238, 0.34);
}

/* Contact submit button animation states */
.contact-form .btn {
  width: 100%;
  justify-content: center;
}

.contact-form .btn .btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.92);
  display: none;
}

.contact-form .btn.is-loading .btn-spinner {
  display: inline-block;
  animation: spin 700ms linear infinite;
}

.contact-form .btn.is-loading {
  filter: saturate(1.08);
}

.contact-form .btn.is-sent {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.92), rgba(34, 211, 238, 0.55));
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 14px 44px rgba(16, 185, 129, 0.18);
}

.contact-form .btn.is-error {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.32);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-hint {
  margin: 10px 0 0;
  min-height: 1.2em;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

/* Thanks page (wow + centered + timed redirect) */
.thanks-screen {
  padding: 56px 0 70px;
}

.thanks-center {
  min-height: calc(100vh - var(--header-h) - 140px);
  display: grid;
  place-items: center;
}

.thanks-card {
  width: min(820px, 100%);
  padding: 30px 26px 22px;
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  text-align: center;
  animation: thanksFloat 5.2s ease-in-out infinite;
}

.thanks-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(
    from 180deg,
    rgba(108, 99, 255, 0.0),
    rgba(108, 99, 255, 0.22),
    rgba(34, 211, 238, 0.18),
    rgba(16, 185, 129, 0.14),
    rgba(108, 99, 255, 0.0)
  );
  opacity: 0.7;
  filter: blur(16px);
  transform: rotate(0deg);
  animation: thanksSpin 8s linear infinite;
  pointer-events: none;
}

.thanks-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(900px 520px at 20% 0%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(800px 520px at 90% 20%, rgba(108, 99, 255, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 40%);
  opacity: 0.9;
}

@keyframes thanksSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes thanksFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
  100% {
    transform: translateY(0);
  }
}

.thanks-badge {
  width: 86px;
  height: 86px;
  margin: 0 auto 10px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(34, 211, 238, 0.30), rgba(108, 99, 255, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 28px 70px rgba(108, 99, 255, 0.20);
  position: relative;
}

.thanks-badge::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 999px;
  border: 2px solid rgba(34, 211, 238, 0.26);
  opacity: 0.0;
  animation: thanksPulse 1.55s ease-in-out infinite;
}

@keyframes thanksPulse {
  0% {
    transform: scale(0.94);
    opacity: 0;
  }
  25% {
    opacity: 0.9;
  }
  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

.thanks-badge i {
  font-size: 2.2rem;
  color: rgba(255, 255, 255, 0.94);
  filter: drop-shadow(0 14px 30px rgba(34, 211, 238, 0.12));
}

.thanks-eyebrow {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

.thanks-title {
  margin: 10px 0 10px 0;
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  position: relative;
  z-index: 1;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(34, 211, 238, 0.88), rgba(108, 99, 255, 0.92));
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: thanksShimmer 2.8s ease-in-out infinite alternate;
}

@keyframes thanksShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

.thanks-sub {
  margin: 0 auto;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.thanks-countdown {
  width: min(560px, 100%);
  margin: 18px auto 0;
  padding: 12px 12px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  z-index: 1;
}

.thanks-countdown-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
}

.thanks-countdown-label {
  color: var(--muted);
}

.thanks-countdown-value {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: rgba(255, 255, 255, 0.92);
}

.thanks-progress {
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.thanks-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(1);
  background: linear-gradient(90deg, rgba(108, 99, 255, 0.95), rgba(34, 211, 238, 0.92), rgba(16, 185, 129, 0.85));
  background-size: 220% 100%;
  animation: progressGlow 4s linear infinite;
}

.thanks-screen.is-running .thanks-progress-bar {
  animation: thanksDrain var(--thanks-duration, 7s) linear forwards, progressGlow 4s linear infinite;
}

@keyframes thanksDrain {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.thanks-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.thanks-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
  position: relative;
  z-index: 1;
}

.thanks-links .btn-sm {
  border-radius: 999px;
}

@media (max-width: 820px) {
  .thanks-card {
    padding: 26px 18px 18px;
  }
}

/* Footer */
.site-footer {
  position: relative;
  border-top: 1px solid var(--border);
  padding: 46px 0 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 42%);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(34, 211, 238, 0.32),
    rgba(108, 99, 255, 0.32),
    transparent
  );
  opacity: 0.9;
  pointer-events: none;
}

.footer-cta {
  margin-bottom: 18px;
}

.footer-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 16px;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.30);
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease;
}

.footer-cta-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(520px 240px at 12% 20%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(520px 240px at 85% 20%, rgba(108, 99, 255, 0.18), transparent 60%);
  opacity: 0.85;
  pointer-events: none;
}

.footer-cta-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.18);
}

.footer-cta-copy {
  position: relative;
  z-index: 1;
}

.footer-cta-title {
  font-weight: 900;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
}

.footer-cta-sub {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.footer-cta-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.footer-right {
  display: flex;
  gap: 12px;
}

.footer-right a {
  color: var(--muted);
  font-weight: 700;
  padding: 10px 10px;
  border-radius: 12px;
}

.footer-right a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 820px) {
  .footer-cta-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-cta-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Responsive */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stack {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-list::before {
    display: none;
  }

  .nav-list {
    position: fixed;
    inset: calc(var(--header-h) + 10px) 12px auto 12px;
    max-height: calc(100dvh - var(--header-h) - 24px);
    overflow: auto;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease, visibility 0ms linear 220ms;
  }

  .nav-list.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    pointer-events: auto;
    transition: opacity 220ms ease, transform 220ms ease, visibility 0ms linear 0ms;
  }

  .header-actions .btn-sm {
    display: none;
  }

  .cards-3 {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  #fx-cursor {
    display: none;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  filter: blur(6px);
  transition: opacity 650ms ease, transform 650ms ease, filter 650ms ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform, filter;
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}



