:root {
  color-scheme: dark;
  --color-bg: #000000;
  --color-surface: #1a1a1a;
  --color-text: #FFFFFF;
  --color-text-muted: #94a3b8;
  --color-border: rgba(255, 255, 255, 0.15);
  --color-accent: #D72638;
  --color-accent2: #1AAFE6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
}

a {
  text-decoration: none;
}

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  height: 4px;
  width: 0%;
  background: #D72638;
  transform-origin: left center;
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 32px;
  background: #D72638;
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}

.menu-toggle.is-open span {
  background: #fff;
}

.menu-toggle.is-open span:first-child {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open span:last-child {
  transform: translateY(-8px) rotate(-45deg);
}

#site-menu.is-open {
  display: block;
  animation: revealMenu 0.55s cubic-bezier(0.76, 0, 0.24, 1) both;
}

@keyframes revealMenu {
  from {
    clip-path: circle(0% at 95% 5%);
  }
  to {
    clip-path: circle(150% at 95% 5%);
  }
}

.spin-star {
  animation: spin 20s linear infinite;
}

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

.hero-bg {
  animation: cinematicPan 15s ease-in-out infinite;
}

@keyframes cinematicPan {
  0%, 100% {
    transform: scale(1) translate(0, 0) rotate(0deg);
  }
  35% {
    transform: scale(1.14) translate(-36px, 24px) rotate(1.5deg);
  }
  70% {
    transform: scale(1.05) translate(24px, -18px) rotate(-1deg);
  }
}

.soft-pulse {
  animation: softPulse 8s ease-in-out infinite;
}

@keyframes softPulse {
  0%, 100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.85;
  }
}

.cta-gradient-motion {
  isolation: isolate;
}

.cta-gradient-motion::before {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(215, 38, 56, 0.6), transparent 28%),
    linear-gradient(125deg, #000000 0%, #1A0810 18%, #D72638 42%, #6D1320 56%, #000000 78%, #D72638 100%);
  background-size: 180% 180%, 260% 260%;
  pointer-events: none;
  animation: ctaRedBlackFlow 14s ease-in-out infinite;
}

@keyframes ctaRedBlackFlow {
  0% {
    background-position: 0% 30%, 0% 50%;
  }

  50% {
    background-position: 82% 64%, 100% 50%;
  }

  100% {
    background-position: 0% 30%, 0% 50%;
  }
}

.hero-banner {
  min-height: 100vh;
  min-height: 100svh;
}

.hero-content {
  text-wrap: balance;
}

.hero-headline {
  font-size: var(--hero-font-size, clamp(3.6rem, 13.8vw, 10.5rem));
  letter-spacing: 0;
}

[dir="rtl"] .hero-headline {
  font-size: var(--hero-font-size, clamp(3.25rem, 12.8vw, 9.75rem));
}

.hero-subtitle {
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.hero-cta {
  max-width: min(100%, 22rem);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .cta-gradient-motion::before {
    animation: none;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #D72638;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.35s ease;
}

.service-card:hover::before {
  transform: scaleY(1);
}

.service-card > * {
  position: relative;
  z-index: 1;
}

.clients-logo-section {
  width: 100%;
  max-width: min(1800px, calc(100vw - 2rem));
  margin: 0 auto;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .clients-logo-section {
    max-width: min(1800px, calc(100vw - 4rem));
  }
}

.marquee-track {
  width: max-content;
  animation: marquee 120s linear infinite;
}

@keyframes marquee {
  to {
    transform: translateX(-33.333%);
  }
}

[dir="rtl"] .marquee-track {
  animation-direction: reverse;
}

.work-filter-card.is-hidden {
  display: none;
}

.work-filter.is-active {
  background: #D72638;
  color: #fff;
}

.image-zoom img {
  transition: transform 0.5s ease;
}

.image-zoom:hover img,
.group:hover .image-zoom img {
  transform: scale(1.06);
}

@media (max-width: 640px) {
  .hero-bg {
    left: -20%;
    top: -10%;
    width: 140%;
  }

  .hero-headline {
    display: flex;
    flex-wrap: wrap;
    font-size: var(--hero-mobile-font-size, clamp(3rem, 12.9vw, 3.85rem));
    gap: 0.04em 0.12em;
    justify-content: center;
    max-width: min(100%, 22rem);
    white-space: normal;
    transform: translateZ(0);
  }

  [dir="rtl"] .hero-headline {
    font-size: var(--hero-mobile-font-size, clamp(2.65rem, 11.6vw, 3.45rem));
    max-width: min(100%, 23rem);
  }

  .hero-mobile-line-break {
    flex-basis: 100%;
    height: 0;
  }

  .hero-subtitle {
    max-width: 20rem;
  }

  .hero-cta {
    width: min(100%, 18rem);
  }

  .brand-mark {
    left: 1rem;
    top: 1.35rem;
  }

  .menu-toggle {
    right: 0.75rem;
    top: 0.75rem;
  }

  .menu-toggle span {
    width: 24px;
  }

  .clients-logo-section {
    max-width: 100%;
    overflow: visible;
  }

  .clients-mobile-grid {
    direction: inherit;
  }
}

/* ============================================================
   THEME SYSTEM — CSS Variables + Dark/Light Mode
   ============================================================ */

/* Smooth theme transition on body */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme toggle icon visibility (CSS-driven, no JS flash) */
.theme-icon-moon { display: none; }
.theme-icon-sun  { display: flex; align-items: center; justify-content: center; }
html.light-mode .theme-icon-moon { display: flex; align-items: center; justify-content: center; }
html.light-mode .theme-icon-sun  { display: none; }

/* ============================================================
   LIGHT MODE OVERRIDES
   ============================================================ */

html.light-mode {
  color-scheme: light;
}

html.light-mode body {
  background-color: #F4F4F4;
  color: #1A1A1A;
}

/* bg-black sections → light background */
html.light-mode .bg-black {
  background-color: #F4F4F4;
}

/* text-white → dark text */
html.light-mode .text-white {
  color: #1A1A1A;
}

/* Keep white text on intentionally dark sections */
html.light-mode .hero-banner .text-white,
html.light-mode .hero-banner .text-white\/80 {
  color: #FFFFFF;
}

html.light-mode .cta-gradient-motion .text-white,
html.light-mode .cta-gradient-motion .text-slate-200,
html.light-mode .cta-gradient-motion .text-slate-300 {
  color: #FFFFFF;
}

html.light-mode #site-menu .text-white {
  color: #FFFFFF;
}

/* Keep white text on red accent elements */
html.light-mode .bg-\[\#D72638\] .text-white,
html.light-mode .bg-\[\#D72638\].text-white {
  color: #FFFFFF;
}

/* bg-white surfaces stay white (cards, portfolio section) */
html.light-mode .bg-white {
  background-color: #FFFFFF;
}

/* Border adjustments */
html.light-mode .border-white {
  border-color: #E0E0E0;
}

/* Slate/gray text — darken for light background readability */
html.light-mode .text-slate-400 { color: #4b5563; }
html.light-mode .text-slate-300 { color: #374151; }
html.light-mode .text-slate-200 { color: #374151; }
html.light-mode .text-slate-500 { color: #4b5563; }
html.light-mode .text-slate-600 { color: #374151; }

/* Client logos: currently white-inverted — flip to black for light mode */
html.light-mode .clients-logo-section img,
html.light-mode .clients-mobile-grid img {
  filter: brightness(0) !important;
}

/* Theme toggle button */
#theme-toggle {
  color: #ffffff;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

html.light-mode #theme-toggle {
  color: #1A1A1A;
}

html.light-mode #theme-toggle:hover {
  color: #D72638;
}
