/* ==========================================================================
   medioswebpe.com — main stylesheet (dark theme, red brand palette)
   ========================================================================== */

:root {
  /* Brand red scale (replaces the original blue/cyan scale sampled from
     the logo — the logo image itself still has its original blue/purple
     gradient baked into its pixels and wasn't recolored, by request). */
  --brand-300: #FF9B8F;
  --brand-500: #FF4136;
  --brand-600: #D32F2F;
  --brand-700: #8B1E1E;
  --maroon-950: #2B0A0A;

  /* Secondary violet accent — kept as-is (only "blue" was asked to change
     to red, this scale stays self-contained and untouched). */
  --purple-400: #A78BFA;
  --purple-600: #6B2FEF;
  --purple-700: #54139C;

  /* Other secondary accents — used deliberately (icons, badges, the 3D
     hero object) to add personality without diluting the red brand
     identity as the dominant color everywhere else. */
  --teal-400:   #2DD4BF;
  --teal-600:   #0D9488;
  --coral-400:  #FF7A5C;
  --coral-600:  #E75A3C;
  --amber-400:  #FBBF24;

  --navy-950: #150606;
  --navy-900: #2A0A0A;

  /* Dark-theme surfaces (page background + elevated "cards" on top of it),
     warmed slightly toward red/black rather than neutral/blue-black, to
     read as cohesive with the red brand accent. */
  --surface-0:  #0D0707;              /* page background — near-black, warm tint */
  --surface-1:  #170B0B;              /* alt-section background, one step up */
  --surface-2:  rgba(255, 255, 255, .045); /* translucent card fill over surface-0/1 */
  --surface-2-solid: #1D0F0F;         /* opaque version, for floating panels like the chat widget */
  --surface-border: rgba(255, 255, 255, .09);

  /* Text on the dark page */
  --ink-100: #F4F6FF; /* headings */
  --ink-300: #B7BEDD; /* body text */
  --ink-500: #7B81A0; /* muted / hints */

  /* Original dark literals — kept for elements that are meant to stay
     dark/light regardless of page theme (e.g. text inside a solid white
     button, or a colored alert banner). */
  --slate-900: #14172B;
  --slate-700: #454A5E;
  --slate-400: #8890A6;
  --white:     #FFFFFF;
  --error-600: #DC2626;

  --gradient-brand:      linear-gradient(135deg, var(--brand-300) 0%, var(--brand-500) 45%, var(--brand-700) 100%);
  --gradient-brand-dark: linear-gradient(160deg, #1A0505 0%, var(--brand-700) 55%, var(--maroon-950) 100%);
  --gradient-teal:       linear-gradient(135deg, var(--teal-400) 0%, var(--brand-500) 100%);
  --gradient-coral:      linear-gradient(135deg, var(--amber-400) 0%, var(--coral-600) 100%);
  --gradient-violet:     linear-gradient(135deg, var(--purple-600) 0%, var(--purple-700) 100%);

  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  --radius: 14px;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .3);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, .5);
  --container-w: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-300);
  background: var(--surface-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink-100);
  line-height: 1.15;
  margin: 0 0 .5em;
  font-weight: 600;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container-w); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 700;
  color: var(--brand-300); margin-bottom: .8em;
}
.eyebrow::before { content: ''; width: 24px; height: 2px; background: var(--gradient-brand); display: inline-block; border-radius: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  cursor: pointer; border: 2px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--gradient-brand); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.35); color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.6); }
.btn-dark { background: var(--white); color: var(--surface-0); }
.btn-dark:hover { background: var(--ink-100); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13, 7, 7, .78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.07);
  transition: box-shadow .2s ease, background .2s ease;
}
.site-header.scrolled { background: rgba(13, 7, 7, .94); box-shadow: 0 4px 24px rgba(0,0,0,.4); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 34px; height: 34px; object-fit: cover; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.18); background: var(--white);
}
.brand-text {
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
  background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-dot { font-weight: 500; opacity: .8; }
.brand-text-footer { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--white); }
.footer-brand .brand-dot { opacity: .7; }

.main-nav ul { display: flex; list-style: none; margin: 0; padding: 0; gap: 4px; align-items: center; }
.main-nav a {
  display: inline-flex; align-items: center; padding: 10px 16px; border-radius: 999px;
  font-size: .92rem; font-weight: 600; color: var(--ink-300);
  transition: background .15s ease, color .15s ease;
}
.main-nav a:hover { background: rgba(255,255,255,.08); color: var(--brand-300); }
.main-nav a.nav-cta { background: var(--gradient-brand); color: var(--white); }
.main-nav a.nav-cta:hover { opacity: .92; background: var(--gradient-brand); color: var(--white); }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18);
  background: transparent; cursor: pointer;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink-100); margin: 0 auto; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Flash messages ---------- */
.flash { padding: 14px 0; font-weight: 500; }
.flash .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flash-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: inherit; line-height: 1; }
/* Success uses teal (not red) so it never looks like the error state below —
   both being red on a red-branded site would be genuinely confusing. */
.flash-exito { background: var(--teal-600); color: var(--white); }
.flash-error { background: var(--error-600); color: var(--white); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 92vh; display: flex; align-items: center;
  color: var(--white); overflow: hidden; background: var(--gradient-brand-dark);
}
.hero-mesh {
  position: absolute; inset: -10%; filter: blur(60px); pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,155,143,.35), transparent 45%),
    radial-gradient(circle at 80% 15%, rgba(255,65,54,.30), transparent 50%),
    radial-gradient(circle at 50% 85%, rgba(139,30,30,.45), transparent 55%);
  background-size: 200% 200%;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-mesh { animation: meshDrift 18s ease-in-out infinite alternate; }
}
@keyframes meshDrift { to { background-position: 15% 10%, 85% 15%, 60% 90%; } }

.hero-circuit { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .55; }
.hero-circuit path { fill: none; stroke: var(--brand-300); stroke-width: 1.4; opacity: .55; stroke-dasharray: 6 10; }
.hero-circuit .node { fill: var(--brand-300); }
@media (prefers-reduced-motion: no-preference) {
  .hero-circuit path { animation: circuitFlow 7s linear infinite; }
  .hero-circuit .node { animation: nodePulse 3s ease-in-out infinite; }
  .hero-circuit .node:nth-of-type(2n) { animation-delay: .6s; }
  .hero-circuit .node:nth-of-type(3n) { animation-delay: 1.2s; }
}
@keyframes circuitFlow { to { stroke-dashoffset: -160; } }
@keyframes nodePulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.hero-content { position: relative; z-index: 2; padding: 130px 0 80px; }
.hero-content h1 { color: var(--white); max-width: 780px; }
.hero-lead { max-width: 560px; font-size: 1.15rem; color: rgba(255,255,255,.82); }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }

.hero-eyebrow, .hero-content h1, .hero-lead, .hero-actions { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .hero-eyebrow, .hero-content h1, .hero-lead, .hero-actions {
    opacity: 0; transform: translateY(18px); animation: heroRise .7s ease-out forwards;
  }
  .hero-eyebrow { animation-delay: .1s; }
  .hero-content h1 { animation-delay: .25s; }
  .hero-lead { animation-delay: .4s; }
  .hero-actions { animation-delay: .55s; }
}
@keyframes heroRise { to { opacity: 1; transform: translateY(0); } }

.hero-scroll-cue {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.6); font-size: .8rem; text-align: center; z-index: 2;
}
.hero-scroll-cue .chevron { width: 18px; height: 18px; margin: 6px auto 0; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
@media (prefers-reduced-motion: no-preference) {
  .hero-scroll-cue .chevron { animation: cueBounce 1.6s ease-in-out infinite; }
}
@keyframes cueBounce { 0%, 100% { transform: rotate(45deg) translate(0,0); } 50% { transform: rotate(45deg) translate(4px,4px); } }

/* Signature 3D hero visual (Three.js canvas). One deliberate 3D moment,
   not scattered across the whole site — see assets/js/hero3d.js. Hidden
   entirely if WebGL isn't available; the CSS mesh/circuit layers behind it
   are the fallback background either way, so the hero never looks broken. */
.hero-3d-wrap {
  position: absolute; top: 0; right: 0; width: 52%; height: 100%;
  z-index: 1; pointer-events: none; opacity: 0;
  transition: opacity 1s ease .3s;
}
.hero-3d-wrap.ready { opacity: 1; }
#hero3d { width: 100%; height: 100%; display: block; }
@media (max-width: 980px) {
  .hero-3d-wrap { width: 100%; opacity: .35; }
}

/* ---------- Scroll-reveal ---------- */
.reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
  .reveal.in-view { opacity: 1; transform: translateY(0); }
  .reveal-stagger.in-view > * { animation: revealStagger .6s ease backwards; }
  .reveal-stagger.in-view > *:nth-child(1) { animation-delay: .05s; }
  .reveal-stagger.in-view > *:nth-child(2) { animation-delay: .12s; }
  .reveal-stagger.in-view > *:nth-child(3) { animation-delay: .19s; }
  .reveal-stagger.in-view > *:nth-child(4) { animation-delay: .26s; }
  .reveal-stagger.in-view > *:nth-child(5) { animation-delay: .33s; }
  .reveal-stagger.in-view > *:nth-child(6) { animation-delay: .40s; }
  .reveal-stagger.in-view > *:nth-child(n+7) { animation-delay: .46s; }
}
@keyframes revealStagger { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
.section-alt { background: var(--surface-1); }
.section-dark { background: var(--gradient-brand-dark); color: var(--white); }
.section-dark h2 { color: var(--white); }
.section-head { max-width: 680px; margin: 0 auto 52px; text-align: center; }

/* ---------- Grid / Cards ---------- */
.grid { display: grid; gap: 28px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface-2); backdrop-filter: blur(8px);
  border-radius: var(--radius); padding: 32px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--surface-border);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(255,255,255,.16); }

.service-icon {
  width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--gradient-brand); color: var(--white); margin-bottom: 18px;
  transition: transform .3s ease;
}
.service-icon svg { width: 26px; height: 26px; }
.service-icon.icon-teal   { background: var(--gradient-teal); }
.service-icon.icon-coral  { background: var(--gradient-coral); }
.service-icon.icon-violet { background: var(--gradient-violet); }
.card:hover .service-icon { transform: rotate(-6deg) scale(1.06); }
.card h3 { margin-bottom: .4em; }
.card p { color: var(--ink-300); margin-bottom: 0; }

/* Perspective-based 3D tilt for cards, driven by JS setting --rx/--ry from
   the pointer position (falls back to flat if JS didn't run). */
.tilt-card {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
  transition: transform .25s ease, box-shadow .2s ease;
}
.tilt-card:hover { box-shadow: var(--shadow-md); }

/* ---------- Portfolio ---------- */
.portfolio-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.portfolio-thumb.thumb-teal   { background: var(--gradient-teal); }
.portfolio-thumb.thumb-coral  { background: var(--gradient-coral); }
.portfolio-thumb.thumb-violet { background: var(--gradient-violet); }
.portfolio-thumb {
  height: 150px; background: var(--gradient-brand-dark);
  display: flex; align-items: center; justify-content: center;
}
.portfolio-thumb svg { width: 44px; height: 44px; opacity: .85; color: var(--white); }
.portfolio-body { padding: 26px; display: flex; flex-direction: column; flex: 1; }
.portfolio-category {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
  color: var(--brand-300); margin-bottom: .5em;
}
.portfolio-category.cat-teal   { color: var(--teal-400); }
.portfolio-category.cat-coral  { color: var(--amber-400); }
.portfolio-category.cat-violet { color: var(--purple-400); }
.portfolio-body p { flex: 1; }
.soon-badge {
  align-self: flex-start; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
  color: var(--purple-400); background: rgba(167,139,250,.14); border: 1px solid rgba(167,139,250,.35);
  padding: 5px 12px; border-radius: 999px; margin-top: 6px;
}
.portfolio-link {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  font-size: .85rem; font-weight: 700; color: var(--brand-300); margin-top: 8px;
  transition: color .15s ease, gap .15s ease;
}
.portfolio-link:hover { color: var(--purple-400); gap: 9px; }

/* ---------- About ---------- */
.about-visual {
  border-radius: var(--radius); background: var(--gradient-brand-dark); min-height: 320px;
  display: flex; align-items: center; justify-content: center; padding: 40px; overflow: hidden; position: relative;
  border: 1px solid var(--surface-border);
}
.about-visual img {
  max-width: 160px; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.25); background: var(--white);
  filter: drop-shadow(0 10px 30px rgba(0,0,0,.5));
}

/* ---------- Forms ---------- */
.form-card {
  background: var(--surface-2); backdrop-filter: blur(8px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 40px;
}
.form-row { margin-bottom: 20px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; color: var(--ink-100); }
.form-row input[type=text], .form-row input[type=email], .form-row textarea {
  width: 100%; padding: 13px 16px; border-radius: 10px; border: 1.5px solid var(--surface-border);
  background: rgba(255,255,255,.04); font-family: var(--font-body); font-size: .96rem; color: var(--ink-100);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--ink-500); }
.form-row input:focus, .form-row textarea:focus {
  outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(255,65,54,.22);
}
.form-row textarea { resize: vertical; min-height: 130px; }
.hint { display: block; font-weight: 400; font-size: .8rem; color: var(--ink-500); margin-top: 4px; }
.hp-field { position: absolute; left: -9999px; top: -9999px; }

.contact-info-card { color: var(--white); }
.contact-info-card h3 { color: var(--white); }
.contact-info-card p { color: rgba(255,255,255,.8); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--gradient-brand-dark); color: var(--white); border-radius: var(--radius); padding: 56px; text-align: center; }
.cta-band h2 { color: var(--white); }
.cta-band .btn-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-950); color: rgba(255,255,255,.75); padding-top: 60px; border-top: 1px solid var(--surface-border); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 50px; justify-content: space-between; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-brand { max-width: 320px; }
.footer-brand p { font-size: .88rem; margin-top: 10px; color: rgba(255,255,255,.6); }
.footer-nav { display: flex; gap: 50px; flex-wrap: wrap; }
.footer-nav h4 { color: var(--brand-300); font-family: var(--font-body); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-nav a { color: rgba(255,255,255,.72); font-size: .9rem; }
.footer-nav a:hover { color: var(--brand-300); }
.footer-bottom { padding: 22px 0; }
.footer-bottom p { margin: 0; font-size: .78rem; color: rgba(255,255,255,.45); text-align: center; }

/* ---------- Scroll to top/bottom ---------- */
.scroll-nav {
  position: fixed; left: 22px; bottom: 22px; z-index: 190;
  display: flex; flex-direction: column; gap: 10px;
}
.scroll-nav-btn {
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  background: var(--surface-2-solid); border: 1px solid var(--surface-border);
  color: var(--ink-100); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease, border-color .18s ease, opacity .2s ease, visibility .2s ease;
  opacity: 0; visibility: hidden;
}
.scroll-nav-btn.visible { opacity: 1; visibility: visible; }
.scroll-nav-btn:hover { transform: translateY(-2px); border-color: var(--brand-300); color: var(--brand-300); }
@media (max-width: 640px) {
  .scroll-nav { left: 16px; bottom: 16px; }
  .scroll-nav-btn { width: 40px; height: 40px; }
}

/* ---------- Chat widget ---------- */
.chat-widget { position: fixed; right: 22px; bottom: 22px; z-index: 200; }
.chat-fab {
  width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--gradient-brand); color: var(--white); box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: transform .2s ease;
}
.chat-fab:hover { transform: scale(1.06); }
.chat-fab-icon { width: 26px; height: 26px; position: absolute; transition: opacity .15s ease, transform .15s ease; }
.chat-fab-close { opacity: 0; transform: rotate(-45deg); }
.chat-fab.open .chat-fab-icon:not(.chat-fab-close) { opacity: 0; transform: rotate(45deg); }
.chat-fab.open .chat-fab-close { opacity: 1; transform: rotate(0); }

.chat-panel {
  position: absolute; bottom: 76px; right: 0; width: 340px; max-width: calc(100vw - 44px);
  background: var(--surface-2-solid); border-radius: 18px; box-shadow: var(--shadow-md);
  flex-direction: column; overflow: hidden; max-height: 480px;
  border: 1px solid var(--surface-border);
}
/* display is only set when the panel isn't [hidden], so JS toggling the
   hidden attribute actually hides it — a plain unconditional `display:flex`
   here would always win over the browser's [hidden] default and the panel
   could never be closed. */
.chat-panel:not([hidden]) { display: flex; }
.chat-panel-head { background: var(--gradient-brand-dark); color: var(--white); padding: 16px 18px; }
.chat-panel-title { display: flex; align-items: center; gap: 10px; }
.chat-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center; font-size: .5rem; font-weight: 700; text-align: center;
  color: var(--white); overflow: hidden; text-indent: -9999px;
}
.chat-panel-title strong { display: block; font-size: .92rem; }
.chat-panel-title small { color: rgba(255,255,255,.7); font-size: .74rem; }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.chat-msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: .88rem; line-height: 1.45; white-space: pre-line; }
.chat-msg-bot { background: rgba(255,255,255,.06); color: var(--ink-100); align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--surface-border); }
.chat-msg-user { background: var(--gradient-brand); color: var(--white); align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-typing { display: flex; gap: 4px; padding: 14px; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-500); animation: typingBounce 1.2s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.chat-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--surface-border); }
.chat-input-row input {
  flex: 1; border: 1.5px solid var(--surface-border); border-radius: 999px; padding: 10px 16px;
  font-family: var(--font-body); font-size: .88rem; background: rgba(255,255,255,.05); color: var(--ink-100);
}
.chat-input-row input::placeholder { color: var(--ink-500); }
.chat-input-row input:focus { outline: none; border-color: var(--brand-500); }
.chat-input-row button {
  width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--gradient-brand);
  color: var(--white); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chat-input-row button svg { width: 16px; height: 16px; }
.chat-disclaimer { font-size: .68rem; color: var(--ink-500); text-align: center; padding: 0 14px 12px; margin: 0; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-lg { margin-top: 50px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed; top: 73px; left: 0; right: 0; bottom: 0; background: var(--surface-0);
    padding: 20px 24px; transform: translateX(100%); transition: transform .25s ease; overflow-y: auto;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; gap: 6px; align-items: stretch; }
  .main-nav a { width: 100%; padding: 14px 16px; font-size: 1rem; }
  .main-nav a.nav-cta { text-align: center; justify-content: center; }
}

@media (max-width: 640px) {
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  section { padding: 64px 0; }
  .hero { min-height: auto; }
  .hero-content { padding: 110px 0 60px; }
  .form-card { padding: 26px; }
  .cta-band { padding: 40px 24px; }
  .chat-panel { width: calc(100vw - 32px); right: -6px; }
  .chat-widget { right: 16px; bottom: 16px; }
}
