/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #0a0a0a;
  --bg-2:      rgba(18,18,18,0.55);
  --bg-3:      rgba(26,26,26,0.7);
  --ink:       #f5f5f2;
  --ink-mute:  #b7b7b3;
  --ink-dim:   rgba(245,245,242,0.5);
  --line:      rgba(245,245,242,0.14);
  --line-2:    rgba(245,245,242,0.24);

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft:  cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --nav-h: 76px;
  --container: 900px;
}

@property --mesh-x { syntax: "<percentage>"; inherits: false; initial-value: 50%; }
@property --mesh-y { syntax: "<percentage>"; inherits: false; initial-value: 50%; }

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth;
  cursor: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScyOCcgaGVpZ2h0PScyOCcgdmlld0JveD0nMCAwIDI0IDI0Jz48cGF0aCBkPSdNMiAxMkwyMiAzIDE0IDIxbC0yLjUtN0wyIDEyeicgZmlsbD0nd2hpdGUnIHN0cm9rZT0nYmxhY2snIHN0cm9rZS13aWR0aD0nMC44JyBzdHJva2UtbGluZWpvaW49J3JvdW5kJy8+PC9zdmc+") 3 9, auto;
  -webkit-user-select: none; user-select: none;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
input, textarea { -webkit-user-select: text; user-select: text; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: inherit; border: 0; background: none; }
a { color: inherit; text-decoration: none; cursor: inherit; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.05; letter-spacing: -0.02em; font-weight: 700; }
ul { list-style: none; padding: 0; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .7rem 1.1rem; background: var(--ink); color: var(--bg);
  border-radius: 8px; font-weight: 600; font-size: .9rem;
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%; max-width: var(--container);
  margin-inline: auto; padding-inline: 1.5rem;
}
@media (min-width: 720px) { .container { padding-inline: 2.5rem; } }

.kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-mute);
}
.kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-mute); }

/* =============================================================
   3. Fondo fijo (foto + estelas de luz) — visible en todo el scroll
   ============================================================= */
.bg-fixed { position: fixed; inset: 0; z-index: -3; overflow: hidden; background: var(--bg); }
.bg-fixed-img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.15) brightness(0.5);
  animation: bgAmbientZoom 40s ease-in-out infinite;
}
@keyframes bgAmbientZoom {
  0%, 100% { transform: scale(1.08) translate3d(0,0,0); }
  50%      { transform: scale(1.2) translate3d(-1.5%,-1.5%,0); }
}
.bg-fixed::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0.6) 0%, rgba(10,10,10,0.55) 40%, rgba(10,10,10,0.85) 100%);
}
.bg-vignette {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, transparent 25%, rgba(10,10,10,0.55) 75%, rgba(10,10,10,0.92) 100%);
}
/* =============================================================
   4. Components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: 1rem 1.8rem; border-radius: 100px;
  font-weight: 600; font-size: .95rem;
  transition: transform .5s var(--ease-soft), box-shadow .5s var(--ease-soft), background .3s var(--ease-out), color .3s var(--ease-out);
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(0,0,0,0.45); }
.btn-primary:active { transform: translateY(-1px); transition-duration: .12s; }
.btn-ghost { background: rgba(245,245,242,0.06); color: var(--ink); border: 1px solid var(--line-2); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(245,245,242,0.1); }

.has-magnetic { display: inline-flex; position: relative; isolation: isolate; }
.magnetic-inner { display: inline-flex; align-items: center; justify-content: center; gap: inherit; will-change: transform; transition: transform .8s var(--ease-soft); }

/* Nav */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 100;
  height: var(--nav-h); display: flex; align-items: center;
  transition: background-color .4s var(--ease-out), border-color .4s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(10,10,10,0.92); border-bottom-color: var(--line);
}
.nav-inner { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-logo img { height: 40px; width: auto; mix-blend-mode: screen; filter: contrast(1.6); }
.nav-links { display: none; align-items: center; gap: 2.2rem; }
@media (min-width: 760px) { .nav-links { display: flex; } }
.nav-link { position: relative; padding: .3rem 0; font-size: .92rem; font-weight: 500; color: var(--ink-mute); transition: color .3s var(--ease-out); }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease-out);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.nav-actions .btn { display: none; }
@media (min-width: 640px) { .nav-actions .btn { display: inline-flex; padding: .75rem 1.4rem; font-size: .86rem; } }
.nav-burger { display: flex; flex-direction: column; gap: 5px; padding: .5rem; }
@media (min-width: 760px) { .nav-burger { display: none; } }
.nav-burger span { width: 22px; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease-out), opacity .3s var(--ease-out); }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.nav-mobile {
  position: fixed; inset: 0; z-index: 99; background: rgba(10,10,10,0.98);
  color: var(--ink); display: grid; place-items: center;
}
.nav-mobile[hidden] { display: none; }
.nav-mobile ul { display: flex; flex-direction: column; gap: 1.6rem; text-align: center; }
.nav-mobile a { font-size: 1.7rem; font-weight: 700; }

/* Reveal */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-soft), transform .9s var(--ease-soft); }
[data-reveal].is-revealed { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }
.split-word, .split-char { display: inline-block; will-change: transform, opacity; }

/* =============================================================
   5. Splash
   ============================================================= */
.splash {
  position: fixed; inset: 0; z-index: 10000; background: var(--bg);
  display: grid; place-items: center; pointer-events: auto;
  transition: opacity .8s var(--ease-out), clip-path 1s var(--ease-soft);
  animation: splashSafety .01s 3.5s forwards;
}
.splash.is-out { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); }
@keyframes splashSafety { to { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); } }
.splash-mark { width: auto; height: 40px; opacity: 0; animation: splashFade 1.2s var(--ease-out) forwards .1s; mix-blend-mode: screen; filter: contrast(1.6); }
@keyframes splashFade { to { opacity: 1; } }

/* =============================================================
   6. Hero
   ============================================================= */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--nav-h) + 2rem) 1.5rem 3rem;
  text-align: center;
}
.hero-inner { max-width: 720px; display: flex; flex-direction: column; align-items: center; gap: 1.3rem; }
.hero-logo { width: clamp(160px, 26vw, 340px); height: auto; opacity: .96; mix-blend-mode: screen; filter: contrast(1.6); }
.hero-title { font-size: clamp(2.2rem, 6.5vw, 4.6rem); line-height: 1; max-width: 16ch; }
.hero-title em { font-style: normal; color: var(--ink-dim); }
.hero-sub { font-size: clamp(1rem, 1.8vw, 1.2rem); color: var(--ink-mute); max-width: 44ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem; margin-top: .4rem; }
@media (max-width: 480px) { .hero-actions { flex-direction: column; width: 100%; max-width: 320px; } .hero-actions .btn { width: 100%; } }

/* =============================================================
   7. Sections (normal scroll)
   ============================================================= */
.section { position: relative; padding: 5rem 0; }
@media (min-width: 760px) { .section { padding: 7rem 0; } }
.section-head { max-width: 560px; margin-bottom: 2.5rem; }
.section-title { font-size: clamp(1.9rem, 4.2vw, 2.8rem); margin-top: .7rem; }
.container-narrow { max-width: 720px; text-align: center; }
.container-narrow .section-head { max-width: none; margin-inline: auto; }

/* Ticker: barra fina, todos los servicios deslizándose en una sola línea */
.ticker {
  overflow: hidden;
  padding: .6rem 0;
  border-block: 1px solid var(--line);
  background: rgba(10,10,10,0.4);
}
.ticker-track {
  display: inline-flex; white-space: nowrap;
  animation: tickerScroll 26s linear infinite;
}
.ticker-track span {
  display: inline-block;
  font-size: .8rem; font-weight: 600; letter-spacing: .02em;
  color: var(--ink-mute);
  padding-inline: 1.2rem;
}
.ticker-track span::after { content: "•"; margin-left: 1.2rem; color: var(--ink-dim); }
@keyframes tickerScroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* Servicios: acordeón limpio, sin cajas */
#servicios .container-narrow { max-width: 880px; }
.services-list { text-align: left; border-top: 1px solid var(--line); }
@media (min-width: 720px) {
  .services-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3rem; align-items: stretch; }
  .service-item { display: flex; flex-direction: column; }
}
.services-note { color: var(--ink-mute); max-width: 60ch; margin: 2rem auto 0; text-align: center; }
.service-item { border-bottom: 1px solid var(--line); break-inside: avoid; }
.service-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.35rem 0; text-align: left;
}
.service-toggle span:first-child { font-size: 1.1rem; font-weight: 600; color: var(--ink); }
.service-chevron {
  width: 18px; height: 18px; flex-shrink: 0; color: var(--ink-mute);
  transition: transform .35s var(--ease-out);
}
.service-toggle[aria-expanded="true"] .service-chevron { transform: rotate(180deg); }
.service-panel {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .35s var(--ease-out);
}
.service-item.is-open .service-panel { grid-template-rows: 1fr; }
.service-panel-inner { overflow: hidden; }
.service-panel p { color: var(--ink-mute); max-width: 60ch; padding-bottom: 1.35rem; }

/* Cómo trabajamos: personalización + equipo + auditoría */
.audit-section { padding: 4rem 0; text-align: center; }
.audit-title { font-size: clamp(1.5rem, 3.2vw, 2.2rem); margin: .9rem 0 1.1rem; }
.audit-sub { color: var(--ink-mute); max-width: 60ch; margin: 0 auto 1.8rem; }
.audit-sub strong { color: var(--ink); }
.audit-team { display: flex; flex-direction: column; align-items: center; gap: .9rem; margin: 0 auto 2.2rem; }
.audit-team-label { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-mute); }
.audit-team-text { color: var(--ink-mute); max-width: 60ch; margin: 0; }
.audit-team-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; list-style: none; padding: 0; margin: 0; }
.audit-team-tags li {
  padding: .5rem 1.1rem; border: 1px solid var(--line); border-radius: 99px;
  font-size: .85rem; color: var(--ink); background: var(--bg-2); backdrop-filter: blur(10px);
}

/* Contact */
.contact-grid { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }
.contact-options { display: flex; flex-direction: column; gap: 1rem; }
.contact-option {
  display: flex; align-items: center; gap: 1rem; padding: 1.3rem;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--bg-2); backdrop-filter: blur(10px);
  transition: border-color .35s var(--ease-out), transform .5s var(--ease-soft);
}
.contact-option:hover { border-color: var(--line-2); transform: translateX(4px); }
.contact-option-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.08); flex-shrink: 0; }
.contact-option-icon svg { width: 18px; height: 18px; }
.contact-option-label { font-size: .75rem; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .1em; }
.contact-option-value { font-size: 1rem; font-weight: 600; margin-top: .12rem; }

.cta-form {
  position: relative; display: flex; flex-direction: column; gap: 1rem;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 1.5rem;
  backdrop-filter: blur(10px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-soft);
}
.field { position: relative; }
.field input, .field textarea {
  width: 100%; padding: 1.4rem 1rem .5rem; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(0,0,0,0.3); color: var(--ink); font-family: inherit; font-size: 1rem;
  transition: border-color .3s var(--ease-out);
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--line-2); outline: none; }
.field label {
  position: absolute; left: 1rem; top: 1.1rem; pointer-events: none; transition: all .25s var(--ease-out);
  color: var(--ink-mute); font-size: .95rem;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  top: .45rem; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
}
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.field-consent {
  display: flex; align-items: flex-start; gap: .6rem;
  font-size: .82rem; color: var(--ink-mute); line-height: 1.4;
}
.field-consent input { margin-top: .2rem; accent-color: var(--ink); flex-shrink: 0; }
.field-consent a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.cta-error { color: #ff8080; font-size: .85rem; min-height: 1em; }
.cta-submit { position: relative; align-self: flex-start; }
.cta-form.is-sending .cta-form-label { opacity: 0; }
.cta-form-spinner { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; pointer-events: none; }
.cta-form.is-sending .cta-form-spinner { opacity: 1; }
.cta-form-spinner::after {
  content: ""; width: 16px; height: 16px; border: 1.5px solid rgba(10,10,10,0.25); border-top-color: var(--bg);
  border-radius: 50%; animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cta-form.is-sent { opacity: 0; transform: translateY(-10px); pointer-events: none; }
.cta-success { opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .7s var(--ease-out) .15s, transform .7s var(--ease-soft) .15s; }
.cta-success.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.cta-success h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.cta-success p { color: var(--ink-mute); }

/* Footer */
.footer { position: relative; padding: 2.5rem 0; border-top: 1px solid var(--line); }
.footer-meta { color: var(--ink-dim); font-size: .82rem; text-align: center; }
.footer-credit-link { color: var(--ink-dim); text-decoration: underline; text-underline-offset: 2px; }
.footer-credit-link:hover { color: var(--ink-mute); }

/* Legal page (privacidad.html) */
.legal { max-width: 720px; margin: 0 auto; padding: calc(var(--nav-h) + 3rem) 1.5rem 5rem; position: relative; z-index: 1; }
.legal h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .5rem; }
.legal .updated { color: var(--ink-mute); font-size: .85rem; margin-bottom: 2.5rem; }
.legal h2 { font-size: 1.2rem; margin: 2rem 0 .75rem; }
.legal p, .legal li { color: var(--ink-mute); line-height: 1.7; margin-bottom: .9rem; }
.legal ul { padding-left: 1.2rem; list-style: disc; }
.legal strong { color: var(--ink); }
.legal a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.back-link { display: inline-block; margin-bottom: 2rem; color: var(--ink-mute); }

.notfound {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: calc(var(--nav-h) + 2rem) 1.5rem 4rem; position: relative; z-index: 1;
}
.notfound-code { font-size: clamp(3.5rem, 12vw, 6rem); font-weight: 800; color: var(--ink-dim); line-height: 1; }
.notfound h1 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); margin: .8rem 0 .8rem; }
.notfound p { color: var(--ink-mute); max-width: 46ch; margin: 0 auto 1.8rem; }

/* =============================================================
   8. Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .splash { animation: none; opacity: 0; clip-path: inset(0 0 100% 0); pointer-events: none; }
}
