:root {
  --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.08), 0 1px 1px rgba(2, 6, 23, 0.04);
  --shadow-md: 0 10px 26px rgba(2, 6, 23, 0.10);
  --shadow-lg: 0 18px 44px rgba(2, 6, 23, 0.12);
  --shadow-xl: 0 28px 70px rgba(2, 6, 23, 0.14);
  --shadow-2xl: 0 40px 120px rgba(2, 6, 23, 0.22);
  --shadow-colored: 0 26px 70px rgba(188, 38, 73, 0.18);

  --container-max-width: 1240px;
  --section-padding: clamp(64px, 7vw, 110px) 0;

  --border-light: rgba(2, 6, 23, 0.10);
  --border-medium: rgba(2, 6, 23, 0.18);

  --bg-primary: #ffffff;
  --bg-secondary: #f6f7fb;
  --bg-tertiary: #eef2f7;

  --text-primary: #0b1220;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-white: #ffffff;

  --gradient-primary: linear-gradient(135deg, #bc2649 0%, #8b1d35 100%);
  --gradient-secondary: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);

  --transition-fast: 120ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-normal: 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-slow: 360ms cubic-bezier(0.2, 0.8, 0.2, 1);

  --nav-height: 78px;
  --focus-ring: 0 0 0 4px rgba(56, 189, 248, 0.35);
}

::selection {
  background: rgba(188, 38, 73, 0.22);
}

html {
  scroll-padding-top: calc(var(--nav-height) + 24px);
}

body {
  background:
    radial-gradient(900px 600px at 8% -10%, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(800px 520px at 92% 0%, rgba(188, 38, 73, 0.12), transparent 55%),
    var(--bg-primary);
}

section[id] {
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

a {
  color: inherit;
}

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

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.95rem 1.7rem;
  border-radius: 999px;
  line-height: 1;
}

.btn-primary {
  box-shadow: var(--shadow-colored);
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-outline-primary {
  border: 2px solid rgba(188, 38, 73, 0.30);
  color: var(--primary-600);
  background: rgba(188, 38, 73, 0.02);
}

.btn-outline-primary:hover {
  background: rgba(188, 38, 73, 0.10);
  border-color: rgba(188, 38, 73, 0.45);
  color: var(--primary-700);
}

.btn-outline-secondary {
  border: 2px solid rgba(2, 6, 23, 0.16);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.55);
}

.btn-outline-secondary:hover {
  background: rgba(2, 6, 23, 0.06);
  border-color: rgba(2, 6, 23, 0.22);
  color: var(--text-primary);
}

/* Navbar */
.navbar {
  background: rgba(2, 6, 23, 0.40);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: none;
  padding: 0.85rem 0;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 10px 40px rgba(2, 6, 23, 0.10);
}

.navbar-brand img {
  height: 44px;
}

.navbar:not(.scrolled) .navbar-brand img {
  filter: brightness(0) invert(1);
}

.navbar.scrolled .navbar-brand img {
  filter: brightness(0) saturate(100%) invert(27%) sepia(99%) saturate(7483%) hue-rotate(348deg) brightness(94%) contrast(92%);
}

.nav-link {
  color: rgba(255, 255, 255, 0.92);
  box-shadow: none !important;
  transform: none !important;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.10);
}

.navbar.scrolled .nav-link {
  color: var(--text-secondary);
}

.navbar.scrolled .nav-link:hover,
.navbar.scrolled .nav-link.active {
  color: var(--primary-600);
  background: rgba(188, 38, 73, 0.10);
}

.navbar-toggler {
  border: none;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 14px;
}

.navbar.scrolled .navbar-toggler {
  background: rgba(2, 6, 23, 0.06);
}

.navbar:not(.scrolled) .hamburger-line {
  background: rgba(255, 255, 255, 0.92);
}

.navbar.scrolled .hamburger-line {
  background: var(--text-primary);
}

@media (max-width: 992px) {
  .navbar-collapse {
    margin-top: 14px;
    border-radius: var(--border-radius-xl);
    padding: 12px;
    background: rgba(2, 6, 23, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(18px);
  }

  .navbar.scrolled .navbar-collapse {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border-light);
  }
}

/* Hero (Index) */
.hero-section {
  background:
    radial-gradient(900px 500px at 16% 18%, rgba(56, 189, 248, 0.22), transparent 55%),
    radial-gradient(900px 520px at 86% 18%, rgba(188, 38, 73, 0.34), transparent 55%),
    linear-gradient(135deg, #0b1220 0%, #111b2d 55%, #1b1020 120%);
  color: var(--text-white);
  text-align: right;
  padding-top: calc(var(--nav-height) + 42px);
  padding-bottom: 84px;
}

.hero-background,
.gradient-overlay {
  display: none;
}

.hero-content {
  max-width: 620px;
  margin: 0;
}

.hero-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.hero-title {
  color: #ffffff;
  font-size: clamp(2.3rem, 4vw, 3.7rem);
}

.title-line {
  color: #ffffff;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.86);
  max-width: 58ch;
}

.hero-features {
  justify-content: flex-start;
  gap: 14px;
}

.feature-item {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
  color: rgba(255, 255, 255, 0.92);
}

.feature-item i {
  color: rgba(255, 255, 255, 0.92);
}

.hero-buttons {
  justify-content: flex-start;
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.70);
  color: rgba(255, 255, 255, 0.92);
}

.btn-outline-light:hover {
  border-color: #ffffff;
}

.floating-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.16);
}

@media (max-width: 992px) {
  .hero-section {
    text-align: center;
  }

  .hero-content {
    margin: 0 auto;
  }

  .hero-features,
  .hero-buttons {
    justify-content: center;
  }
}

/* Sections */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(188, 38, 73, 0.08);
  border: 1px solid rgba(188, 38, 73, 0.12);
  color: var(--primary-700);
}

.section-title {
  letter-spacing: -0.015em;
}

.section-subtitle {
  max-width: 70ch;
  margin-inline: auto;
}

.stats-section,
.services-section,
.contact-section {
  background: transparent;
}

.stat-card,
.service-card,
.portfolio-card,
.contact-form {
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.stat-card:hover,
.service-card:hover,
.portfolio-card:hover {
  box-shadow: var(--shadow-lg);
}

.portfolio-image {
  height: auto;
}

.portfolio-image img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: rgba(2, 6, 23, 0.12);
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(10px);
}

.filter-btn.active,
.filter-btn:hover {
  border-color: rgba(188, 38, 73, 0.30);
  background: rgba(188, 38, 73, 0.10);
}

/* Works page */
.page-hero {
  padding-top: calc(var(--nav-height) + 56px);
  padding-bottom: 56px;
  background:
    radial-gradient(900px 540px at 85% 0%, rgba(188, 38, 73, 0.18), transparent 60%),
    radial-gradient(900px 540px at 10% 10%, rgba(56, 189, 248, 0.14), transparent 60%),
    linear-gradient(180deg, #0b1220 0%, #0b1220 65%, rgba(11, 18, 32, 0) 100%);
  color: var(--text-white);
  text-align: center;
}

.page-hero .section-badge {
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
}

.page-hero-title {
  color: var(--text-white);
  font-weight: 900;
  font-size: clamp(2.1rem, 3.6vw, 3.1rem);
  margin-bottom: 12px;
}

.page-hero-subtitle {
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.05rem;
  max-width: 75ch;
  margin: 0 auto;
}

.section-padding {
  padding: var(--section-padding);
}

.projects-section {
  background: var(--bg-secondary);
}

.filter-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-buttons .filter-btn i {
  font-size: 1.05em;
}

.projects-section .project-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.projects-section .project-card:hover {
  box-shadow: var(--shadow-lg);
}

.projects-section .project-image {
  background: #ffffff;
}

/* Section background rhythm */
.stats-section,
.portfolio-section,
.process-section {
  background: var(--bg-primary);
}

.services-section,
.contact-section {
  background: var(--bg-secondary);
}
