/**
 * ==========================================================================
 *  Modern Enhancement Layer — Omar Khalifa Portfolio
 *  Loaded AFTER main.css. Overrides the base template with a cohesive
 *  "Modern Dark / Engineer" design system: glass surfaces, ambient light,
 *  gradient accents, and purposeful motion.
 * ==========================================================================
 *  1.  Design tokens
 *  2.  Base + typography
 *  3.  Ambient background
 *  4.  Sidebar / header
 *  5.  Section titles
 *  6.  Buttons
 *  7.  Surface + spotlight system
 *  8.  Hero
 *  9.  About
 *  10. Stats
 *  11. Skills
 *  12. Resume / timeline
 *  13. CV CTA
 *  14. Portfolio
 *  15. Contact
 *  16. Reviews
 *  17. Footer
 *  18. Chrome: scroll progress, scroll top, preloader, cursor
 *  19. Reveal utilities
 *  20. Responsive
 *  21. Accessibility + reduced motion
 * ==========================================================================
 */

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root {
  /* --- Type --- */
  --default-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --heading-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-font: "Inter", system-ui, sans-serif;
  --mono-font: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono",
    Menlo, Consolas, monospace;

  /* --- Core surfaces (deep navy, never pure black) --- */
  --background-color: #080b14;
  --surface-color: #101728;
  --surface-raised: #161f33;
  --default-color: #cbd5e1;
  --heading-color: #f8fafc;
  --contrast-color: #050810;

  /* --- Accents --- */
  --accent-color: #6366f1; /* indigo — primary brand */
  --accent-2: #22d3ee; /* cyan — gradient partner */
  --accent-3: #a855f7; /* violet — depth */
  --accent-run: #22c55e; /* green — "build passing" engineer signal */
  --accent-soft: rgba(99, 102, 241, 0.14);

  /* Text-safe accents. --accent-color (#6366f1) is only ~3.5:1 on our dark
     surfaces, so it is reserved for fills/borders. Small text uses these. */
  --accent-text: #a5b4fc; /* ~9.5:1 on surface */
  --accent-text-2: #67e8f9; /* ~12.8:1 on surface */
  --text-muted: #94a3b8; /* ~6.5:1 on surface — lowest gray we allow */

  /* Decorative only — bars, rings, rails, masked text. Its cyan end is far
     too light to sit under white label text. */
  --gradient-brand: linear-gradient(
    135deg,
    var(--accent-color) 0%,
    var(--accent-3) 50%,
    var(--accent-2) 100%
  );

  /* Button fills. Both stops stay dark enough for white text (6.6:1 → 5.1:1),
     unlike --gradient-brand where white would hit ~1.9:1 on the cyan end. */
  --gradient-cta: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --gradient-text: linear-gradient(
    100deg,
    #a5b4fc 0%,
    #c4b5fd 40%,
    #67e8f9 100%
  );

  /* --- Glass --- */
  --glass-bg: rgba(20, 28, 46, 0.62);
  --glass-bg-strong: rgba(16, 23, 40, 0.86);
  --glass-border: rgba(148, 163, 184, 0.14);
  --glass-border-hover: rgba(129, 140, 248, 0.45);
  --glass-blur: saturate(160%) blur(18px);

  /* --- Elevation --- */
  --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.4);
  --shadow-md: 0 8px 24px -8px rgba(2, 6, 23, 0.7);
  --shadow-lg: 0 24px 56px -16px rgba(2, 6, 23, 0.85);
  --shadow-glow: 0 0 0 1px rgba(99, 102, 241, 0.25),
    0 12px 40px -12px rgba(99, 102, 241, 0.5);

  /* --- Radii --- */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* --- Spacing scale (density 5 / standard) --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;

  /* --- Motion --- */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 160ms;
  --dur-mid: 260ms;
  --dur-slow: 480ms;

  /* --- Layers --- */
  --z-bg: 0;
  --z-content: 1;
  --z-sticky: 40;
  --z-header: 100;
  --z-overlay: 1000;
}

/* Nav palette */
:root {
  --nav-color: #94a3b8;
  --nav-hover-color: #f8fafc;
  --nav-mobile-background-color: rgba(12, 18, 32, 0.94);
  --nav-dropdown-background-color: rgba(12, 18, 32, 0.94);
  --nav-dropdown-color: #cbd5e1;
  --nav-dropdown-hover-color: #f8fafc;
}

/* Alternating section tone — subtle, not a hard slab */
.light-background {
  --background-color: #0b1120;
  --surface-color: #131c30;
  --surface-raised: #1a2439;
}

.dark-background {
  --background-color: #05080f;
  --default-color: #e2e8f0;
  --heading-color: #ffffff;
  --surface-color: #0d1425;
  --contrast-color: #ffffff;
}

/* ==========================================================================
   2. BASE + TYPOGRAPHY
   ========================================================================== */

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

body {
  font-family: var(--default-font);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  letter-spacing: -0.011em;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--heading-font);
  letter-spacing: -0.028em;
  line-height: 1.18;
  font-weight: 600;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* Sections breathe more than the template default */
section,
.section {
  padding: var(--space-8) 0;
  position: relative;
}

/* Hairline separator between alternating sections */
.section + .section::before {
  content: "";
  position: absolute;
  inset-inline: 10%;
  top: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(148, 163, 184, 0.16) 20%,
    rgba(148, 163, 184, 0.16) 80%,
    transparent
  );
  pointer-events: none;
}

/* Monospaced figures wherever numbers align */
.stat-number,
.timeline-year,
.portfolio-year,
.skill-percentage {
  font-family: var(--mono-font);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

::selection {
  background: rgba(99, 102, 241, 0.4);
  color: #fff;
}

/* Custom scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.5) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #060911;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-color), var(--accent-3));
  border-radius: var(--r-full);
  border: 2px solid #060911;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #818cf8, #c084fc);
}

a {
  transition: color var(--dur-fast) var(--ease-out-quart);
}

/* Animated underline for inline text links */
.content-area a:not(.btn-primary):not(.btn-secondary):not(.action-btn),
.position-description a {
  background-image: linear-gradient(var(--accent-2), var(--accent-2));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size var(--dur-mid) var(--ease-out-quart);
}

.content-area a:hover,
.position-description a:hover {
  background-size: 100% 1px;
}

/* ==========================================================================
   3. AMBIENT BACKGROUND
   ========================================================================== */

.ambient {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}

/* Soft drifting light blobs */
.ambient__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.42;
  will-change: transform;
}

.ambient__blob--1 {
  width: 46vw;
  height: 46vw;
  min-width: 320px;
  min-height: 320px;
  top: -12vw;
  left: 8vw;
  background: radial-gradient(circle, #4338ca 0%, transparent 68%);
  animation: blobDrift1 26s var(--ease-out-quart) infinite alternate;
}

.ambient__blob--2 {
  width: 40vw;
  height: 40vw;
  min-width: 280px;
  min-height: 280px;
  top: 42vh;
  right: -8vw;
  background: radial-gradient(circle, #0e7490 0%, transparent 68%);
  animation: blobDrift2 32s var(--ease-out-quart) infinite alternate;
}

.ambient__blob--3 {
  width: 34vw;
  height: 34vw;
  min-width: 240px;
  min-height: 240px;
  bottom: -10vw;
  left: 28vw;
  background: radial-gradient(circle, #7e22ce 0%, transparent 68%);
  animation: blobDrift3 38s var(--ease-out-quart) infinite alternate;
  opacity: 0.3;
}

@keyframes blobDrift1 {
  to {
    transform: translate3d(9vw, 7vh, 0) scale(1.14);
  }
}

@keyframes blobDrift2 {
  to {
    transform: translate3d(-11vw, -9vh, 0) scale(0.88);
  }
}

@keyframes blobDrift3 {
  to {
    transform: translate3d(7vw, -6vh, 0) scale(1.1);
  }
}

/* Engineering grid + subtle noise */
.ambient__grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      rgba(148, 163, 184, 0.055) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 30%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(
    ellipse 90% 65% at 50% 30%,
    #000 20%,
    transparent 78%
  );
}

.ambient__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 120% 80% at 50% 0%,
    transparent 30%,
    rgba(5, 8, 15, 0.75) 100%
  );
}

/* Content sits above the ambient layer; sections stay transparent so it shows */
.main,
.footer {
  position: relative;
  z-index: var(--z-content);
}

section,
.section {
  background-color: transparent;
}

/* Tinted wash instead of a solid fill for alternating sections */
.section.light-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(11, 17, 32, 0) 0%,
    rgba(11, 17, 32, 0.66) 22%,
    rgba(11, 17, 32, 0.66) 78%,
    rgba(11, 17, 32, 0) 100%
  );
  z-index: -1;
  pointer-events: none;
}

/* ==========================================================================
   4. SIDEBAR / HEADER
   ========================================================================== */

.header {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-header);
}

/* Vertical light seam on the sidebar edge */
.header::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(99, 102, 241, 0.55) 30%,
    rgba(34, 211, 238, 0.4) 70%,
    transparent
  );
  pointer-events: none;
}

.header .profile-img {
  position: relative;
}

.header .profile-img img {
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--gradient-brand) border-box;
  padding: 3px;
  transition: transform var(--dur-slow) var(--ease-out-expo),
    box-shadow var(--dur-slow) var(--ease-out-expo);
  box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.5);
}

.header .profile-img img:hover {
  transform: scale(1.06) rotate(-2deg);
  box-shadow: 0 0 34px -6px rgba(99, 102, 241, 0.75);
}

/* Live "available" pulse on the avatar */
.header .profile-img::after {
  content: "";
  position: absolute;
  right: calc(50% - 46px);
  bottom: 8px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent-run);
  border: 2px solid #0b1120;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: livePulse 2.4s ease-out infinite;
}

@keyframes livePulse {
  70% {
    box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.header .logo h1.sitename {
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Nav items become pills with a sliding accent rail */
.navmenu a {
  font-family: var(--nav-font);
  font-weight: 500;
  font-size: 15px;
  border-radius: var(--r-md);
  position: relative;
  overflow: hidden;
  transition: color var(--dur-mid) var(--ease-out-quart),
    background-color var(--dur-mid) var(--ease-out-quart),
    transform var(--dur-mid) var(--ease-out-quart);
}

.navmenu a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: var(--r-full);
  background: var(--gradient-brand);
  transform: translateY(-50%);
  transition: height var(--dur-mid) var(--ease-out-expo);
}

.navmenu a:hover,
.navmenu a.active {
  background: var(--accent-soft);
  color: var(--nav-hover-color);
}

.navmenu a:hover::before,
.navmenu a.active::before {
  height: 62%;
}

.navmenu a:hover {
  transform: translateX(4px);
}

.navmenu a.active {
  font-weight: 600;
}

.navmenu a .navicon {
  transition: transform var(--dur-mid) var(--ease-spring),
    color var(--dur-mid) var(--ease-out-quart);
}

.navmenu a:hover .navicon,
.navmenu a.active .navicon {
  color: var(--accent-2);
  transform: scale(1.16);
}

/* Social row */
.header .social-links a,
.footer .social-links a {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  border: 1px solid var(--glass-border);
  background: rgba(148, 163, 184, 0.06);
  color: var(--default-color);
  transition: transform var(--dur-mid) var(--ease-spring),
    border-color var(--dur-mid) var(--ease-out-quart),
    color var(--dur-mid) var(--ease-out-quart),
    box-shadow var(--dur-mid) var(--ease-out-quart);
}

.header .social-links a:hover,
.footer .social-links a:hover {
  transform: translateY(-4px);
  color: #fff;
  border-color: var(--glass-border-hover);
  background: var(--accent-soft);
  box-shadow: var(--shadow-glow);
}

/* Mobile toggle */
.header-toggle {
  background: var(--glass-bg-strong) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  color: var(--heading-color) !important;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--dur-mid) var(--ease-spring),
    border-color var(--dur-mid) var(--ease-out-quart);
}

.header-toggle:hover {
  transform: scale(1.08);
  border-color: var(--glass-border-hover);
}

/* ==========================================================================
   5. SECTION TITLES
   ========================================================================== */

.section-title {
  padding-bottom: var(--space-6);
}

.section-title h2 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-3);
  background: linear-gradient(180deg, #ffffff 0%, #94a3b8 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Replace the template's flat rules with a glowing gradient bar */
.section-title h2::before {
  width: 220px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(148, 163, 184, 0.3),
    transparent
  );
}

.section-title h2::after {
  width: 72px;
  height: 3px;
  border-radius: var(--r-full);
  background: var(--gradient-brand);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.8);
}

.section-title p {
  max-width: 68ch;
  margin-inline: auto;
  color: color-mix(in srgb, var(--default-color), transparent 22%);
  font-size: 1.0625rem;
}

/* ==========================================================================
   6. BUTTONS
   ========================================================================== */

.btn-primary,
.btn-secondary,
.btn-cv,
.submit-btn {
  --btn-py: 14px;
  --btn-px: 30px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: var(--btn-py) var(--btn-px);
  border-radius: var(--r-full);
  font-family: var(--default-font);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid transparent;
  transition: transform var(--dur-mid) var(--ease-out-expo),
    box-shadow var(--dur-mid) var(--ease-out-expo),
    border-color var(--dur-mid) var(--ease-out-quart);
}

/* Primary — gradient fill with a light sweep on hover */
.hero .hero-content .hero-actions .btn-primary,
.btn-cv.download-btn,
.contact .php-email-form .submit-btn,
.submit-btn {
  background: var(--gradient-cta);
  color: #fff;
  box-shadow: 0 8px 28px -10px rgba(99, 102, 241, 0.8);
}

.btn-primary::after,
.btn-cv::after,
.submit-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(255, 255, 255, 0.28) 50%,
    transparent 80%
  );
  transform: translateX(-120%);
  transition: transform var(--dur-slow) var(--ease-out-quart);
}

.btn-primary:hover::after,
.btn-cv:hover::after,
.submit-btn:hover::after {
  transform: translateX(120%);
}

.hero .hero-content .hero-actions .btn-primary:hover,
.btn-cv.download-btn:hover,
.submit-btn:hover {
  transform: translateY(-3px);
  color: #fff;
  box-shadow: 0 16px 40px -10px rgba(99, 102, 241, 0.95);
}

.btn-primary:active,
.btn-secondary:active,
.btn-cv:active,
.submit-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* Secondary — glass outline */
.hero .hero-content .hero-actions .btn-secondary,
.btn-cv.view-btn {
  background: rgba(148, 163, 184, 0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--heading-color);
}

.hero .hero-content .hero-actions .btn-secondary:hover,
.btn-cv.view-btn:hover {
  transform: translateY(-3px);
  background: var(--accent-soft);
  border-color: var(--glass-border-hover);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   7. SURFACE + SPOTLIGHT SYSTEM
   Shared glass treatment for every card-like block in the site.
   ========================================================================== */

.expertise-item,
.philosophy-quote,
.stats .stat-item,
.achievement,
.skill-category,
.tech-item,
.achievement-item,
.professional-summary,
.timeline-content,
.competency-item,
.cert-item,
.cv-card,
.portfolio-card,
.info-item,
.detail-item,
.contact .php-email-form,
.review-card,
.education-item,
.certification-section {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--dur-mid) var(--ease-out-expo),
    border-color var(--dur-mid) var(--ease-out-quart),
    box-shadow var(--dur-mid) var(--ease-out-expo),
    background-color var(--dur-mid) var(--ease-out-quart);
}

/* --- Specificity re-applications ---
   main.css scopes these four with deeper selectors (e.g.
   `.portfolio .portfolio-card`, `.skills .skills-sidebar … .tech-item`), which
   outrank the shared group above. Re-declare the glass treatment at matching
   or higher specificity so every card renders from one system. */

.portfolio .portfolio-card,
.cv-cta .cv-card,
.reviews .review-card,
.skills .skills-sidebar .technologies-section .tech-stack .tech-item {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}

.skills .skills-sidebar .technologies-section .tech-stack .tech-item {
  border-radius: var(--r-md);
}

.skills .skills-sidebar .technologies-section .tech-stack .tech-item:hover {
  background: var(--accent-soft);
  border-color: var(--glass-border-hover);
}

/* Image sits flush against the card's top edge */
.portfolio .portfolio-image {
  border-radius: 0;
  margin-bottom: 0;
}

.reviews .review-card:hover {
  transform: translateY(-6px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg);
}

/* Cursor-tracking spotlight — JS sets --mx / --my */
.spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-mid) var(--ease-out-quart);
  background: radial-gradient(
    340px circle at var(--mx, 50%) var(--my, 50%),
    rgba(99, 102, 241, 0.16),
    transparent 62%
  );
}

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

/* Lift on hover for the interactive ones */
.expertise-item:hover,
.stats .stat-item:hover,
.achievement:hover,
.tech-item:hover,
.achievement-item:hover,
.competency-item:hover,
.cert-item:hover,
.detail-item:hover {
  transform: translateY(-6px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99, 102, 241, 0.18);
}

/* Icon chips — consistent size, gradient wash, spring press */
.expertise-icon,
.achievement-icon,
.detail-icon,
.info-icon,
.cv-icon,
.icon-wrapper,
.service-icon,
.summary-header i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: var(--r-md);
  background: linear-gradient(
    145deg,
    rgba(99, 102, 241, 0.22),
    rgba(34, 211, 238, 0.12)
  );
  border: 1px solid rgba(129, 140, 248, 0.28);
  color: #a5b4fc;
  font-size: 1.375rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform var(--dur-mid) var(--ease-spring),
    color var(--dur-mid) var(--ease-out-quart),
    box-shadow var(--dur-mid) var(--ease-out-quart);
}

.expertise-item:hover .expertise-icon,
.achievement:hover .achievement-icon,
.detail-item:hover .detail-icon,
.achievement-item:hover .achievement-icon,
.service-card:hover .service-icon,
.service-block:hover .service-icon {
  transform: scale(1.1) rotate(-4deg);
  color: #c7d2fe;
  box-shadow: 0 0 26px -6px rgba(99, 102, 241, 0.8);
}

/* Tag / chip system */
.tag,
.achievement-tag,
.portfolio-filters li,
.employment-type {
  font-family: var(--mono-font);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 5px 12px;
  border-radius: var(--r-full);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--glass-border);
  color: #a5b4fc;
  transition: background-color var(--dur-fast) var(--ease-out-quart),
    border-color var(--dur-fast) var(--ease-out-quart),
    color var(--dur-fast) var(--ease-out-quart),
    transform var(--dur-fast) var(--ease-out-quart);
}

.tag:hover,
.achievement-tag:hover {
  background: var(--accent-soft);
  border-color: var(--glass-border-hover);
  color: #e0e7ff;
  transform: translateY(-2px);
}

/* ==========================================================================
   8. HERO
   ========================================================================== */

.hero {
  min-height: 100svh;
  padding: var(--space-8) 0;
}

.hero .container {
  padding-block: var(--space-6);
}

/* Eyebrow: terminal-style availability badge */
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono-font);
  font-size: 0.8125rem;
  padding: 7px 16px 7px 12px;
  margin-bottom: var(--space-4);
  border-radius: var(--r-full);
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.32);
  color: #86efac;
}

.hero-kicker__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-run);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: livePulse 2.4s ease-out infinite;
  flex: 0 0 8px;
}

.hero .hero-content h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.15rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-4);
}

/* Gradient accent phrase, with a soft glow instead of the flat underline */
.hero .hero-content h1 .accent-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  display: inline;
}

.hero .hero-content h1 .accent-text::after {
  content: none;
}

/* Typed role line under the headline */
.hero-role {
  font-family: var(--mono-font);
  font-size: clamp(0.9375rem, 1.7vw, 1.125rem);
  color: #67e8f9;
  margin-bottom: var(--space-3);
  min-height: 1.6em;
}

.hero-role__prompt {
  color: var(--accent-run);
  margin-right: 8px;
}

.hero-role .typed-cursor {
  color: var(--accent-2);
}

.hero .hero-content .hero-description {
  font-size: 1.0625rem;
  line-height: 1.75;
  max-width: 56ch;
  color: color-mix(in srgb, var(--default-color), transparent 12%);
  margin-bottom: var(--space-5);
}

.hero .hero-content .hero-actions {
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

/* Hero stat strip */
.hero .hero-content .hero-stats {
  gap: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--glass-border);
  flex-wrap: wrap;
}

.hero .hero-content .hero-stats .stat-item .stat-number {
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero .hero-content .hero-stats .stat-item .stat-label {
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

/* --- Hero image: gradient ring + conic glow --- */
.hero .hero-image .image-wrapper {
  position: relative;
}

.hero .hero-image .image-wrapper::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: var(--r-xl);
  background: conic-gradient(
    from 0deg,
    var(--accent-color),
    var(--accent-2),
    var(--accent-3),
    var(--accent-color)
  );
  filter: blur(30px);
  opacity: 0.4;
  animation: spinSlow 14s linear infinite;
  z-index: -1;
}

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

.hero .hero-image .image-wrapper .main-image {
  border-radius: var(--r-xl);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur-slow) var(--ease-out-expo),
    box-shadow var(--dur-slow) var(--ease-out-expo);
}

.hero .hero-image .image-wrapper .main-image:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: var(--shadow-lg), 0 0 60px -18px rgba(99, 102, 241, 0.7);
}

/* Floating capability cards — glass + gentle idle float */
.hero .hero-image .image-wrapper .floating-card {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 12px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--heading-color);
  animation: floatCard 6s ease-in-out infinite;
  transition: transform var(--dur-mid) var(--ease-out-expo),
    border-color var(--dur-mid) var(--ease-out-quart),
    box-shadow var(--dur-mid) var(--ease-out-quart);
}

.hero .hero-image .image-wrapper .floating-card.card-2 {
  animation-delay: -2s;
}

.hero .hero-image .image-wrapper .floating-card.card-3 {
  animation-delay: -4s;
}

.hero .hero-image .image-wrapper .floating-card:hover {
  animation-play-state: paused;
  transform: translateY(-6px) scale(1.04);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg), 0 0 34px -10px rgba(99, 102, 241, 0.8);
}

.hero .hero-image .image-wrapper .floating-card i {
  color: var(--accent-2);
  font-size: 1.125rem;
}

@keyframes floatCard {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

/* Scroll hint at the bottom of the hero */
.hero-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--mono-font);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #64748b;
  z-index: 3;
  transition: color var(--dur-mid) var(--ease-out-quart);
}

.hero-scroll-hint:hover {
  color: #a5b4fc;
}

.hero-scroll-hint__track {
  width: 1px;
  height: 44px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.7), transparent);
  position: relative;
  overflow: hidden;
}

.hero-scroll-hint__track::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: var(--accent-2);
  animation: scrollTrack 2s var(--ease-out-quart) infinite;
}

@keyframes scrollTrack {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  100% {
    transform: translateY(250%);
    opacity: 0;
  }
}

/* ==========================================================================
   9. ABOUT
   ========================================================================== */

.about .intro-header h1 {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 700;
  background: linear-gradient(180deg, #ffffff, #94a3b8 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.about .intro-header .subtitle {
  font-family: var(--mono-font);
  font-size: 0.9375rem;
  color: #67e8f9;
  letter-spacing: -0.01em;
}

.about .profile-image-container {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}

.about .profile-image-container img {
  display: block;
  width: 100%;
  transition: transform var(--dur-slow) var(--ease-out-expo);
}

.about .profile-image-container:hover img {
  transform: scale(1.05);
}

/* Gradient scrim so text over the photo stays legible */
.about .profile-image-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 55%,
    rgba(8, 11, 20, 0.55) 100%
  );
  pointer-events: none;
}

.about .profile-meta {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.about .profile-meta .location,
.about .profile-meta .status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--glass-border);
}

.about .profile-meta .location i {
  color: var(--accent-2);
}

.about .profile-meta .status {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.28);
  color: #86efac;
}

.about .status-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-run);
  flex: 0 0 9px;
  animation: livePulse 2.4s ease-out infinite;
}

.about .lead-text {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--heading-color);
}

.about .story-block p {
  max-width: 72ch;
}

.expertise-item {
  padding: var(--space-4);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.expertise-content h4 {
  font-size: 1.0625rem;
  margin-bottom: 6px;
}

.expertise-content p {
  font-size: 0.9375rem;
  margin: 0;
  color: #94a3b8;
}

/* Philosophy quote — accent rail + oversized glyph */
.philosophy-quote {
  padding: var(--space-5) var(--space-5) var(--space-5) var(--space-6);
  overflow: hidden;
}

.philosophy-quote::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-brand);
}

.philosophy-quote .quote-mark {
  font-family: Georgia, serif;
  font-size: 5rem;
  line-height: 0.6;
  color: rgba(99, 102, 241, 0.28);
  margin-bottom: 4px;
}

.philosophy-quote p {
  font-size: 1.125rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--heading-color);
  margin: 0;
}

/* ==========================================================================
   10. STATS
   ========================================================================== */

.stats .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

.stats .stat-item {
  padding: var(--space-5) var(--space-4);
  text-align: center;
  overflow: hidden;
}

/* Top light bar that fills on hover */
.stats .stat-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--gradient-brand);
  transition: width var(--dur-slow) var(--ease-out-expo);
}

.stats .stat-item:hover::after {
  width: 78%;
}

.stats .stat-item .stat-number {
  font-size: clamp(2.5rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stats .stat-item .stat-label {
  margin-top: 10px;
  margin-bottom: 0;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.stats .achievements-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.stats .achievement {
  padding: var(--space-4);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.stats .achievement-content h4 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.stats .achievement-content p {
  font-size: 0.875rem;
  margin: 0;
  color: #94a3b8;
}

/* ==========================================================================
   11. SKILLS
   ========================================================================== */

.skills .lead-text {
  font-size: 1.0625rem;
  color: #94a3b8;
}

.skills .skill-category {
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.skills .category-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--glass-border);
}

.skills .category-title {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.skills .category-title::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: var(--r-full);
  background: var(--gradient-brand);
  flex: 0 0 4px;
}

.skills .category-subtitle {
  font-size: 0.875rem;
  color: #94a3b8;
  margin: 6px 0 0;
}

.skills .skill-row {
  margin-bottom: var(--space-3);
}

.skills .skill-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.skills .skill-name {
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--heading-color);
}

.skills .skill-percentage {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  border: 1px solid rgba(129, 140, 248, 0.22);
  color: #a5b4fc;
}

/* Progress bars: gradient fill + travelling shimmer */
.skills .progress {
  height: 7px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: var(--r-full);
  overflow: hidden;
}

.skills .progress .progress-bar {
  position: relative;
  height: 100%;
  border-radius: var(--r-full);
  background: var(--gradient-brand);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.6);
  transition: width 1.3s var(--ease-out-expo);
}

.skills .progress .progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.42),
    transparent
  );
  transform: translateX(-100%);
  animation: shimmer 2.6s var(--ease-out-quart) infinite;
}

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

/* Tech chips grid */
.skills .tech-item,
.tech-item {
  padding: var(--space-3);
  text-align: center;
  font-size: 0.875rem;
  border-radius: var(--r-md);
}

.tech-item i {
  color: var(--accent-2);
  font-size: 1.5rem;
  display: block;
  margin-bottom: 8px;
  transition: transform var(--dur-mid) var(--ease-spring);
}

.tech-item:hover i {
  transform: scale(1.18) translateY(-2px);
}

.achievement-item {
  padding: var(--space-4);
}

.achievement-item .achievement-text {
  font-size: 0.9375rem;
  color: var(--heading-color);
}

.achievement-item .achievement-date {
  font-family: var(--mono-font);
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ==========================================================================
   12. RESUME / TIMELINE
   ========================================================================== */

.resume .professional-summary {
  padding: var(--space-5);
}

.resume .summary-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.resume .summary-header h3 {
  font-size: 1.375rem;
  margin: 0;
}

.resume .summary-text {
  font-size: 1rem;
  line-height: 1.8;
  color: #cbd5e1;
  margin: 0;
  max-width: 78ch;
}

.resume .section-intro {
  margin-bottom: var(--space-5);
}

.resume .section-intro h2 {
  font-size: 1.625rem;
  margin: var(--space-3) 0 8px;
}

.resume .section-intro p {
  font-size: 0.9375rem;
  color: #94a3b8;
}

/* Timeline rail */
.resume .experience-timeline,
.resume .education-timeline {
  position: relative;
  padding-left: 34px;
}

.resume .experience-timeline::before,
.resume .education-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: var(--r-full);
  background: linear-gradient(
    180deg,
    var(--accent-color),
    var(--accent-3) 50%,
    transparent
  );
  opacity: 0.5;
}

.resume .timeline-item {
  position: relative;
  padding-bottom: var(--space-5);
}

/* Glowing node */
.resume .timeline-dot {
  position: absolute;
  left: -34px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--background-color);
  border: 3px solid var(--accent-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14),
    0 0 18px rgba(99, 102, 241, 0.7);
  transition: transform var(--dur-mid) var(--ease-spring),
    border-color var(--dur-mid) var(--ease-out-quart),
    box-shadow var(--dur-mid) var(--ease-out-quart);
}

.resume .timeline-item:hover .timeline-dot {
  transform: scale(1.28);
  border-color: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.16),
    0 0 26px rgba(34, 211, 238, 0.85);
}

.resume .timeline-content {
  padding: var(--space-4);
}

.resume .timeline-item:hover .timeline-content {
  transform: translateX(6px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg);
}

.resume .position-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.resume .timeline-year {
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  border: 1px solid rgba(129, 140, 248, 0.28);
  color: #a5b4fc;
}

.resume .timeline-content h3 {
  font-size: 1.125rem;
  margin-bottom: 6px;
}

.resume .timeline-content h4 {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #67e8f9;
  margin-bottom: 12px;
}

.resume .position-description {
  font-size: 0.9375rem;
  color: #94a3b8;
}

.resume .key-achievements {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.resume .experience-highlights {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.resume .experience-highlights li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #94a3b8;
}

.resume .experience-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.9);
}

.resume .experience-highlights li strong {
  color: var(--heading-color);
  font-weight: 600;
}

.competency-item,
.cert-item {
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

.cert-item .cert-name {
  font-weight: 600;
  color: var(--heading-color);
}

.cert-item .cert-provider {
  font-family: var(--mono-font);
  font-size: 0.8125rem;
  color: #67e8f9;
}

.cert-item .cert-description {
  font-size: 0.9375rem;
  color: #94a3b8;
}

/* ==========================================================================
   13. CV CTA
   ========================================================================== */

.cv-cta .cv-card {
  padding: var(--space-7) var(--space-5);
  overflow: hidden;
}

/* Radial brand glow behind the card */
.cv-cta .cv-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 100% at 50% 0%,
    rgba(99, 102, 241, 0.2),
    transparent 70%
  );
  pointer-events: none;
}

.cv-cta .cv-icon {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  margin: 0 auto var(--space-4);
  font-size: 2rem;
  border-radius: var(--r-lg);
}

.cv-cta .cv-card h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.cv-cta .cv-card p {
  max-width: 60ch;
  margin: 0 auto var(--space-5);
  color: #94a3b8;
}

.cv-cta .cv-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   14. PORTFOLIO
   ========================================================================== */

.portfolio .filters-wrapper {
  margin-bottom: var(--space-6);
}

.portfolio .portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.portfolio .portfolio-filters li {
  cursor: pointer;
  padding: 9px 20px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
}

.portfolio .portfolio-filters li:hover {
  color: #e0e7ff;
  border-color: var(--glass-border-hover);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.portfolio .portfolio-filters li.filter-active {
  background: var(--gradient-cta);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 20px -6px rgba(99, 102, 241, 0.85);
}

/* Project cards */
.portfolio .portfolio-card {
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
}

.portfolio .portfolio-card:hover {
  transform: translateY(-8px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99, 102, 241, 0.22);
}

.portfolio .portfolio-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #0b1120;
}

.portfolio .portfolio-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out-expo),
    filter var(--dur-slow) var(--ease-out-expo);
}

.portfolio .portfolio-card:hover .portfolio-image img {
  transform: scale(1.07);
  filter: saturate(1.12);
}

.portfolio .portfolio-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: var(--space-3);
  opacity: 0;
  background: linear-gradient(
    180deg,
    transparent 30%,
    rgba(5, 8, 15, 0.82) 100%
  );
  transition: opacity var(--dur-mid) var(--ease-out-quart);
}

.portfolio .portfolio-card:hover .portfolio-overlay,
.portfolio .portfolio-card:focus-within .portfolio-overlay {
  opacity: 1;
}

.portfolio .portfolio-actions .action-btn {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: #fff;
  font-size: 1.25rem;
  transform: translateY(12px);
  transition: transform var(--dur-mid) var(--ease-spring),
    background-color var(--dur-mid) var(--ease-out-quart),
    box-shadow var(--dur-mid) var(--ease-out-quart);
}

.portfolio .portfolio-card:hover .action-btn,
.portfolio .portfolio-card:focus-within .action-btn {
  transform: translateY(0);
}

.portfolio .portfolio-actions .action-btn:hover {
  background: var(--gradient-brand);
  transform: translateY(-2px) scale(1.06);
  box-shadow: var(--shadow-glow);
}

.portfolio .portfolio-content {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.portfolio .portfolio-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 12px;
}

.portfolio .portfolio-category {
  font-family: var(--mono-font);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #67e8f9;
}

.portfolio .portfolio-year {
  font-size: 0.75rem;
  color: #64748b;
}

.portfolio .portfolio-title {
  font-size: 1.1875rem;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.35;
}

.portfolio .portfolio-description {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #94a3b8;
  margin-bottom: var(--space-3);
  flex: 1;
}

.portfolio .portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   15. CONTACT
   ========================================================================== */

.contact .info-item {
  padding: var(--space-4);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  margin-bottom: var(--space-3);
}

.contact .info-content h4 {
  font-size: 1.125rem;
  margin-bottom: 6px;
}

.contact .info-content p {
  font-size: 0.9375rem;
  color: #94a3b8;
  margin: 0;
}

.contact .contact-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.contact .detail-item {
  padding: var(--space-3) var(--space-4);
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.contact .detail-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  font-size: 1.1875rem;
}

.contact .detail-label {
  display: block;
  font-family: var(--mono-font);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 2px;
}

.contact .detail-value {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--heading-color);
  word-break: break-word;
}

.contact .detail-item:hover .detail-value {
  color: #a5b4fc;
}

/* Form */
.contact .php-email-form {
  padding: var(--space-5);
}

.contact .form-group {
  margin-bottom: var(--space-4);
}

.contact .php-email-form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.contact .php-email-form input[type="text"],
.contact .php-email-form input[type="email"],
.contact .php-email-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 13px 16px;
  font-size: 1rem;
  font-family: var(--default-font);
  color: var(--heading-color);
  background: rgba(8, 11, 20, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  box-shadow: none;
  transition: border-color var(--dur-mid) var(--ease-out-quart),
    box-shadow var(--dur-mid) var(--ease-out-quart),
    background-color var(--dur-mid) var(--ease-out-quart);
}

.contact .php-email-form textarea {
  min-height: 140px;
  resize: vertical;
}

.contact .php-email-form input::placeholder,
.contact .php-email-form textarea::placeholder {
  color: #64748b;
}

.contact .php-email-form input:focus,
.contact .php-email-form textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  background: rgba(8, 11, 20, 0.85);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

.contact .php-email-form .submit-btn {
  width: auto;
}

.contact .php-email-form .submit-btn i {
  transition: transform var(--dur-mid) var(--ease-out-quart);
}

.contact .php-email-form .submit-btn:hover i {
  transform: translateX(4px);
}

/* Form messages */
.php-email-form .error-message,
.php-email-form .sent-message,
.php-email-form .loading {
  border-radius: var(--r-md);
  font-weight: 500;
  padding: 14px 18px;
}

.php-email-form .error-message {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.php-email-form .sent-message {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.php-email-form .loading {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

/* ==========================================================================
   16. REVIEWS
   ========================================================================== */

.reviews .review-card {
  padding: var(--space-3);
  overflow: hidden;
}

.reviews .review-image img {
  border-radius: var(--r-md);
  width: 100%;
  height: auto;
}

.reviews .swiper-pagination {
  position: static;
  margin-top: var(--space-4);
}

.reviews .swiper-pagination-bullet {
  width: 9px;
  height: 9px;
  background: rgba(148, 163, 184, 0.4);
  opacity: 1;
  transition: width var(--dur-mid) var(--ease-out-expo),
    background-color var(--dur-mid) var(--ease-out-quart);
}

.reviews .swiper-pagination-bullet-active {
  width: 30px;
  border-radius: var(--r-full);
  background: var(--gradient-brand);
}

/* ==========================================================================
   17. FOOTER
   ========================================================================== */

.footer {
  position: relative;
  padding: var(--space-7) 0 var(--space-5);
  border-top: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(8, 11, 20, 0), rgba(5, 8, 15, 0.9));
  text-align: center;
}

.footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 70%);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-color),
    var(--accent-2),
    transparent
  );
}

.footer h3.sitename {
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.footer .social-links {
  gap: 12px;
  margin: var(--space-4) 0;
}

.footer .copyright,
.footer .credits {
  font-size: 0.8125rem;
  color: #64748b;
}

.footer .credits a {
  color: #94a3b8;
}

/* ==========================================================================
   18. CHROME: SCROLL PROGRESS, SCROLL TOP, PRELOADER, CURSOR
   ========================================================================== */

/* Reading progress bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: var(--gradient-brand);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.9);
  z-index: var(--z-overlay);
  pointer-events: none;
}

/* Back to top */
.scroll-top {
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--shadow-glow);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform var(--dur-mid) var(--ease-spring),
    opacity var(--dur-mid) var(--ease-out-quart),
    box-shadow var(--dur-mid) var(--ease-out-quart);
}

.scroll-top:hover {
  color: #fff;
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 16px 40px -10px rgba(99, 102, 241, 0.95);
}

.scroll-top i {
  font-size: 1.5rem;
}

/* Preloader — orbiting rings */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #080b14;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 400ms var(--ease-out-quart);
}

#preloader::before,
#preloader::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}

#preloader::before {
  width: 62px;
  height: 62px;
  border-top-color: var(--accent-color);
  border-right-color: var(--accent-3);
  animation: spinRing 900ms linear infinite;
}

#preloader::after {
  width: 40px;
  height: 40px;
  border-bottom-color: var(--accent-2);
  border-left-color: var(--accent-run);
  animation: spinRing 700ms linear infinite reverse;
}

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

/* Soft cursor light — desktop pointers only */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  margin: -210px 0 0 -210px;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.11) 0%,
    transparent 62%
  );
  transition: opacity 500ms var(--ease-out-quart);
  will-change: transform;
}

/* ==========================================================================
   19. REVEAL UTILITIES
   Progressive enhancement: only active once JS adds .js-reveal-ready,
   so content stays visible if scripts fail.
   ========================================================================== */

.js-reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms var(--ease-out-expo),
    transform 700ms var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.js-reveal-ready [data-reveal="left"] {
  transform: translateX(-32px);
}

.js-reveal-ready [data-reveal="right"] {
  transform: translateX(32px);
}

.js-reveal-ready [data-reveal="scale"] {
  transform: scale(0.94);
}

.js-reveal-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Soften the template's AOS defaults to match our easing */
[data-aos] {
  transition-timing-function: var(--ease-out-expo) !important;
}

/* ==========================================================================
   20. RESPONSIVE
   ========================================================================== */

@media (max-width: 1199px) {
  .header {
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
  }

  .header::after {
    display: none;
  }

  .header .profile-img::after {
    right: calc(50% - 40px);
  }
}

@media (max-width: 991px) {
  section,
  .section {
    padding: var(--space-7) 0;
  }

  .hero {
    padding-top: var(--space-8);
    text-align: center;
  }

  .hero .hero-content .hero-description {
    margin-inline: auto;
  }

  .hero .hero-content .hero-actions,
  .hero .hero-content .hero-stats {
    justify-content: center;
  }

  .hero-scroll-hint {
    display: none;
  }

  .cursor-glow {
    display: none;
  }
}

@media (max-width: 767px) {
  :root {
    --space-8: 64px;
    --space-7: 48px;
  }

  .hero {
    min-height: auto;
    padding-block: var(--space-7);
  }

  .hero .hero-content h1 {
    font-size: clamp(2rem, 8.5vw, 2.75rem);
  }

  .hero .hero-content .hero-stats {
    gap: var(--space-4);
  }

  .hero .hero-image .image-wrapper .floating-card {
    padding: 9px 13px;
    font-size: 0.75rem;
  }

  .hero .hero-image .image-wrapper .floating-card i {
    font-size: 1rem;
  }

  .section-title h2::before {
    width: 160px;
  }

  .resume .experience-timeline,
  .resume .education-timeline {
    padding-left: 26px;
  }

  .resume .timeline-dot {
    left: -26px;
    width: 13px;
    height: 13px;
  }

  .resume .timeline-item:hover .timeline-content {
    transform: none;
  }

  .ambient__grid {
    background-size: 44px 44px;
  }

  /* Reduce blur cost on small devices */
  .ambient__blob {
    filter: blur(60px);
  }
}

@media (max-width: 575px) {
  .cv-cta .cv-actions .btn-cv,
  .hero .hero-content .hero-actions .btn-primary,
  .hero .hero-content .hero-actions .btn-secondary {
    width: 100%;
  }
}

/* Landscape phones: don't let the hero lock to viewport height */
@media (max-height: 560px) and (orientation: landscape) {
  .hero {
    min-height: auto;
  }

  .hero-scroll-hint {
    display: none;
  }
}

/* ==========================================================================
   21. ACCESSIBILITY + REDUCED MOTION
   ========================================================================== */

/* Visible, on-brand focus ring everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible,
.portfolio-filters li:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translate(-50%, -160%);
  z-index: calc(var(--z-overlay) + 1);
  padding: 12px 22px;
  border-radius: var(--r-full);
  background: var(--gradient-cta);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur-mid) var(--ease-out-expo);
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
  color: #fff;
}

/* Screen-reader-only helper (Bootstrap's .visually-hidden already covers most) */
.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;
}

/* Everything decorative stops when the user asks for calm */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  :root {
    scroll-behavior: auto;
  }

  .ambient__blob,
  .hero .hero-image .image-wrapper::before,
  .hero-scroll-hint__track::after,
  .skills .progress .progress-bar::after,
  .header .profile-img::after,
  .hero-kicker__dot,
  .about .status-indicator {
    animation: none !important;
  }

  .cursor-glow,
  .scroll-progress {
    display: none !important;
  }

  .js-reveal-ready [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero .hero-image .image-wrapper .floating-card {
    animation: none !important;
  }
}

/* Coarse pointers: no hover-dependent chrome */
@media (hover: none) {
  .cursor-glow {
    display: none;
  }

  .portfolio .portfolio-overlay {
    opacity: 1;
    background: linear-gradient(
      180deg,
      transparent 55%,
      rgba(5, 8, 15, 0.7) 100%
    );
  }

  .portfolio .portfolio-actions .action-btn {
    transform: none;
  }
}

/* High contrast preference */
@media (prefers-contrast: more) {
  :root {
    --default-color: #e8eef7;
    --glass-border: rgba(203, 213, 225, 0.35);
    --glass-bg: rgba(12, 18, 32, 0.92);
  }

  .portfolio .portfolio-category,
  .contact .detail-label,
  .stats .stat-item .stat-label {
    color: #cbd5e1;
  }
}

/* ==========================================================================
   22. LEGIBILITY + TARGET CORRECTIONS
   main.css assigns var(--accent-color) (#6366f1 ≈ 3.5:1) and heavily
   transparent grays to small text via deep selectors. Those combinations fail
   WCAG AA, so they are re-declared here at matching specificity using the
   text-safe tokens. Measured ratios are noted per group.
   ========================================================================== */

/* #6366f1 → #a5b4fc  (3.5:1 → 9.5:1) */
.skills
  .skills-container
  .skill-category
  .skills-list
  .skill-row
  .skill-info
  .skill-percentage,
.portfolio-tags .tag,
.key-achievements .achievement-tag {
  color: var(--accent-text);
}

/* #6366f1 → #67e8f9  (3.5:1 → 12.8:1) */
.portfolio .portfolio-meta .portfolio-category {
  color: var(--accent-text-2);
}

/* Base link colour: #6366f1 was 3.9:1 on the page background */
a {
  color: var(--accent-text);
}

a:hover {
  color: var(--accent-text-2);
}

/* Deep-selector accent text in the resume (3.5–4.0:1 → 9.5:1) */
.resume
  .professional-journey
  .experience-timeline
  .timeline-item
  .timeline-content
  .position-meta
  .timeline-year,
.resume
  .education-skills
  .education-grid
  .education-card
  .education-header
  .degree-info
  .graduation-year,
.resume
  .education-skills
  .education-grid
  .education-card
  .education-details
  .honors
  .honor-badge {
  color: var(--accent-text);
}

/* Solid accent buttons: dark label on #6366f1 was 4.48:1 — just under AA.
   Re-style as white-on-CTA-gradient (view-btn) / glass (secondary). */
.about .bottom-section .action-buttons .btn-custom.primary,
.cv-cta .cv-actions .btn-cv.view-btn {
  background: var(--gradient-cta);
  background-color: transparent;
  color: #fff;
  border: 1px solid transparent;
}

.about .bottom-section .action-buttons .btn-custom.primary:hover,
.cv-cta .cv-actions .btn-cv.view-btn:hover {
  background: var(--gradient-cta);
  background-color: transparent;
  color: #fff;
}

.cv-cta .cv-actions .btn-cv.download-btn {
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--glass-border);
  color: var(--heading-color);
}

.cv-cta .cv-actions .btn-cv.download-btn:hover {
  background: var(--accent-soft);
  border-color: var(--glass-border-hover);
  color: #fff;
}

.about .bottom-section .action-buttons .btn-custom.secondary:hover {
  border-color: var(--glass-border-hover);
  color: var(--accent-text);
}

/* Education cards were missed by the shared surface group */
.resume .education-skills .education-grid .education-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--dur-mid) var(--ease-out-expo),
    border-color var(--dur-mid) var(--ease-out-quart),
    box-shadow var(--dur-mid) var(--ease-out-expo);
}

.resume .education-skills .education-grid .education-card:hover {
  transform: translateY(-6px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg);
}

/* transparent grays / #64748b → #94a3b8  (3.9–4.1:1 → 6.5:1) */
.portfolio .portfolio-meta .portfolio-year,
.contact .contact-details .detail-item .detail-content .detail-label,
.skills
  .skills-sidebar
  .achievements-section
  .achievement-list
  .achievement-item
  .achievement-date,
.footer .copyright,
.footer .credits,
.hero-scroll-hint {
  color: var(--text-muted);
}

.footer .credits a {
  color: #cbd5e1;
}

/* --- Project detail pages (portfolio-details / sha8lny-details) --- */

/* accent @ 80% alpha → 3.05:1 */
.portfolio-details .hero-section .project-header .project-meta .category,
.portfolio-details .hero-section .project-header .project-meta .year {
  color: var(--accent-text);
}

/* default colour @ 50% alpha → 3.94:1 */
.portfolio-details .content-section .project-specs .spec-item h5,
.portfolio-details
  .project-nav
  .nav-wrapper
  .nav-link.prev-project
  .nav-content
  .nav-direction,
.portfolio-details
  .project-nav
  .nav-wrapper
  .nav-link.next-project
  .nav-content
  .nav-direction {
  color: var(--text-muted);
}

/* Give the detail pages the same surface language as the home page */
.portfolio-details .content-section .project-specs .spec-item,
.portfolio-details .project-nav .nav-wrapper .nav-link {
  border-radius: var(--r-md);
  transition: transform var(--dur-mid) var(--ease-out-expo),
    border-color var(--dur-mid) var(--ease-out-quart);
}

.portfolio-details .project-nav .nav-wrapper .nav-link:hover {
  transform: translateY(-3px);
  border-color: var(--glass-border-hover);
}

/* --- Service detail page CTAs (4.0–4.48:1 → AA) --- */

.service-details .service-sidebar .cta-block .btn.btn-primary,
.service-details .service-sidebar .cta-block .btn.btn-primary:hover {
  background-color: transparent;
  background-image: var(--gradient-cta);
  color: #fff;
  border-color: transparent;
}

.service-details .service-sidebar .cta-block .btn.btn-outline {
  color: var(--accent-text);
  border-color: var(--glass-border-hover);
}

.service-details .service-sidebar .cta-block .btn.btn-outline:hover {
  background-color: var(--accent-soft);
  color: #fff;
}

.service-details .service-sidebar .cta-block .btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
}

/* Touch targets: 40–42px → 44px minimum (Apple HIG / Material) */
.header .social-links a,
.footer .social-links a {
  width: 44px;
  height: 44px;
}

.portfolio .portfolio-filters li {
  min-height: 44px;
}

/* Inline contact links were 26px tall — pad them into a real target */
.contact .contact-details .detail-item .detail-content .detail-value {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ==========================================================================
   23. VISUAL QA CORRECTIONS
   Fixes found by reviewing the rendered page in a real browser. Each entry
   notes the observed defect.
   ========================================================================== */

/* [1] Sidebar avatar rendered as a 220×290 OVAL — the source image is 960×1280
   (3:4), so border-radius:50% could never produce a circle. */
.header .profile-img img {
  width: 200px;
  height: 200px;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 12%;
  max-width: 100%;
}

/* [2] The "available" dot floated inside the photo instead of sitting on the
   rim. Anchor it trigonometrically to the circle edge (r·sin45° ≈ 0.707r). */
.header .profile-img {
  position: relative;
  width: -moz-fit-content;
  width: fit-content;
  margin-inline: auto;
}

.header .profile-img::after {
  right: auto;
  bottom: auto;
  left: calc(50% + 68px);
  top: calc(50% + 68px);
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-width: 3px;
}

/* [3] About photo was capped at max-width:300px inside a 343px container,
   leaving a 42px dark strip down the right edge. main.css scopes this as
   `.about .profile-section .profile-image-container img`, so match it.
   Also drops the template's permanent grayscale(20%). */
.about .profile-section .profile-image-container img {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 15%;
  border-radius: var(--r-lg);
  filter: none;
}

/* [4] .expertise-grid computed to `display: block`, so the four cards stacked
   full-width and made the column enormously tall. */
.about .expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: var(--space-3);
  margin-block: var(--space-4);
}

/* [5] Skill bars rendered 2px tall (main.css --progress-height won on
   specificity), reading as a hairline crowding the label. */
.skills .skills-container .skill-category .skills-list .skill-row .progress {
  height: 8px;
  border-radius: var(--r-full);
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.skills
  .skills-container
  .skill-category
  .skills-list
  .skill-row
  .progress
  .progress-bar {
  height: 8px;
  border-radius: var(--r-full);
  background: var(--gradient-brand);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

/* [6] The "Firebase Integration" floating card sits at right:-68px and was
   clipped by the hero's overflow on viewports below ~1400px. */
@media (max-width: 1400px) {
  .hero .hero-image .image-wrapper .floating-card.card-2 {
    right: -8px;
  }
}

@media (max-width: 1100px) {
  .hero .hero-image .image-wrapper .floating-card.card-2 {
    right: 8px;
  }

  .hero .hero-image .image-wrapper .floating-card.card-3 {
    left: 8px;
  }
}

/* [7] Hero stat strip wrapped to two rows, orphaning the third stat. */
.hero .hero-content .hero-stats {
  gap: var(--space-3) var(--space-4);
}

.hero .hero-content .hero-stats .stat-item {
  flex: 0 1 auto;
  min-width: 0;
}

/* Hero already has 96px section padding; the extra 48px pushed content down. */
.hero .container {
  padding-block: var(--space-3);
}

/* [8] Contact rows mixed a 48px margin with a 16px flex gap, giving an
   uneven 64/64/64/92px rhythm. */
.contact .contact-details .detail-item {
  margin-bottom: 0;
}

.contact .info-item {
  margin-bottom: var(--space-3);
}

/* [10] On phones the three hero stats stacked into three separate rows,
   eating vertical space above the fold. Lay them out as one compact row. */
@media (max-width: 575px) {
  .hero .hero-content .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    text-align: center;
  }

  .hero .hero-content .hero-stats .stat-item .stat-number {
    font-size: 1.625rem;
  }

  .hero .hero-content .hero-stats .stat-item .stat-label {
    font-size: 0.625rem;
    letter-spacing: 0.02em;
  }
}

/* [9] The sidebar edge seam read as a bright second line beside the
   scrollbar. Soften it to a hint. */
.header::after {
  background: linear-gradient(
    180deg,
    transparent,
    rgba(99, 102, 241, 0.28) 30%,
    rgba(34, 211, 238, 0.2) 70%,
    transparent
  );
}

/* ==========================================================================
   24. SERVICES
   The #services section on the home page and the standalone services.html.
   ========================================================================== */

/* --- Home page: services grid --- */
.services .services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4);
}

/* There are six services. auto-fit gives four columns on a wide screen,
   which strands two cards in a half-empty second row — pin it to 3 x 2. */
@media (min-width: 1200px) {
  .services .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.services .service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-5) var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform var(--dur-mid) var(--ease-out-expo),
    border-color var(--dur-mid) var(--ease-out-quart),
    box-shadow var(--dur-mid) var(--ease-out-expo);
}

/* Accent bar that draws in on hover */
.services .service-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-brand);
  transition: width var(--dur-slow) var(--ease-out-expo);
}

.services .service-card:hover {
  transform: translateY(-6px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99, 102, 241, 0.18);
}

.services .service-card:hover::after {
  width: 100%;
}

.services .service-card h3 {
  font-size: 1.1875rem;
  margin: var(--space-3) 0 10px;
  line-height: 1.35;
}

.services .service-card p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  flex: 1;
}

.services .service-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.services .service-points li {
  font-family: var(--mono-font);
  font-size: 0.6875rem;
  letter-spacing: -0.01em;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--accent-text);
}

.services .services-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* --- services.html: lede --- */
.services-page-intro .services-lede h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 700;
  margin: var(--space-4) 0 var(--space-3);
  background: linear-gradient(180deg, #ffffff, #94a3b8 135%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.services-page-intro .services-lede p {
  font-size: 1.0625rem;
  line-height: 1.8;
  max-width: 68ch;
  color: #cbd5e1;
}

/* --- services.html: detail blocks --- */
.services-detail .service-block {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--space-4);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  transition: border-color var(--dur-mid) var(--ease-out-quart),
    box-shadow var(--dur-mid) var(--ease-out-expo);
}

.services-detail .service-block:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg);
}

.services-detail .service-block__aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.services-detail .service-block__index {
  font-family: var(--mono-font);
  font-size: 1.5rem;
  font-weight: 600;
  /* rgba(148,163,184,.28) measured 1.67:1 — below the 3:1 large-text floor. */
  color: #64748b;
}

.services-detail .service-block__body h3 {
  font-size: 1.375rem;
  margin-bottom: 10px;
}

.services-detail .service-block__lede {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: #cbd5e1;
  margin-bottom: var(--space-4);
  max-width: 62ch;
}

.services-detail .service-block__cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--glass-border);
}

.services-detail .service-block__cols h4 {
  font-family: var(--mono-font);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.services-detail .service-block__cols > div > h4:not(:first-child) {
  margin-top: var(--space-4);
}

.service-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.service-checklist li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #cbd5e1;
}

/* Check mark drawn in CSS — no icon font dependency */
.service-checklist li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.45em;
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--accent-run);
  border-bottom: 2px solid var(--accent-run);
  transform: rotate(-45deg);
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-proof {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

.service-proof a {
  color: var(--accent-text-2);
}

/* --- services.html: process --- */
.services-process .process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--space-3);
  counter-reset: step;
}

.services-process .process-step {
  position: relative;
  padding: var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  transition: transform var(--dur-mid) var(--ease-out-expo),
    border-color var(--dur-mid) var(--ease-out-quart);
}

.services-process .process-step:hover {
  transform: translateY(-5px);
  border-color: var(--glass-border-hover);
}

.services-process .process-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: var(--space-3);
  border-radius: 50%;
  font-family: var(--mono-font);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-cta);
  box-shadow: 0 6px 18px -6px rgba(99, 102, 241, 0.8);
}

.services-process .process-step h3 {
  font-size: 1.0625rem;
  margin-bottom: 8px;
}

.services-process .process-step p {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0;
}

/* --- Page title block (shared by services.html + detail pages) --- */
.page-title {
  padding: var(--space-7) 0 var(--space-6);
  text-align: center;
  position: relative;
}

.page-title h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  margin-bottom: var(--space-3);
  background: linear-gradient(180deg, #ffffff, #94a3b8 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-title .breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.page-title .breadcrumbs ol li + li::before {
  content: "/";
  margin-right: 10px;
  color: rgba(148, 163, 184, 0.5);
}

.page-title .breadcrumbs ol li.current {
  color: #e2e8f0;
}

/* --- Services responsive --- */
@media (max-width: 991px) {
  .services-detail .service-block {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .services-detail .service-block__aside {
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
  }

  .services-detail .service-block__cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .services .services-cta .btn-primary,
  .services .services-cta .btn-secondary {
    width: 100%;
  }

  .services-detail .service-block {
    padding: var(--space-4);
  }
}

/* Print */
@media print {
  .header,
  .ambient,
  .cursor-glow,
  .scroll-progress,
  .scroll-top,
  #preloader,
  .hero-scroll-hint {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
