/* ==========================================================================
   Custom CSS — Portfolio Website
   Theme tokens, animations, glassmorphism, micro-interactions
   ========================================================================== */

/* ---------- CSS Variables (Dark mode default) ---------- */
:root {
  /* Brand accent — electric violet (primary) + cyan (secondary) */
  --accent-500: #7c5cff;
  --accent-400: #9d85ff;
  --accent-600: #5a3fe0;
  --accent-glow: rgba(124, 92, 255, 0.5);

  --cyan-500: #5d08da;
  --cyan-glow: rgba(34, 211, 238, 0.4);

  /* Surfaces (dark mode) */
  --bg-base: #0a0a0f;
  --bg-elevated: #11111a;
  --bg-overlay: rgba(17, 17, 26, 0.7);
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);

  /* Text */
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --text-inverse: #0a0a0f;

  /* Misc */
  --gradient-brand: linear-gradient(135deg, #7c5cff 0%, #5d08da 100%);
  --gradient-text: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
  --gradient-accent: linear-gradient(135deg, #7c5cff 0%, #b794ff 50%, #5d08da 100%);
  --shadow-glow: 0 0 40px rgba(124, 92, 255, 0.15);
  --shadow-glow-lg: 0 0 80px rgba(124, 92, 255, 0.25);
  --shadow-elevated: 0 20px 40px -10px rgba(0, 0, 0, 0.5);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
}



/* ---------- Base ---------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01", "ss03";
  transition: background-color var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
  min-height: 100vh;
}

::selection {
  background: var(--accent-500);
  color: white;
}

/* ---------- Scrollbar (webkit) ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-500);
}

/* ---------- Typography helpers ---------- */
.font-display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  font-weight: 600;
}

.font-mono {
  font-family: var(--font-mono);
}

.text-gradient {
  background: var(--gradient-accent);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 8s ease infinite;
}

.text-gradient-static {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-muted {
  color: var(--text-secondary);
}
.text-subtle {
  color: var(--text-tertiary);
}

@keyframes gradient-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* ---------- Glassmorphism ---------- */
.glass {
  background: var(--bg-overlay);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
}

.glass-strong {
  background: var(--bg-overlay);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
}

/* Frosted sticky navbar surface */
.nav-frosted {
  background: var(--bg-overlay);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.nav-frosted.is-scrolled {
  /* Slightly more opaque + a subtle bottom shadow when scrolled */
  background: var(--bg-overlay-strong, var(--bg-overlay));
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.25);
  border-bottom-color: var(--border-strong);
}

/* Stronger background surface tokens — give the frosted layer something to sit on */
:root {
  --bg-overlay: rgba(10, 10, 15, 0.65);
  --bg-overlay-strong: rgba(10, 10, 15, 0.85);
}

/* Safari fallback: when backdrop-filter isn't supported we still want opaque bg */
@supports not ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .nav-frosted { background: var(--bg-elevated); }
  .glass-strong { background: var(--bg-elevated); }
}

.glass-card {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: var(--gradient-brand);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--accent-glow);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

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

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: transparent;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 9999px;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--accent-500);
  transform: translateY(-2px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

/* ---------- Backgrounds & ambient effects ---------- */
.grid-bg {
  background-image: linear-gradient(
      to right,
      var(--border) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(
    ellipse 80% 60% at 50% 0%,
    black 0%,
    transparent 80%
  );
}

.dot-bg {
  background-image: radial-gradient(
    circle,
    var(--border-strong) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
}

.blob {
  position: absolute;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
  border-radius: 50%;
  z-index: 0;
  animation: blob-float 12s ease-in-out infinite;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-500), transparent 70%);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--cyan-500), transparent 70%);
  top: 30%;
  right: -150px;
  animation-delay: -4s;
}

.blob-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #ff5c9d, transparent 70%);
  bottom: -100px;
  left: 30%;
  animation-delay: -8s;
}

@keyframes blob-float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(40px, -30px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 40px) scale(0.95);
  }
}

/* ---------- Noise texture overlay ---------- */
.noise::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}

/* ---------- Noise utility class ---------- */
.noise-overlay {
  position: relative;
}
.noise-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
  mix-blend-mode: overlay;
  border-radius: inherit;
}

/* ---------- Scroll animations (IntersectionObserver driven) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--transition-slow),
    transform var(--transition-slow);
}
.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-fade {
  opacity: 0;
  transition: opacity 1s ease;
}
.reveal-fade.is-visible {
  opacity: 1;
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity var(--transition-slow),
    transform var(--transition-slow);
}
.reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity var(--transition-slow),
    transform var(--transition-slow);
}
.reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity var(--transition-slow),
    transform var(--transition-slow);
}
  .reveal-right.is-visible {
    opacity: 1;
    transform: translateX(0);
  }

/* ---------- Testimonial slider ---------- */
.testimonial-slider {
  position: relative;
  overflow: hidden;
}

.testimonial-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.testimonial-slide {
  flex: 0 0 100%;
  min-width: 0;
  padding: 0 0.5rem;
}

@media (min-width: 768px) {
  .testimonial-slide {
    flex: 0 0 50%;
  }
}

@media (min-width: 1024px) {
  .testimonial-slide {
    flex: 0 0 33.333%;
  }
}

.testimonial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  padding: 0;
}

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

.testimonial-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}

.testimonial-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-500);
  color: var(--accent-500);
}

.star-filled {
  color: #f59e0b;
  fill: #f59e0b;
}

/* Stagger children delays via CSS variable --i set inline */
.stagger > * {
  transition-delay: calc(var(--i, 0) * 80ms);
}

/* ---------- Marquee ---------- */
.marquee {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
  gap: 3rem;
}

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

/* ---------- Magnetic hover glow ---------- */
.glow-hover {
  transition: box-shadow var(--transition-base);
}
.glow-hover:hover {
  box-shadow: 0 0 0 1px var(--accent-500), 0 8px 30px var(--accent-glow);
}

/* ---------- Skills icon cards ---------- */
.skill-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  cursor: default;
  overflow: hidden;
}

.skill-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    var(--accent-glow),
    transparent 40%
  );
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

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

.skill-card:hover {
  border-color: var(--accent-500);
  transform: translateY(-4px);
}

.skill-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  transition: transform var(--transition-spring);
}

.skill-card:hover .skill-card-icon {
  transform: scale(1.15);
  color: var(--accent-400);
}

/* ---------- Navbar ---------- */
.nav-link {
  position: relative;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.25rem;
  transition: color var(--transition-base);
  text-decoration: none;
}

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

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

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--gradient-brand);
  border-radius: 2px;
}

.nav-mobile-link {
  display: block;
  padding: 0.875rem 1rem;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--transition-base);
}

.nav-mobile-link:hover,
.nav-mobile-link.active {
  background: var(--surface-hover);
}

/* ---------- Custom cursor ---------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, opacity 0.2s;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, opacity 0.25s;
}

.cursor-ring.is-hover {
  width: 56px;
  height: 56px;
  border-color: var(--accent-400);
}

@media (max-width: 768px) {
  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}

/* ---------- Project / Portfolio cards ---------- */
.project-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--transition-base);
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
}

.project-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--bg-elevated),
    var(--surface-hover)
  );
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.85) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
}

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

.project-overlay-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-base);
  text-decoration: none;
}

.project-overlay-btn:hover {
  background: white;
  color: var(--text-inverse);
}

/* ---------- Filter chips ---------- */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.filter-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.filter-chip.active {
  background: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
}

/* ---------- Tech badges ---------- */
.tech-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  transition: all var(--transition-base);
}

.tech-badge:hover {
  border-color: var(--accent-500);
  color: var(--text-primary);
}

/* ---------- Skill tags (no percentages) ---------- */
.skill-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: all var(--transition-base);
  line-height: 1.4;
}

.skill-tag:hover {
  border-color: var(--accent-400);
  color: var(--text-primary);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 2.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-500), var(--accent-400), transparent);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.375rem;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-500);
  border: 3px solid var(--bg-base);
  box-shadow: 0 0 0 2px var(--accent-500), 0 0 12px var(--accent-glow);
  transition: all var(--transition-base);
  z-index: 1;
}

.timeline-item:hover::before {
  transform: scale(1.2);
  box-shadow: 0 0 0 2px var(--accent-500), 0 0 20px var(--accent-glow);
}

.timeline-card-sleek {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 1px solid var(--border);
}

.timeline-card-sleek:hover {
  border-color: var(--border-strong);
  border-left-color: var(--accent-500);
  background: var(--surface-hover);
}

.timeline-date {
  color: var(--accent-400);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--accent-500);
  padding: 1.25rem 1.5rem;
  transition: all var(--transition-base);
}

.timeline-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  border-left-color: var(--accent-400);
  transform: translateX(4px);
}

/* ---------- Form ---------- */
.form-field {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all var(--transition-base);
  outline: none;
  resize: vertical;
}

.form-field::placeholder {
  color: var(--text-tertiary);
}

.form-field:focus {
  border-color: var(--accent-500);
  background: var(--surface-hover);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.form-field.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.form-field.is-valid {
  border-color: #22c55e;
}

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

select.form-field {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--bg-elevated);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239d85ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
  cursor: pointer;
}

select.form-field:hover {
  border-color: var(--accent-500);
}

select.form-field option {
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 0.5rem;
}
}

.form-error {
  color: #ef4444;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: none;
}

.form-field.is-invalid + .form-error {
  display: block;
}

/* Floating label */
.form-group {
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---------- Loading screen ---------- */
.loader-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-text {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-accent);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 2s ease infinite, pulse 1.5s ease infinite;
}

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

.loader-bar {
  width: 200px;
  height: 2px;
  margin-top: 1rem;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}

.loader-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-brand);
  animation: loader-slide 1.2s ease-in-out infinite;
}

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

/* ---------- Back-to-top ---------- */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-base);
  box-shadow: 0 4px 20px var(--accent-glow);
  z-index: 100;
}

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

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

/* ---------- Badge / availability indicator ---------- */
.availability-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.875rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #22c55e;
}

.availability-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse-dot 2s ease infinite;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* ---------- Hero decorations ---------- */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      to right,
      var(--border) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(
    ellipse 80% 70% at 50% 30%,
    black,
    transparent 70%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 80% 70% at 50% 30%,
    black,
    transparent 70%
  );
  opacity: 0.5;
  pointer-events: none;
}

.hero-stars {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    2px 2px at 20% 30%,
    var(--text-tertiary),
    transparent
  ),
    radial-gradient(1.5px 1.5px at 60% 70%, var(--text-tertiary), transparent),
    radial-gradient(1px 1px at 50% 50%, var(--text-tertiary), transparent),
    radial-gradient(1.5px 1.5px at 80% 10%, var(--text-tertiary), transparent),
    radial-gradient(2px 2px at 90% 60%, var(--text-tertiary), transparent),
    radial-gradient(1px 1px at 33% 80%, var(--text-tertiary), transparent),
    radial-gradient(1.5px 1.5px at 15% 60%, var(--text-tertiary), transparent),
    radial-gradient(2px 2px at 70% 25%, var(--text-tertiary), transparent);
  background-size: 200% 200%;
  pointer-events: none;
  opacity: 0.4;
  animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from {
    background-position: 0% 0%;
    opacity: 0.3;
  }
  to {
    background-position: 100% 100%;
    opacity: 0.5;
  }
}

/* ---------- Profile image glow ---------- */
.profile-glow {
  position: relative;
}

.profile-glow::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: var(--gradient-brand);
  filter: blur(60px);
  opacity: 0.4;
  z-index: -1;
  border-radius: 50%;
  animation: pulse 4s ease infinite;
}

.profile-frame {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

/* ---------- Blog post typography ---------- */
.prose {
  color: var(--text-primary);
  font-size: 1.0625rem;
  line-height: 1.75;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.02em;
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.prose p {
  margin: 1.25rem 0;
  color: var(--text-secondary);
}

.prose a {
  color: var(--accent-400);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition-base);
}

.prose a:hover {
  color: var(--accent-500);
}

.prose ul,
.prose ol {
  margin: 1.25rem 0;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.prose li {
  margin: 0.5rem 0;
}

.prose blockquote {
  border-left: 3px solid var(--accent-500);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-secondary);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent-400);
}

.prose pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.prose pre code {
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
}

.prose img {
  border-radius: var(--radius-md);
  margin: 2rem 0;
  width: 100%;
  border: 1px solid var(--border);
}

/* ---------- Tool cards ---------- */
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.tool-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

/* ---------- Masonry ---------- */
.masonry {
  column-count: 1;
  column-gap: 1.5rem;
}

@media (min-width: 640px) {
  .masonry {
    column-count: 2;
  }
}

@media (min-width: 1024px) {
  .masonry {
    column-count: 3;
  }
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

/* ---------- Mobile nav overlay ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
  display: flex;
  flex-direction: column;
  padding: 6rem 1.5rem 2rem;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
}

/* ---------- Utility ---------- */
.divider-gradient {
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--border-strong),
    transparent
  );
}

.hover-lift {
  transition: transform var(--transition-base);
}
.hover-lift:hover {
  transform: translateY(-3px);
}

/* Scrollbar-hiding utility (used on horizontal filter rows) */
.hide-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Fade edges of overflowing content (used on marquees) */
.mask-fade {
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--accent-500);
  outline-offset: 2px;
  border-radius: 4px;
}

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

  .reveal,
  .reveal-up,
  .reveal-fade,
  .reveal-scale,
  .reveal-left,
  .reveal-right {
    opacity: 1 !important;
    transform: none !important;
  }
}
