/* ══════════════════════════════════════
   CSS Variables (source of truth)
   ══════════════════════════════════════ */
:root {
  --site-background: #09090b;
  --site-foreground: #fafafa;
  --site-primary: #e93d3d;
  --site-primary-dark: #b91c1c;
  --site-secondary: #0ea5e9;
  --site-accent: #6366f1;
  --site-muted: #18181b;
  --site-muted-foreground: #a1a1aa;
  --site-border: #27272a;
  --site-card: #09090b;
}

/* ══════════════════════════════════════
   Base / Reset
   ══════════════════════════════════════ */
html,
body {
  background: var(--site-background);
  color: var(--site-foreground);
  font-family: "Outfit", sans-serif;
  overflow-x: hidden;
}

body {
  padding-top: 80px;
}

/* ══════════════════════════════════════
   Global Background Texture — Dot Grid
   ══════════════════════════════════════ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px
  );
  background-size: 28px 28px;
}

/* Film grain noise overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* All direct children of body need z-index to sit above the textures */
body > * {
  position: relative;
  z-index: 1;
}

header#mainHeader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
}

/* Footer — very subtle top-edge gradient fade */
footer {
  position: relative;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(233, 61, 61, 0.2) 30%,
    rgba(99, 102, 241, 0.15) 50%,
    rgba(45, 212, 191, 0.2) 70%,
    transparent 100%
  );
  z-index: 1;
}

/* ══════════════════════════════════════
   Gradient Dividers between sections
   ══════════════════════════════════════ */
.section-divider {
  width: 100%;
  height: 1px;
  border: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
  position: relative;
  z-index: 1;
}

/* Colored divider variant */
.section-divider--accent {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(233, 61, 61, 0.2) 50%,
    transparent 100%
  );
}

* {
  scroll-behavior: smooth;
}

::selection {
  background: var(--site-primary);
  color: #fff;
}

::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: var(--site-background);
}

::-webkit-scrollbar-thumb {
  background: var(--site-border);
  border-radius: 8px;
}

/* ══════════════════════════════════════
   Nav Links (pseudo-element underline)
   ══════════════════════════════════════ */
.nav-link {
  position: relative;
  font-weight: 500;
  color: var(--site-muted-foreground);
  transition: color 0.3s;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--site-primary);
  transition: width 0.3s;
}

.nav-link:hover {
  color: var(--site-foreground);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  color: var(--site-foreground);
}

.nav-link.active::after {
  width: 100%;
}

/* ══════════════════════════════════════
   Buttons (hover states)
   ══════════════════════════════════════ */
.btn-primary {
  background: var(--site-primary);
  color: #fff;
  transition:
    background 0.25s,
    transform 0.25s;
}

.btn-primary:hover {
  background: var(--site-primary-dark);
  transform: translateY(-1px);
}

.btn-ghost {
  border: 1.5px solid var(--site-border);
  background: transparent;
  color: var(--site-muted-foreground);
  transition: all 0.25s;
}

.btn-ghost:hover {
  border-color: var(--site-foreground);
  color: var(--site-foreground);
}

.btn-outline {
  border: 1.5px solid var(--site-border);
  background: transparent;
  color: var(--site-muted-foreground);
  transition: all 0.25s;
}

.btn-outline:hover {
  border-color: var(--site-foreground);
  color: var(--site-foreground);
}

/* ══════════════════════════════════════
   Cards (hover interactions)
   ══════════════════════════════════════ */
.card {
  background: var(--site-card);
  border: 1px solid var(--site-border);
  border-radius: 16px;
  padding: 2rem;
  transition:
    border-color 0.3s,
    transform 0.3s;
  position: relative;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-4px);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--site-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.25rem;
  color: var(--site-secondary);
  transition: all 0.3s;
}

.card:hover .feature-icon {
  background: var(--site-secondary);
  color: var(--site-background);
}

/* ══════════════════════════════════════
   Services Grid (3D cascade perspective)
   ══════════════════════════════════════ */
#services-grid {
  perspective: 1000px;
}

/* ══════════════════════════════════════
   Process Bento Grid
   ══════════════════════════════════════ */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* Wide cards span full width */
.bento-wide {
  grid-column: 1 / -1;
}

/* Card base */
.bento-card {
  position: relative;
  background: var(--site-card);
  border: 1px solid var(--site-border);
  border-radius: 20px;
  padding: 2.25rem 2.5rem;
  overflow: hidden;
  transition:
    border-color 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-4px);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.03);
}

/* Watermark number */
.bento-watermark {
  position: absolute;
  top: -0.1em;
  right: 1rem;
  font-size: 8rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.04);
  pointer-events: none;
  user-select: none;
  transition: color 0.5s;
}

.bento-card:hover .bento-watermark {
  color: rgba(255, 255, 255, 0.06);
}

.bento-card:hover .bento-watermark {
  color: rgba(255, 255, 255, 0.035);
}

/* Card inner layout — horizontal for wide, vertical for small */
.bento-card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.bento-card-inner.bento-vertical {
  flex-direction: column;
}

/* Icon */
.bento-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--site-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--site-secondary);
  flex-shrink: 0;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card:hover .bento-icon {
  background: var(--site-secondary);
  color: var(--site-background);
  box-shadow: 0 4px 20px rgba(45, 212, 191, 0.3);
}

/* Content */
.bento-content {
  flex: 1;
  min-width: 0;
}

/* Step label */
.bento-step-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--site-muted-foreground);
  margin-bottom: 0.25rem;
  transition: color 0.4s;
}

.bento-card:hover .bento-step-label {
  color: var(--site-secondary);
}

/* Process tags (shared) */
.process-tag {
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid var(--site-border);
  padding: 0.375rem 1rem;
  font-size: 0.8rem;
  color: var(--site-muted-foreground);
  background: transparent;
  transition: all 0.4s;
}

.bento-card:hover .process-tag {
  border-color: rgba(45, 212, 191, 0.2);
  color: var(--site-foreground);
}

/* ═══ Mobile: single column ═══ */
@media (max-width: 767px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }

  .bento-card {
    padding: 1.75rem;
  }

  .bento-card-inner {
    flex-direction: column;
  }

  .bento-watermark {
    font-size: 5rem;
  }
}

/* ══════════════════════════════════════
   Social Icons (hover state)
   ══════════════════════════════════════ */
.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--site-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--site-muted-foreground);
  transition: all 0.25s;
  background: transparent;
}

.social-icon:hover {
  border-color: var(--site-primary);
  color: var(--site-primary);
}

/* ══════════════════════════════════════
   Footer Links (hover state)
   ══════════════════════════════════════ */
.footer-link {
  color: var(--site-muted-foreground);
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--site-foreground);
}

/* ══════════════════════════════════════
   Mobile Menu & Burger
   ══════════════════════════════════════ */
@media (min-width: 768px) {
  #menuToggle,
  .mobile-menu {
    display: none !important;
  }
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 65px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 6, 8, 0.97);
  backdrop-filter: blur(16px);
  z-index: 30;
}

.mobile-menu.open {
  display: flex;
  flex-direction: column;
}

.mobile-menu ul {
  padding: 2rem 1.5rem;
}

.mobile-menu li {
  margin-bottom: 0.25rem;
}

.mobile-menu a {
  display: block;
  padding: 0.9rem 1rem;
  color: var(--site-foreground);
  font-weight: 500;
  border-radius: 10px;
  transition: background 0.2s;
}

.mobile-menu a:hover {
  background: var(--site-muted);
}

#menuToggle {
  border: none;
  background: none;
  outline: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.burger {
  width: 24px;
  height: 18px;
  position: relative;
}

.burger-bar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--site-foreground);
  border-radius: 2px;
  transition: 0.3s ease;
}

.burger-bar:nth-child(1) {
  top: 0;
}

.burger-bar:nth-child(2) {
  top: 8px;
}

.burger-bar:nth-child(3) {
  top: 16px;
}

#menuToggle.active .burger-bar:nth-child(1) {
  top: 8px;
  transform: rotate(45deg);
}

#menuToggle.active .burger-bar:nth-child(2) {
  opacity: 0;
}

#menuToggle.active .burger-bar:nth-child(3) {
  top: 8px;
  transform: rotate(-45deg);
}

/* ══════════════════════════════════════
   GSAP animation initial state
   ══════════════════════════════════════ */
.gs-hidden {
  opacity: 0;
}

/* ══════════════════════════════════════
   Light Theme variables & overrides
   ══════════════════════════════════════ */
.theme-light {
  --site-background: #ffffff;
  --site-foreground: #09090b;
  --site-muted: #f4f4f5;
  --site-muted-foreground: #52525b;
  --site-border: #e4e4e7;
  --site-card: #ffffff;

  background-color: var(--site-background);
  color: var(--site-foreground);
}

.theme-light::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(
    circle,
    rgba(0, 0, 0, 0.05) 1px,
    transparent 1px
  );
  background-size: 28px 28px;
}

.theme-light::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* Specific light theme adjustments */
.theme-light .card {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.theme-light .card:hover {
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

.theme-light .bento-card {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.theme-light .bento-card:hover {
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

.theme-light .bento-watermark {
  color: rgba(0, 0, 0, 0.03);
}

.theme-light .bento-card:hover .bento-watermark {
  color: rgba(0, 0, 0, 0.05);
}
