/* =========================================================================
   NEVIZA Web Studio — styles.css (v5.0 — bold editorial hero with real-project
   showcase, Servicios bento grid + service-type chips + WhatsApp-agent
   explainer, Conexiones integrations grid, Comenzar transition band, splash
   intro, optional idea CTA before the footer)
   Dark navy canvas, warm cream type, Wine accent family (bright interactive
   Blue Grey → deep Wine fill → intense Wine reserved). Flat color fields,
   hairline borders as the default elevation, named shadow tokens reserved
   for raised/interactive surfaces. Space Grotesk display + Inter body.
   Motion: hover/press feedback, scroll-reveal, a low-opacity ambient hero
   drift, a guarded-autoplay carousel on Proyectos (the hero project track and
   the old Servicios carousel are both non-autoplaying/removed — see
   .claude/rules/motion.md), a one-time splash intro, and a click-triggered
   "Empezar" re-entrance on the Conexiones cards. No scroll-jacking, no
   gradients, no glassmorphism. See rule 4 in CLAUDE.md for the full motion
   inventory.
   ========================================================================= */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; }
img, picture, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul[class], ol[class] { padding: 0; list-style: none; }
a { text-decoration: none; color: inherit; }

/* ---------- Design tokens ---------- */
:root {
  /* Color — brand palette: Navy canvas, Cream ink, Wine fills, Blue Grey interactive accent, Grey muted */
  --paper: #142841;          /* primary page background — brand Navy */
  --surface: #0F1E30;        /* raised panel: header, footer, sticky visual, bands — darker Navy tint */
  --surface-strong: #47576A; /* hover state for raised surfaces, cards — lighter Navy tint */
  --surface-card: #304157;   /* resting card background (projects, form) — lighter Navy tint */
  --ink: #F2EED9;            /* primary text — brand Cream */
  --muted: #959596;          /* secondary text — brand Grey */
  --accent: #8396AD;         /* interactive accent — links, captions, focus ring (brand Blue Grey, lightened 8% for AA text contrast on Navy) */
  --accent-strong: #490B1A;  /* solid fills — primary buttons, logo mark (brand Wine) */
  --accent-intense: #3A0814; /* reserved: deepest hover/active state only (Wine, darkened) */
  --on-accent: #F2EED9;      /* text on accent-strong / accent-intense fills — brand Cream */
  --border: rgba(242, 238, 217, 0.12);
  --border-strong: rgba(242, 238, 217, 0.26);
  --destructive: #FF8A7A;

  /* Type */
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;

  /* Spacing scale (px) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --s-11: 192px;

  /* Radius */
  --radius-control: 8px;
  --radius-card: 16px;
  --radius-badge: 12px;
  --radius-pill: 9999px;

  /* Elevation — hairline border is the default; shadow signals "floating" surfaces */
  --shadow-card: 0 16px 40px -18px rgba(4, 6, 12, 0.5);   /* resting lift: project cards, contact form, services panel */
  --shadow-float: 0 24px 60px -16px rgba(5, 8, 14, 0.55); /* deeper hover lift on top of --shadow-card */
  --shadow-button: 0 10px 24px -8px rgba(99, 39, 30, 0.5);

  /* Layout */
  --content-width: 1200px;
  --content-width-wide: 1440px;
  --section-pad: clamp(96px, 12vw, 192px);
  --hero-pad: clamp(64px, 9vw, 140px);

  /* Motion */
  --motion-fast: 180ms cubic-bezier(0.4, 0, 0.2, 1);
  --motion-base: 240ms cubic-bezier(0.4, 0, 0.2, 1);
  --motion-menu: 240ms cubic-bezier(0.4, 0, 0.2, 1);
  --motion-lift: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --motion-slow: 450ms cubic-bezier(0.4, 0, 0.2, 1);
  --motion-reveal: 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Base elements ---------- */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  line-height: 1.02;
  font-weight: 500;
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.08;
  font-weight: 500;
}

h3 {
  font-size: 1.375rem;
  line-height: 1.25;
  font-weight: 600;
}

p {
  max-width: 68ch;
}

.body-large {
  font-size: 1.25rem;
  line-height: 1.55;
}

.caption {
  font-family: var(--font-body);
  font-size: 0.75rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Accessibility utility ---------- */
.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;
}

/* ---------- Splash intro ----------
   A brief, one-time (per session) full-screen brand moment before the Hero:
   solid Navy (--paper) canvas, the mark + wordmark both in Cream (--ink) —
   the same two brand tokens used in the header/footer logo lockup, just at
   full-screen scale. Shown for ~900ms then fades/scales into the page. No
   external image: the same inline mark used in the header/footer. Skipped
   entirely under prefers-reduced-motion and via <noscript> (see index.html)
   so it never blocks content when motion is off or JS doesn't run. */
.splash {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  background: var(--paper);
  opacity: 1;
  visibility: visible;
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), visibility 600ms,
    transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.splash-mark {
  width: clamp(56px, 10vw, 88px);
  height: clamp(56px, 10vw, 88px);
  fill: var(--ink);
}

.splash-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.375rem, 3.5vw, 1.875rem);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-transform: lowercase;
}

.splash[data-hide] {
  opacity: 0;
  transform: scale(1.03);
}

.splash[hidden] {
  display: none;
}

/* ---------- Focus ---------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Layout utilities ---------- */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--s-5);
}

.container-wide {
  width: 100%;
  max-width: var(--content-width-wide);
  margin-inline: auto;
  padding-inline: var(--s-5);
}

section {
  padding-block: var(--section-pad);
  scroll-margin-top: 88px; /* keeps anchored content clear of the sticky header (WCAG 2.4.11) */
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -48px;
  background: var(--accent-strong);
  color: var(--on-accent);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius-control);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  z-index: 1000;
  transition: top var(--motion-fast);
}

.skip-link:focus-visible {
  top: var(--s-4);
  outline-offset: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: var(--s-3) var(--s-6);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1.3;
  white-space: nowrap;
  transition: background-color var(--motion-lift), color var(--motion-lift),
    border-color var(--motion-lift), transform var(--motion-lift), box-shadow var(--motion-lift);
}

.btn-primary {
  background: var(--accent-strong);
  color: var(--on-accent);
  border-color: var(--accent-strong);
  box-shadow: var(--shadow-button);
}

.btn-primary:hover {
  background: var(--accent-intense);
  border-color: var(--accent-intense);
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -10px rgba(78, 0, 0, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: var(--surface-strong);
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Tap/press feedback — fires on touch devices, not just mouse hover */
.btn:active {
  transform: scale(0.96);
  transition-duration: 90ms;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  transition: opacity var(--motion-fast);
}

.logo:hover {
  opacity: 0.85;
}

.logo-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.logo-mark .mark-ink {
  fill: var(--ink);
}

.logo-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-transform: lowercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s-7);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--s-6);
}

.nav-list a {
  display: inline-block;
  position: relative;
  padding-block: var(--s-2);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transition: right var(--motion-fast);
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--accent);
}

.nav-list a:hover::after,
.nav-list a:focus-visible::after {
  right: 0;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  border-radius: var(--radius-control);
}

.menu-toggle-bar {
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform var(--motion-menu), opacity var(--motion-menu);
}

@media (max-width: 820px) {
  .menu-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: 72px 0 0 0;
    background: var(--surface);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--s-6) var(--s-5);
    gap: var(--s-6);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    overflow-y: auto;
    transition: opacity var(--motion-menu), transform var(--motion-menu);
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-4);
    width: 100%;
  }

  .nav-cta {
    width: 100%;
  }

  body[data-menu="open"] .site-nav {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  body[data-menu="open"] .menu-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body[data-menu="open"] .menu-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  body[data-menu="open"] .menu-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-block: var(--s-7);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
}

.footer-brand .logo-mark {
  width: 24px;
  height: 24px;
}

.footer-brand-text .logo-word {
  display: block;
}

.footer-brand-text .caption {
  margin-top: var(--s-1);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
  font-size: 0.9375rem;
  font-weight: 500;
}

.footer-links a {
  transition: color var(--motion-fast);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--accent);
}

.footer-copy {
  width: 100%;
  margin-top: var(--s-4);
}

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--hero-pad) var(--section-pad);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-9);
  align-items: center;
}

.hero-eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  margin-bottom: var(--s-5);
}

.hero-eyebrow-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
}

.hero-eyebrow-badge .caption {
  color: var(--accent);
}

.hero-title {
  max-width: 18ch;
  margin-bottom: var(--s-5);
  font-size: clamp(2.25rem, 5.5vw, 4.25rem);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero-subhead {
  max-width: 54ch;
  color: var(--muted);
  margin-bottom: var(--s-7);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
}

/* v5.1: the accent-word is now a solid Wine "highlight block" (stamped
   behind the text, Cream type on top) instead of an underline — the
   client asked for the hero to carry real visual weight, not a subtle
   tweak, so the accent treatment needed to read as a block of color, not
   a thin rule. box-decoration-break keeps the block contiguous even if
   the phrase wraps across two lines at narrow widths. */
.hero-title .accent-word {
  display: inline;
  color: var(--on-accent);
  background: var(--accent-strong);
  padding: 0.05em 0.2em;
  border-radius: var(--radius-control);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero-pillars {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-7);
}

.hero-pillars li {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-pillars li svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--accent);
}

/* ---------- Hero spine ----------
   v5.1: a vertical editorial label pinned to the hero's left edge — a
   boutique-studio device (rotated caption text reading bottom-to-top)
   that adds a second, static graphic layer beyond the ambient glyph and
   the diagonal line field. Purely decorative/redundant with the header
   brand + hero copy, so it's aria-hidden. Reuses .caption's typography
   as-is (no new font-size/color tokens), just rotates it. Hidden once
   the hero grid stacks to one column (820px) since there's no longer a
   left "edge" for it to sit against. */
.hero-spine {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: var(--s-5);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.hero-spine .caption {
  display: inline-block;
  white-space: nowrap;
  transform: rotate(-90deg);
}

@media (max-width: 820px) {
  .hero-spine {
    display: none;
  }
}

/* ---------- Hero diagonal line field ----------
   A second, additional graphic layer behind the copy column (on top of the
   existing .hero-ambient glyph) — thin diagonal hairlines, low-opacity, pure
   CSS/SVG, giving the bold editorial hero more visual weight without any
   external image. */
.hero-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: min(34vw, 460px);
  height: 100%;
  stroke: var(--border-strong);
  stroke-width: 1;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Hero visual — real-project showcase ----------
   Replaces the old static mockup panel: a tilted "stack" of three bordered
   browser-chrome cards so the hero reads with real visual weight and
   genuine proof of work, not just a generic mockup. The front card
   (.hero-showcase-card) holds the live, autoplaying initCarousel()
   track (#hero-track/#hero-dots) cycling through all six real client
   sites. As of v5.2.3, .hero-showcase-back and .hero-showcase-mid are no
   longer empty decorative panels — each holds a static <img> (two of the
   same six real-project screenshots, dimmed via opacity: 0.4 / 0.65) so
   the whole stack reads as a genuine collage of real sites, not one
   active card with blank backing cards, per client reference ("tipo
   collage con las paginas"). These two back images are fixed — they do
   NOT sync to which project the front carousel is currently showing —
   deliberately, to avoid wiring extra JS into the shared initCarousel()
   engine for a purely decorative layer. SVG/CSS + the existing project
   screenshots only, no new image assets. */
.hero-showcase {
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

.hero-showcase-stack {
  position: relative;
}

.hero-showcase-back {
  position: absolute;
  inset: var(--s-5) calc(-1 * var(--s-4)) calc(-1 * var(--s-5)) var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  transform: rotate(-3deg);
  z-index: 0;
  overflow: hidden;
}

/* v5.1: a third stack layer between .hero-showcase-back and
   .hero-showcase-card — shallower offset and rotation than the back
   layer, deeper than the front card — so the showcase reads as a real
   pile of printed project cards (more depth/weight) instead of two flat
   panels. Same z-index as the back layer; document order (it comes
   after .hero-showcase-back in index.html) is what puts it visually on
   top, so no extra z-index bookkeeping is needed. */
.hero-showcase-mid {
  position: absolute;
  inset: var(--s-3) calc(-1 * var(--s-2)) calc(-1 * var(--s-3)) var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  transform: rotate(-1deg);
  z-index: 0;
  overflow: hidden;
}

.hero-showcase-back img,
.hero-showcase-mid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-showcase-back img {
  opacity: 0.4;
}

.hero-showcase-mid img {
  opacity: 0.65;
}

.hero-showcase-card {
  position: relative;
  z-index: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  transform: rotate(1.25deg);
}

.hero-showcase-chrome {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
}

.hero-visual-dots {
  display: flex;
  gap: 6px;
}

.hero-visual-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}

.hero-showcase-url {
  font-size: 0.8125rem;
  color: var(--muted);
}

.hero-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hero-track::-webkit-scrollbar {
  display: none;
}

.hero-track-item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  aspect-ratio: 16 / 11;
}

.hero-track-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--motion-slow);
}

.hero-track-item:hover img,
.hero-track-item:focus-visible img {
  transform: scale(1.04);
}

.hero-showcase-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-6);
}

.hero-showcase-caption {
  margin: 0;
}

.hero-showcase-foot-controls {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.hero-showcase-foot-controls .carousel-arrow {
  width: var(--s-6);
  height: var(--s-6);
}

@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--s-7);
  }
}

@media (max-width: 560px) {
  .hero-pillars {
    gap: var(--s-2);
  }

  .hero-showcase-back {
    transform: rotate(-1.5deg);
  }

  .hero-showcase-mid {
    transform: rotate(-0.5deg);
  }

  .hero-showcase-card {
    transform: none;
  }
}

/* ---------- Section heading pattern ---------- */
.section-eyebrow {
  color: var(--accent);
  margin-bottom: var(--s-3);
}

.section-title {
  max-width: 24ch;
  margin-bottom: var(--s-8);
}

/* ---------- Carousel (shared mechanics) ----------
   This mechanics block is used by Proyectos (and, independently, the hero's
   own .hero-track/.hero-dots instance of the same JS engine with its own
   CSS — see .claude/rules/styling.md for why the hero doesn't reuse these
   classes directly): a flex strip with native CSS scroll-snap (so touch/
   trackpad/keyboard scroll already work with zero JS), sized items via
   `> *`, plus the header row (eyebrow/title + play-pause/prev/next
   controls) and dot indicators. `initCarousel()` in main.js layers
   prev/next, dots, and a guarded autoplay on top — see
   .claude/rules/motion.md for the full safeguard list. Servicios does NOT
   use this block — its rail (`.services-rail`) is a simpler, uncontrolled
   scroll-snap strip with no JS engine at all (see the Servicios comment
   below). */
.carousel-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-5);
  flex-wrap: wrap;
}

.carousel-subhead {
  max-width: 56ch;
  margin-top: var(--s-3);
  color: var(--muted);
}

.carousel-controls {
  display: flex;
  gap: var(--s-3);
  flex-shrink: 0;
  margin-bottom: var(--s-8);
}

.carousel-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--s-7);
  height: var(--s-7);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--ink);
  transition: background-color var(--motion-lift), color var(--motion-lift),
    border-color var(--motion-lift), transform var(--motion-lift);
}

.carousel-arrow:hover:not(:disabled) {
  background: var(--surface-strong);
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.carousel-arrow:active:not(:disabled) {
  transform: scale(0.96);
  transition-duration: 90ms;
}

.carousel-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.carousel-arrow[hidden] {
  display: none;
}

.carousel-track-wrap {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: var(--s-6);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: var(--s-3);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track > * {
  flex: 0 0 85%;
  scroll-snap-align: start;
}

@media (min-width: 541px) {
  .carousel-track > * {
    flex-basis: 60%;
  }
}

@media (min-width: 821px) {
  .carousel-track > * {
    flex-basis: 38%;
  }
}

@media (min-width: 1201px) {
  .carousel-track > * {
    flex-basis: 31%;
  }
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: var(--s-2);
  margin-top: var(--s-6);
}

.carousel-dot {
  width: var(--s-5);
  height: var(--s-5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--radius-pill);
}

.carousel-dot::before {
  content: "";
  width: var(--s-2);
  height: var(--s-2);
  border-radius: 50%;
  background: var(--border-strong);
  transition: background-color var(--motion-lift), transform var(--motion-lift);
}

.carousel-dot:hover::before,
.carousel-dot:focus-visible::before {
  background: var(--accent);
}

.carousel-dot.is-active::before {
  background: var(--accent);
  transform: scale(1.3);
}

/* ---------- Servicios — even 2x2 grid ----------
   v5.2.1: a direct response to client feedback that the v5.1 feature-card
   + rail pattern (one oversized protagonist card over three more cards
   of a different size) read as both "too big" and "crowded" at once —
   four heavy bordered/shadowed boxes of mismatched size stacked in a
   column, with no clear hierarchy between them. This replaces that
   pattern entirely with four equal-weight `.service-tile` cells in a
   static 2-column grid: same compact padding, same small inline icon
   (matching the Conexiones `.integration-card` icon convention — 28px,
   `var(--accent)`), same caption-sized index numeral, no card is bigger
   or more decorated than any other. No JS, no scroll-snap, no carousel —
   a plain CSS grid that collapses to one column at the same 820px
   breakpoint the rest of the page uses. */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-5);
  margin-bottom: var(--s-9);
}

.service-tile {
  padding: var(--s-5);
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: transform var(--motion-lift), box-shadow var(--motion-lift), border-color var(--motion-lift);
}

.service-tile:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-float);
  border-color: var(--border-strong);
}

.service-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-4);
}

.service-tile-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.service-tile-index {
  color: var(--muted);
}

.service-tile h3 {
  margin-bottom: var(--s-3);
  font-size: 1.25rem;
}

.service-tile p {
  color: var(--muted);
  max-width: 42ch;
}

@media (max-width: 820px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Servicios — service-type chips ---------- */
.services-types-eyebrow {
  margin-bottom: var(--s-4);
}

.services-types-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
  margin-bottom: var(--s-9);
}

.service-type-chip {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  transition: border-color var(--motion-lift), background-color var(--motion-lift), transform var(--motion-lift);
}

.service-type-chip:hover {
  border-color: var(--border-strong);
  background: var(--surface-card);
  transform: translateY(-2px);
}

.service-type-chip svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.service-type-chip span {
  font-size: 0.9375rem;
  color: var(--ink);
}

@media (max-width: 820px) {
  .services-types-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .services-types-grid { grid-template-columns: 1fr; }
}

/* ---------- Servicios — WhatsApp-agent explainer ---------- */
.whatsapp-agent {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-8);
  padding: var(--s-7);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.whatsapp-agent-copy h3 {
  margin-top: var(--s-2);
  margin-bottom: var(--s-4);
  max-width: 24ch;
}

.whatsapp-agent-copy p {
  color: var(--muted);
  max-width: 40ch;
}

.whatsapp-agent-points {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  align-self: center;
}

.whatsapp-agent-points li {
  position: relative;
  padding-left: var(--s-5);
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.whatsapp-agent-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

@media (max-width: 820px) {
  .whatsapp-agent { grid-template-columns: 1fr; gap: var(--s-6); padding: var(--s-6); }
}

/* ---------- Conexiones — integrations grid ---------- */
.conexiones-sub {
  max-width: 56ch;
}

.integrations-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--s-4);
  margin-top: var(--s-8);
  margin-bottom: var(--s-8);
}

.integration-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-3);
  text-align: center;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: transform var(--motion-lift), box-shadow var(--motion-lift), border-color var(--motion-lift);
}

.integration-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-float);
  border-color: var(--accent);
}

.integration-card svg {
  width: 30px;
  height: 30px;
  color: var(--accent);
  transition: color var(--motion-lift);
}

/* A short, interaction-triggered icon "wiggle" — not an idle loop, it only
   plays on hover/focus (desktop) or :active (touch tap), and finishes in
   under half a second. This is the Conexiones section's dedicated dynamic
   touch, distinct from the "Empezar" replay below (which re-plays the
   whole grid on click, not per-card on hover/tap). */
@keyframes integration-wiggle {
  0% { transform: rotate(0deg) scale(1); }
  30% { transform: rotate(-10deg) scale(1.12); }
  60% { transform: rotate(7deg) scale(1.06); }
  100% { transform: rotate(0deg) scale(1); }
}

.integration-card:hover svg,
.integration-card:focus-visible svg,
.integration-card:active svg {
  color: var(--accent-strong);
  animation: integration-wiggle 480ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.integration-card span {
  font-size: 0.875rem;
  color: var(--ink);
}

@keyframes integration-pop {
  0% { opacity: 0; transform: translateY(10px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.integration-card.is-replaying {
  animation: integration-pop var(--motion-reveal) cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .integration-card.is-replaying { animation: none; }
}

@media (max-width: 1024px) {
  .integrations-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 620px) {
  .integrations-grid { grid-template-columns: repeat(2, 1fr); }
}

.build-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  padding: var(--s-6) var(--s-7);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.build-prompt-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ink);
}

@media (max-width: 560px) {
  .build-prompt { flex-direction: column; align-items: flex-start; gap: var(--s-4); }
}

/* ---------- Idea CTA box — the "texto libre" panel inside #contacto ----------
   v5.2 removed the standalone .final-cta band and merged this block's
   section (.idea-cta) into #contacto as a toggled second panel — see the
   .contacto-toggle/.contacto-panel rules below. Only the box/textarea/
   actions styling survives under its original class names, now scoped
   inside `#contacto-panel-idea`. */
.idea-cta-sub {
  max-width: 48ch;
  margin-inline: auto;
  margin-bottom: var(--s-5);
  color: var(--muted);
}

.idea-cta-box {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--s-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  text-align: left;
}

.idea-cta-box textarea {
  width: 100%;
  resize: vertical;
  padding: var(--s-4);
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

.idea-cta-box textarea::placeholder {
  color: var(--muted);
}

.idea-cta-box textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.idea-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-5);
}

@media (max-width: 560px) {
  .idea-cta-actions { flex-direction: column; }
  .idea-cta-actions .btn { width: 100%; text-align: center; }
}

/* ---------- Proyectos — carousel cards ----------
   Project-specific cosmetics on top of the shared carousel mechanics above
   (`.carousel-track-wrap`/`.carousel-track`/`.carousel-dots`): the fake
   browser-chrome header, screenshot, and meta caption. This is one of the
   two sections on the page with a narrow, guarded autoplay exception: see
   .claude/rules/motion.md and main.js's initCarousel() for the full
   safeguard list (pause on hover/focus/touch, permanent stop on manual
   interaction, pause off-screen, never under prefers-reduced-motion, always
   a visible pause/play toggle). */
.project-card {
  position: relative;
  display: block;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-card);
  box-shadow: var(--shadow-card);
  transition: transform var(--motion-lift), box-shadow var(--motion-lift), border-color var(--motion-lift);
}

.project-demo-badge {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  z-index: 1;
  padding: var(--s-1) var(--s-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: var(--shadow-float);
  border-color: var(--border-strong);
}

.project-card:active {
  transform: scale(0.98);
  transition-duration: 90ms;
}

.project-chrome {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.project-chrome-dots {
  display: flex;
  gap: 6px;
}

.project-chrome-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}

.project-chrome-url {
  margin-left: var(--s-3);
  font-size: 0.8125rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card img {
  width: 100%;
  height: auto;
  transition: transform var(--motion-slow);
}

.project-card:hover img,
.project-card:focus-visible img {
  transform: scale(1.045);
}

.project-meta {
  padding: var(--s-5);
}

.project-meta h3 {
  margin-bottom: var(--s-2);
  font-size: 1.125rem;
}

.project-meta p {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ---------- Contacto — merged CTA + form ----------
   Replaces the old two-button final-CTA band plus a separate two-column
   "intro copy / form" contacto section with one centered section: heading,
   the form itself (now the single primary action), then the direct contact
   links (email / WhatsApp / Instagram) below it as plain text links, not
   buttons — the form is the CTA now, the links are the fallback. */
.contacto-section {
  background: var(--surface);
  text-align: center;
}

.contacto-title {
  max-width: 20ch;
  margin-inline: auto;
  margin-bottom: var(--s-4);
}

.contacto-sub {
  max-width: 48ch;
  margin-inline: auto;
  margin-bottom: var(--s-7);
  color: var(--muted);
}

/* Two plain toggle buttons choosing which .contacto-panel is visible —
   "Llenar formulario" is the default/priority panel (aria-pressed="true"
   in the markup), "Contarlo con mis palabras" is the free-text fallback.
   See initContactToggle() in main.js. */
.contacto-toggle {
  display: inline-flex;
  gap: var(--s-2);
  padding: var(--s-1);
  margin-bottom: var(--s-7);
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.contacto-toggle-btn {
  padding: var(--s-3) var(--s-5);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background-color var(--motion-lift), color var(--motion-lift), border-color var(--motion-lift);
}

.contacto-toggle-btn:hover {
  color: var(--ink);
}

.contacto-toggle-btn[aria-pressed="true"] {
  background: var(--accent-strong);
  color: var(--on-accent);
  border-color: var(--accent-strong);
}

@media (max-width: 560px) {
  .contacto-toggle {
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
  }

  .contacto-toggle-btn {
    flex: 1;
  }
}

.contacto-panel {
  animation: contacto-panel-in var(--motion-base);
}

@keyframes contacto-panel-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.contacto-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  max-width: 640px;
  margin-inline: auto;
  text-align: left;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--s-7);
}

.form-row {
  display: flex;
  gap: var(--s-5);
}

.form-row .form-field {
  flex: 1;
  min-width: 0;
}

.contacto-direct {
  margin-top: var(--s-8);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-6);
  font-weight: 500;
}

.contacto-direct a {
  transition: color var(--motion-fast);
}

.contacto-direct a:hover,
.contacto-direct a:focus-visible {
  color: var(--accent);
}

.contacto-privacy {
  margin-top: var(--s-5);
  max-width: 44ch;
  margin-inline: auto;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.form-field label {
  font-size: 0.9375rem;
  font-weight: 500;
}

.form-field input,
.form-field textarea {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--paper);
  color: var(--ink);
  padding: var(--s-3) var(--s-4);
  font-family: var(--font-body);
  font-size: 1rem;
  resize: vertical;
  transition: border-color var(--motion-fast);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--muted);
}

.form-field input:hover,
.form-field textarea:hover {
  border-color: var(--accent);
}

.form-field input:focus-visible,
.form-field textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.field-error {
  min-height: 1.2em;
  font-size: 0.875rem;
  color: var(--destructive);
}

.form-field:has(.field-error:not(:empty)) input,
.form-field:has(.field-error:not(:empty)) textarea {
  border-color: var(--destructive);
}

.form-submit {
  align-self: flex-start;
}

.form-message {
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  font-size: 0.9375rem;
}

.form-message-success {
  border-color: var(--accent);
  color: var(--ink);
}

.form-message-error {
  border-color: var(--destructive);
  color: var(--destructive);
}

.form-message-error a {
  text-decoration: underline;
}

@media (max-width: 540px) {
  .form-row {
    flex-direction: column;
    gap: var(--s-5);
  }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  transition: opacity var(--motion-reveal), transform var(--motion-reveal);
  transition-delay: var(--reveal-delay, 0ms);
}

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

/* Growing underline under eyebrow captions, syncs with scroll-reveal
   (scroll-triggered, so it fires on touch devices too, not just hover) */
.section-eyebrow {
  position: relative;
  padding-bottom: var(--s-3);
}

.section-eyebrow::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 650ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: 150ms;
}

.section-eyebrow.is-visible::after {
  width: 48px;
}

/* ---------- Hero ambient motion ----------
   A subtle supporting texture behind the copy column — kept low-opacity and
   confined to the left/text side on purpose, since the bold visual weight
   in this hero comes from the headline scale, the Wine highlight block, the
   .hero-spine label, the static .hero-lines field, and the three-layer
   .hero-showcase stack, not from this background glyph. */
.hero-ambient {
  position: absolute;
  top: 6%;
  left: -8%;
  width: min(46vw, 560px);
  height: min(46vw, 560px);
  color: var(--accent-strong);
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
  animation: hero-drift 16s ease-in-out infinite;
}

@keyframes hero-drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-14px, 18px) rotate(4deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-ambient {
    animation: none;
  }
}

/* ---------- Reduced motion ---------- */
@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;
    transform: none;
  }

  .project-card:hover,
  .service-tile:hover,
  .btn-primary:hover,
  .btn-ghost:hover {
    transform: none;
  }
}
