/* Developer Foxy — light European blue theme */
:root {
  --site-fondo: url("../doc/fondo.png");
  --bg-solid: #ffffff;
  --bg: rgba(255, 255, 255, 0.78);
  --bg-soft: rgba(248, 250, 252, 0.82);
  --bg-accent: rgba(239, 246, 255, 0.88);
  --bg-surface: rgba(255, 255, 255, 0.94);
  --text: #0f172a;
  --text-muted: #64748b;
  --brand: #2563eb;
  --brand-light: #3b82f6;
  --brand-sky: #0ea5e9;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(37, 99, 235, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.1);
  --radius: 14px;
  --radius-lg: 22px;
  --header-h: 72px;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --section-pad: clamp(4rem, 10vw, 7rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg-solid);
  overflow-x: hidden;
  isolation: isolate;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background: var(--site-fondo) center / cover no-repeat;
  opacity: 0.34;
  filter: saturate(0.95);
}

body::after {
  z-index: -1;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(248, 250, 252, 0.76) 50%,
    rgba(239, 246, 255, 0.8) 100%
  );
}

body.nav-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--brand-sky);
}

.container {
  width: min(1180px, 92vw);
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Scroll progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-sky));
  z-index: 200;
  transition: width 0.1s linear;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
}

.logo-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 10px;
}

.logo strong {
  color: var(--brand);
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: width 0.25s var(--ease), left 0.25s var(--ease);
}

.nav-list a:hover,
.nav-list a.is-active {
  color: var(--text);
}

.nav-list a:hover::after,
.nav-list a.is-active::after {
  width: 100%;
  left: 0;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-sky));
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  color: #fff;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.45);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--brand-light);
  color: var(--brand);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
  color: var(--brand);
  transform: none;
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  padding-bottom: 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--site-fondo) center / cover no-repeat;
  opacity: 0.24;
  filter: saturate(0.92);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(59, 130, 246, 0.1), transparent),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(14, 165, 233, 0.06), transparent),
    linear-gradient(180deg, rgba(239, 246, 255, 0.58) 0%, rgba(255, 255, 255, 0.68) 55%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, black 20%, transparent 85%);
  opacity: 0.4;
}

.hero-grid-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.35rem);
  line-height: 1.12;
  font-weight: 700;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, var(--brand), var(--brand-sky));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  color: var(--text-muted);
  max-width: 32rem;
  margin: 0 0 2rem;
  font-size: 1.125rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-visual {
  position: relative;
  min-height: 420px;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-fox {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translate(var(--fox-x, 0), var(--fox-y, 0));
  transition: transform 0.15s ease-out;
}

.fox-svg {
  width: min(280px, 70vw);
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(37, 99, 235, 0.2));
}

.fox-tail {
  transform-origin: 200px 220px;
  animation: tail-wag 4s ease-in-out infinite;
}

@keyframes tail-wag {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(6deg);
  }
}

.hero-float {
  position: absolute;
  z-index: 3;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand);
  box-shadow: var(--shadow);
  animation: float 5s ease-in-out infinite;
}

.hero-float-1 {
  top: 12%;
  left: 0;
  animation-delay: 0s;
}

.hero-float-2 {
  top: 45%;
  right: -5%;
  animation-delay: 1.2s;
}

.hero-float-3 {
  bottom: 15%;
  left: 10%;
  animation-delay: 2.4s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 28px;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: 20px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.hero-scroll-hint span {
  width: 4px;
  height: 8px;
  background: var(--brand);
  border-radius: 2px;
  animation: scroll-dot 2s ease infinite;
}

@keyframes scroll-dot {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* Metrics */
.metrics {
  padding: 3rem 0;
  background: rgba(248, 250, 252, 0.55);
  border-block: 1px solid var(--border);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.metric-card {
  text-align: center;
  padding: 1.5rem;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--brand);
}

.metric-suffix {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-sky);
}

.metric-label {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Sections */
.section {
  padding-block: var(--section-pad);
}

.section-header {
  max-width: 640px;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.section-desc {
  color: var(--text-muted);
  margin: 0;
}

/* Services */
.services {
  background: rgba(255, 255, 255, 0.35);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.service-card {
  padding: 2rem;
  background: var(--bg-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: var(--shadow-lg);
}

.service-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-accent);
  border-radius: 12px;
  color: var(--brand);
  margin-bottom: 1.25rem;
}

.service-icon svg {
  width: 26px;
  height: 26px;
}

.service-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.service-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* Process */
.process {
  background: rgba(248, 250, 252, 0.55);
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  position: relative;
}

.process-steps::before {
  content: '';
  position: absolute;
  top: 26px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-light), var(--brand));
  z-index: 0;
}

.process-step {
  padding: 0 1.5rem;
  background: none;
  border: none;
  border-radius: 0;
  position: relative;
  z-index: 1;
}

.step-num {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid rgba(59, 130, 246, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--brand);
  margin-bottom: 1.4rem;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.process-step:hover .step-num {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.process-step h3 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.process-step p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

/* Portfolio */
.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.filter-btn:hover,
.filter-btn.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.portfolio-card {
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.portfolio-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.portfolio-card-inner {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-accent);
}

.portfolio-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.portfolio-card:hover img {
  transform: scale(1.06);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(15, 23, 42, 0.75), transparent 55%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.portfolio-card:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-overlay h3 {
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.portfolio-overlay span {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
}

.portfolio-card-meta {
  padding: 1.25rem 1.25rem 1.5rem;
  background: var(--bg-surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  background: var(--bg-accent);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--brand);
  border-radius: 999px;
}

.tag-tech {
  background: var(--bg-soft);
  border-color: var(--border);
  color: var(--text-muted);
}

.portfolio-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.portfolio-card-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.87rem;
  line-height: 1.55;
}

/* Modal */
.portfolio-modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
}

.portfolio-modal::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

.portfolio-modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 150;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
}

.modal-panel {
  position: relative;
  z-index: 1;
  background: var(--bg-solid);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: min(92vw, 720px);
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.4s var(--ease);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--bg-solid);
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.modal-image-wrap {
  background: var(--bg-accent);
  aspect-ratio: 16/9;
}

.modal-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-body {
  padding: 2rem;
}

.modal-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
}

.modal-tech li {
  padding: 0.35rem 0.75rem;
  background: var(--bg-accent);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--brand);
  font-weight: 500;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 4rem;
  align-items: start;
}

.contact-info {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}

.contact-info li {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.contact-info strong {
  display: block;
  color: var(--text);
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.contact-form {
  background: var(--bg-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.form-row {
  margin-bottom: 1.25rem;
}

.form-row label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--bg-solid);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-note {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  min-height: 1.4em;
}

.form-note.is-success {
  color: #059669;
}

/* Footer */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.65);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-inner nav {
  display: flex;
  gap: 1.5rem;
}

/* FABs */
.fab {
  position: fixed;
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s var(--ease);
}

.fab:hover {
  transform: scale(1.08);
}

.fab-chat {
  bottom: 1.5rem;
  right: 1.5rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-sky));
  color: #fff;
  position: fixed;
}

.fab-chat-pulse {
  position: absolute;
  top: 2px;
  right: 3px;
  width: 11px;
  height: 11px;
  background: #22c55e;
  border: 2px solid #fff;
  border-radius: 50%;
  animation: chat-pulse-dot 2s ease-in-out infinite;
}

@keyframes chat-pulse-dot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}

/* Ocultar panel demo si el chat usa WhatsApp, Crisp o Tawk */
body[data-chat-mode="whatsapp"] .chat-widget,
body[data-chat-mode="crisp"] .chat-widget,
body[data-chat-mode="tawk"] .chat-widget {
  display: none !important;
}

/* Chat widget */
.chat-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: min(360px, calc(100vw - 2rem));
  background: var(--bg-solid);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 120;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  overflow: hidden;
  animation: chat-slide 0.35s var(--ease);
}

.chat-widget[hidden] {
  display: none !important;
}

@keyframes chat-slide {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.3rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-sky));
  color: #fff;
  gap: 0.75rem;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex: 1;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.chat-header-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.chat-online {
  font-size: 0.75rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-online-dot {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
}

.chat-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.chat-messages {
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 200px;
  max-height: 260px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
}

.chat-msg {
  max-width: 83%;
  padding: 0.65rem 0.95rem;
  border-radius: 13px;
  font-size: 0.87rem;
  line-height: 1.5;
  animation: msg-in 0.3s ease;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.chat-msg p {
  margin: 0;
}

.chat-msg-time {
  font-size: 0.67rem;
  display: block;
  margin-top: 3px;
}

.chat-msg-bot {
  align-self: flex-start;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-msg-bot .chat-msg-time {
  color: var(--text-muted);
}

.chat-msg-user {
  align-self: flex-end;
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-user .chat-msg-time {
  color: rgba(255, 255, 255, 0.7);
}

/* Typing indicator */
.chat-typing {
  align-self: flex-start;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 13px;
  border-bottom-left-radius: 4px;
  padding: 0.65rem 0.95rem;
  margin: 0 1rem;
  display: none;
  gap: 4px;
  align-items: center;
}

.chat-typing.is-visible {
  display: flex;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Quick replies */
.chat-quick-replies {
  padding: 0.4rem 1rem 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.quick-reply-btn {
  background: none;
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--brand);
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.2s, border-color 0.2s;
}

.quick-reply-btn:hover {
  background: var(--bg-accent);
  border-color: var(--brand-light);
}

/* Chat form */
.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--border);
  align-items: flex-end;
}

.chat-form textarea {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.87rem;
  color: var(--text);
  background: var(--bg-soft);
  resize: none;
  max-height: 90px;
  line-height: 1.4;
  transition: border-color 0.2s;
}

.chat-form textarea:focus {
  outline: none;
  border-color: var(--brand-light);
}

.chat-form textarea::placeholder {
  color: var(--text-muted);
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  background: var(--brand);
  border: none;
  border-radius: 9px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}

.chat-send-btn:hover {
  background: var(--brand-sky);
  transform: scale(1.07);
}

/* Section transition overlay */
.section-transition {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  transition: opacity 0.25s ease;
}

.section-transition.is-active {
  opacity: 0.4;
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}

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

/* Responsive */
@media (max-width: 1024px) {
  .hero-grid-layout {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-lead {
    margin-inline: auto;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-visual {
    min-height: 360px;
  }

  .services-grid,
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .process-steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .process-steps::before {
    display: none;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

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

  .nav-list {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
  }

  .nav-list.is-open {
    transform: translateX(0);
  }

  .header-actions .btn-ghost {
    display: none;
  }

  .services-grid,
  .portfolio-grid,
  .process-steps {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .process-step {
    padding: 0;
  }

  .fab-chat {
    bottom: 1.25rem;
  }

  .chat-widget {
    right: 1rem;
    left: 1rem;
    width: auto;
  }
}
