/* WaltzSec Global Styles */

/* ============================================
   Self-hosted Fonts (eliminates render-blocking Google Fonts request)
   ============================================ */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  ascent-override: 105%;
  descent-override: 30%;
  line-gap-override: 0%;
  size-adjust: 98%;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  ascent-override: 105%;
  descent-override: 30%;
  line-gap-override: 0%;
  size-adjust: 98%;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  ascent-override: 105%;
  descent-override: 30%;
  line-gap-override: 0%;
  size-adjust: 98%;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  ascent-override: 105%;
  descent-override: 30%;
  line-gap-override: 0%;
  size-adjust: 98%;
}

/* ============================================
   CSS Variables - Theme Colors
   ============================================ */

:root {
  /* Dark mode (default) */
  --color-bg-primary: #09090b;
  --color-bg-secondary: rgba(24, 24, 27, 0.3);
  --color-bg-card: #18181b;
  --color-bg-card-hover: #27272a;
  --color-bg-elevated: #27272a;
  --color-bg-input: #18181b;

  --color-text-primary: #ffffff;
  --color-text-secondary: #a1a1aa;
  --color-text-muted: #71717a;
  --color-text-inverted: #18181b;

  --color-border: #27272a;
  --color-border-light: #3f3f46;

  --color-surface-overlay: rgba(9, 9, 11, 0.95);
  --color-surface-blur: rgba(9, 9, 11, 0.98);

  /* Brand colors (same for both modes) */
  --color-brand: #d31145;
  --color-brand-hover: #b50e3a;
  --color-brand-light: rgba(211, 17, 69, 0.1);
  --color-brand-glow: rgba(211, 17, 69, 0.25);

  /* Focus ring color */
  --color-focus-ring: #d31145;
}

html.light {
  /* Light mode overrides */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f4f4f5;
  --color-bg-card: #ffffff;
  --color-bg-card-hover: #f4f4f5;
  --color-bg-elevated: #f4f4f5;
  --color-bg-input: #ffffff;

  --color-text-primary: #18181b;
  --color-text-secondary: #52525b;
  --color-text-muted: #71717a;
  --color-text-inverted: #ffffff;

  --color-border: #e4e4e7;
  --color-border-light: #d4d4d8;

  --color-surface-overlay: rgba(255, 255, 255, 0.95);
  --color-surface-blur: rgba(255, 255, 255, 0.98);

  --color-brand-light: rgba(211, 17, 69, 0.08);
}

/* ============================================
   Logo Theme Switching
   ============================================ */

.light-logo {
  display: block;
}

.dark-logo {
  display: none;
}

html:not(.light) .light-logo {
  display: none;
}

html:not(.light) .dark-logo {
  display: block;
}


/* ============================================
   Base Styles
   ============================================ */

* {
  font-family:
    "Plus Jakarta Sans",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

html,
body {
  overflow-x: hidden;
  width: 100%;
}

body {
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* ============================================
   Accessibility Utilities
   ============================================ */

/* Screen reader only - visually hidden but accessible */
.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;
}

/* ============================================
   Focus States
   ============================================ */

/* Global focus-visible styles for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* Remove default focus for mouse users, keep for keyboard */
:focus:not(:focus-visible) {
  outline: none;
}

/* Buttons and links */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Form inputs */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 0;
  border-color: var(--color-brand);
}

/* Cards and interactive containers */
.card-hover:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-brand);
  color: white;
  padding: 8px 16px;
  z-index: 10000;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   Theme-Aware Utility Classes
   ============================================ */

/* Backgrounds */
.bg-theme-primary {
  background-color: var(--color-bg-primary);
}
.bg-theme-secondary {
  background-color: var(--color-bg-secondary);
}
.bg-theme-card {
  background-color: var(--color-bg-card);
}
.bg-theme-elevated {
  background-color: var(--color-bg-elevated);
}
.bg-theme-overlay {
  background-color: var(--color-surface-overlay);
}
.bg-theme-blur {
  background-color: var(--color-surface-blur);
}

/* Text */
.text-theme-primary {
  color: var(--color-text-primary);
}
.text-theme-secondary {
  color: var(--color-text-secondary);
}
.text-theme-muted {
  color: var(--color-text-muted);
}
.text-theme-inverted {
  color: var(--color-text-inverted);
}

/* Borders */
.border-theme {
  border-color: var(--color-border);
}
.border-theme-light {
  border-color: var(--color-border-light);
}

/* Brand backgrounds */
.bg-brand-light {
  background-color: var(--color-brand-light);
}

/* ============================================
   Custom Gradients & Effects
   ============================================ */

.gradient-text {
  background: linear-gradient(135deg, #d31145 0%, #e04a6f 50%, #e87590 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-border {
  background: linear-gradient(
    135deg,
    rgba(211, 17, 69, 0.3) 0%,
    rgba(211, 17, 69, 0.1) 100%
  );
}

.glow-red {
  box-shadow: 0 0 80px var(--color-brand-glow);
}

/* ============================================
   Interactive Elements
   ============================================ */

.card-hover {
  transition: all 0.3s ease;
}

/* Consolidated hover state for cards */
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Light mode shadow adjustment */
html.light .card-hover:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Product icon filter (makes SVGs red) */
.product-icon {
  filter: brightness(0) saturate(100%) invert(27%) sepia(95%) saturate(7151%)
    hue-rotate(346deg) brightness(86%) contrast(86%);
}

/* White icons inside the red CTA section */
#contact .product-icon {
  filter: brightness(0) invert(1);
}

/* ============================================
   Animations
   ============================================ */

@keyframes pulse-slow {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.7;
  }
}

.animate-pulse-slow {
  animation: pulse-slow 4s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.05);
  }
}

.animate-breathe {
  animation: breathe 2s ease-in-out infinite;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .animate-pulse-slow,
  .animate-breathe {
    animation: none;
  }

  .card-hover {
    transition: none;
  }

  .card-hover:hover {
    transform: none;
  }

  .stepper-connector-fill {
    transition: none;
  }

  .service-content-active,
  .service-content-exit {
    transition: none;
  }
}

/* ============================================
   Navigation
   ============================================ */

.sticky-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  background-color: var(--color-surface-overlay);
  transition: all 0.3s ease;
}

.sticky-nav.scrolled {
  background-color: var(--color-surface-blur);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

/* Navigation link focus states */
.sticky-nav a:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ============================================
   Mobile Accessibility
   ============================================ */

@media (max-width: 768px) {
  button,
  a {
    min-height: 44px;
  }
}

/* ============================================
   Section Backgrounds
   ============================================ */

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

/* ============================================
   Form Elements (for future HubSpot forms)
   ============================================ */

.form-input {
  background-color: var(--color-bg-input);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

.form-input:focus {
  border-color: var(--color-brand);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-brand-light);
}

.form-input:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 0;
}

/* ============================================
   Video Container
   ============================================ */

.video-container {
  background: linear-gradient(
    to bottom right,
    var(--color-bg-card),
    var(--color-bg-primary)
  );
}

/* ============================================
   Form Validation
   ============================================ */

.field-error {
  color: #e04a6f;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: none;
}

.field-error.visible {
  display: block;
}

.input-error {
  border-color: #d31145 !important;
}

/* ============================================
   Services Section
   ============================================ */

/* Light mode: detail card needs visible separation from section bg */
html.light #service-detail {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.04);
}

/* ============================================
   Services Stepper
   ============================================ */

.stepper-node {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.stepper-node:hover .stepper-circle {
  border-color: rgba(211, 17, 69, 0.5);
}

.stepper-node:hover .stepper-label {
  color: var(--color-text-secondary);
}

.stepper-connector {
  position: relative;
}

.stepper-connector-fill {
  transition: width 0.4s ease;
}

/* Light mode stepper adjustments */
html.light .stepper-node:not(.active):not(.completed) .stepper-circle {
  background-color: var(--color-bg-elevated);
  border-color: var(--color-border);
}

/* ============================================
   Service Card Transitions
   ============================================ */

.service-content-active {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.service-content-exit {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.service-content-enter {
  opacity: 0;
  transform: translateX(20px);
}

/* ============================================
   Service Placeholder Panels
   ============================================ */

.service-placeholder-bg {
  background: linear-gradient(
    135deg,
    var(--color-bg-elevated) 0%,
    var(--color-bg-card) 50%,
    rgba(211, 17, 69, 0.06) 100%
  );
  transition: background 0.4s ease;
}

[data-step="0"] .service-placeholder-bg {
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-card) 40%, rgba(211, 17, 69, 0.06) 100%);
}

[data-step="1"] .service-placeholder-bg {
  background: linear-gradient(160deg, var(--color-bg-elevated) 0%, var(--color-bg-card) 40%, rgba(211, 17, 69, 0.10) 100%);
}

[data-step="2"] .service-placeholder-bg {
  background: linear-gradient(180deg, var(--color-bg-elevated) 0%, var(--color-bg-card) 40%, rgba(211, 17, 69, 0.14) 100%);
}

[data-step="3"] .service-placeholder-bg {
  background: linear-gradient(200deg, var(--color-bg-elevated) 0%, var(--color-bg-card) 40%, rgba(211, 17, 69, 0.18) 100%);
}

/* ============================================
   Floating Badge (on visual panel)
   ============================================ */

.floating-badge {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html.light .floating-badge {
  background-color: rgba(255, 255, 255, 0.85);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

html:not(.light) .floating-badge {
  background-color: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* ============================================
   Cookie Consent Banner
   ============================================ */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background-color: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  padding: 1rem 1.5rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cookie-banner.visible {
  transform: translateY(0);
}

/* ============================================
   Scroll Animations
   ============================================ */

.scroll-fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.stagger-children > .scroll-fade-up:nth-child(1) { transition-delay: 0ms; }
.stagger-children > .scroll-fade-up:nth-child(2) { transition-delay: 80ms; }
.stagger-children > .scroll-fade-up:nth-child(3) { transition-delay: 160ms; }
.stagger-children > .scroll-fade-up:nth-child(4) { transition-delay: 240ms; }
.stagger-children > .scroll-fade-up:nth-child(5) { transition-delay: 320ms; }
.stagger-children > .scroll-fade-up:nth-child(6) { transition-delay: 400ms; }

/* Counter animation */
.stat-counter {
  display: inline-block;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .scroll-fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .stagger-children > .scroll-fade-up {
    transition-delay: 0ms !important;
  }
}
