/* =====================================================================
   Bufalo — Shared chrome · Bone & Linen System
   Nav, footer, buttons, page-hero, sec-head, reveals, scroll progress,
   theme toggle, language toggle. Loaded on every page after
   colors_and_type.css.
   ===================================================================== */

html, body { margin: 0; }
* { box-sizing: border-box; }
.container { max-width: 1320px; margin: 0 auto; padding: 0 32px; }
img { display: block; max-width: 100%; }

/* ─────────── SCROLL PROGRESS BAR (scroll-driven, native) ─────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 200;
  pointer-events: none;
  will-change: transform;
  box-shadow: 0 0 12px var(--purple-40);
}
@supports (animation-timeline: scroll()) {
  .scroll-progress {
    animation: scrollProgress linear forwards;
    animation-timeline: scroll(root);
    transform: scaleX(0);
  }
  @keyframes scrollProgress { to { transform: scaleX(1); } }
}

/* ─────────── NAV ─────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              padding var(--dur-base) var(--ease-out);
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom-color: var(--rule);
  box-shadow: 0 8px 28px -16px rgba(26, 24, 21, 0.18);
}
[data-theme="dark"] .nav.scrolled {
  box-shadow: 0 8px 28px -16px rgba(0, 0, 0, 0.6);
}

.nav-inner {
  max-width: 1320px; margin: 0 auto;
  padding: 18px 32px;
  display: flex; align-items: center; gap: 28px;
  transition: padding var(--dur-base) var(--ease-out);
}
.nav.scrolled .nav-inner { padding: 12px 32px; }

.nav-brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--fg-strong);
  transition: color var(--dur-theme) var(--ease-soft);
}
.nav-brand svg, .nav-brand img {
  height: 30px; width: auto; display: block;
  fill: currentColor;
  filter: none;
  transition: filter var(--dur-theme) var(--ease-soft);
}
/* If a page still uses the PNG/SVG-as-img, force it to read as currentColor */
[data-theme="light"] .nav-brand img { filter: brightness(0) saturate(100%); }
[data-theme="dark"]  .nav-brand img { filter: brightness(0) saturate(100%) invert(95%) sepia(7%) saturate(263%) hue-rotate(353deg) brightness(98%) contrast(94%); }

.nav-links {
  display: flex; gap: 32px; flex: 1; justify-content: center;
}
.nav-links a {
  position: relative;
  color: var(--fg); font-family: var(--font-display);
  font-size: 13.5px; font-weight: var(--fw-regular); text-decoration: none;
  padding: 6px 2px; letter-spacing: 0.01em;
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-links a::after {
  content: ""; position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.nav-cta { display: flex; align-items: center; gap: 12px; }

/* ─────────── THEME TOGGLE (sun/moon pill) ─────────── */
.theme-toggle {
  position: relative; width: 54px; height: 28px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule);
  background: transparent;
  cursor: pointer;
  display: inline-flex; align-items: center; padding: 2px;
  transition: border-color var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out);
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle .knob {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--fg-strong);
  display: grid; place-items: center;
  color: var(--bg);
  transition: transform 460ms cubic-bezier(0.7, 0.2, 0.2, 1),
              background-color var(--dur-theme) var(--ease-soft);
}
[data-theme="dark"] .theme-toggle .knob {
  transform: translateX(26px);
  background: var(--accent);
  color: var(--bone);
}
.theme-toggle svg { width: 13px; height: 13px; display: block; }
.theme-toggle .sun { display: block; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

/* ─────────── LANGUAGE TOGGLE (EN / ES) ─────────── */
.lang-toggle {
  display: inline-flex; align-items: center;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 0;
  transition: border-color var(--dur-base) var(--ease-out);
}
.lang-toggle:hover { border-color: var(--accent); }
.lang-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--fw-medium);
  letter-spacing: 0.10em;
  color: var(--fg-muted);
  background: transparent;
  border: none;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.lang-btn:hover { color: var(--fg-strong); }
.lang-btn.active {
  background: var(--accent);
  color: var(--bone);
}
.lang-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─────────── BUTTONS ─────────── */
.btn {
  font-family: var(--font-display); font-weight: var(--fw-medium); font-size: 13.5px;
  height: 42px; padding: 0 20px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  letter-spacing: 0.01em;
  transition: all var(--dur-base) var(--ease-out);
  white-space: nowrap;
}
.btn.primary {
  background: var(--accent);
  color: var(--bone);
  border-color: var(--accent);
  box-shadow: 0 6px 18px -8px var(--purple-60);
}
.btn.primary:hover {
  transform: translateY(-1px);
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 14px 30px -8px var(--purple-60), 0 0 24px -4px var(--purple-40);
}
.btn.primary:active { transform: translateY(0); transition-duration: 80ms; }

.btn.ghost {
  background: transparent; color: var(--fg-strong);
  border: 1px solid var(--fg-strong);
}
.btn.ghost:hover {
  background: var(--fg-strong);
  color: var(--bg);
}

.btn.lg { height: 52px; padding: 0 26px; font-size: 14.5px; }
.btn.sm { height: 36px; padding: 0 16px; font-size: 12.5px; }

/* Legacy gold buttons → re-routed to purple */
.btn.gold,
.btn.gold-shine {
  background: var(--accent);
  color: var(--bone);
  border: 1px solid var(--accent);
  box-shadow: 0 6px 18px -8px var(--purple-60);
  font-weight: var(--fw-medium);
  animation: none !important;
}
.btn.gold:hover,
.btn.gold-shine:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -8px var(--purple-60), 0 0 24px -4px var(--purple-40);
}
.btn.gold-shine::before,
.btn.gold-shine::after,
.gold-shine__particles { display: none !important; }
.btn.gold-shine .gold-shine__label { text-shadow: none; position: relative; z-index: 1; }

/* CTA pill with dot */
.cta-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--fg-strong);
  border-radius: var(--radius-pill);
  font-family: var(--font-display); font-weight: var(--fw-medium); font-size: 12.5px;
  color: var(--fg-strong); text-decoration: none;
  background: transparent;
  transition: all var(--dur-base) var(--ease-out);
}
.cta-pill:hover { background: var(--fg-strong); color: var(--bg); }
.cta-pill .d { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ─────────── SECTION HEADER ─────────── */
section { position: relative; }
.sec-pad { padding: 112px 0; }
.sec-head { text-align: center; margin-bottom: 56px; }
.sec-head .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--fw-regular);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: transparent;
  border: none;
}
.sec-head .eyebrow::before {
  content: ""; width: 8px; height: 8px;
  background: var(--accent);
  transform: rotate(45deg);
}
.sec-head .eyebrow.gold { color: var(--accent); }
.sec-head .eyebrow.gold::before { background: var(--accent); }
.sec-head h2 {
  font-family: var(--font-display); font-weight: var(--fw-light);
  font-size: clamp(36px, 5.4vw, 64px);
  line-height: 1.0; letter-spacing: -0.035em;
  margin: 22px auto 0; max-width: 920px;
  color: var(--fg-strong);
}
.sec-head h2 .accent,
.sec-head h2 .serif-it {
  font-family: var(--font-serif);
  font-style: italic; font-weight: var(--fw-regular);
  color: var(--accent);
  letter-spacing: -0.02em;
  -webkit-background-clip: initial; background-clip: initial;
  background: none; color: var(--accent);
}
.sec-head p {
  font-size: 17px; line-height: 1.7; color: var(--fg-muted);
  max-width: 620px; margin: 22px auto 0;
  font-weight: var(--fw-light);
}

/* ─────────── PAGE HERO (used by sub-pages) ─────────── */
.page-hero {
  position: relative; overflow: hidden;
  padding: 96px 0 72px;
}
/* Override existing grid backgrounds — replaced with linen weave from body */
.page-hero .grid-bg { display: none; }
/* Soft purple aura (only visible in dark; quiet in light) */
.page-hero .glow {
  position: absolute; left: 50%; top: -10%;
  width: 900px; height: 700px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 65%);
  filter: blur(40px); pointer-events: none;
  opacity: 0.55;
  transition: opacity var(--dur-theme) var(--ease-soft);
}
[data-theme="light"] .page-hero .glow { opacity: 0.18; }

.page-hero-inner {
  position: relative; text-align: center;
  max-width: 820px; margin: 0 auto;
}
.page-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--fw-regular);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: transparent;
  border: none;
}
.page-hero .eyebrow::before {
  content: ""; width: 8px; height: 8px;
  background: var(--accent); transform: rotate(45deg);
}
.page-hero h1 {
  font-family: var(--font-display); font-weight: var(--fw-light);
  font-size: clamp(48px, 7vw, 92px);
  line-height: 1.0; letter-spacing: -0.04em;
  margin: 24px 0 0;
  color: var(--fg-strong);
}
.page-hero h1 .accent {
  font-family: var(--font-serif);
  font-style: italic; font-weight: var(--fw-regular);
  color: var(--accent);
  -webkit-background-clip: initial; background-clip: initial;
  background: none;
  letter-spacing: -0.02em;
}
.page-hero .lead {
  font-size: 18.5px; line-height: 1.65; color: var(--fg-muted);
  max-width: 600px; margin: 26px auto 0;
  font-weight: var(--fw-light);
}
.page-hero .cta-row {
  display: inline-flex; gap: 12px; margin-top: 38px;
  flex-wrap: wrap; justify-content: center;
}

/* ─────────── GHOST MARK BACKDROP (decorative brand watermark) ─────────── */
.ghost-mark {
  position: absolute; pointer-events: none;
  color: var(--ghost); opacity: var(--ghost-opacity);
  z-index: 0;
  transition: color var(--dur-theme) var(--ease-soft),
              opacity var(--dur-theme) var(--ease-soft);
}

/* ─────────── FOOTER ─────────── */
footer {
  border-top: 1px solid var(--rule);
  padding: 64px 0 32px;
  background: transparent;
  position: relative;
}
footer .foot-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 56px;
}
footer .foot-brand svg,
footer .foot-brand img {
  height: 24px; width: auto; margin-bottom: 18px;
  fill: currentColor; color: var(--fg-strong);
}
[data-theme="light"] footer .foot-brand img { filter: brightness(0) saturate(100%); }
[data-theme="dark"]  footer .foot-brand img { filter: brightness(0) saturate(100%) invert(95%) sepia(7%) saturate(263%) hue-rotate(353deg) brightness(98%) contrast(94%); }

footer .foot-brand p {
  font-family: var(--font-display);
  font-weight: var(--fw-light);
  font-size: 15px; color: var(--fg-muted);
  max-width: 280px; margin: 0 0 22px; line-height: 1.5;
}
footer .foot-brand .chips { display: flex; gap: 8px; flex-wrap: wrap; }
footer .chip {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: var(--fw-regular);
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  color: var(--fg-muted);
}
footer h6 {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: var(--fw-regular);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 18px;
}
footer ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 12px;
}
footer li a {
  font-family: var(--font-display);
  font-size: 13.5px; color: var(--fg);
  text-decoration: none; cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
}
footer li a:hover { color: var(--accent); }
.foot-tagline {
  margin-top: 56px; padding-top: 36px;
  text-align: center;
  border-top: 1px solid var(--rule);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 2.4vw, 32px);
  letter-spacing: -.015em;
  color: var(--accent);
  line-height: 1.2;
}
.foot-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 28px; padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg-subtle);
}
.foot-bottom .links { display: flex; gap: 20px; }
.foot-bottom .links a { color: var(--fg-subtle); }
.foot-bottom .links a:hover { color: var(--accent); }

/* ─────────── REVEAL (Intersection-driven) ─────────── */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 720ms var(--ease-out), transform 720ms var(--ease-out);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal[data-delay="100"]{ transition-delay: 100ms; }
.reveal[data-delay="200"]{ transition-delay: 200ms; }
.reveal[data-delay="300"]{ transition-delay: 300ms; }
.reveal[data-delay="400"]{ transition-delay: 400ms; }
.reveal[data-delay="500"]{ transition-delay: 500ms; }

/* Reveal variants */
.reveal-left  { transform: translateX(-24px); }
.reveal-left.in { transform: translateX(0); }
.reveal-right { transform: translateX( 24px); }
.reveal-right.in { transform: translateX(0); }
.reveal-scale { transform: scale(0.96); }
.reveal-scale.in { transform: scale(1); }

/* ─────────── SCROLL-DRIVEN (native CSS animation-timeline) ─────────── */
@supports (animation-timeline: view()) {
  .scroll-fade {
    animation: fadeUp linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
  }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(36px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .scroll-parallax {
    animation: parallax linear both;
    animation-timeline: scroll(root);
  }
  @keyframes parallax {
    from { transform: translateY(0); }
    to   { transform: translateY(-80px); }
  }
}

/* ─────────── UTILITIES ─────────── */
.eyebrow-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--fw-regular);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.mono { font-family: var(--font-mono); }

/* Generic cards / surfaces — backward compat for existing inline styles */
.mv-card,
.audit-card,
.case-card,
.about-cta {
  background: var(--surface-card) !important;
  border-color: var(--rule) !important;
  color: var(--fg);
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .mv-card,
[data-theme="dark"] .audit-card,
[data-theme="dark"] .case-card,
[data-theme="dark"] .about-cta {
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6);
}

/* Re-route the existing gradient-text accents to a solid purple */
.accent {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  color: var(--accent) !important;
  -webkit-text-fill-color: var(--accent) !important;
}

/* ─────────── CARD ANIMATION POLISH ─────────── */
/* Subtle accent line that grows on hover for marquee cards */
.specimen, .mv-card, .plan, .case-card, .lead-form-card, .specimen-mini, .audit-card {
  position: relative;
  will-change: transform;
}
.specimen::before,
.mv-card::before,
.specimen-mini::before {
  content: ""; position: absolute;
  top: -1px; left: 50%; transform: translateX(-50%);
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 600ms var(--ease-out);
  pointer-events: none;
}
.specimen:hover::before,
.mv-card:hover::before,
.specimen-mini:hover::before {
  width: 70%;
}

/* Eyebrow square subtle rotation on parent hover */
.specimen:hover .label,
.mv-card:hover .label {
  color: var(--accent);
  transition: color .3s var(--ease-out);
}

/* "Glow underlay" on specimen card hover (light + dark) */
.specimen, .specimen-mini {
  transition:
    transform .5s var(--ease-out),
    border-color .5s var(--ease-out),
    box-shadow .5s var(--ease-out);
}
.specimen:hover, .specimen-mini:hover {
  border-color: var(--accent);
}
[data-theme="light"] .specimen:hover,
[data-theme="light"] .specimen-mini:hover {
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px var(--purple-16),
    0 24px 60px -24px var(--purple-40);
}
[data-theme="dark"] .specimen:hover,
[data-theme="dark"] .specimen-mini:hover {
  box-shadow:
    0 30px 60px -30px rgba(0,0,0,.7),
    0 0 0 1px var(--purple-24),
    0 0 80px -20px var(--accent-glow);
}

/* Step cards (process / principles) — accent dot pulse on hover */
.step .n, .principle .n, .cap .n {
  transition: letter-spacing .3s var(--ease-out);
}
.step:hover .n, .principle:hover .n, .cap:hover .n {
  letter-spacing: .28em;
}

/* Count-up — gentle bloom when it lands */
@keyframes countBloom {
  0% { text-shadow: 0 0 0 transparent; }
  60% { text-shadow: 0 0 40px var(--purple-24); }
  100% { text-shadow: 0 0 0 transparent; }
}
.count-up.bloom { animation: countBloom 1.2s var(--ease-out); }

/* Faq item subtle accent on open */
.faq-item[open] { background: var(--purple-04); border-radius: 6px; padding-left: 16px; padding-right: 16px; transition: all .3s var(--ease-out); }

/* Process cards — animated underline on number */
.step .n {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
}
.step .n::before {
  content: ""; width: 24px; height: 1px; background: var(--accent);
  display: inline-block;
  transition: width .4s var(--ease-out);
}
.step:hover .n::before { width: 40px; }

/* ═════════════════════════════════════════════════════════════
   FLOATING WHATSAPP BUTTON (persistent on every page)
   ═════════════════════════════════════════════════════════════ */
.wa-fab {
  position: fixed; bottom: 22px; right: 22px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bone);
  display: grid; place-items: center;
  text-decoration: none;
  box-shadow:
    0 12px 30px -10px var(--purple-60),
    0 0 0 1px var(--purple-24);
  z-index: 60;
  transition: transform 280ms var(--ease-out),
              box-shadow 280ms var(--ease-out);
  cursor: pointer;
}
.wa-fab:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 18px 40px -10px var(--purple-60),
    0 0 0 1px var(--accent),
    0 0 0 6px var(--purple-16);
}
.wa-fab svg {
  width: 28px; height: 28px;
  fill: currentColor;
  pointer-events: none;
}
.wa-fab .wa-pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0; z-index: -1;
  animation: waPulse 2.6s ease-out infinite;
}
@keyframes waPulse {
  0%   { transform: scale(.95); opacity: .55; }
  100% { transform: scale(1.6);  opacity: 0;   }
}
.wa-fab .wa-tip {
  position: absolute; right: 0; left: auto; bottom: calc(100% + 14px);
  transform: translateY(6px);
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface-card); color: var(--fg-strong);
  border: 1px solid var(--rule);
  font-family: var(--font-display); font-weight: 500; font-size: 13px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
  box-shadow: var(--shadow-md);
}
.wa-fab:hover .wa-tip {
  opacity: 1; transform: translateY(0);
}

@media (max-width: 640px) {
  .wa-fab { bottom: 18px; right: 18px; width: 54px; height: 54px; }
  .wa-fab svg { width: 24px; height: 24px; }
  .wa-fab .wa-tip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wa-fab .wa-pulse { animation: none; display: none; }
  .wa-fab { transition: none; }
}
@media print { .wa-fab, .cookie-notice { display: none !important; } }

/* ═════════════════════════════════════════════════════════════
   FLOATING DIAGNOSTIC BUTTON (persistent on every page)
   Sits to the LEFT of the WhatsApp FAB. Visually different:
   bone background, accent ring, rotating conic-gradient glow.
   ═════════════════════════════════════════════════════════════ */
.diag-fab {
  position: fixed; bottom: 22px; right: calc(22px + 60px + 32px);
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--surface-card);
  color: var(--accent);
  display: grid; place-items: center;
  text-decoration: none;
  border: 1.5px solid var(--purple-24);
  box-shadow:
    0 12px 30px -10px rgba(0,0,0,.30),
    0 0 0 1px var(--rule);
  z-index: 60;
  transition: transform 280ms var(--ease-out),
              box-shadow 280ms var(--ease-out),
              border-color 280ms var(--ease-out);
  cursor: pointer;
  isolation: isolate;
}
.diag-fab::before {
  content: ""; position: absolute; inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    var(--accent) 0deg,
    transparent 90deg,
    transparent 270deg,
    var(--accent) 360deg);
  z-index: -1;
  opacity: .55;
  filter: blur(3px);
  animation: diagSpin 6s linear infinite;
}
@keyframes diagSpin { to { transform: rotate(360deg); } }
.diag-fab:hover {
  transform: translateY(-3px) scale(1.05);
  border-color: var(--accent);
  box-shadow:
    0 18px 40px -10px rgba(0,0,0,.40),
    0 0 0 1px var(--accent),
    0 0 0 6px var(--purple-16);
}
.diag-fab svg {
  width: 28px; height: 28px;
  fill: none; stroke: currentColor;
  pointer-events: none;
}
.diag-fab .diag-pulse {
  position: absolute; inset: -2px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0;
  animation: diagPing 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes diagPing {
  0%   { transform: scale(.9);  opacity: .55; }
  100% { transform: scale(1.55); opacity: 0;   }
}
.diag-fab .diag-badge {
  position: absolute; top: -6px; left: -6px;
  background: var(--accent); color: var(--bone);
  font-family: var(--font-mono); font-size: 9px;
  padding: 3px 6px; border-radius: 999px;
  letter-spacing: .14em; line-height: 1;
  box-shadow: 0 4px 10px -2px rgba(0,0,0,.30);
}
.diag-fab .diag-tip {
  position: absolute; right: 0; left: auto; bottom: calc(100% + 14px);
  transform: translateY(6px);
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface-card); color: var(--fg-strong);
  border: 1px solid var(--rule);
  font-family: var(--font-display); font-weight: 500; font-size: 13px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
  box-shadow: var(--shadow-md);
}
.diag-fab:hover .diag-tip {
  opacity: 1; transform: translateY(0);
}
@media (max-width: 640px) {
  /* Stack the diagnostic FAB above the WhatsApp FAB on small screens */
  .diag-fab {
    bottom: calc(18px + 54px + 12px); right: 18px;
    width: 54px; height: 54px;
  }
  .diag-fab svg { width: 24px; height: 24px; }
  .diag-fab .diag-tip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .diag-fab::before { animation: none; }
  .diag-fab .diag-pulse { animation: none; display: none; }
  .diag-fab { transition: none; }
}
@media print { .diag-fab { display: none !important; } }

/* ═════════════════════════════════════════════════════════════
   COOKIE / PRIVACY NOTICE (minimal, dismissible)
   ═════════════════════════════════════════════════════════════ */
.cookie-notice {
  position: fixed; left: 22px; right: 22px; bottom: 22px;
  max-width: 540px;
  padding: 16px 20px;
  background: var(--surface-card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  display: none;
  align-items: center; gap: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 70;
  backdrop-filter: blur(12px);
  font-family: var(--font-sans);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 400ms var(--ease-out), opacity 400ms var(--ease-out);
}
.cookie-notice.on { display: flex; transform: translateY(0); opacity: 1; }
.cookie-notice p {
  margin: 0; font-size: 13px; line-height: 1.5; color: var(--fg-muted);
  flex: 1;
}
.cookie-notice .accept {
  flex-shrink: 0;
  padding: 8px 16px; border-radius: 999px;
  background: var(--accent); color: var(--bone);
  border: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 500; font-size: 12.5px;
  letter-spacing: .01em;
  transition: background 220ms var(--ease-out);
}
.cookie-notice .accept:hover { background: var(--accent-hover); }

@media (max-width: 640px) {
  .cookie-notice { left: 14px; right: 14px; bottom: 90px; padding: 14px 16px; }
  .cookie-notice p { font-size: 12.5px; }
}

/* ═════════════════════════════════════════════════════════════
   SCHEDULING MODAL (embedded calendar — branded, no new tab)
   ═════════════════════════════════════════════════════════════ */
.sched-overlay {
  position: fixed; inset: 0;
  z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 32px;
  background: color-mix(in srgb, var(--black) 62%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 320ms var(--ease-out);
}
.sched-overlay.on { display: flex; opacity: 1; }

.sched-modal {
  position: relative;
  width: min(920px, 100%);
  height: min(720px, 86vh);
  background: var(--surface-card);
  border: 1px solid var(--accent);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--purple-24), 0 40px 80px -30px rgba(0,0,0,.7);
  transform: translateY(16px) scale(.98);
  transition: transform 360ms var(--ease-out);
  display: flex; flex-direction: column;
}
.sched-overlay.on .sched-modal { transform: translateY(0) scale(1); }

.sched-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.sched-head .sched-title {
  font-family: var(--font-mono); font-size: 11px; font-weight: 400;
  letter-spacing: .22em; text-transform: uppercase; color: var(--fg-muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.sched-head .sched-title::before { content: ""; width: 8px; height: 8px; background: var(--accent); transform: rotate(45deg); }
.sched-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: transparent; border: 1px solid var(--rule);
  color: var(--fg-strong); cursor: pointer;
  display: grid; place-items: center;
  transition: border-color 220ms var(--ease-out), background 220ms var(--ease-out);
}
.sched-close:hover { border-color: var(--accent); background: var(--purple-08); }
.sched-close svg { width: 16px; height: 16px; display: block; }
.sched-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sched-body { flex: 1; position: relative; min-height: 0; }
.sched-body iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; display: block;
  background: var(--bg);
}
.sched-loading {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--fg-muted);
  pointer-events: none;
}

@media (max-width: 640px) {
  .sched-overlay { padding: 0; }
  .sched-modal {
    width: 100%; height: 100%; max-height: 100%;
    border-radius: 0; border-left: none; border-right: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sched-overlay, .sched-modal { transition: none; }
}

/* ─────────── SINGLE DEMO CARD (homepage hero, clickable) ─────────── */
.specimen.is-link {
  text-decoration: none; color: inherit;
  cursor: pointer; display: flex;
}
.specimen.is-link:hover { border-color: var(--accent); }

/* ─────────── LEGAL PAGES (privacidad / terminos) ─────────── */
.legal { padding: 120px 0 100px; }
.legal .container { max-width: 820px; }
.legal .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--fg-muted); margin-bottom: 28px;
}
.legal .eyebrow::before { content: ""; width: 8px; height: 8px; background: var(--accent); transform: rotate(45deg); }
.legal h1 {
  font-family: var(--font-display); font-weight: 200;
  font-size: clamp(40px, 6vw, 72px); line-height: 1; letter-spacing: -.04em;
  color: var(--fg-strong); margin-bottom: 18px;
}
.legal .updated {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--fg-subtle); margin-bottom: 40px;
}
.legal .intro {
  font-family: var(--font-sans); font-weight: 300; font-size: 18px; line-height: 1.7;
  color: var(--fg-muted); margin-bottom: 48px; padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
}
.legal h2 {
  font-family: var(--font-display); font-weight: 400; font-size: 22px;
  letter-spacing: -.015em; color: var(--fg-strong);
  margin: 40px 0 14px;
  display: flex; gap: 14px; align-items: baseline;
}
.legal h2 .legal-num {
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
  letter-spacing: .1em; flex-shrink: 0;
}
.legal p, .legal li {
  font-family: var(--font-sans); font-weight: 300; font-size: 15.5px; line-height: 1.75;
  color: var(--fg-muted); margin: 0 0 14px; max-width: 70ch;
}
.legal a { color: var(--accent); }
.legal a:hover { color: var(--fg-strong); }

/* ─────────── GATE STATUS + PRIVACY CHECKBOX (diagnostic contact gate) ─────────── */
.gate-status {
  display: none; margin-top: 14px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase;
  padding: 10px 14px; border-radius: 8px;
}
.gate-status.on { display: block; }
.gate-status.sending { color: var(--fg-muted); background: var(--purple-08); border: 1px solid var(--rule); }
.gate-status.sent    { color: var(--accent);   background: var(--purple-08); border: 1px solid var(--accent); }
.gate-status.error   { color: #8a3a2a;          background: rgba(138,58,42,.08); border: 1px solid #8a3a2a; }

.gate-checkbox {
  display: flex; align-items: flex-start; gap: 12px;
  margin-top: 18px;
  font-family: var(--font-sans); font-weight: 300; font-size: 13.5px; line-height: 1.5;
  color: var(--fg-muted); cursor: pointer;
}
.gate-checkbox input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px;
  border: 1.5px solid var(--rule); border-radius: 5px;
  background: var(--bg); cursor: pointer;
  display: grid; place-items: center;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.gate-checkbox input[type="checkbox"]:hover { border-color: var(--accent); }
.gate-checkbox input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.gate-checkbox input[type="checkbox"]:checked::after {
  content: ""; width: 6px; height: 10px;
  border: solid var(--bone); border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}
.gate-checkbox input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gate-checkbox a { color: var(--accent); }

/* ─────────── RESPONSIVE ─────────── */
@media (max-width: 1024px) {
  footer .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 760px) {
  .nav-inner { padding: 14px 22px; flex-wrap: wrap; gap: 16px; }
  .nav-links { order: 3; width: 100%; justify-content: center; gap: 18px; flex-wrap: wrap; }
  .nav-cta { gap: 8px; }
  .nav-cta .btn.primary { display: none; }
  .container { padding: 0 22px; }
  footer .foot-grid { grid-template-columns: 1fr; }
  .foot-bottom { flex-direction: column; gap: 10px; text-align: center; }
}
