/* =============================================================
   1. Tokens
   ============================================================= */
@property --mesh-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --mesh-x     { syntax: "<percentage>"; inherits: false; initial-value: 30%; }
@property --mesh-y     { syntax: "<percentage>"; inherits: false; initial-value: 40%; }

:root {
  --bg:        #F7F7F7;
  --bg-2:      #F0F2F3;
  --paper:     #ffffff;
  --ink:       #111111;
  --ink-soft:  #222222;
  --ink-mute:  #85898D;

  --navy-900:  #111111;
  --navy-700:  #0020FF;
  --navy-600:  #0033FF;
  --navy-500:  #0033FF;
  --navy-100:  #F0F2F3;

  --gold:      #E5BB07;

  --accent:    var(--navy-700);
  --accent-2:  var(--navy-500);

  --line:      rgba(17,17,17,.12);
  --line-soft: rgba(17,17,17,.07);
  --glass:         rgba(255,255,255,.6);
  --glass-strong:  rgba(255,255,255,.8);
  --glass-line:    rgba(17,17,17,.14);
  --shadow-color:  17,17,17;

  --display: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans:    "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:     cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  text-wrap: balance;
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-weight: 700;
}
ul { list-style: none; padding: 0; }
::selection { background: var(--navy-700); color: #fff; }

:focus-visible {
  outline: 2px solid var(--navy-500);
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.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;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .85rem; font-weight: 600; color: var(--navy-600);
  margin-bottom: 1.1rem;
}
.eyebrow-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--navy-500);
  box-shadow: 0 0 0 4px var(--navy-100);
}
.section { padding-block: clamp(4.5rem, 9vw, 8rem); position: relative; }
.section-head { max-width: 640px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head p.lead { color: var(--ink-mute); font-size: 1.05rem; margin-top: 1rem; }

/* =============================================================
   4. Typography
   ============================================================= */
.hero-title {
  font-size: clamp(2.35rem, 1.5rem + 3.6vw, 4.4rem);
  line-height: 1.04;
  max-width: 16ch;
}
h2.section-title { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.7rem); }
h3.card-title { font-size: 1.2rem; font-weight: 600; }

.split-word, .split-char { display: inline-block; will-change: transform, opacity; }

/* =============================================================
   5. Components
   ============================================================= */

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--sans); font-weight: 700; font-size: .97rem;
  padding: 1rem 1.7rem; border-radius: 999px;
  transition: transform .45s var(--ease-soft), box-shadow .45s var(--ease-soft), background-color .3s var(--ease-out);
  white-space: nowrap;
}
.btn-primary {
  background: var(--navy-700); color: #fff;
  box-shadow: 0 10px 24px -8px rgba(0,32,255,.4);
}
.btn-primary:hover { background: var(--navy-900); transform: translateY(-3px); box-shadow: 0 18px 34px -10px rgba(17,17,17,.4); }
.btn-primary:active { transform: translateY(-1px); transition-duration: .12s; }
.btn-ghost {
  background: transparent; color: var(--ink); border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--navy-500); color: var(--navy-700); transform: translateY(-3px); }

.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;
  padding-block: 1.15rem;
  transition: background-color .4s var(--ease-out), box-shadow .4s var(--ease-out), padding .4s var(--ease-out);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.nav.is-scrolled {
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 1px 0 var(--line);
  padding-block: .8rem;
}
.nav-logo { display: inline-flex; align-items: center; }
.nav-logo img { height: 24px; width: auto; display: block; }
.nav-links { display: none; align-items: center; gap: 2.1rem; }
@media (min-width: 960px) { .nav-links { display: flex; } }
.nav-link { position: relative; font-weight: 600; font-size: .95rem; padding: .25rem 0; color: var(--ink-soft); }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 2px; background: var(--navy-500);
  transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-out);
}
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta { display: none; }
@media (min-width: 720px) { .nav-cta { display: inline-flex; padding: .75rem 1.35rem; font-size: .88rem; } }

.nav-burger {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 10px; border: 1.5px solid var(--line);
}
@media (min-width: 960px) { .nav-burger { display: none; } }
.nav-burger svg { width: 18px; height: 18px; }

.nav-mobile {
  position: fixed; inset: 0; z-index: 99;
  background: var(--navy-900); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .6s var(--ease-soft);
}
.nav-mobile.is-open { clip-path: inset(0 0 0% 0); }
.nav-mobile a { font-family: var(--display); font-size: 1.6rem; font-weight: 600; }
.nav-mobile .btn-primary { margin-top: 1rem; }
.nav-mobile-close {
  position: absolute; top: 1.4rem; right: var(--gutter);
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  border: 1.5px solid rgba(255,255,255,.25); color: #fff;
}

/* --- Glass card --- */
.glass-card {
  position: relative;
  border-radius: 20px;
  padding: 2.1rem;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--glass-line);
  box-shadow: 0 1px 1px rgba(var(--shadow-color), .04);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform .55s var(--ease-soft), box-shadow .55s var(--ease-soft), border-color .3s;
}
@supports (backdrop-filter: blur(20px)) {
  .glass-card { background: var(--glass); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); }
}
.glass-card:hover {
  transition-duration: .18s;
  border-color: rgba(0,32,255,.35);
  box-shadow:
    0 40px 70px -24px rgba(var(--shadow-color), .28),
    0 14px 26px -10px rgba(var(--shadow-color), .18);
}
.glass-card .card-icon { transform: translateZ(30px); }
.glass-card .card-title, .glass-card p { transform: translateZ(20px); }

.card-icon {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--navy-100); color: var(--navy-700);
  margin-bottom: 1.3rem;
}
.card-icon svg { width: 22px; height: 22px; }

/* --- Placeholder media slot --- */
.media-slot {
  position: relative;
  border-radius: 20px;
  border: 1.5px dashed var(--line);
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  min-height: 220px;
  color: var(--ink-mute);
  text-align: center;
  padding: 1.5rem;
}
.media-slot-inner { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.media-slot svg { width: 30px; height: 30px; opacity: .55; }
.media-slot span { font-size: .85rem; font-weight: 600; }

/* --- Avatar (initials) --- */
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--navy-700); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 1rem;
  flex-shrink: 0;
}

/* --- Stars --- */
.stars { display: flex; gap: 2px; margin-bottom: 1rem; }
.stars svg { width: 15px; height: 15px; fill: var(--gold); }

/* --- Form --- */
.field { position: relative; margin-bottom: 1.15rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: 1.35rem 1rem .55rem; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font-family: var(--sans); font-size: 1rem;
  transition: border-color .25s var(--ease-out);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--navy-500); }
.field label {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  pointer-events: none; transition: all .25s var(--ease-out);
  color: var(--ink-mute); font-size: .97rem;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label,
.field select:focus + label, .field.has-value select + label {
  top: .55rem; transform: none; font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--navy-600);
}
.field select { padding-top: 1.2rem; }

.cta-form { position: relative; transition: opacity .55s var(--ease-out), transform .55s var(--ease-soft); }
.cta-form.is-sent { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.cta-submit { position: relative; width: 100%; }
.cta-form-spinner, .cta-form-check {
  position: absolute; inset: 0; display: grid; place-items: center;
  opacity: 0; pointer-events: none;
}
.cta-form.is-sending .cta-form-label { opacity: 0; }
.cta-form.is-sending .cta-form-spinner { opacity: 1; }
.cta-form-spinner::after {
  content: ""; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cta-success {
  border-radius: 20px; border: 1.5px solid var(--glass-line);
  background: var(--navy-100);
  padding: 2.4rem; text-align: center;
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-soft);
}
.cta-success.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.cta-success-check {
  width: 52px; height: 52px; border-radius: 50%; background: var(--navy-700);
  display: grid; place-items: center; margin-bottom: .4rem;
}
.cta-success-check svg { width: 24px; height: 24px; stroke: #fff; }
.cta-success-check path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .6s var(--ease-out) .3s; }
.cta-success.is-visible .cta-success-check path { stroke-dashoffset: 0; }

/* =============================================================
   6. Sections
   ============================================================= */

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding-top: 7rem;
  overflow: clip;
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: -10%; z-index: -1;
  background:
    radial-gradient(55% 45% at var(--mesh-x) var(--mesh-y), rgba(0,32,255,.14), transparent 65%),
    conic-gradient(from var(--mesh-angle), rgba(17,17,17,.05), rgba(0,32,255,.08), rgba(17,17,17,.05));
  filter: blur(70px) saturate(120%);
  animation: meshShift 26s linear infinite;
}
@keyframes meshShift {
  0%   { --mesh-angle: 0deg;   --mesh-x: 25%; --mesh-y: 30%; }
  50%  { --mesh-angle: 180deg; --mesh-x: 75%; --mesh-y: 60%; }
  100% { --mesh-angle: 360deg; --mesh-x: 25%; --mesh-y: 30%; }
}
.hero-grid {
  display: grid; gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}
@media (min-width: 1024px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }

.hero-eyebrow-row { display: flex; align-items: center; gap: .55rem; margin-bottom: 1.4rem; }
.hero-sub { font-size: 1.15rem; color: var(--ink-mute); max-width: 46ch; margin: 1.6rem 0 2.3rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.hero-note { margin-top: 1.4rem; font-size: .88rem; color: var(--ink-mute); }

.hero-figure { position: relative; }
.hero-shape {
  aspect-ratio: 1 / 1.05;
  border-radius: 28px;
  position: relative;
  background: linear-gradient(155deg, var(--navy-900) 0%, var(--navy-700) 55%, var(--navy-500) 100%);
  overflow: hidden;
  box-shadow: 0 50px 90px -30px rgba(17,17,17,.45);
}
.hero-shape img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.02);
}
.hero-shape::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(185deg, rgba(17,17,17,.15) 0%, rgba(17,17,17,.55) 78%, rgba(17,17,17,.82) 100%),
    radial-gradient(120% 90% at 15% 10%, rgba(0,32,255,.32), transparent 55%);
}
.hero-shape-badge {
  position: absolute; left: 1.6rem; bottom: 1.6rem; right: 1.6rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(10px);
  border-radius: 16px; padding: 1.1rem 1.3rem;
  color: #fff;
}
.hero-shape-badge strong { display: block; font-family: var(--display); font-size: 1.4rem; }
.hero-shape-badge span { font-size: .82rem; color: rgba(255,255,255,.75); }

/* --- Trust strip --- */
.trust-strip {
  border-block: 1px solid var(--line-soft);
  background: var(--bg-2);
}
.trust-strip .container { padding-block: 1.5rem; }
.trust-strip p {
  font-family: var(--display); font-weight: 500; font-style: normal;
  font-size: clamp(.95rem, .8rem + .6vw, 1.15rem);
  color: var(--ink-soft); text-align: center; max-width: 62ch; margin-inline: auto;
}

/* --- Ventajas / Capacidades (4-col reusable grid) --- */
.ventajas-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 720px) { .ventajas-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1024px) { .ventajas-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 719px) { .ventajas-grid { grid-template-columns: 1fr; } }

/* --- Especialización (3-col reusable grid) --- */
.grid-3 { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); } }

/* --- Numbered step rows (El sistema MONO) --- */
.step-row { display: grid; grid-template-columns: 72px 1fr; gap: 1.5rem; padding-block: 2.2rem; border-top: 1px solid var(--line-soft); }
.step-row:first-child { border-top: none; }
.step-num { font-family: var(--display); font-weight: 800; font-size: 2.1rem; color: var(--navy-700); line-height: 1; }
.step-row h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.step-row p { color: var(--ink-mute); max-width: 62ch; }
.step-row p + p { margin-top: .5rem; }
.step-tags { margin-top: .6rem; font-size: .88rem; color: var(--navy-600); font-weight: 600; }

/* --- Compact timeline strip (Nuestro proceso) --- */
.timeline-grid { display: grid; gap: 2rem 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .timeline-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1024px) { .timeline-grid { grid-template-columns: repeat(5, minmax(0,1fr)); } }
.timeline-item { padding-top: 1.2rem; border-top: 2px solid var(--navy-700); }
.timeline-item .step-num { font-size: 1.3rem; display: block; margin-bottom: .5rem; }
.timeline-item h3 { font-size: 1rem; margin-bottom: .35rem; }
.timeline-item p { font-size: .88rem; color: var(--ink-mute); }

/* --- Cliché quote chips (Por qué MONO) --- */
.cliche-list { display: flex; flex-wrap: wrap; gap: .7rem; margin-block: 1.5rem; }
.cliche-list span {
  font-size: .9rem; color: var(--ink-mute); text-decoration: line-through;
  padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 999px;
}

/* --- Results checklist --- */
.results-list { display: flex; flex-wrap: wrap; gap: .8rem 1rem; margin-block: 1.5rem; }
.results-list span {
  font-weight: 700; font-size: .95rem; color: var(--ink);
  padding: .6rem 1.1rem; background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
}

/* --- FAQ (native details/summary, no JS needed) --- */
.faq-item { border-top: 1px solid var(--line-soft); }
.faq-item:last-child { border-bottom: 1px solid var(--line-soft); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1.3rem; cursor: pointer; list-style: none;
  font-family: var(--display); font-weight: 700; font-size: 1.02rem; color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .faq-icon { flex-shrink: 0; width: 22px; height: 22px; position: relative; }
.faq-item summary .faq-icon::before, .faq-item summary .faq-icon::after {
  content: ""; position: absolute; top: 50%; left: 50%; background: var(--navy-700);
  transform: translate(-50%, -50%);
}
.faq-item summary .faq-icon::before { width: 14px; height: 2px; }
.faq-item summary .faq-icon::after { width: 2px; height: 14px; transition: transform .25s var(--ease-out); }
.faq-item[open] summary .faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); scale: 0; }
.faq-item p { padding-bottom: 1.4rem; color: var(--ink-mute); max-width: 68ch; }

/* --- Testimonios --- */
.testimonios-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 1023px) { .testimonios-grid { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; } }
.testimonio-quote { font-size: 1rem; color: var(--ink-soft); margin-bottom: 1.5rem; }
.testimonio-person { display: flex; align-items: center; gap: .8rem; }
.testimonio-person strong { display: block; font-size: .95rem; color: var(--ink); }
.testimonio-person span { font-size: .82rem; color: var(--ink-mute); }

/* --- Contacto --- */
.contacto-grid { display: grid; gap: clamp(2.5rem, 5vw, 4rem); }
@media (min-width: 960px) { .contacto-grid { grid-template-columns: .85fr 1.15fr; } }
.contacto-info-item { display: flex; gap: 1rem; align-items: flex-start; padding-block: 1.1rem; border-top: 1px solid var(--line-soft); }
.contacto-info-item:first-child { border-top: none; }
.contacto-info-item .card-icon { margin-bottom: 0; flex-shrink: 0; }
.contacto-info-item strong { display: block; color: var(--ink); font-size: .95rem; margin-bottom: .15rem; }
.contacto-info-item span { color: var(--ink-mute); font-size: .92rem; }
.contacto-form-wrap { position: relative; }

/* --- Footer --- */
.footer { background: var(--navy-900); color: rgba(255,255,255,.72); }
.footer .container { padding-block: clamp(3rem, 6vw, 4.5rem); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-brand { margin-bottom: .8rem; }
.footer-brand img { height: 26px; width: auto; display: block; filter: brightness(0) invert(1); }
.footer-tagline { max-width: 32ch; font-size: .92rem; }
.footer-cols { display: flex; gap: 3.5rem; flex-wrap: wrap; }
.footer-col h4 { color: #fff; font-family: var(--sans); font-size: .82rem; font-weight: 700; letter-spacing: .04em; margin-bottom: .9rem; }
.footer-col a, .footer-col span { display: block; font-size: .92rem; margin-bottom: .55rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); padding-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: .82rem; }

/* --- Chat widget --- */
.chat-widget { position: fixed; right: clamp(16px, 4vw, 28px); bottom: clamp(16px, 4vw, 28px); z-index: 120; }
.chat-toggle {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--navy-700); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 16px 32px -10px rgba(17,17,17,.5);
  transition: transform .35s var(--ease-soft), background-color .3s;
  position: relative;
}
.chat-toggle:hover { background: var(--navy-900); transform: translateY(-3px); }
.chat-toggle-icon { width: 24px; height: 24px; position: absolute; transition: opacity .2s, transform .2s; }
.chat-toggle .icon-close { opacity: 0; transform: scale(.7); }
.chat-toggle .icon-open { opacity: 1; transform: scale(1); }
.chat-widget.is-open .chat-toggle .icon-open { opacity: 0; transform: scale(.7); }
.chat-widget.is-open .chat-toggle .icon-close { opacity: 1; transform: scale(1); }

.chat-panel {
  position: absolute; right: 0; bottom: calc(100% + 16px);
  width: min(360px, calc(100vw - 32px));
  height: min(500px, calc(100vh - 140px));
  background: #fff; border-radius: 20px;
  border: 1px solid var(--glass-line);
  box-shadow: 0 30px 70px -20px rgba(17,17,17,.32);
  display: flex; flex-direction: column; overflow: hidden;
  transform-origin: bottom right;
  opacity: 0; transform: scale(.92) translateY(12px);
  pointer-events: none;
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-soft);
}
.chat-widget.is-open .chat-panel { opacity: 1; transform: none; pointer-events: auto; }

.chat-header { padding: 1.1rem 1.3rem; background: var(--navy-900); color: #fff; }
.chat-header strong { display: block; font-family: var(--display); font-size: 1rem; }
.chat-header span { font-size: .78rem; color: rgba(255,255,255,.65); }

.chat-messages { flex: 1; overflow-y: auto; padding: 1.1rem; display: flex; flex-direction: column; gap: .7rem; }
.chat-msg { max-width: 85%; padding: .65rem .9rem; border-radius: 14px; font-size: .9rem; line-height: 1.5; }
.chat-msg-model { align-self: flex-start; background: var(--bg-2); color: var(--ink-soft); border-bottom-left-radius: 4px; }
.chat-msg-user { align-self: flex-end; background: var(--navy-700); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg-error { align-self: flex-start; background: #fdecea; color: #7a2019; border-bottom-left-radius: 4px; }
.chat-msg-typing { align-self: flex-start; display: flex; gap: 4px; padding: .8rem 1rem; background: var(--bg-2); border-radius: 14px; border-bottom-left-radius: 4px; }
.chat-msg-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-mute); animation: chatTyping 1.2s infinite ease-in-out; }
.chat-msg-typing span:nth-child(2) { animation-delay: .15s; }
.chat-msg-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chatTyping { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-3px); opacity: 1; } }

.chat-form { display: flex; gap: .5rem; padding: .8rem; border-top: 1px solid var(--line-soft); }
.chat-form input {
  flex: 1; border: 1.5px solid var(--line); border-radius: 12px; padding: .7rem .9rem;
  font-family: var(--sans); font-size: .9rem; color: var(--ink);
}
.chat-form input:focus { border-color: var(--navy-500); }
.chat-form button {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: var(--navy-700); color: #fff; display: grid; place-items: center;
  transition: background-color .3s;
}
.chat-form button:hover { background: var(--navy-900); }
.chat-form button:disabled { opacity: .5; pointer-events: none; }
.chat-form button svg { width: 18px; height: 18px; }

.chat-disclaimer { font-size: .72rem; color: var(--ink-mute); text-align: center; padding: 0 1rem .8rem; }
.chat-disclaimer a { color: var(--navy-600); font-weight: 600; }

@media (max-width: 480px) {
  .chat-panel { width: calc(100vw - 24px); height: min(70vh, 560px); }
}

/* =============================================================
   7. Effects
   ============================================================= */
[data-reveal] {
  opacity: 0; transform: translateY(36px);
  transition: opacity .8s var(--ease-soft), transform .8s var(--ease-soft);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }
[data-reveal][data-split] { opacity: 1; transform: none; }

.stagger-children > * { transition-delay: calc(var(--i, 0) * 70ms); }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) { }
@media (min-width: 720px) { }
@media (min-width: 960px) { }
@media (min-width: 1280px) { .container { padding-inline: var(--gutter); } }

/* =============================================================
   9. Reduced-motion (only intrusive effects)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
}
