:root {
      --bg-canvas: #0b101b;
      --bg-surface: #111827;
      --bg-elevated: #182236;
      --bg-card: rgba(23, 32, 51, 0.86);
      --text-primary: #f8fafc;
      --text-secondary: #cbd5e1;
      --text-muted: #94a3b8;
      --border-subtle: rgba(148, 163, 184, 0.18);
      --border-strong: rgba(212, 165, 116, 0.48);
      --accent-primary: #818cf8;
      --accent-secondary: #deb180;
      --accent-teal: #2dd4bf;
      --header-bg: rgba(11, 16, 27, 0.86);
      --ring-glow: rgba(129, 140, 248, 0.24);
      --hero-orb-1: rgba(99, 102, 241, 0.22);
      --hero-orb-2: rgba(212, 165, 116, 0.18);
      --shadow-card: 0 22px 48px -22px rgba(0, 0, 0, 0.72);
      --scroll-y: 0px;
      --scroll-progress: 0;
    }

    body.light-mode {
      --bg-canvas: #faf7f2;
      --bg-surface: #ffffff;
      --bg-elevated: #f3efe8;
      --bg-card: rgba(255, 255, 255, 0.95);
      --text-primary: #0f172a;
      --text-secondary: #334155;
      --text-muted: #475569;
      --border-subtle: rgba(15, 23, 42, 0.14);
      --border-strong: rgba(180, 125, 68, 0.5);
      --accent-primary: #4f46e5;
      --accent-secondary: #9a652e;
      --accent-teal: #0f766e;
      --header-bg: rgba(250, 247, 242, 0.9);
      --ring-glow: rgba(79, 70, 229, 0.16);
      --hero-orb-1: rgba(79, 70, 229, 0.12);
      --hero-orb-2: rgba(180, 125, 68, 0.16);
      --shadow-card: 0 18px 40px -22px rgba(15, 23, 42, 0.16);
    }

    body {
      font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
      font-size: 16px;
      line-height: 1.65;
      background-color: var(--bg-canvas);
      color: var(--text-primary);
      transition: background-color 0.4s cubic-bezier(0.22, 1, 0.36, 1), color 0.4s cubic-bezier(0.22, 1, 0.36, 1);
      overflow-x: clip;
    }

    .font-mono-code {
      font-family: 'JetBrains Mono', monospace;
    }

    .text-accent-gradient {
      background: linear-gradient(120deg, var(--accent-primary), #60a5fa 52%, var(--accent-secondary));
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }

    /* Top Scroll Progress Indicator */
    .scroll-progress-bar {
      position: fixed;
      top: 0;
      left: 0;
      height: 3px;
      width: 100%;
      z-index: 60;
      transform-origin: left center;
      transform: scaleX(var(--scroll-progress, 0));
      background: linear-gradient(90deg, var(--accent-primary), var(--accent-teal), var(--accent-secondary));
      pointer-events: none;
    }

    /* Page-Load Developer Intro Overlay */
    .dev-loader {
      position: fixed;
      inset: 0;
      z-index: 90;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 1.25rem;
      background: radial-gradient(circle at 25% 20%, rgba(99, 102, 241, 0.2), transparent 50%),
                  radial-gradient(circle at 80% 75%, rgba(222, 177, 128, 0.16), transparent 50%),
                  var(--bg-canvas);
      transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.55s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .dev-loader.is-done {
      opacity: 0;
      visibility: hidden;
      transform: translateY(-10px) scale(1.02);
      pointer-events: none;
    }

    @keyframes codeLineReveal {
      from {
        opacity: 0;
        transform: translateX(-10px);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }

    .code-line-anim {
      opacity: 0;
      animation: codeLineReveal 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }

    @keyframes progressSweep {
      0% {
        transform: translateX(-100%);
      }
      100% {
        transform: translateX(100%);
      }
    }

    .loader-bar-fill {
      animation: progressSweep 1.05s cubic-bezier(0.22, 1, 0.36, 1) infinite;
    }

    /* Moving Colorful Border on Key Elements / Sections */
    @property --border-angle {
      syntax: "<angle>";
      initial-value: 0deg;
      inherits: false;
    }

    @keyframes spinBorderAngle {
      to {
        --border-angle: 360deg;
      }
    }

    .moving-border-box {
      position: relative;
      z-index: 0;
    }

    .moving-border-box::before {
      content: "";
      position: absolute;
      inset: -1.5px;
      border-radius: inherit;
      padding: 1.5px;
      background: conic-gradient(
        from var(--border-angle, 0deg),
        #818cf8,
        #2dd4bf,
        #deb180,
        #f472b6,
        #60a5fa,
        #818cf8
      );
      -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      -webkit-mask-composite: xor;
      mask-composite: exclude;
      opacity: 0.35;
      transition: opacity 0.35s ease;
      pointer-events: none;
      z-index: 1;
      animation: spinBorderAngle 4.5s linear infinite;
    }

    .moving-border-box:hover::before,
    .moving-border-box:focus-within::before {
      opacity: 1;
    }

    .btn-primary-gradient {
      background: linear-gradient(125deg, #4f46e5 0%, #6366f1 55%, #b47d44 135%);
      color: #ffffff;
      box-shadow: 0 12px 26px -8px rgba(79, 70, 229, 0.55);
      transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, filter 0.3s ease;
    }

    .btn-primary-gradient:hover {
      filter: brightness(1.08);
      transform: translateY(-2px) scale(1.01);
      box-shadow: 0 16px 32px -8px rgba(79, 70, 229, 0.68);
    }

    .btn-primary-gradient:active {
      transform: translateY(0) scale(0.98);
    }

    /* 3D Tilt & Scroll-Reactive Card System */
    .surface-card {
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      box-shadow: var(--shadow-card);
      backdrop-filter: blur(12px);
      transform-style: preserve-3d;
      transition:
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.3s ease,
        box-shadow 0.38s ease;
    }

    .surface-card:hover {
      border-color: var(--border-strong);
      box-shadow: 0 26px 54px -22px rgba(0, 0, 0, 0.78);
    }

    /* Multi-Layer 3D Portrait Rig (No Top Clipping, Visible 3D Planes) */
    .dp-3d-perspective {
      perspective: 1400px;
    }

    .dp-3d-rig {
      transform-style: preserve-3d;
      transform:
        rotateX(var(--tilt-x, 0deg))
        rotateY(var(--tilt-y, 0deg))
        translate3d(0, calc(var(--scroll-y) * -0.04), 0);
      transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
      will-change: transform;
    }

    .dp-plane-back {
      transform:
        translateZ(-42px)
        rotate(-4deg)
        translate3d(calc(var(--shift-x, 0px) * 1.15), calc(var(--shift-y, 0px) * 1.15), 0);
      transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .dp-plane-mid {
      transform:
        translateZ(12px)
        rotate(2deg)
        translate3d(calc(var(--shift-x, 0px) * 0.45), calc(var(--shift-y, 0px) * 0.45), 0);
      transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .dp-plane-subject {
      opacity: 0;
      transform: translate3d(0, 22px, 54px) scale(0.96);
      filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.6));
      transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }

    @keyframes formalDpHeroEntry {
      0% {
        opacity: 0;
        transform: translate3d(0, 26px, 24px) scale(0.95);
      }
      100% {
        opacity: 1;
        transform: translate3d(0, 0, 54px) scale(1);
      }
    }

    body.dp-ready .dp-plane-subject {
      animation: formalDpHeroEntry 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }

    .dp-plane-badge {
      transform: translateZ(76px) translate3d(calc(var(--shift-x, 0px) * -0.35), calc(var(--shift-y, 0px) * -0.35), 0);
      transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .cutout-screen {
      mix-blend-mode: screen;
    }

    body.light-mode .cutout-screen {
      mix-blend-mode: normal;
    }

    /* Entrance & Scroll Animations */
    @keyframes heroStaggerIn {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .hero-stagger {
      opacity: 0;
      animation: heroStaggerIn 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }

    .hero-delay-1 { animation-delay: 0.08s; }
    .hero-delay-2 { animation-delay: 0.16s; }
    .hero-delay-3 { animation-delay: 0.24s; }
    .hero-delay-4 { animation-delay: 0.32s; }
    .hero-delay-5 { animation-delay: 0.4s; }

    @keyframes ambientDrift {
      0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
      }
      50% {
        transform: translate3d(14px, -14px, 0) scale(1.04);
      }
    }

    .ambient-orb {
      animation: ambientDrift 9s ease-in-out infinite;
    }

    /* Scroll reveal + continuous subtle scroll motion */
    .reveal-on-scroll {
      opacity: 0;
      transform: translate3d(0, calc(24px + var(--scroll-drift, 0px)), 0) scale(0.985);
      transition:
        opacity 0.72s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .reveal-on-scroll.is-visible {
      opacity: 1;
      transform: translate3d(0, var(--scroll-drift, 0px), 0) scale(1);
    }

    /* Navigation indicator */
    .nav-link {
      position: relative;
      padding-bottom: 4px;
      transition: color 0.25s ease, transform 0.25s ease;
    }

    .nav-link:hover {
      transform: translateY(-1px);
    }

    .nav-link::after {
      content: '';
      position: absolute;
      left: 0;
      bottom: -2px;
      height: 2px;
      width: 0;
      background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
      border-radius: 999px;
      transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .nav-link:hover::after,
    .nav-link.active::after {
      width: 100%;
    }

    .nav-link.active {
      color: var(--text-primary);
      font-weight: 600;
    }

    /* Mobile drawer transition */
    .mobile-drawer {
      display: grid;
      grid-template-rows: 0fr;
      opacity: 0;
      transition: grid-template-rows 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
    }

    .mobile-drawer.is-open {
      grid-template-rows: 1fr;
      opacity: 1;
    }

    .mobile-drawer-inner {
      overflow: hidden;
    }

    /* Floating WhatsApp Button */
    @keyframes whatsappPulse {
      0%, 100% {
        box-shadow: 0 12px 28px -6px rgba(37, 211, 102, 0.55), 0 0 0 0 rgba(37, 211, 102, 0.35);
      }
      50% {
        box-shadow: 0 14px 32px -6px rgba(37, 211, 102, 0.65), 0 0 0 10px rgba(37, 211, 102, 0);
      }
    }

    .whatsapp-fab {
      background: linear-gradient(135deg, #25d366 0%, #16a34a 100%);
      color: #ffffff;
      animation: whatsappPulse 2.6s ease-in-out infinite;
      transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), filter 0.25s ease;
    }

    .whatsapp-fab:hover {
      transform: translateY(-3px) scale(1.06);
      filter: brightness(1.06);
    }

    .whatsapp-fab:active {
      transform: scale(0.96);
    }

    /* Certificate Modal Animation */
    .cert-modal {
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .cert-modal.is-open {
      opacity: 1;
      pointer-events: auto;
    }

    .cert-modal-panel {
      opacity: 0;
      transform: scale(0.92) translateY(16px);
      transition:
        opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .cert-modal.is-open .cert-modal-panel {
      opacity: 1;
      transform: scale(1) translateY(0);
    }

    @media (prefers-reduced-motion: reduce) {
      html {
        scroll-behavior: auto;
      }
      .dev-loader,
      .scroll-progress-bar {
        display: none !important;
      }
      .hero-stagger,
      .ambient-orb,
      .reveal-on-scroll,
      .dp-3d-rig,
      .dp-plane-back,
      .dp-plane-mid,
      .dp-plane-subject,
      .dp-plane-badge,
      .surface-card,
      .btn-primary-gradient,
      .whatsapp-fab,
      .cert-modal,
      .cert-modal-panel,
      .moving-border-box::before {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
      }
    }

    ::-webkit-scrollbar {
      width: 9px;
    }

    ::-webkit-scrollbar-track {
      background: var(--bg-surface);
    }

    ::-webkit-scrollbar-thumb {
      background: rgba(129, 140, 248, 0.45);
      border-radius: 999px;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: rgba(129, 140, 248, 0.72);
    }