/* CSS Variables & Theme */
:root {
  /* Color Palette - HSL for easy manipulation */
  --hue-primary: 206;
  /* Azure */
  --hue-secondary: 167;
  /* Teal accent */

  --color-bg: hsl(var(--hue-primary), 20%, 98%);
  --color-bg-card: hsl(0, 0%, 100%);
  --color-bg-alt: hsl(var(--hue-primary), 18%, 95%);
  --color-text-main: hsl(var(--hue-primary), 60%, 15%);
  --color-text-muted: hsl(var(--hue-primary), 22%, 33%);

  --color-primary: hsl(var(--hue-primary), 90%, 55%);
  --color-primary-hover: hsl(var(--hue-primary), 90%, 45%);

  --color-secondary: hsl(var(--hue-secondary), 80%, 60%);
  --color-accent: hsl(22, 88%, 58%);

  /* Gradients */
  --gradient-primary: linear-gradient(
    135deg,
    hsl(var(--hue-primary), 88%, 54%),
    hsl(var(--hue-secondary), 72%, 45%)
  );
  --gradient-vibrant: linear-gradient(
    135deg,
    hsl(var(--hue-primary), 88%, 54%),
    hsl(22, 88%, 58%)
  );
  --gradient-subtle: linear-gradient(
    135deg,
    hsl(var(--hue-primary), 20%, 98%),
    hsl(var(--hue-secondary), 15%, 96%)
  );

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-blur: blur(12px);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 24px;

  --font-sans: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;

  --spacing-container: 2rem;
  --max-width: 1200px;

  --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.3);

  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Light Mode Default (also on :root for fallback) */
:root,
body {
  --color-bg: hsl(220, 20%, 98%);
  --color-bg-card: hsl(0, 0%, 100%);
  --color-bg-alt: hsl(220, 18%, 95%);
  --color-text-main: hsl(220, 60%, 15%);
  --color-text-muted: hsl(220, 22%, 33%);

  --color-primary: hsl(220, 90%, 55%);
  --color-primary-hover: hsl(220, 90%, 45%);

  --color-secondary: hsl(280, 80%, 60%);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Dark Mode Variables */
@media (prefers-color-scheme: dark) {
  :root,
  body {
    --color-bg: hsl(220, 20%, 10%);
    --color-bg-card: hsl(220, 15%, 15%);
    --color-bg-alt: hsl(220, 16%, 13%);
    --color-text-main: hsl(220, 20%, 95%);
    --color-text-muted: hsl(220, 12%, 74%);

    --color-primary: hsl(220, 85%, 65%);
    --color-primary-hover: hsl(220, 85%, 75%);

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  }
}

/* Dark Mode Class Override (takes precedence over media query) */
body.dark-mode {
  --color-bg: hsl(220, 20%, 10%);
  --color-bg-card: hsl(220, 15%, 15%);
  --color-bg-alt: hsl(220, 16%, 13%);
  --color-text-main: hsl(220, 20%, 95%);
  --color-text-muted: hsl(220, 12%, 74%);

  --color-primary: hsl(220, 85%, 65%);
  --color-primary-hover: hsl(220, 85%, 75%);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  background-image:
    radial-gradient(
      circle at 12% 6%,
      rgba(14, 165, 233, 0.16) 0,
      rgba(14, 165, 233, 0) 34%
    ),
    radial-gradient(
      circle at 88% 22%,
      rgba(16, 185, 129, 0.14) 0,
      rgba(16, 185, 129, 0) 36%
    ),
    linear-gradient(180deg, rgba(15, 23, 42, 0.75), rgba(2, 6, 23, 0.92));
}

/* Light Mode Class Override (for manual toggle back to light) */
body:not(.dark-mode) {
  --color-bg: hsl(220, 20%, 98%);
  --color-bg-card: hsl(0, 0%, 100%);
  --color-bg-alt: hsl(220, 18%, 95%);
  --color-text-main: hsl(220, 60%, 15%);
  --color-text-muted: hsl(220, 22%, 33%);

  --color-primary: hsl(220, 90%, 55%);
  --color-primary-hover: hsl(220, 90%, 45%);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

html {
  scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  background-image:
    radial-gradient(
      circle at 8% 8%,
      rgba(14, 165, 233, 0.12) 0,
      rgba(14, 165, 233, 0) 38%
    ),
    radial-gradient(
      circle at 92% 18%,
      rgba(16, 185, 129, 0.1) 0,
      rgba(16, 185, 129, 0) 35%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(248, 250, 252, 0.8));
  color: var(--color-text-main);
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-primary) 70%, white 30%);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
}
.btn:focus-visible,
.theme-toggle:focus-visible,
.mobile-menu-toggle:focus-visible,
.back-to-top:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-primary) 72%, white 28%);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.22);
}

ul {
  list-style: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Accessibility */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  .particles-container,
  .scroll-progress {
    display: none !important;
  }
  .card:hover,
  .portfolio-item:hover,
  .testimonial-card:hover,
  .btn:hover,
  .back-to-top:hover {
    transform: none !important;
    box-shadow: var(--shadow-sm) !important;
  }
  background: var(--color-primary);
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-to-content:focus {
  top: 0;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-container);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* Consistent space between major page sections */
main > section + section {
  margin-top: 2rem;
}

@media (max-width: 768px) {
  main > section + section {
    margin-top: 1.5rem;
  }
}

/* Reusable utilities for previously inline styles */
.link-clean {
  text-decoration: none;
  color: inherit;
}

.bio-card {
  background: var(--color-bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 1.5rem 0;
}

.bio-list {
  list-style: none;
  padding: 0;
}

.mb-05 {
  margin-bottom: 0.5rem;
}

.mb-1 {
  margin-bottom: 1rem;
}

.mt-1 {
  margin-top: 1rem;
}

.mt-2 {
  margin-top: 2rem;
}

.mt-0 {
  margin-top: 0;
}

.ml-05 {
  margin-left: 0.5rem;
}

.skills-max {
  max-width: 800px;
  margin: 3rem auto;
}

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

.text-primary-strong {
  color: var(--color-primary);
  font-weight: 600;
}

.about-content-full {
  grid-column: 1 / -1;
}

.products-grid-narrow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 400px));
  justify-content: center;
}

.bg-alt-section {
  background-color: var(--color-bg-alt);
}

.portfolio-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 1rem;
}

.placeholder-emoji {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.placeholder-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.placeholder-vital {
  background: linear-gradient(135deg, #0f172a, #334155);
  color: white;
}

.placeholder-blood {
  background: linear-gradient(135deg, #7f1d1d, #374151);
  color: white;
}

.placeholder-pulse {
  background: linear-gradient(135deg, #3b82f6, #f8fafc);
  color: #1e293b;
}

.placeholder-amazon {
  background: linear-gradient(135deg, #ff9900, #146eb4);
  color: white;
}

.placeholder-featured {
  background: linear-gradient(135deg, #0ea5e9, #e0f2fe);
  color: #0c4a6e;
}

.placeholder-fasting {
  background: linear-gradient(135deg, #10b981, #ecfdf5);
  color: #064e3b;
}

.placeholder-nephrosite {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: white;
}

.placeholder-polascin-net {
  background: linear-gradient(135deg, #475569, #0f172a);
  color: white;
}

.placeholder-slovak-sites {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: white;
}

.placeholder-books {
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
  color: white;
}

.action-links {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-compact {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.btn-gumroad {
  background-color: #ff90e8;
  color: #000;
  border: none;
  font-weight: 700;
}

.nephrology-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.info-card-static {
  cursor: default;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.info-card-featured {
  border: 1px solid var(--color-primary);
  background: var(--color-bg-alt);
}

.inline-row-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.inline-emoji-md {
  font-size: 1.5rem;
}

.small-note {
  font-size: 0.9em;
  margin-top: 0.5rem;
}

.social-links-inline {
  margin: 1rem 0;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.social-links-inline a {
  font-size: 1.5rem;
  transition: transform 0.2s;
}

.footer-links-inline {
  text-align: center;
  margin-bottom: 1rem;
}

.footer-links-inline a {
  margin: 0 0.5rem;
  font-size: 0.9rem;
}

.honeypot-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* Header */
.site-header {
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding: 1rem 0;
  transition: all 0.3s ease;
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.08);
  padding: 0.75rem 0;
}

@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(20, 30, 48, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .site-header.scrolled {
    background: rgba(20, 30, 48, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

body.dark-mode .site-header {
  background: rgba(20, 30, 48, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .site-header.scrolled {
  background: rgba(20, 30, 48, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

/* Typing Effect Cursor */
.typing-cursor {
  display: inline-block;
  width: 3px;
  background-color: var(--color-primary);
  animation: blink 1s step-end infinite;
  margin-left: 4px;
  vertical-align: middle;
  height: 1em;
}

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

  50% {
    opacity: 0;
  }
}

.logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.1);
}

.nav-links {
  display: flex;
  gap: 2rem;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  font-weight: 600;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

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

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary);
}

.nav-links a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

/* Theme Toggle */
.theme-toggle {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--color-bg-card);
  transform: rotate(20deg);
}

.theme-toggle:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

@media (prefers-color-scheme: dark) {
  .theme-toggle {
    border-color: rgba(255, 255, 255, 0.1);
  }
}

body.dark-mode .theme-toggle {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero-section {
  padding: 7rem 0 6rem;
  text-align: center;
  background:
    radial-gradient(
      circle at 92% 0%,
      rgba(20, 184, 166, 0.18) 0,
      rgba(20, 184, 166, 0) 40%
    ),
    radial-gradient(
      circle at 8% 100%,
      rgba(14, 165, 233, 0.18) 0,
      rgba(14, 165, 233, 0) 44%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(248, 250, 252, 0.95));
  border-radius: 0 0 34px 34px;
}

.hero-content h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(130deg, #0f172a 10%, #0369a1 60%, #0f766e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  border: none;
  font-size: 1rem;
  font-family: inherit;
  position: relative;
}

.btn:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 10px 24px rgba(2, 132, 199, 0.28);
}

.btn-primary:hover:not(:disabled) {
  background: var(--gradient-vibrant);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.72);
  color: var(--color-text-main);
  border: 1px solid rgba(15, 23, 42, 0.14);
  margin-left: 1rem;
}

.btn-secondary:hover {
  border-color: rgba(15, 23, 42, 0.28);
  background-color: rgba(255, 255, 255, 0.95);
}

@media (prefers-color-scheme: dark) {
  .btn-secondary {
    border-color: rgba(255, 255, 255, 0.2);
  }

  .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
  }
}

body.dark-mode .btn-secondary {
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Button Loading State */
.btn-loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn.loading .btn-text {
  display: none;
}

.btn.loading .btn-loader {
  display: block;
}

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

/* Features Section */
.features-section {
  padding: 5rem 0;
}

.features-section h2 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
  font-weight: 700;
}

.card {
  background: var(--color-bg-card);
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border: 1px solid rgba(14, 116, 144, 0.12);
}

@media (prefers-color-scheme: dark) {
  .card {
    border-color: rgba(255, 255, 255, 0.05);
  }
}

body.dark-mode .card {
  border-color: rgba(255, 255, 255, 0.05);
}

.card:hover {
  transform: translateY(-7px);
  box-shadow: 0 18px 32px rgba(2, 132, 199, 0.18);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--color-text-main);
}

.card p {
  color: var(--color-text-muted);
}

/* About Section */
.about-section {
  padding: 5rem 0;
  background: var(--color-bg-card);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.about-intro {
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
  color: var(--color-text-main);
}

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

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.tag {
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-secondary)
  );
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
}

.placeholder-avatar {
  width: 300px;
  height: 300px;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-secondary)
  );
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 800;
  color: white;
  box-shadow: var(--shadow-lg);
}

/* Portfolio Section */
.portfolio-section {
  padding: 5rem 0;
}

.portfolio-section h2 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 700;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.portfolio-item {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border: 1px solid rgba(14, 116, 144, 0.12);
}

@media (prefers-color-scheme: dark) {
  .portfolio-item {
    border-color: rgba(255, 255, 255, 0.05);
  }
}

body.dark-mode .portfolio-item {
  border-color: rgba(255, 255, 255, 0.05);
}

.portfolio-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 34px rgba(2, 132, 199, 0.2);
}

.portfolio-image {
  height: 220px;
  overflow: hidden;
  position: relative;
  background: var(--color-bg);
}

.portfolio-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-item:hover .portfolio-image img {
  transform: scale(1.05);
}

.portfolio-content {
  padding: 1.5rem;
}

/* ... (existing content) ... */

/* Updated Profile Image Style */
.profile-img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: rotate(3deg);
  border: 4px solid var(--color-bg-card);
  transition: transform 0.3s ease;
}

.profile-img:hover {
  transform: rotate(0deg) scale(1.02);
}

.portfolio-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--color-text-main);
}

.portfolio-content p {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mini-tag {
  background: var(--color-bg);
  color: var(--color-text-main);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid rgba(15, 23, 42, 0.16);
}

@media (prefers-color-scheme: dark) {
  .mini-tag {
    border-color: rgba(255, 255, 255, 0.1);
  }
}

body.dark-mode .mini-tag {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Testimonials Section */
.testimonials-section {
  padding: 5rem 0;
  background: var(--color-bg-card);
}

.testimonials-section h2 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 700;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.testimonial-card {
  background: var(--color-bg);
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

@media (prefers-color-scheme: dark) {
  .testimonial-card {
    border-color: rgba(255, 255, 255, 0.05);
  }
}

body.dark-mode .testimonial-card {
  border-color: rgba(255, 255, 255, 0.05);
}

.testimonial-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.testimonial-content {
  margin-bottom: 1.5rem;
}

.testimonial-content p {
  font-style: italic;
  color: var(--color-text-muted);
  line-height: 1.7;
  font-size: 1rem;
}

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

.author-avatar {
  width: 50px;
  height: 50px;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-secondary)
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.author-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.author-info strong {
  color: var(--color-text-main);
  font-size: 0.95rem;
}

.author-info span {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* Contact Section */
/* ... (existing content) ... */

/* =========================================
   Cookie Banner & Consent Modal
   ========================================= */

/* Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--color-bg-card);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.cookie-content {
  flex: 1;
  min-width: 300px;
}

.cookie-content h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: var(--color-text-main);
}

.cookie-content p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0;
}

.cookie-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* Modal */
.cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cookie-modal.visible {
  opacity: 1;
  visibility: visible;
}

.cookie-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.cookie-modal-content {
  background: var(--color-bg-card);
  width: 90%;
  max-width: 600px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 2;
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.cookie-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cookie-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--color-text-main);
}

.cookie-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color 0.2s;
}

.cookie-close:hover {
  color: var(--color-text-main);
}

.cookie-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.cookie-modal-body > p {
  margin-bottom: 2rem;
  color: var(--color-text-muted);
}

.cookie-option {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.cookie-option:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cookie-option-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.cookie-type {
  font-weight: 600;
  color: var(--color-text-main);
}

.cookie-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--color-primary);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--color-primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.toggle-switch.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.toggle-switch.disabled .slider {
  cursor: not-allowed;
}

.cookie-modal-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background: var(--color-bg);
  display: flex;
  justify-content: flex-end;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .cookie-banner,
  .cookie-modal-header,
  .cookie-modal-footer {
    border-color: rgba(255, 255, 255, 0.1);
  }

  .cookie-option {
    border-color: rgba(255, 255, 255, 0.05);
  }

  .slider {
    background-color: #4b5563;
  }
}

body.dark-mode .cookie-banner,
body.dark-mode .cookie-modal-header,
body.dark-mode .cookie-modal-footer {
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .cookie-option {
  border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .slider {
  background-color: #4b5563;
}

.contact-section {
  padding: 5rem 0;
}

.contact-section h2 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 700;
}

.section-subtitle {
  text-align: center;
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: 3rem;
  max-width: 70ch;
  margin-left: auto;
  margin-right: auto;
}

.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  background: var(--color-bg-card);
  color: var(--color-text-main);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  .form-group input,
  .form-group textarea {
    border-color: rgba(255, 255, 255, 0.1);
  }
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
  border-color: rgba(255, 255, 255, 0.1);
}

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

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

.form-group input.error:focus,
.form-group textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* Fade-in Animation */
.fade-in-section {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-secondary)
  );
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  transition: all 0.3s ease;
  z-index: 98;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.back-to-top:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.4);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.back-to-top span {
  line-height: 1;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 23, 42, 0.12);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  position: relative;
  z-index: 101;
  flex-shrink: 0;
}

.mobile-menu-toggle i {
  font-size: 1.1rem;
  color: var(--color-text-main);
  transition: transform 0.2s ease;
}

.mobile-menu-toggle:hover i {
  transform: scale(1.08);
}

.mobile-menu-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .mobile-menu-toggle {
    display: block;
    order: 2;
  }

  .site-header nav {
    position: relative;
    gap: 0.75rem;
  }

  .logo {
    width: 52px;
    height: 52px;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(86vw, 340px);
    height: 100vh;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: calc(5rem + env(safe-area-inset-top)) 1.25rem
      calc(1.5rem + env(safe-area-inset-bottom));
    gap: 0.4rem;
    box-shadow: -10px 0 32px rgba(15, 23, 42, 0.18);
    border-left: 1px solid rgba(15, 23, 42, 0.08);
    transition: right 0.3s ease;
    z-index: 100;
    overflow-y: auto;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    font-size: 1rem;
    text-transform: none;
    letter-spacing: 0.01em;
    font-weight: 600;
    padding: 0.78rem 0.8rem;
    width: 100%;
    text-align: left;
    border-radius: 0.6rem;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background: rgba(14, 165, 233, 0.12);
  }

  .nav-links a::after {
    display: none;
  }

  /* Mobile menu overlay */
  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.3s ease,
      visibility 0.3s ease;
    z-index: 99;
  }

  .mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .logo {
    order: 1;
  }

  .theme-toggle {
    order: 3;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .cta-group {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    align-items: center;
    width: 100%;
  }

  .cta-group .btn {
    width: min(100%, 320px);
  }

  .btn-secondary {
    margin-left: 0;
  }

  .portfolio-grid,
  .grid-3,
  .stats-grid,
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .portfolio-content,
  .testimonial-card,
  .card {
    padding: 1.25rem;
  }

  .section-subtitle {
    margin-bottom: 2rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .placeholder-avatar {
    width: 200px;
    height: 200px;
    font-size: 3.5rem;
    margin: 0 auto;
  }

  .about-image {
    order: -1;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.85rem;
  }

  .hero-content h1 {
    font-size: 1.9rem;
  }

  .hero-subtitle {
    font-size: 0.98rem;
  }

  .nav-links {
    width: 100%;
    padding-inline: 1rem;
  }

  .mobile-menu-toggle,
  .theme-toggle {
    width: 42px;
    height: 42px;
  }

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

/* ============================================
   PREMIUM ENHANCEMENTS - NEW FEATURES
   ============================================ */

/* Scroll Progress Indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-primary);
  z-index: 200;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Particle Container */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 50%;
  opacity: 0.3;
  animation: float 20s infinite ease-in-out;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }

  10% {
    opacity: 0.3;
  }

  50% {
    transform: translateY(-100vh) translateX(50px);
    opacity: 0.5;
  }

  90% {
    opacity: 0.3;
  }
}

/* Glassmorphism Header Enhancement */
.site-header {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(20, 30, 48, 0.7);
  }
}

body.dark-mode .site-header {
  background: rgba(20, 30, 48, 0.7);
}

/* Enhanced Card Hover Effects */
.card,
.portfolio-item,
.testimonial-card {
  position: relative;
  overflow: hidden;
}

.card::before,
.portfolio-item::before,
.testimonial-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s;
}

.card:hover::before,
.portfolio-item:hover::before,
.testimonial-card:hover::before {
  left: 100%;
}

/* Shimmer Effect for Primary Buttons */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

/* Floating Animation for Hero Elements */
@keyframes floating {
  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-20px);
  }
}

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

/* Pulse Animation for Important Elements */
@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  }

  50% {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.6);
  }
}

.btn-primary:hover {
  animation: pulse-glow 2s infinite;
}

/* Statistics Counter Styles */
.stats-section {
  padding: 5rem 0;
  background: var(--gradient-subtle);
  position: relative;
  overflow: hidden;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-top: 3rem;
}

.stat-card {
  text-align: center;
  padding: 2rem;
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition-smooth);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  display: block;
}

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

/* Skill Bars */
.skills-section {
  padding: 5rem 0;
  background: var(--color-bg-card);
}

.skill-item {
  margin-bottom: 2rem;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.skill-name {
  font-weight: 600;
  color: var(--color-text-main);
}

.skill-percentage {
  font-weight: 600;
  color: var(--color-primary);
}

.skill-bar {
  height: 10px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.skill-progress {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  width: 0;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.skill-progress::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

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

  100% {
    transform: translateX(100%);
  }
}

/* Enhanced About Section Background */
.about-section {
  position: relative;
  overflow: hidden;
}

.about-section::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.05), transparent);
  animation: rotate-slow 30s linear infinite;
}

@keyframes rotate-slow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Mobile Responsiveness for New Components */
@media (max-width: 768px) {
  .toast-container {
    right: 10px;
    left: 10px;
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }

  .stat-number {
    font-size: 2.5rem;
  }
}

/* ==========================================
   PREMIUM ENHANCEMENTS - NEW STYLES
   ========================================== */

/* Particle Effects */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: float 20s infinite linear;
}

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
  min-width: 300px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success {
  background: rgba(34, 197, 94, 0.9);
  color: white;
}

.toast.error {
  background: rgba(239, 68, 68, 0.9);
  color: white;
}

.toast.info {
  background: rgba(59, 130, 246, 0.9);
  color: white;
}

.toast-icon {
  font-size: 1.2rem;
  font-weight: bold;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.9rem;
  opacity: 0.9;
}

.toast-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.toast-close:hover {
  opacity: 1;
}

@media (forced-colors: active) {
  .btn,
  .theme-toggle,
  .mobile-menu-toggle,
  .back-to-top,
  .nav-links a,
  input,
  textarea {
    forced-color-adjust: auto;
    border: 1px solid ButtonText;
  }

  .btn-primary,
  .btn-secondary {
    background: ButtonFace !important;
    color: ButtonText !important;
  }
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-secondary)
  );
  z-index: 1001;
  transition: width 0.1s ease;
}

/* Enhanced Button States */
.btn.loading {
  position: relative;
  color: transparent !important;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Enhanced Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--color-bg-card);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  color: var(--color-text-main);
  font-family: inherit;
  font-size: 1rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}

.form-group input.error,
.form-group textarea.error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

/* Enhanced Stats Animation */
.stat-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--color-primary);
  transition: color 0.3s ease;
}

.stat-number.counted {
  animation: countUp 2s ease-out;
}

@keyframes countUp {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Skill Bars Animation */
.skill-progress {
  height: 8px;
  background: var(--color-primary);
  border-radius: 4px;
  width: 0;
  transition: width 2s ease-out;
}

.skill-progress.animated {
  animation: skillFill 2s ease-out;
}

@keyframes skillFill {
  0% {
    width: 0;
  }
}

/* Parallax Elements */
[data-parallax] {
  will-change: transform;
}

/* Enhanced Mobile Menu */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.nav-links.active {
  transform: translateX(0);
}

/* Enhanced Back to Top */
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* Sticky Header Enhancement */
.site-header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
}

.dark-mode .site-header.scrolled {
  background: rgba(15, 23, 42, 0.95);
}

/* Enhanced Fade In Animations */
.fade-in-section {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Enhanced Hover Effects */
.portfolio-item {
  transition: all 0.3s ease;
}

.portfolio-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

/* Print Styles */
@media print {
  .theme-toggle,
  .mobile-menu-toggle,
  .back-to-top,
  .scroll-progress,
  .particles-container,
  .toast-container {
    display: none !important;
  }

  body {
    --color-bg: white;
    --color-text-main: black;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #0000ff;
    --color-secondary: #800080;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.8);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.9);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 1);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .particle,
  .scroll-progress,
  .fade-in-section,
  .stat-number,
  .skill-progress {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================
   CALL-TO-ACTION SECTION
   ========================================== */

.cta-section {
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-secondary)
  );
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.cta-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.cta-content p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
}

/* ==========================================
   MOBILE RESPONSIVENESS FOR NEW COMPONENTS
   ========================================== */

/* ==========================================
   ENHANCED FOOTER
   ========================================== */

footer {
  background: var(--color-bg-card);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.dark-mode footer {
  background: hsl(220, 15%, 12%);
  border-top-color: rgba(255, 255, 255, 0.1);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.footer-section h4 {
  color: var(--color-text-main);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.footer-section p {
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.social-links {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--color-bg);
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.25rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.dark-mode .social-links a {
  background: hsl(220, 15%, 18%);
  border-color: rgba(255, 255, 255, 0.1);
}

.social-links a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--color-primary);
  color: white;
}

.footer-contact {
  margin: 0;
}

.footer-contact a {
  color: var(--color-primary);
  text-decoration: none;
}

.footer-contact a:hover {
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 1.5rem;
  text-align: center;
}

.dark-mode .footer-bottom {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  margin: 0.5rem 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.footer-tagline {
  font-style: italic;
  opacity: 0.8;
}

/* ==========================================
   MOBILE RESPONSIVENESS FOR NEW COMPONENTS
   ========================================== */

@media (max-width: 768px) {
  .cta-content h2 {
    font-size: 2rem;
  }

  .cta-content p {
    font-size: 1.1rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn-large {
    width: 100%;
    max-width: 300px;
  }

  .toast-container {
    right: 10px;
    left: 10px;
    top: 10px;
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }

  .particles-container {
    display: none;
    /* Disable particles on mobile for performance */
  }

  .scroll-progress {
    height: 4px;
    /* Slightly thicker on mobile */
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .social-links {
    justify-content: center;
  }
}

/* ==========================================
   COOKIE CONSENT STYLES
   ========================================== */

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  transform: translateY(100%);
  animation: slideUp 0.5s forwards 1s;
}

@keyframes slideUp {
  to {
    transform: translateY(0);
  }
}

.cookie-content {
  flex: 1;
  max-width: 800px;
}

.cookie-content h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: var(--color-text-main);
}

.cookie-content p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0;
}

.cookie-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .cookie-banner {
    background: rgba(20, 30, 48, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }

  body.dark-mode .cookie-banner {
    background: rgba(20, 30, 48, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }
}

/* Modal Styles */
.cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cookie-modal.visible {
  display: flex;
  opacity: 1;
}

.cookie-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.cookie-modal-content {
  background: var(--color-bg-card);
  width: 90%;
  max-width: 600px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  z-index: 2001;
  overflow: hidden;
  position: relative;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.cookie-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (prefers-color-scheme: dark) {
  .cookie-modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }

  body.dark-mode .cookie-modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }
}

.cookie-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.cookie-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0.5rem;
  line-height: 1;
}

.cookie-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.cookie-option {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.cookie-option:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cookie-option-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.cookie-type {
  font-weight: 600;
  font-size: 1rem;
}

.cookie-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  padding-left: 3.5rem;
  /* Indent to align with text */
}

.cookie-modal-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: flex-end;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--color-primary);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--color-primary);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

/* Disabled Toggle State */
.toggle-switch.disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.toggle-switch.disabled .slider {
  background-color: var(--color-primary);
  /* Always active visual */
  cursor: not-allowed;
}

/* Utility Classes */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 2rem;
    /* Add space for mobile browsers */
  }

  .cookie-actions {
    width: 100%;
    justify-content: stretch;
  }

  .cookie-actions .btn {
    flex: 1;
  }

  .cookie-desc {
    padding-left: 0;
    margin-top: 0.5rem;
  }
}

/* Small-phone micro-tuning */
@media (max-width: 430px) {
  .site-header {
    padding: 0.7rem 0;
  }

  .hero-section {
    padding: 5.8rem 0 4.8rem;
    border-radius: 0 0 24px 24px;
  }

  .hero-content h1 {
    font-size: 1.82rem;
  }

  .section-subtitle {
    font-size: 1rem;
    margin-bottom: 1.6rem;
  }

  .portfolio-grid,
  .grid-3,
  .stats-grid,
  .testimonials-grid {
    gap: 1rem;
  }

  .card,
  .portfolio-content,
  .testimonial-card,
  .stat-card {
    padding: 1rem;
  }

  .btn {
    min-height: 44px;
    padding: 0.72rem 1.1rem;
  }
}

@media (max-width: 390px) {
  .container {
    padding: 0 0.72rem;
  }

  .hero-content h1 {
    font-size: 1.68rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .nav-links {
    padding-inline: 0.85rem;
  }

  .nav-links a {
    font-size: 0.96rem;
    padding: 0.7rem 0.65rem;
  }

  .stat-number {
    font-size: 2.4rem;
  }
}

@media (max-width: 360px) {
  .logo {
    width: 46px;
    height: 46px;
  }

  .mobile-menu-toggle,
  .theme-toggle {
    width: 40px;
    height: 40px;
  }

  .hero-content h1 {
    font-size: 1.56rem;
  }

  .hero-subtitle {
    font-size: 0.92rem;
  }

  .btn {
    font-size: 0.92rem;
    border-radius: 0.85rem;
  }

  .portfolio-image {
    height: 190px;
  }

  .back-to-top {
    width: 40px;
    height: 40px;
    right: 12px;
    bottom: 14px;
  }
}

/* Landscape-phone optimization (short viewport height) */
@media (max-height: 760px) and (orientation: landscape) {
  .site-header {
    padding: 0.55rem 0;
  }

  .hero-section {
    padding: 4.4rem 0 3.2rem;
    border-radius: 0 0 18px 18px;
  }

  .hero-content h1 {
    font-size: clamp(1.7rem, 4.2vw, 2.4rem);
    margin-bottom: 0.85rem;
  }

  .hero-subtitle {
    font-size: 0.97rem;
    margin-bottom: 1.25rem;
    max-width: 66ch;
  }

  .cta-group {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .cta-group .btn {
    width: auto;
    min-height: 40px;
    padding: 0.62rem 1rem;
  }

  main > section + section {
    margin-top: 1.15rem;
  }

  .section-subtitle {
    margin-bottom: 1.5rem;
  }

  .portfolio-grid,
  .grid-3,
  .stats-grid,
  .testimonials-grid {
    gap: 1rem;
  }

  .portfolio-content,
  .card,
  .testimonial-card,
  .stat-card {
    padding: 1rem;
  }

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

@media (max-width: 926px) and (max-height: 500px) and (orientation: landscape) {
  .nav-links {
    width: min(72vw, 340px);
    padding-top: calc(4.2rem + env(safe-area-inset-top));
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    gap: 0.15rem;
  }

  .nav-links a {
    font-size: 0.92rem;
    padding: 0.56rem 0.7rem;
  }
}
