/* ============================================
   Gugubrand — Premium AI Agency Styles
   Brand: Green #2B6650 | Gold #DAB437 | Dark
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- CSS Custom Properties --- */
:root {
  --color-bg-primary: #0A0A0F;
  --color-bg-surface: #12121A;
  --color-bg-elevated: #1A1A26;
  --color-brand-green: #2B6650;
  --color-brand-gold: #DAB437;
  --color-brand-cream: #FAEDCD;
  --color-green-signal: #00FF88;
  --color-text-primary: #F0F0F5;
  --color-text-secondary: #8A8A9A;
  --color-text-muted: #4A4A5A;
  --color-border: #1E1E2E;

  --shadow-glow-gold: 0 0 20px rgba(218, 180, 55, 0.2);
  --shadow-glow-gold-strong: 0 0 40px rgba(218, 180, 55, 0.3);
  --shadow-glow-green: 0 0 20px rgba(43, 102, 80, 0.3);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* --- Base Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* --- Focus States --- */
*:focus-visible {
  outline: 2px solid var(--color-brand-gold);
  outline-offset: 2px;
}

/* --- Selection --- */
::selection {
  background: rgba(43, 102, 80, 0.3);
  color: var(--color-text-primary);
}

/* --- Section Spacing --- */
.section-spacing {
  padding: 5rem 0;
}

@media (min-width: 768px) {
  .section-spacing {
    padding: 7rem 0;
  }
}

@media (min-width: 1024px) {
  .section-spacing {
    padding: 9rem 0;
  }
}

/* ============================================
   AGENT STATUS PULSE
   ============================================ */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 4px var(--color-green-signal);
  }
  50% {
    opacity: 0.5;
    box-shadow: 0 0 12px var(--color-green-signal);
  }
}

.agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-green-signal);
  display: inline-block;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
  background-color: transparent;
}

.navbar.scrolled {
  background-color: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--color-border);
}

.nav-cta {
  box-shadow: var(--shadow-glow-gold);
  transition: all 0.2s ease;
}

.nav-cta:hover {
  box-shadow: var(--shadow-glow-gold-strong);
  transform: translateY(-1px);
}

/* Nav Link Underline */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-brand-green);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.nav-link.active {
  color: var(--color-text-primary);
}

.nav-link.active::after {
  transform: scaleX(1);
}

/* ============================================
   MOBILE MENU
   ============================================ */
.mobile-menu {
  position: fixed;
  inset: 0;
  background-color: rgba(10, 10, 15, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu a {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.mobile-menu a:hover {
  color: var(--color-brand-green);
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  z-index: 101;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   HERO
   ============================================ */
.hero-title {
  font-size: clamp(2.5rem, 6vw, 5.5rem);
}

/* Animated gradient mesh */
@keyframes meshMove1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes meshMove2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, 30px) scale(1.1); }
  66% { transform: translate(30px, -10px) scale(0.9); }
}

@keyframes meshMove3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, 40px) scale(1.05); }
}

.hero-mesh {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero-mesh::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(43, 102, 80, 0.08) 0%, transparent 70%);
  animation: meshMove1 20s ease-in-out infinite;
}

.hero-mesh::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(ellipse, rgba(218, 180, 55, 0.04) 0%, transparent 70%);
  animation: meshMove2 25s ease-in-out infinite;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 30%;
  left: 40%;
  width: 40%;
  height: 40%;
  background: radial-gradient(ellipse, rgba(0, 255, 136, 0.02) 0%, transparent 70%);
  animation: meshMove3 18s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   HERO — AGENT TERMINAL
   ============================================ */
.terminal-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow:
    0 0 60px rgba(43, 102, 80, 0.08),
    0 25px 50px rgba(0, 0, 0, 0.3);
  max-width: 480px;
  margin-left: auto;
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--color-border);
}

.terminal-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.terminal-line {
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.terminal-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.terminal-divider {
  padding: 2px 0;
  overflow: hidden;
}

.terminal-check {
  font-size: 0.85rem;
}

.terminal-spinner {
  font-size: 0.85rem;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Progress bar */
.terminal-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 4px;
}

.terminal-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.terminal-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-brand-green), var(--color-green-signal));
  border-radius: var(--radius-full);
  transition: width 2s ease-out;
}

.terminal-progress-fill.animate {
  width: 78%;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-gold {
  box-shadow: var(--shadow-glow-gold);
  transition: all 0.25s ease;
}

.btn-gold:hover {
  box-shadow: var(--shadow-glow-gold-strong);
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-ghost-green {
  transition: all 0.25s ease;
}

.btn-ghost-green:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--color-text-secondary);
  transform: translateY(-1px);
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Stagger children */
.reveal:nth-child(2) { transition-delay: 80ms; }
.reveal:nth-child(3) { transition-delay: 160ms; }
.reveal:nth-child(4) { transition-delay: 240ms; }

/* ============================================
   PAIN ITEMS
   ============================================ */
.pain-item {
  transition: all 0.25s ease;
}

.pain-item:hover {
  padding-left: 8px;
}

/* ============================================
   AGENT CARDS (legacy)
   ============================================ */
.agent-card {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.agent-card__watermark {
  position: absolute;
  top: -10px;
  right: 16px;
  font-size: 8rem;
  line-height: 1;
  opacity: 0.03;
  pointer-events: none;
  user-select: none;
}

.agent-card:hover {
  transform: translateY(-4px);
  border-color: rgba(43, 102, 80, 0.3);
}

/* Agent tag chips */
.agent-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  transition: all 0.2s ease;
}

/* ============================================
   TEAM TABS (Desktop)
   ============================================ */
.team-tabs {
  gap: 0;
  margin-bottom: 0;
}

.team-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--color-text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  justify-content: center;
  white-space: nowrap;
}

.team-tab:hover {
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.02);
}

.team-tab--active {
  color: var(--color-text-primary);
  border-bottom-color: var(--color-brand-gold);
}

/* Dynamic accent: set via JS */
.team-tab--active[data-color="#DAB437"] { border-bottom-color: #DAB437; }
.team-tab--active[data-color="#00FF88"] { border-bottom-color: #00FF88; }
.team-tab--active[data-color="#60A5FA"] { border-bottom-color: #60A5FA; }
.team-tab--active[data-color="#C084FC"] { border-bottom-color: #C084FC; }
.team-tab--active[data-color="#FAEDCD"] { border-bottom-color: #FAEDCD; }

/* ============================================
   TEAM PANELS (Desktop)
   ============================================ */
.team-panel {
  display: none;
  padding-top: 32px;
}

.team-panel--active {
  display: block;
  animation: fadeInPanel 0.35s ease;
}

@keyframes fadeInPanel {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.team-panel__header {
  margin-bottom: 24px;
}

/* ============================================
   SUB-AGENT CARDS
   ============================================ */
.sub-agent-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  transition: all 0.3s ease;
}

.sub-agent-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.sub-agent-card:hover .agent-tag {
  border-color: rgba(255, 255, 255, 0.1);
}

/* ============================================
   TEAM ACCORDION (Mobile)
   ============================================ */
.team-accordion {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.team-accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: background 0.2s ease;
}

.team-accordion__trigger:hover {
  background: rgba(255, 255, 255, 0.02);
}

.team-accordion__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  padding: 0 16px;
}

.team-accordion--open .team-accordion__content {
  max-height: 2000px;
}

.team-accordion__chevron {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.team-accordion--open .team-accordion__chevron {
  transform: rotate(180deg);
}

/* ============================================
   PROCESS TIMELINE
   ============================================ */
.process-timeline {
  position: relative;
}

.process-connect-line {
  display: none;
}

@media (min-width: 768px) {
  .process-connect-line {
    display: block;
    position: absolute;
    top: 28px;
    left: calc(16.67% + 24px);
    right: calc(16.67% + 24px);
    height: 2px;
    background: linear-gradient(90deg, var(--color-brand-green), var(--color-brand-gold), var(--color-green-signal));
    opacity: 0.3;
    z-index: 0;
  }
}

.process-step {
  text-align: center;
  position: relative;
  z-index: 1;
}

.process-step__number {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-bg-surface);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  transition: all 0.3s ease;
}

.process-step:hover .process-step__number {
  border-color: var(--color-brand-gold);
  box-shadow: 0 0 20px rgba(218, 180, 55, 0.15);
}

/* Mini Calendar Visual */
.process-step__visual {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  max-width: 200px;
  margin: 0 auto;
}

.mini-calendar__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.mini-calendar__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.mini-calendar__grid span {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--color-border);
}

.mini-calendar__grid span.active {
  background: var(--color-brand-gold);
  box-shadow: 0 0 8px rgba(218, 180, 55, 0.3);
}

/* Mini Terminal Visual */
.mini-terminal {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-terminal__line {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Mini Chart Visual */
.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 60px;
}

.mini-chart__bar {
  flex: 1;
  background: var(--color-brand-green);
  border-radius: 3px 3px 0 0;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.mini-chart__bar--highlight {
  background: var(--color-green-signal);
  opacity: 0.8;
}

.process-step:hover .mini-chart__bar {
  opacity: 0.7;
}

.process-step:hover .mini-chart__bar--highlight {
  opacity: 1;
}

/* ============================================
   ABOUT — CREDENTIALS
   ============================================ */
.credential-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.credential-chip:hover {
  border-color: var(--color-brand-green);
  color: var(--color-text-primary);
}

/* ============================================
   CTA SECTION (Green break)
   ============================================ */
#contacto {
  background: var(--color-brand-green);
}

/* ============================================
   COUNTERS
   ============================================ */
.counter {
  font-variant-numeric: tabular-nums;
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .terminal-line {
    opacity: 1;
    transform: none;
  }

  .terminal-progress-fill {
    width: 78%;
    transition: none;
  }

  .hero-mesh::before,
  .hero-mesh::after,
  .hero-section::before {
    animation: none;
  }

  .agent-dot {
    animation: none;
  }

  .team-panel--active {
    animation: none;
  }

  .team-accordion__content {
    transition: none;
  }

  .team-accordion__chevron {
    transition: none;
  }
}
