@import "tailwindcss";

@font-face {
  font-family: 'Arista Pro Alternate';
  src: url('/fonts/Arista-Pro-Alternate-Regular.woff2') format('woff2'),
       url('/fonts/Arista-Pro-Alternate-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@import "@fontsource-variable/host-grotesk";
@import "@fontsource/quicksand/300.css";
@import "@fontsource/quicksand/400.css";
@import "@fontsource/quicksand/500.css";
@import "@fontsource/quicksand/600.css";
@import "@fontsource/quicksand/700.css";
@import "@fontsource/cormorant-garamond/400.css";
@import "@fontsource/cormorant-garamond/500.css";

@custom-variant dark (&:where(.dark, .dark *));

@theme {
  --color-hds-naranja: #EE7623;
  --color-hds-naranja-hover: #D8651A;
  --color-hds-coral: #FA9F5C;
  --color-hds-durazno: #FFCBA1;
  --color-hds-tinta: #1A1612;

  --font-sans: 'Quicksand', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Host Grotesk', 'Quicksand', system-ui, sans-serif;
  --font-brand: 'Arista Pro Alternate', 'Host Grotesk', system-ui, sans-serif;
  --font-editorial: 'Cormorant Garamond', Georgia, serif;

  --tracking-display: -0.02em;
  --tracking-eyebrow: 0.25em;
}

@layer base {
  :root {
    color-scheme: light;
    --hds-bg: #FAF6EE;
    --hds-bg-soft: #F5EFE3;
    --hds-bg-section: #FFFFFF;
    --hds-fg: #1A1612;
    --hds-fg-soft: #4A4540;
    --hds-fg-muted: #8A8580;
    --hds-line: #E8E2D5;
    --hds-card: #FFFFFF;
    --hds-card-soft: #FFFFFF;
  }

  :root.dark {
    color-scheme: dark;
    --hds-bg: #1A1612;
    --hds-bg-soft: #221E1A;
    --hds-bg-section: #2A2520;
    --hds-fg: #FAF6EE;
    --hds-fg-soft: #C8C2B8;
    --hds-fg-muted: #8A8580;
    --hds-line: #3A332C;
    --hds-card: #2A2520;
    --hds-card-soft: #221E1A;
  }

  html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
  }

  body {
    font-family: var(--font-sans);
    color: var(--hds-fg);
    background-color: var(--hds-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: var(--tracking-display);
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}

@layer components {
  .font-display { font-family: var(--font-display); }
  .font-editorial { font-family: var(--font-editorial); }
  .font-brand { font-family: var(--font-brand); letter-spacing: 0.01em; }

  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--color-hds-naranja);
  }

  .eyebrow::after {
    content: '';
    display: inline-block;
    width: 3rem;
    height: 1px;
    background: var(--color-hds-naranja);
  }

  .btn-primary {
    background: var(--color-hds-naranja);
    color: #FFFFFF;
    padding: 0.875rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    transition: background 0.2s ease, transform 0.2s ease;
    border: 2px solid var(--color-hds-naranja);
    cursor: pointer;
  }
  .btn-primary:hover {
    background: var(--color-hds-naranja-hover);
    border-color: var(--color-hds-naranja-hover);
  }

  .btn-secondary {
    border: 2px solid var(--hds-fg);
    color: var(--hds-fg);
    padding: 0.78rem 1.4rem;
    border-radius: 6px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: transparent;
    cursor: pointer;
  }
  .btn-secondary:hover {
    background: var(--hds-fg);
    color: var(--hds-bg);
  }

  .btn-ghost {
    color: var(--color-hds-naranja);
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: gap 0.2s ease;
    background: transparent;
    border: none;
    cursor: pointer;
  }
  .btn-ghost:hover {
    gap: 0.7rem;
  }

  .icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1.5px solid var(--color-hds-naranja);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-hds-naranja);
    flex-shrink: 0;
  }

  .service-card {
    background: var(--hds-card);
    border: 1px solid var(--hds-line);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.25s ease;
  }
  .service-card:hover {
    border-color: var(--color-hds-naranja);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(238,118,35,0.08);
  }

  .particle-grid {
    background-image:
      linear-gradient(to right, rgba(238,118,35,0.10) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(238,118,35,0.10) 1px, transparent 1px);
    background-size: 56px 56px;
  }

  :root.dark .particle-grid {
    background-image:
      linear-gradient(to right, rgba(238,118,35,0.18) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(238,118,35,0.18) 1px, transparent 1px);
  }

  .skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 9999;
    padding: 0.75rem 1rem;
    background: var(--color-hds-naranja);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: top 0.2s ease;
  }
  .skip-link:focus { top: 1rem; }
}

:focus-visible {
  outline: 2px solid var(--color-hds-naranja);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* Scroll reveal animations */
.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.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Stagger children */
.stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.stagger.is-visible > *:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0s; }
.stagger.is-visible > *:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.08s; }
.stagger.is-visible > *:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.16s; }
.stagger.is-visible > *:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 0.24s; }
.stagger.is-visible > *:nth-child(5) { opacity: 1; transform: translateY(0); transition-delay: 0.32s; }
.stagger.is-visible > *:nth-child(6) { opacity: 1; transform: translateY(0); transition-delay: 0.40s; }
.stagger.is-visible > *:nth-child(7) { opacity: 1; transform: translateY(0); transition-delay: 0.48s; }
.stagger.is-visible > *:nth-child(8) { opacity: 1; transform: translateY(0); transition-delay: 0.56s; }
.stagger.is-visible > *:nth-child(9) { opacity: 1; transform: translateY(0); transition-delay: 0.64s; }

/* Float subtle */
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.floaty {
  animation: floaty 4s ease-in-out infinite;
}
.floaty-delay {
  animation: floaty 4s ease-in-out infinite;
  animation-delay: 1s;
}

/* Pulse glow */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(238,118,35,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(238,118,35,0); }
}
.pulse-glow {
  animation: pulse-glow 2.5s ease-in-out infinite;
}

/* Counter */
@keyframes countUp {
  from { opacity: 0.3; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
