/* ============================================
   RASTINO Portfolio — Professional Styles
   Brand: امیرعلی راستینه
   ============================================ */

:root {
  --blue-950: #061224;
  --blue-900: #0c1e3d;
  --blue-800: #0f2b5e;
  --blue-700: #1a3a7a;
  --blue-600: #1e4d9b;
  --blue-500: #2563eb;
  --blue-400: #3b82f6;
  --blue-300: #60a5fa;
  --blue-200: #93c5fd;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --white: #ffffff;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --shadow: 0 20px 60px rgba(37, 99, 235, 0.25);
  --font: 'Vazirmatn', system-ui, sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --nav-h: 80px;
  --radius: 16px;
  --text-muted: var(--blue-200);
  --bg: var(--blue-900);
  --bg-card: var(--glass);
}

[data-theme="light"] {
  --blue-900: #f0f4ff;
  --blue-800: #e8eeff;
  --blue-950: #ffffff;
  --glass: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(37, 99, 235, 0.15);
  --white: #0f172a;
  --text-muted: #475569;
  --bg: #f0f4ff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --shadow: 0 20px 60px rgba(37, 99, 235, 0.12);
}

[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] #canvas-container {
  opacity: 0.4;
}

[data-theme="light"] .gradient-text {
  background: linear-gradient(135deg, #1e40af, #2563eb, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--white);
  width: 100%;
  overflow-x: hidden;
  line-height: 1.7;
  transition: background 0.4s, color 0.4s;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

body.menu-open { overflow: hidden; }

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
svg, canvas, video { max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

@media (hover: none) and (pointer: coarse) {
  .btn:active, .nav-link:active, .social-icon:active, .filter-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
  }
  .service-card:active, .project-card:active {
    transform: scale(0.98);
  }
}

* { -webkit-tap-highlight-color: transparent; }

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  right: 1rem;
  background: var(--blue-500);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  z-index: 10000;
  transition: top 0.3s;
}
.skip-link:focus { top: 1rem; }

/* ===== Preloader ===== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--blue-950);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s, visibility 0.6s;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  text-align: center;
}

.preloader-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  animation: logo-pulse 2s ease-in-out infinite;
  border-radius: 16px;
}

@keyframes logo-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(59,130,246,0.4)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 25px rgba(59,130,246,0.7)); }
}

.preloader-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--white), var(--blue-300), var(--blue-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}

.preloader-bar {
  width: 200px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  margin: 0 auto 1rem;
  overflow: hidden;
}

.preloader-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-300));
  border-radius: 3px;
  transition: width 0.3s;
}

.preloader-text {
  font-size: 0.85rem;
  color: var(--blue-300);
}

/* ===== Canvas ===== */
#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  animation: toast-in 0.4s var(--ease);
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.toast.success { background: #059669; color: white; }
.toast.error { background: #dc2626; color: white; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(12, 30, 61, 0.75);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.4s var(--ease);
}

.navbar.scrolled {
  background: rgba(12, 30, 61, 0.95);
  box-shadow: 0 4px 30px rgba(0,0,0,0.2);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.4s var(--ease);
}

.nav-logo-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-logo-img {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
  position: relative;
  z-index: 2;
  transition: transform 0.5s var(--ease), filter 0.3s;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.nav-brand:hover .nav-logo-img {
  transform: rotate(-6deg) scale(1.06);
  filter: drop-shadow(0 0 16px rgba(59, 130, 246, 0.7));
}

.logo-orbit {
  position: absolute;
  inset: -5px;
  border-radius: 16px;
  border: 1.5px solid rgba(96, 165, 250, 0.4);
  animation: logo-orbit 5s linear infinite;
  z-index: 1;
}

.logo-orbit-2 {
  inset: -10px;
  border-style: dashed;
  border-width: 1px;
  opacity: 0.5;
  animation-duration: 8s;
  animation-direction: reverse;
}

@keyframes logo-orbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.brand-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #93c5fd 45%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  transition: filter 0.3s, transform 0.3s;
  text-transform: none;
}

.nav-brand:hover .brand-title {
  filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.45));
  transform: translateX(-2px);
}

.brand-title-footer {
  display: block;
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.mobile-menu-brand { display: none; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.3s;
}

.nav-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.9;
}

.nav-link:hover, .nav-link.active {
  color: var(--white);
  background: rgba(37, 99, 235, 0.15);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  transition: all 0.3s;
}

.theme-toggle:hover { color: var(--blue-300); border-color: var(--blue-400); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  z-index: 1002;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: 0.3s;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}

.nav-overlay.visible { opacity: 1; visibility: visible; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.8rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.4s var(--ease), box-shadow 0.4s;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}

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

.btn svg { width: 18px; height: 18px; }
.btn-sm { padding: 0.5rem 1.2rem; font-size: 0.85rem; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-500), var(--blue-400));
  color: white;
  box-shadow: 0 8px 25px rgba(37,99,235,0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(37,99,235,0.45);
}

.btn-glow:hover {
  box-shadow: 0 0 30px rgba(59,130,246,0.5), 0 12px 35px rgba(37,99,235,0.45);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--blue-400);
}

.btn-outline:hover {
  background: rgba(37,99,235,0.15);
  transform: translateY(-2px);
}

.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}

.btn-ghost:hover { color: var(--white); border-color: var(--blue-400); }
.btn-full { width: 100%; }

/* ===== Sections ===== */
.section {
  position: relative;
  z-index: 2;
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: clip;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-tag {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--blue-300);
  margin-bottom: 1rem;
  backdrop-filter: blur(10px);
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 0.8rem;
}

.section-desc {
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

.gradient-text {
  color: var(--white);
  background: linear-gradient(135deg, var(--white), var(--blue-300), var(--blue-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--nav-h);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-content {
  position: relative;
  z-index: 3;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  background: rgba(37,99,235,0.15);
  border: 1px solid rgba(37,99,235,0.3);
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--blue-300);
  margin-bottom: 1.2rem;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: blink 2s infinite;
}

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

.hero-greeting {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.hero-title {
  position: relative;
  z-index: 3;
  color: var(--white);
  overflow: visible;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 0.8rem;
  min-height: 1.3em;
}

.hero-title.reveal.visible {
  opacity: 1 !important;
  transform: none !important;
}

.typed-name {
  display: inline-block;
  position: relative;
  z-index: 4;
  color: var(--white);
  -webkit-text-fill-color: var(--white);
  text-shadow: 0 0 18px rgba(59, 130, 246, 0.25);
}

.hero-role {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--blue-300);
  font-weight: 600;
  margin-bottom: 1.2rem;
  min-height: 2rem;
}

.typed-cursor {
  animation: cursor-blink 1s infinite;
  color: var(--blue-400);
}

.title-cursor {
  margin-inline-start: 0.15em;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 2rem;
  max-width: 520px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.hero-social {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 2.5rem;
}

.social-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  transition: all 0.3s;
}

.social-icon svg { width: 20px; height: 20px; }

.social-icon:hover {
  background: var(--blue-500);
  color: white;
  border-color: var(--blue-400);
  transform: translateY(-3px);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-item {
  padding: 1rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  text-align: center;
  backdrop-filter: blur(10px);
}

.stat-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--blue-300);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Hero Visual */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-3d-frame {
  position: relative;
  width: 400px;
  height: 400px;
  perspective: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Code programming background */
.code-scene {
  position: absolute;
  inset: -30px -40px;
  z-index: 0;
  pointer-events: none;
}

.code-panel {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 110%;
  max-width: 380px;
  background: rgba(6, 18, 36, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  animation: code-panel-float 6s ease-in-out infinite;
}

@keyframes code-panel-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

.code-panel-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 0.9rem;
  background: rgba(37, 99, 235, 0.12);
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}

.code-panel-header span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.5);
}

.code-panel-header span:nth-child(1) { background: #ef4444; opacity: 0.8; }
.code-panel-header span:nth-child(2) { background: #fbbf24; opacity: 0.8; }
.code-panel-header span:nth-child(3) { background: #22c55e; opacity: 0.8; }

.code-panel-header code {
  margin-right: auto;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.7rem;
  color: var(--blue-300);
}

.code-lines {
  padding: 1rem;
  margin: 0;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.72rem;
  line-height: 1.7;
  color: #94a3b8;
  direction: ltr;
  text-align: left;
  animation: code-typing-glow 3s ease-in-out infinite;
}

.c-keyword { color: #c084fc; }
.c-var { color: #60a5fa; }
.c-str { color: #4ade80; }
.c-fn { color: #fbbf24; }

@keyframes code-typing-glow {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

.code-float-tags {
  position: absolute;
  inset: 0;
}

.code-float-tags span {
  position: absolute;
  font-family: 'Consolas', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(96, 165, 250, 0.35);
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.08);
  animation: tag-float 5s ease-in-out infinite;
}

.code-float-tags span:nth-child(1) { top: 5%; right: 0; animation-delay: 0s; }
.code-float-tags span:nth-child(2) { top: 25%; left: -5%; animation-delay: 1s; font-size: 1.1rem; }
.code-float-tags span:nth-child(3) { bottom: 30%; right: -8%; animation-delay: 2s; }
.code-float-tags span:nth-child(4) { top: 15%; left: 10%; animation-delay: 1.5s; }

@keyframes tag-float {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.5; }
  50% { transform: translateY(-12px) rotate(5deg); opacity: 0.9; }
}

.frame-glow {
  position: absolute;
  inset: 20px;
  background: radial-gradient(circle, rgba(37,99,235,0.4) 0%, rgba(37,99,235,0.1) 45%, transparent 70%);
  border-radius: 50%;
  animation: glow-pulse 4s ease-in-out infinite;
  z-index: 1;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.frame-ring {
  position: absolute;
  border: 2px solid rgba(96,165,250,0.3);
  border-radius: 50%;
  animation: ring-spin 20s linear infinite;
  pointer-events: none;
  z-index: 2;
}

.ring-a { inset: 30px; animation-duration: 12s; }
.ring-b { inset: 5px; border-style: dashed; animation-duration: 20s; animation-direction: reverse; opacity: 0.55; }
.ring-c { inset: -25px; border-width: 1px; animation-duration: 30s; opacity: 0.3; }

@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.profile-orbit-border {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 3;
  background: conic-gradient(from 0deg, #3b82f6, #60a5fa, #93c5fd, #2563eb, #3b82f6);
  animation: border-spin 4s linear infinite;
  padding: 3px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

@keyframes border-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.profile-img-wrap {
  position: relative;
  width: 290px;
  height: 290px;
  flex-shrink: 0;
  transform-style: preserve-3d;
  z-index: 4;
}

.profile-img-wrap.profile-circle {
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(12, 30, 61, 0.9);
  box-shadow:
    0 0 0 2px rgba(96, 165, 250, 0.4),
    0 0 50px rgba(37, 99, 235, 0.5),
    0 25px 60px rgba(0, 0, 0, 0.45);
  background: linear-gradient(160deg, #1e3a8a 0%, #0c1e3d 50%, #172554 100%);
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 8%;
  transform: scale(1.12);
  filter: contrast(1.08) saturate(1.1) brightness(1.05);
  transition: transform 0.5s var(--ease), filter 0.5s;
}

.profile-3d-frame:hover .profile-img {
  transform: scale(1.16);
  filter: contrast(1.1) saturate(1.15) brightness(1.08);
}

.floating-badge {
  position: absolute;
  padding: 0.6rem 1rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  backdrop-filter: blur(15px);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  animation: float-badge 4s ease-in-out infinite;
}

.badge-1 { top: 2%; left: -12%; animation-delay: 0s; z-index: 5; }
.badge-2 { top: 38%; right: -18%; animation-delay: 1s; z-index: 5; }
.badge-3 { bottom: 2%; left: -5%; animation-delay: 2s; z-index: 5; }

@keyframes float-badge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--blue-300);
  font-size: 0.75rem;
  animation: bounce 2s infinite;
}

.mouse {
  width: 22px;
  height: 34px;
  border: 2px solid var(--blue-400);
  border-radius: 11px;
  display: flex;
  justify-content: center;
  padding-top: 5px;
}

.wheel {
  width: 3px;
  height: 7px;
  background: var(--blue-400);
  border-radius: 2px;
  animation: scroll-wheel 2s infinite;
}

@keyframes scroll-wheel {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(10px); }
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ===== Marquee ===== */
.marquee-section {
  position: relative;
  z-index: 2;
  padding: 1.5rem 0;
  background: var(--glass);
  border-block: 1px solid var(--glass-border);
  overflow: hidden;
}

.marquee-track { overflow: hidden; }

.marquee-content {
  display: flex;
  gap: 2rem;
  animation: marquee 30s linear infinite;
  white-space: nowrap;
}

.marquee-content span {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue-300);
  opacity: 0.7;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(50%); }
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 3rem;
}

.about-img-frame {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--glass-border);
  box-shadow: var(--shadow);
}

.about-img-frame img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}

.about-experience {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  background: var(--blue-500);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 8px 25px rgba(37,99,235,0.4);
}

.exp-num { display: block; font-size: 2rem; font-weight: 900; }
.exp-text { font-size: 0.75rem; line-height: 1.4; }

.about-text h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.9;
}

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.about-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.about-features svg {
  width: 18px;
  height: 18px;
  color: var(--blue-400);
  flex-shrink: 0;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.timeline-item {
  padding: 1.5rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  transition: border-color 0.3s;
}

.timeline-item:hover { border-color: var(--blue-400); }

.timeline-year {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--blue-300);
  background: rgba(37,99,235,0.15);
  padding: 0.2rem 0.7rem;
  border-radius: 50px;
  margin-bottom: 0.6rem;
}

.timeline-item h4 { font-size: 1rem; margin-bottom: 0.4rem; }
.timeline-item p { font-size: 0.85rem; color: var(--text-muted); }

/* ===== Services ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.service-card {
  padding: 2rem 1.5rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  transition: all 0.4s var(--ease), border-color 0.3s, box-shadow 0.4s;
  --mouse-x: 50%;
  --mouse-y: 50%;
  background-image: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(59,130,246,0.12), transparent 40%);
}

.service-card:hover {
  border-color: var(--blue-400);
  box-shadow: var(--shadow);
  transform: translateY(-5px);
}

.service-icon {
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.24), rgba(96, 165, 250, 0.1));
  border: 1px solid rgba(96, 165, 250, 0.28);
  color: var(--blue-300);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 24px rgba(6, 18, 36, 0.32);
  transition: all 0.4s var(--ease), box-shadow 0.4s var(--ease);
  position: relative;
  isolation: isolate;
}

.service-icon::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(147, 197, 253, 0.45), rgba(37, 99, 235, 0));
  opacity: 0.5;
  z-index: -1;
}

.service-icon svg {
  width: 30px;
  height: 30px;
  stroke-width: 1.9;
}

.service-card:hover .service-icon {
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.42), rgba(96, 165, 250, 0.2));
  border-color: var(--blue-400);
  color: #dbeafe;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 14px 28px rgba(37, 99, 235, 0.28);
  transform: translateY(-3px) scale(1.03);
}

[data-theme="light"] .service-icon {
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.14), rgba(96, 165, 250, 0.08));
  border-color: rgba(37, 99, 235, 0.28);
  color: var(--blue-500);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 10px 20px rgba(30, 64, 175, 0.14);
}

[data-theme="light"] .service-card:hover .service-icon {
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.26), rgba(96, 165, 250, 0.16));
  color: var(--blue-600);
}

.service-card:nth-child(2) .service-icon { color: #7dd3fc; }
.service-card:nth-child(3) .service-icon { color: #93c5fd; }
.service-card:nth-child(4) .service-icon { color: #60a5fa; }
.service-card:nth-child(5) .service-icon { color: #38bdf8; }
.service-card:nth-child(6) .service-icon { color: #a5b4fc; }

.service-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}

.service-card > p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.service-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.service-list li {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: rgba(37,99,235,0.12);
  color: var(--blue-300);
  border-radius: 6px;
}

/* ===== Skills ===== */
.skills-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

.skills-3d-scene {
  position: relative;
  height: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.2);
}

#skillsCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.skills-scene-label {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 4px;
  color: var(--blue-300);
  opacity: 0.6;
}

.skill-category { margin-bottom: 1.5rem; }
.skill-category h3 {
  font-size: 1rem;
  color: var(--blue-300);
  margin-bottom: 1rem;
}

.skill-bar-item { margin-bottom: 1rem; }

.skill-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.skill-bar-header span:last-child { color: var(--blue-300); }

.skill-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-300));
  border-radius: 6px;
  transition: width 1.2s var(--ease);
  position: relative;
}

.skill-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

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

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.skill-tag {
  padding: 0.4rem 1rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue-300);
  transition: all 0.3s;
}

.skill-tag:hover {
  background: var(--blue-500);
  color: white;
  border-color: var(--blue-400);
  transform: translateY(-2px);
}

/* ===== Projects ===== */
.project-filters {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.filter-btn {
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  transition: all 0.3s;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--blue-500);
  color: white;
  border-color: var(--blue-400);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: all 0.4s var(--ease);
  --mouse-x: 50%;
  --mouse-y: 50%;
  background-image: radial-gradient(500px circle at var(--mouse-x) var(--mouse-y), rgba(59,130,246,0.1), transparent 45%);
}

.project-card:hover {
  border-color: var(--blue-400);
  box-shadow: var(--shadow);
}

.project-card.hidden-card {
  display: none;
}

.project-img {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

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

.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(12,30,61,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s;
}

.project-card:hover .project-overlay { opacity: 1; }

.project-view-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--blue-500);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.8);
  transition: transform 0.3s;
}

.project-view-btn svg { width: 22px; height: 22px; }
.project-card:hover .project-view-btn { transform: scale(1); }

.project-info { padding: 1.5rem; }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.project-tags span {
  font-size: 0.7rem;
  padding: 0.15rem 0.6rem;
  background: rgba(37,99,235,0.15);
  color: var(--blue-300);
  border-radius: 50px;
}

.project-info h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.project-info p { font-size: 0.85rem; color: var(--text-muted); }

.project-live-link {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.8rem;
  color: var(--blue-300);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.25s;
}

.project-live-link:hover {
  color: var(--blue-100);
}

/* ===== Process ===== */
.process-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.process-step {
  flex: 1;
  text-align: center;
  padding: 1.5rem;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-400));
  border-radius: 14px;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 20px rgba(37,99,235,0.3);
}

.process-step h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.process-step p { font-size: 0.85rem; color: var(--text-muted); }

.process-connector {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-300));
  margin-top: 2.5rem;
  flex-shrink: 0;
  opacity: 0.4;
}

/* ===== Testimonials ===== */
.testimonial-slider {
  max-width: 700px;
  margin: 0 auto;
}

.testimonial-track {
  position: relative;
  min-height: 220px;
}

.testimonial-card {
  position: absolute;
  inset: 0;
  padding: 2rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(15px);
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.5s var(--ease);
  pointer-events: none;
}

.testimonial-card.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
}

.testimonial-stars {
  color: #fbbf24;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.testimonial-card > p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.9;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author-avatar {
  width: 44px;
  height: 44px;
  background: var(--blue-500);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.testimonial-author strong { display: block; font-size: 0.95rem; }
.testimonial-author span { font-size: 0.8rem; color: var(--text-muted); }

.testimonial-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.testimonial-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.testimonial-btn:hover {
  background: var(--blue-500);
  color: white;
  border-color: var(--blue-400);
}

.testimonial-btn svg { width: 18px; height: 18px; }

.testimonial-dots {
  display: flex;
  gap: 0.5rem;
}

.testimonial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--glass-border);
  cursor: pointer;
  transition: all 0.3s;
}

.testimonial-dot.active {
  background: var(--blue-400);
  width: 24px;
  border-radius: 4px;
}

/* ===== FAQ ===== */
.faq-list {
  max-width: 700px;
  margin: 0 auto;
}

.faq-item {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin-bottom: 0.8rem;
  overflow: hidden;
  transition: border-color 0.3s;
}

.faq-item[open] { border-color: var(--blue-400); }

.faq-item summary {
  padding: 1.2rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--blue-400);
  transition: transform 0.3s;
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item p {
  padding: 0 1.5rem 1.2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
}

.contact-cards {
  display: grid;
  gap: 1rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: all 0.3s;
}

.contact-card:hover {
  border-color: var(--blue-400);
  transform: translateX(-5px);
}

.contact-card-icon { font-size: 1.5rem; }
.contact-card .label { display: block; font-size: 0.75rem; color: var(--blue-300); }
.contact-card .value {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.contact-form {
  padding: 2rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(15px);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  position: relative;
  margin-bottom: 1.2rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--white);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color 0.3s;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: 0 0 15px rgba(37,99,235,0.15);
}

.form-group input.error,
.form-group textarea.error {
  border-color: #ef4444;
}

.form-group label {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: var(--blue-300);
  font-size: 0.9rem;
  pointer-events: none;
  transition: all 0.3s;
}

.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
  top: -0.5rem;
  right: 0.8rem;
  font-size: 0.7rem;
  background: var(--blue-800);
  padding: 0 0.4rem;
  border-radius: 4px;
}

[data-theme="light"] .form-group input:focus ~ label,
[data-theme="light"] .form-group input:not(:placeholder-shown) ~ label,
[data-theme="light"] .form-group textarea:focus ~ label,
[data-theme="light"] .form-group textarea:not(:placeholder-shown) ~ label {
  background: var(--blue-50);
}

.form-error {
  display: block;
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: 0.3rem;
  min-height: 1rem;
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--blue-800);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  z-index: 1;
  animation: modal-in 0.4s var(--ease);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all 0.3s;
}

.modal-close:hover { background: #ef4444; border-color: #ef4444; }
.modal-close svg { width: 18px; height: 18px; }

.modal-img {
  height: 250px;
  overflow: hidden;
}

.modal-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-body { padding: 2rem; }
.modal-body h2 { font-size: 1.5rem; margin: 0.8rem 0; }
.modal-body > p { color: var(--text-muted); margin-bottom: 1rem; line-height: 1.8; }

.modal-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.modal-details div {
  padding: 0.8rem;
  background: var(--glass);
  border-radius: 10px;
  font-size: 0.85rem;
}

.modal-details strong { color: var(--blue-300); }

.modal-actions {
  display: flex;
  gap: 0.8rem;
}

/* ===== Footer ===== */
.footer {
  position: relative;
  z-index: 2;
  padding: 3rem 2rem 1.5rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(6,18,36,0.8);
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

.footer-logo-wrap {
  margin-bottom: 0.8rem;
}

.footer-brand p { font-size: 0.85rem; color: var(--text-muted); }

.footer-links h4, .footer-contact h4 {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--blue-300);
}

.footer-links a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  transition: color 0.3s;
}

.footer-links a:hover { color: var(--white); }

.footer-contact p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.footer-social {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.footer-social a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.3s;
}

.footer-social a:hover {
  background: var(--blue-500);
  color: white;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--blue-500);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  box-shadow: 0 8px 25px rgba(37,99,235,0.4);
  transition: all 0.3s;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

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

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(37,99,235,0.5);
}

.back-to-top svg { width: 22px; height: 22px; }

/* ===== Tilt Cards ===== */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ===== Responsive ===== */

/* Large desktop */
@media (min-width: 1440px) {
  .section { max-width: 1320px; padding: 6rem 2.5rem; }
  .hero-grid { gap: 4rem; }
  .profile-3d-frame { width: 440px; height: 440px; }
  .profile-img-wrap { width: 310px; height: 310px; }
  .profile-orbit-border { width: 320px; height: 320px; }
}

/* Laptop */
@media (max-width: 1280px) {
  .navbar { padding: 0 1.5rem; }
  .section { padding: 5rem 1.5rem; }
  .hero-grid { gap: 2rem; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 1.5rem; }
}

/* Tablet & small laptop */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2.5rem;
  }

  .hero-visual { order: -1; }
  .hero-desc { margin: 0 auto 2rem; }
  .hero-buttons, .hero-social { justify-content: center; }
  .hero-stats {
    grid-template-columns: repeat(4, 1fr);
    max-width: 520px;
    margin: 0 auto;
  }

  .profile-3d-frame { width: 340px; height: 340px; margin: 0 auto; }
  .profile-img-wrap { width: 250px; height: 250px; }
  .profile-orbit-border { width: 260px; height: 260px; }
  .code-panel { max-width: 320px; }
  .code-lines { font-size: 0.65rem; padding: 0.8rem; }

  .brand-title { font-size: 1.45rem; }
  .nav-logo-wrap, .nav-logo-img { width: 50px; height: 50px; }

  .about-grid { grid-template-columns: 1fr; max-width: 600px; margin: 0 auto; }
  .about-image { order: -1; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-showcase { grid-template-columns: 1fr; }
  .skills-3d-scene { height: 280px; max-width: 500px; margin: 0 auto; }
  .timeline { grid-template-columns: 1fr; max-width: 600px; margin: 0 auto; }
  .contact-grid { grid-template-columns: 1fr; max-width: 600px; margin: 0 auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .process-steps { flex-direction: column; align-items: center; }
  .process-connector { width: 2px; height: 30px; margin: 0; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonial-slider { max-width: 90%; }
}

/* Mobile */
@media (max-width: 768px) {
  html, body, main {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  :root { --nav-h: 72px; }

  .navbar {
    padding: 0 max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: min(85%, 320px);
    height: 100vh;
    height: 100dvh;
    background: rgba(12,30,61,0.98);
    backdrop-filter: blur(20px);
    padding: calc(var(--nav-h) + 1rem) 1.5rem 2rem;
    padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 1rem);
    transition: left 0.4s var(--ease);
    z-index: 999;
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
    box-shadow: 10px 0 30px rgba(2, 6, 23, 0.45);
  }

  .nav-menu.open { left: 0; }

  .mobile-menu-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    margin-top: -16px;
    margin-bottom: 5px;
    padding: 0.2rem 0;
    text-align: center;
  }

  .mobile-menu-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
  }

  .mobile-menu-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--blue-200);
  }

  .nav-links {
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 12px;
  }
  .nav-actions { gap: 0.45rem; }

  .nav-link {
    display: block;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    min-height: 44px;
  }

  .nav-link svg {
    width: 18px;
    height: 18px;
  }

  .nav-toggle { display: flex; min-width: 44px; min-height: 44px; }
  .nav-cv { display: none; }
  .brand-title { font-size: 1.25rem; }
  .nav-logo-wrap, .nav-logo-img { width: 44px; height: 44px; }

  .section {
    padding: 3.5rem max(1rem, env(safe-area-inset-right)) 3.5rem max(1rem, env(safe-area-inset-left));
  }

  .section-header { margin-bottom: 2.5rem; }
  .section-title { font-size: clamp(1.6rem, 6vw, 2.2rem); }

  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-h) + 1.5rem);
    padding-bottom: 4rem;
  }

  .hero-title { font-size: clamp(2rem, 8vw, 2.8rem); }
  .hero-role { font-size: 1rem; }
  .hero-desc { font-size: 0.95rem; }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 340px;
    margin: 0 auto 1.5rem;
  }

  .hero-buttons .btn { width: 100%; justify-content: center; min-height: 48px; }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    max-width: 100%;
  }

  .stat-item { padding: 0.85rem 0.5rem; }
  .stat-num { font-size: 1.5rem; }

  .profile-3d-frame { width: 290px; height: 290px; }
  .profile-img-wrap { width: 210px; height: 210px; }
  .profile-orbit-border { width: 220px; height: 220px; }
  .code-scene { display: none; }
  .floating-badge { display: none; }

  .scroll-indicator { display: none; }

  .marquee-content span { font-size: 0.9rem; }

  .services-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .about-grid {
    gap: 1.4rem;
    margin-bottom: 2rem;
  }
  .about-text {
    max-width: 100%;
    padding-inline: 0.2rem;
    text-align: right;
  }
  .about-text h3 {
    font-size: clamp(1.2rem, 5.2vw, 1.45rem);
    line-height: 1.6;
    margin-bottom: 0.75rem;
  }
  .about-text p {
    font-size: 0.96rem;
    line-height: 1.95;
    margin-bottom: 0.75rem;
  }
  .about-features {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    margin-top: 1rem;
  }
  .about-features li {
    font-size: 0.88rem;
    line-height: 1.8;
    align-items: flex-start;
  }
  .about-features svg {
    margin-top: 0.15rem;
  }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-social { justify-content: center; }

  .modal { padding: 1rem; align-items: flex-end; }
  .modal-content {
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
  }

  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; min-height: 48px; }

  .project-filters { gap: 0.4rem; }
  .filter-btn { padding: 0.45rem 0.9rem; font-size: 0.8rem; min-height: 40px; }

  .contact-form { padding: 1.5rem; }
  .contact-card {
    align-items: flex-start;
    text-align: right;
  }
  .contact-card-icon {
    margin-top: 0.1rem;
    flex-shrink: 0;
  }
  .back-to-top {
    bottom: max(1.2rem, env(safe-area-inset-bottom));
    left: max(1.2rem, env(safe-area-inset-left));
    width: 44px;
    height: 44px;
  }

  .toast-container {
    bottom: max(1.5rem, env(safe-area-inset-bottom));
    left: 1rem;
    right: 1rem;
    transform: none;
  }

  .toast { text-align: center; }

  .skills-tags { gap: 0.45rem; }
  .skill-tag { font-size: 0.75rem; padding: 0.35rem 0.8rem; }

  .process-step { padding: 1rem; }
  .testimonial-card { padding: 1.5rem; }
  .faq-item summary { padding: 1rem 1.2rem; font-size: 0.9rem; }
}

/* Small phones */
@media (max-width: 480px) {
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-social { flex-wrap: wrap; justify-content: center; }
  .social-icon { width: 44px; height: 44px; }

  .profile-3d-frame { width: 260px; height: 260px; }
  .profile-img-wrap { width: 190px; height: 190px; }
  .profile-orbit-border { width: 200px; height: 200px; }

  .brand-title { font-size: 1.1rem; }
  .nav-brand { gap: 0.6rem; }

  .service-card { padding: 1.5rem 1.2rem; }
  .about-text { padding-inline: 0; }
  .about-text h3 { font-size: 1.12rem; }
  .about-text p { font-size: 0.92rem; }
  .project-img { height: 180px; }
  .contact-card { padding: 1rem; }
  .footer-contact p { font-size: 0.8rem; }

  .hero-badge { font-size: 0.78rem; padding: 0.4rem 1rem; }
}

/* Landscape phone */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding-top: calc(var(--nav-h) + 1rem); }
  .hero-grid { grid-template-columns: 1fr 1fr; text-align: right; gap: 1.5rem; }
  .hero-visual { order: 0; }
  .profile-3d-frame { width: 220px; height: 220px; }
  .profile-img-wrap { width: 160px; height: 160px; }
  .profile-orbit-border { width: 170px; height: 170px; }
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
  .scroll-indicator { display: none; }
}
