/* ==========================================================================
   Nabil Rahman Portfolio — Production Stylesheet
   Theme: Deep Navy (#0A0F1E), Electric Blue (#3B82F6), Violet (#8B5CF6)
   GPU-friendly animations (transform & opacity) + prefers-reduced-motion
   ========================================================================== */

:root {
  --bg-primary: #0a0f1e;
  --bg-surface: rgba(16, 24, 46, 0.72);
  --bg-surface-solid: #10182e;
  --bg-surface-hover: rgba(24, 35, 66, 0.85);
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-glow: rgba(99, 102, 241, 0.45);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --accent-blue: #3b82f6;
  --accent-violet: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --accent-glow: rgba(59, 130, 246, 0.35);

  --font-display: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --container-max: 1180px;
  --header-height: 74px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button,
input,
textarea {
  font-family: inherit;
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.2;
  text-wrap: balance;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

/* Skip Link */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 9999;
  padding: 10px 18px;
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: transform 0.2s var(--ease-out-expo);
}

.skip-link:focus {
  transform: translateY(116px);
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ==========================================================================
   Page Loader (< 1.5s)
   ========================================================================== */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background-color: var(--bg-primary);
  transition: transform 0.55s var(--ease-out-expo), opacity 0.45s ease, visibility 0.55s;
  will-change: transform, opacity;
}

.page-loader.is-done {
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.loader-name {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #f8fafc 0%, #93c5fd 50%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: loaderFadeIn 0.65s var(--ease-out-expo) both;
}

.loader-line {
  width: 140px;
  height: 3px;
  border-radius: 99px;
  background: var(--accent-gradient);
  transform-origin: left center;
  animation: loaderBarDraw 0.75s var(--ease-out-expo) 0.1s both;
}

@keyframes loaderFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ==========================================================================
   Scroll Progress Bar & Desktop Cursor Glow
   ========================================================================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 1200;
  background: var(--accent-gradient);
  transform-origin: left center;
  transform: scaleX(0);
  pointer-events: none;
  will-change: transform;
}

.cursor-glow {
  display: none;
}

@media (pointer: fine) {
  .cursor-glow {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 420px;
    height: 420px;
    margin-top: -210px;
    margin-left: -210px;
    border-radius: 50%;
    background: radial-gradient(
      circle,
      rgba(59, 130, 246, 0.12) 0%,
      rgba(139, 92, 246, 0.06) 40%,
      transparent 70%
    );
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: transform;
  }

  .cursor-glow.is-active {
    opacity: 1;
  }
}

/* ==========================================================================
   Sticky Glass Header (3-Zone Top Bar)
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease;
}

.site-header.scrolled {
  background-color: rgba(10, 15, 30, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border-subtle);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 28px;
}

.nav-link {
  position: relative;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  padding-block: 6px;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s var(--ease-out-expo);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-cta {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 8px 24px -8px var(--accent-glow);
  transition: transform 0.2s var(--ease-out-expo), box-shadow 0.2s ease;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -6px rgba(139, 92, 246, 0.5);
}

/* Mobile Hamburger */
.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.menu-toggle:hover {
  border-color: var(--border-glow);
  background: rgba(255, 255, 255, 0.08);
}

.hamburger-bar {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background-color: var(--text-primary);
  transition: transform 0.28s var(--ease-out-expo), opacity 0.2s ease;
}

.menu-toggle[aria-expanded='true'] .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded='true'] .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded='true'] .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Slide Drawer */
.mobile-drawer {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background-color: rgba(10, 15, 30, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 20px 24px 28px;
  transform: translateY(-16px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s var(--ease-out-expo), opacity 0.25s ease, visibility 0.3s;
}

.mobile-drawer.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.mobile-cta {
  margin-top: 8px;
  justify-content: center;
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 600;
}

@media (min-width: 900px) {
  .desktop-nav {
    display: flex;
  }

  .nav-cta {
    display: inline-flex;
  }

  .menu-toggle,
  .mobile-drawer {
    display: none;
  }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--header-height) + 40px);
  padding-bottom: 72px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.mesh-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.42;
  will-change: transform;
}

.blob-blue {
  width: 520px;
  height: 520px;
  top: -120px;
  left: -100px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.55) 0%, transparent 70%);
  animation: floatBlobOne 18s ease-in-out infinite alternate;
}

.blob-violet {
  width: 560px;
  height: 560px;
  bottom: -140px;
  right: -120px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.52) 0%, transparent 70%);
  animation: floatBlobTwo 22s ease-in-out infinite alternate;
}

.blob-indigo {
  width: 360px;
  height: 360px;
  top: 40%;
  left: 46%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
  animation: floatBlobThree 16s ease-in-out infinite alternate;
}

@keyframes floatBlobOne {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(70px, 50px, 0) scale(1.1);
  }
}

@keyframes floatBlobTwo {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(-80px, -60px, 0) scale(1.12);
  }
}

@keyframes floatBlobThree {
  0% {
    transform: translate3d(-40px, 20px, 0) scale(0.95);
  }
  100% {
    transform: translate3d(40px, -40px, 0) scale(1.08);
  }
}

.hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.75;
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 48px;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 56px;
  }
}

.hero-kicker {
  font-size: 0.95rem;
  font-weight: 600;
  color: #93c5fd;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: clamp(2.65rem, 5.4vw, 4.35rem);
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #ffffff 15%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.3vw, 1.65rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.hero-typing {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-muted);
  min-height: 1.75em;
  margin-bottom: 18px;
}

.typing-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}

.typing-cursor {
  display: inline-block;
  margin-left: 2px;
  color: var(--accent-blue);
  animation: cursorBlink 0.9s steps(2, start) infinite;
}

@keyframes cursorBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.hero-tagline {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 56ch;
  margin-bottom: 12px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.925rem;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.meta-sep {
  opacity: 0.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease-out-expo), box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 14px 32px -10px rgba(59, 130, 246, 0.55);
}

.btn-primary:hover {
  box-shadow: 0 18px 36px -8px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  color: var(--text-primary);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(148, 163, 184, 0.35);
}

/* Profile Photo & Glowing Ring */
.hero-media {
  display: flex;
  justify-content: center;
}

.avatar-ring-wrap {
  position: relative;
  width: min(350px, 78vw);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.avatar-glow-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #3b82f6, #8b5cf6, #38bdf8, #8b5cf6, #3b82f6);
  filter: blur(0px);
  animation: spinRing 9s linear infinite;
  will-change: transform;
}

.avatar-glow-ring::after {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: inherit;
  filter: blur(26px);
  opacity: 0.45;
  z-index: -1;
}

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

.avatar-frame {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 5px;
  background: var(--bg-primary);
  overflow: hidden;
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  transition: transform 0.5s var(--ease-out-expo);
}

.avatar-ring-wrap:hover .avatar-frame img {
  transform: scale(1.03);
}

.avatar-fallback {
  display: none;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.16), #0f172a);
  color: var(--text-primary);
  font-family: var(--font-display);
}

.avatar-fallback span {
  font-size: 3.25rem;
  font-weight: 700;
}

.avatar-fallback small {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Scroll Down Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.scroll-indicator:hover {
  color: var(--text-primary);
}

.scroll-mouse {
  width: 24px;
  height: 38px;
  border-radius: 99px;
  border: 1.5px solid rgba(148, 163, 184, 0.45);
  display: flex;
  justify-content: center;
  padding-top: 7px;
}

.scroll-wheel {
  width: 4px;
  height: 7px;
  border-radius: 99px;
  background: var(--accent-blue);
  animation: scrollWheel 1.7s var(--ease-out-expo) infinite;
}

@keyframes scrollWheel {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* ==========================================================================
   Shared Sections & Glass Cards
   ========================================================================== */
.section {
  position: relative;
  z-index: 2;
  padding-block: 88px;
}

.section-header {
  max-width: 680px;
  margin-bottom: 44px;
}

.section-title {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 1.02rem;
  color: var(--text-muted);
}

.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 44px -26px rgba(2, 6, 23, 0.85);
}

/* ==========================================================================
   About Section & Stat Counters
   ========================================================================== */
.about-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 900px) {
  .about-layout {
    grid-template-columns: 1.35fr 1fr;
    align-items: stretch;
  }
}

.about-card {
  padding: 32px;
  display: flex;
  align-items: center;
}

.about-lead {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 900px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.25s var(--ease-out-expo), border-color 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.4rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: right;
}

@media (min-width: 601px) and (max-width: 899px) {
  .stat-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-label {
    text-align: left;
  }
}

/* ==========================================================================
   Photos of Nabil Rahman (SEO Photo Gallery)
   ========================================================================== */
.photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 900px) {
  .photo-gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

.photo-card {
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s var(--ease-out-expo), border-color 0.25s ease, box-shadow 0.25s ease;
}

.photo-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 20px 40px -22px rgba(59, 130, 246, 0.5);
}

.photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #0d1428;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transition: transform 0.55s var(--ease-out-expo);
}

.photo-card:hover .photo-frame img {
  transform: scale(1.05);
}

.photo-caption {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.photo-caption strong {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.photo-caption span {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

@media (max-width: 479px) {
  .photo-caption {
    padding: 10px 10px;
  }

  .photo-caption strong {
    font-size: 0.85rem;
  }

  .photo-caption span {
    font-size: 0.72rem;
  }
}

/* ==========================================================================
   Skills Section & Infinite Marquee
   ========================================================================== */
.skills-groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 44px;
}

@media (min-width: 768px) {
  .skills-groups {
    grid-template-columns: repeat(3, 1fr);
  }
}

.skill-group {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s var(--ease-out-expo), border-color 0.25s ease;
}

.skill-group:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
}

.skill-group-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.skill-group-desc {
  font-size: 0.925rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.skill-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.28);
  box-shadow: 0 0 18px -6px rgba(59, 130, 246, 0.45);
  transition: transform 0.2s var(--ease-out-expo), box-shadow 0.2s ease, border-color 0.2s ease;
}

.skill-badge:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 6px 22px -6px rgba(139, 92, 246, 0.6);
}

/* Marquee Ticker */
.marquee-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding-block: 14px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 26s linear infinite;
  will-change: transform;
}

.marquee-wrapper:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-set {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-right: 18px;
}

.marquee-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  background: rgba(16, 24, 46, 0.88);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 0 26px -10px rgba(59, 130, 246, 0.55);
  transition: transform 0.22s var(--ease-out-expo), border-color 0.22s ease, box-shadow 0.22s ease;
}

.marquee-badge svg {
  color: #93c5fd;
  flex-shrink: 0;
}

.marquee-badge:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 10px 28px -8px rgba(139, 92, 246, 0.65);
}

@keyframes marqueeScroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

/* ==========================================================================
   Projects Section (3D Tilt, Moving Gradient Border, Shine Sweep)
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card {
  position: relative;
  border-radius: var(--radius-md);
  padding: 1.5px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.14);
  transform-style: preserve-3d;
  transition: transform 0.22s var(--ease-out-expo), box-shadow 0.25s ease;
  will-change: transform;
}

.project-card:hover {
  box-shadow: 0 26px 52px -24px rgba(59, 130, 246, 0.45);
}

.project-border {
  position: absolute;
  inset: -50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(59, 130, 246, 0.85) 60deg,
    rgba(139, 92, 246, 0.9) 120deg,
    transparent 180deg
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  animation: rotateBorder 6s linear infinite;
  pointer-events: none;
}

.project-card:hover .project-border,
.project-card:focus-within .project-border {
  opacity: 1;
}

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

.project-shine {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 65%
  );
  transform: translateX(-120%);
  transition: transform 0.75s var(--ease-out-expo);
  pointer-events: none;
}

.project-card:hover .project-shine {
  transform: translateX(120%);
}

.project-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: 30px;
  border-radius: calc(var(--radius-md) - 1.5px);
  background: linear-gradient(160deg, rgba(16, 24, 46, 0.96) 0%, rgba(11, 17, 34, 0.98) 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.project-tag {
  font-size: 0.82rem;
  font-weight: 500;
  color: #93c5fd;
  letter-spacing: 0.01em;
}

.project-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.project-desc {
  font-size: 0.975rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.project-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease-out-expo);
}

.project-link:hover {
  background: var(--accent-gradient);
  border-color: transparent;
  transform: translateY(-2px);
}

/* ==========================================================================
   Services Section
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 680px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1080px) {
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.service-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.25s var(--ease-out-expo), border-color 0.25s ease, background-color 0.25s ease;
}

.service-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-glow);
  background: var(--bg-surface-hover);
}

.service-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #93c5fd;
  transition: transform 0.25s var(--ease-out-expo);
}

.service-card:hover .service-icon {
  transform: scale(1.06);
}

.service-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.service-desc {
  font-size: 0.925rem;
  color: var(--text-muted);
}

/* ==========================================================================
   FAQ Accordion
   ========================================================================== */
.faq-container {
  max-width: 860px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  overflow: hidden;
  transition: border-color 0.25s ease;
}

.faq-item:hover {
  border-color: var(--border-glow);
}

.faq-heading {
  margin: 0;
}

.faq-trigger {
  width: 100%;
  min-height: 60px;
  padding: 18px 24px;
  background: transparent;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.faq-icon {
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background-color: #93c5fd;
  transform: translate(-50%, -50%);
  transition: transform 0.28s var(--ease-out-expo), opacity 0.2s ease;
}

.faq-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.faq-trigger[aria-expanded='true'] .faq-icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 0;
}

.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s var(--ease-out-expo);
}

.faq-panel.open {
  grid-template-rows: 1fr;
}

.faq-panel-inner {
  overflow: hidden;
}

.faq-panel-inner p {
  padding: 0 24px 22px;
  font-size: 0.96rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: stretch;
  }
}

.contact-form {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background-color: rgba(10, 15, 30, 0.72);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 4px;
}

.mailto-fallback {
  font-size: 0.9rem;
  font-weight: 500;
  color: #93c5fd;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.mailto-fallback:hover {
  color: #ffffff;
}

.form-status {
  min-height: 1.4em;
  font-size: 0.9rem;
  font-weight: 500;
}

.form-status.is-success {
  color: #6ee7b7;
}

.form-status.is-error {
  color: #fca5a5;
}

.contact-info {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact-info-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.contact-location {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: #93c5fd;
  font-weight: 500;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-link-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(10, 15, 30, 0.45);
  transition: transform 0.22s var(--ease-out-expo), border-color 0.22s ease, background-color 0.22s ease;
}

.contact-link-item:hover {
  transform: translateX(4px);
  border-color: var(--border-glow);
  background: rgba(59, 130, 246, 0.08);
}

.contact-link-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  flex-shrink: 0;
  transition: transform 0.22s var(--ease-out-expo);
}

.contact-link-item:hover .contact-link-icon {
  transform: scale(1.08);
}

.contact-link-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-link-text strong {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.contact-link-text span {
  font-size: 0.85rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Footer & Back to Top Progress Ring
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border-subtle);
  padding-block: 30px;
  background: rgba(7, 11, 22, 0.8);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    text-align: left;
  }
}

.footer-copy {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-domain {
  font-size: 0.9rem;
  font-weight: 500;
  color: #93c5fd;
  transition: color 0.2s ease;
}

.footer-domain:hover {
  color: #ffffff;
}

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

.footer-socials a {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: transform 0.2s var(--ease-out-expo), border-color 0.2s ease, color 0.2s ease;
}

.footer-socials a:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
  color: #ffffff;
}

/* Floating Back to Top Button */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 950;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 24, 46, 0.9);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.25s ease, visibility 0.25s, transform 0.25s var(--ease-out-expo);
  box-shadow: 0 10px 28px -8px rgba(2, 6, 23, 0.85);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-3px);
}

.progress-ring {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.progress-ring-track {
  fill: none;
  stroke: rgba(148, 163, 184, 0.2);
  stroke-width: 2.5;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--accent-blue);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 125.66;
  stroke-dashoffset: 125.66;
  transition: stroke-dashoffset 0.1s linear;
}

.back-to-top-arrow {
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   Scroll Reveal Animations (IntersectionObserver)
   ========================================================================== */
.reveal-up,
.reveal-slide,
.reveal-scale {
  opacity: 0;
  transition:
    opacity 0.65s var(--ease-out-expo) var(--delay, 0ms),
    transform 0.65s var(--ease-out-expo) var(--delay, 0ms);
  will-change: opacity, transform;
}

.reveal-up {
  transform: translateY(24px);
}

.reveal-slide {
  transform: translateX(-24px);
}

.reveal-scale {
  transform: scale(0.95);
}

.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* ==========================================================================
   Accessibility: Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .page-loader {
    display: none;
  }

  .reveal-up,
  .reveal-slide,
  .reveal-scale {
    opacity: 1;
    transform: none;
  }

  .marquee-track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
    justify-content: center;
  }

  .marquee-set[aria-hidden='true'] {
    display: none;
  }

  .cursor-glow {
    display: none;
  }
}

/* ==========================================================================
   Mobile-First Polish (320px - 899px)
   ========================================================================== */
@media (max-width: 959px) {
  :root {
    --header-height: 64px;
  }

  .container {
    padding-inline: 16px;
  }

  .site-header {
    background-color: rgba(10, 15, 30, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: rgba(148, 163, 184, 0.1);
  }

  .brand-logo {
    font-size: 1.1rem;
  }

  .mobile-drawer {
    max-height: calc(100dvh - var(--header-height));
    overflow-y: auto;
    padding: 16px 16px 24px;
  }

  .mobile-link {
    font-size: 0.98rem;
    padding: 12px 14px;
  }

  /* Hero: Avatar on top, centered premium mobile layout */
  .hero-section {
    min-height: auto;
    padding-top: calc(var(--header-height) + 28px);
    padding-bottom: 52px;
  }

  .hero-grid {
    gap: 28px;
  }

  .hero-media {
    order: -1;
  }

  .avatar-ring-wrap {
    width: min(196px, 52vw);
  }

  .avatar-glow-ring::after {
    inset: -10px;
    filter: blur(18px);
    opacity: 0.4;
  }

  .hero-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-kicker {
    font-size: 0.875rem;
    margin-bottom: 6px;
  }

  .hero-title {
    font-size: clamp(2.15rem, 9vw, 3.1rem);
    margin-bottom: 10px;
  }

  .hero-subtitle {
    font-size: clamp(1.08rem, 4.4vw, 1.35rem);
    margin-bottom: 8px;
  }

  .hero-typing {
    font-size: 0.94rem;
    margin-bottom: 14px;
  }

  .hero-tagline {
    font-size: 0.96rem;
    margin-bottom: 14px;
    max-width: 34ch;
  }

  .hero-meta {
    justify-content: center;
    gap: 8px;
    font-size: 0.84rem;
    margin-bottom: 24px;
  }

  .hero-actions {
    width: 100%;
    max-width: 360px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .hero-actions .btn {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.9rem;
    min-height: 46px;
  }

  .scroll-indicator {
    display: none;
  }

  /* Lighter GPU blobs for smooth 60fps Android scrolling */
  .mesh-blob {
    filter: blur(60px);
    opacity: 0.34;
  }

  .blob-blue {
    width: 280px;
    height: 280px;
    top: -60px;
    left: -80px;
  }

  .blob-violet {
    width: 300px;
    height: 300px;
    bottom: -80px;
    right: -90px;
  }

  .blob-indigo {
    width: 220px;
    height: 220px;
  }

  /* Prevent horizontal wobble on scroll reveal */
  .reveal-slide {
    transform: translateY(18px);
  }
}

@media (max-width: 767px) {
  .section {
    padding-block: 52px;
  }

  .section-header {
    margin-bottom: 28px;
  }

  .section-title {
    font-size: clamp(1.5rem, 6.2vw, 1.95rem);
    margin-bottom: 8px;
  }

  .section-subtitle {
    font-size: 0.93rem;
  }

  /* About + Compact 3-Column KPI Row */
  .about-layout {
    gap: 16px;
  }

  .about-card {
    padding: 20px;
  }

  .about-lead {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 14px 10px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
  }

  .stat-value {
    font-size: clamp(1.45rem, 6vw, 1.85rem);
    line-height: 1.1;
  }

  .stat-label {
    font-size: 0.74rem;
    line-height: 1.3;
    text-align: center;
    color: var(--text-muted);
  }

  /* Skills & Marquee */
  .skills-groups {
    gap: 14px;
    margin-bottom: 28px;
  }

  .skill-group {
    padding: 20px;
    gap: 10px;
  }

  .skill-group-title {
    font-size: 1.05rem;
  }

  .skill-group-desc {
    font-size: 0.88rem;
  }

  .skill-badge {
    padding: 6px 12px;
    font-size: 0.82rem;
  }

  .marquee-set {
    gap: 12px;
    padding-right: 12px;
  }

  .marquee-badge {
    padding: 9px 15px;
    font-size: 0.85rem;
    gap: 8px;
  }

  /* Projects */
  .projects-grid {
    gap: 16px;
  }

  .project-inner {
    padding: 20px;
    gap: 10px;
  }

  .project-title {
    font-size: 1.2rem;
  }

  .project-desc {
    font-size: 0.92rem;
    margin-bottom: 6px;
  }

  .project-link {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
  }

  /* Services */
  .services-grid {
    gap: 14px;
  }

  .service-card {
    padding: 20px;
    gap: 10px;
  }

  .service-icon {
    width: 42px;
    height: 42px;
  }

  .service-title {
    font-size: 1.04rem;
  }

  .service-desc {
    font-size: 0.89rem;
  }

  /* FAQ */
  .faq-list {
    gap: 12px;
  }

  .faq-trigger {
    min-height: 54px;
    padding: 15px 16px;
    font-size: 0.95rem;
    gap: 12px;
  }

  .faq-panel-inner p {
    padding: 0 16px 16px;
    font-size: 0.9rem;
    line-height: 1.65;
  }

  /* Contact */
  .contact-grid {
    gap: 16px;
  }

  .contact-form,
  .contact-info {
    padding: 20px;
    gap: 14px;
  }

  .form-group input,
  .form-group textarea {
    font-size: 16px;
    padding: 12px 14px;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .form-actions .btn {
    width: 100%;
    min-height: 48px;
  }

  .mailto-fallback {
    text-align: center;
    padding-block: 4px;
  }

  .contact-link-item {
    padding: 11px 12px;
    gap: 12px;
  }

  .contact-link-icon {
    width: 38px;
    height: 38px;
  }

  .contact-link-text strong {
    font-size: 0.88rem;
  }

  .contact-link-text span {
    font-size: 0.8rem;
  }

  /* Footer & Back-to-top */
  .site-footer {
    padding-block: 24px;
  }

  .footer-copy {
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .footer-links {
    flex-direction: column;
    gap: 12px;
  }

  .back-to-top {
    right: 14px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 379px) {
  .hero-actions {
    grid-template-columns: 1fr;
  }

  .avatar-ring-wrap {
    width: 168px;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }
}
