/* ============================================================
   WELEED.AI — DESIGN SYSTEM
   Signature motif: "Signal Flow" — a thin champagne line that
   pulses through the page like data moving through an automated
   system, tying visually to the AI-automation positioning.
   ============================================================ */

:root {
  /* Color tokens */
  --espresso-deep: #150E09;
  --espresso: #241810;
  --espresso-surface: #2F2117;
  --champagne: #D4B896;
  --champagne-light: #E9D9BC;
  --cream: #F3ECE0;
  --bronze: #8A6F52;
  --bronze-dim: #5C4A38;

  /* Type */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  /* Motion */
  --ease-signature: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@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;
    scroll-behavior: auto !important;
  }
}

body {
  background: var(--espresso-deep);
  color: var(--cream);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Texture: fine film grain over espresso bg ---------- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--champagne-light);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze);
}

.text-muted { color: rgba(243, 236, 224, 0.62); }

/* ---------- Signature: Signal line ---------- */
.signal-line {
  position: relative;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--bronze-dim) 20%, var(--bronze-dim) 80%, transparent);
  overflow: visible;
}
.signal-line::after {
  content: '';
  position: absolute;
  top: -1.5px;
  left: -6px;
  width: 8px;
  height: 4px;
  border-radius: 999px;
  background: var(--champagne-light);
  box-shadow: 0 0 12px 2px rgba(212,184,150,0.9);
  animation: signal-travel 4.5s linear infinite;
}
@keyframes signal-travel {
  0% { left: -2%; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* ---------- Nav scroll state ---------- */
#site-nav.scrolled {
  background: rgba(21,14,9,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(138,111,82,0.2);
}
#menu-toggle.open span:first-child { transform: translateY(3px) rotate(45deg); }
#menu-toggle.open span:last-child { transform: translateY(-3px) rotate(-45deg); }
#menu-toggle span { transition: transform 0.3s var(--ease-signature); }

/* ---------- Ambient floating orbs ---------- */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  opacity: 0.35;
}
.orb-1 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, var(--champagne) 0%, transparent 70%);
  top: -80px; right: -60px;
  animation: orb-float-1 14s ease-in-out infinite;
}
.orb-2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--bronze) 0%, transparent 70%);
  bottom: -40px; left: -40px;
  animation: orb-float-2 18s ease-in-out infinite;
}
.orb-3 {
  width: 220px; height: 220px;
  background: radial-gradient(circle, var(--champagne-light) 0%, transparent 70%);
  top: 40%; left: 55%;
  animation: orb-float-3 20s ease-in-out infinite;
  opacity: 0.2;
}
@keyframes orb-float-1 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-40px, 50px) scale(1.15); }
}
@keyframes orb-float-2 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(50px, -30px) scale(1.1); }
}
@keyframes orb-float-3 {
  0%, 100% { transform: translate(0,0) scale(1); opacity: 0.2; }
  50% { transform: translate(-30px, -40px) scale(1.25); opacity: 0.32; }
}
@media (prefers-reduced-motion: reduce) {
  .orb { animation: none !important; }
}

/* ---------- Cursor glow (desktop only) ---------- */
#cursor-glow {
  position: fixed;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,184,150,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
  will-change: transform;
}

/* ---------- Word reveal (hero headline) ---------- */
.word-reveal { display: inline-block; overflow: hidden; vertical-align: top; }
.word-reveal span {
  display: inline-block;
  transform: translateY(110%);
  animation: word-up 0.9s var(--ease-signature) forwards;
}
@keyframes word-up { to { transform: translateY(0); } }

/* ---------- Rotating/pulsing service icons ---------- */
.icon-spin { animation: icon-rotate 10s linear infinite; transform-origin: center; }
.icon-pulse { animation: icon-pulse 2.4s ease-in-out infinite; transform-origin: center; }
.icon-drift { animation: icon-drift 4s ease-in-out infinite; }
@keyframes icon-rotate { to { transform: rotate(360deg); } }
@keyframes icon-pulse { 0%,100% { opacity: 0.55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes icon-drift { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
  .icon-spin, .icon-pulse, .icon-drift { animation: none !important; }
}

/* ---------- Gradient mesh shift (hero backdrop) ---------- */
.mesh-bg {
  position: absolute; inset: -10%;
  background:
    radial-gradient(circle at 20% 30%, rgba(212,184,150,0.10) 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(138,111,82,0.14) 0%, transparent 40%),
    radial-gradient(circle at 60% 80%, rgba(233,217,188,0.08) 0%, transparent 45%);
  background-size: 200% 200%;
  animation: mesh-shift 16s ease-in-out infinite;
}
@keyframes mesh-shift {
  0%, 100% { background-position: 0% 0%, 100% 0%, 50% 100%; }
  50% { background-position: 100% 100%, 0% 100%, 0% 0%; }
}
@media (prefers-reduced-motion: reduce) {
  .mesh-bg { animation: none !important; }
}

/* ---------- Work page filters ---------- */
.filter-btn {
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--bronze-dim);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--cream);
  opacity: 0.7;
  transition: all 0.3s var(--ease-signature);
}
.filter-btn:hover { opacity: 1; border-color: var(--champagne); }
.filter-btn.active {
  background: var(--champagne);
  color: var(--espresso-deep);
  border-color: var(--champagne);
  opacity: 1;
  font-weight: 600;
}
.work-card { transition: opacity 0.4s var(--ease-signature), transform 0.4s var(--ease-signature); }
.work-card.hidden-filter { display: none; }

/* ---------- Nav ---------- */
.nav-link {
  position: relative;
  color: var(--cream);
  opacity: 0.75;
  transition: opacity 0.3s var(--ease-signature);
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--champagne);
  transition: width 0.35s var(--ease-signature);
}
.nav-link:hover, .nav-link.active { opacity: 1; }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* ---------- Buttons ---------- */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.8rem;
  background: var(--champagne);
  color: var(--espresso-deep);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 3px;
  overflow: hidden;
  transition: transform 0.4s var(--ease-signature), box-shadow 0.4s var(--ease-signature);
  box-shadow: 0 0 0 0 rgba(212,184,150,0);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px rgba(212,184,150,0.45);
}
.btn-primary .arrow { transition: transform 0.4s var(--ease-signature); }
.btn-primary:hover .arrow { transform: translateX(4px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--bronze-dim);
  color: var(--cream);
  border-radius: 3px;
  transition: border-color 0.35s var(--ease-signature), background 0.35s var(--ease-signature);
}
.btn-ghost:hover {
  border-color: var(--champagne);
  background: rgba(212,184,150,0.06);
}

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(160deg, var(--espresso-surface), var(--espresso));
  border: 1px solid rgba(138,111,82,0.25);
  border-radius: 6px;
  transition: transform 0.5s var(--ease-signature), border-color 0.5s var(--ease-signature), box-shadow 0.5s var(--ease-signature);
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(212,184,150,0.5);
  box-shadow: 0 24px 48px -20px rgba(0,0,0,0.6);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-signature), transform 0.9s var(--ease-signature);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Marquee (trust strip) ---------- */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Hero network canvas ---------- */
#hero-canvas { position: absolute; inset: 0; }

/* ---------- Utility ---------- */
.container-x { max-width: 1240px; margin-inline: auto; padding-inline: 1.5rem; }
@media (min-width: 768px) { .container-x { padding-inline: 3rem; } }

.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--bronze-dim), transparent); }

::selection { background: var(--champagne); color: var(--espresso-deep); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--espresso-deep); }
::-webkit-scrollbar-thumb { background: var(--bronze-dim); border-radius: 4px; }
