/* ===== Tokens ===== */
:root {
  --bg: #0b1020;
  --bg-2: #0f1528;
  --surface: #141b30;
  --surface-2: #1a2440;
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef1f8;
  --muted: #9aa6c2;
  --brand: #e02d25;       /* rojo DYPO real */
  --brand-2: #ff5a3c;     /* naranja cálido */
  --accent: #ff8a3d;      /* ámbar */
  --grad: linear-gradient(120deg, #ff4d4d 0%, #e02d25 50%, #ff7a3d 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1140px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: "Sora", system-ui, sans-serif; line-height: 1.15; font-weight: 700; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-2);
  margin-bottom: 14px;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(224, 45, 37, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 45, 37, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(224, 45, 37, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 45, 37, 0); }
}
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(224, 45, 37, 0.65);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(224, 45, 37, 0.8); }
.btn-ghost { background: rgba(255,255,255,0.05); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-2px); }

/* ===== Header ===== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(11, 16, 32, 0.55);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.site-header.scrolled { background: rgba(11, 16, 32, 0.92); border-bottom-color: var(--line); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand img { height: 34px; width: auto; }
.primary-nav ul { display: flex; align-items: center; gap: 6px; }
.primary-nav a {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.primary-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-cta {
  background: var(--grad);
  color: #fff !important;
  font-weight: 600;
}
.nav-cta:hover { transform: translateY(-1px); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  will-change: transform;
}
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(11,16,32,0.78) 0%, rgba(11,16,32,0.62) 40%, rgba(11,16,32,0.95) 100%),
    radial-gradient(60% 70% at 75% 30%, rgba(224, 45, 37, 0.28), transparent 60%);
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 2; }
.hero-copy { max-width: 720px; }
.hero-copy h1 {
  font-size: clamp(2.3rem, 5.4vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 30px rgba(0,0,0,0.4);
}
.hero-copy .lead { color: #c6cfe4; font-size: 1.15rem; margin: 22px 0 30px; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-stats { display: flex; gap: 40px; margin-top: 50px; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong {
  font-family: "Sora", sans-serif; font-size: 2rem; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-stats span { color: var(--muted); font-size: 0.88rem; }

/* Scroll cue */
.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 3;
  width: 26px; height: 42px;
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 14px;
  display: grid; place-items: start center;
  padding-top: 7px;
}
.scroll-cue span {
  width: 4px; height: 8px; border-radius: 2px; background: #fff;
  animation: cue 1.6s infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 80% { opacity: 0; transform: translateY(12px); } 100% { opacity: 0; } }

/* ===== Marquee ===== */
.marquee {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 16px 0;
}
.marquee-track {
  display: flex; gap: 26px; align-items: center;
  width: max-content;
  animation: scroll-x 38s linear infinite;
  white-space: nowrap;
}
.marquee-track span {
  font-family: "Sora", sans-serif; font-weight: 600;
  color: var(--muted); font-size: 1.05rem;
}
.marquee-track span:nth-child(even) { color: var(--brand); }
@keyframes scroll-x { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ===== Sections ===== */
.section { padding: 90px 0; position: relative; }
.section-alt { background: var(--bg-2); }

/* Decoración de fondo por sección (CSS puro, sin imágenes) */
.section > .container { position: relative; z-index: 2; }
.section { overflow: hidden; }
.section::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 0%, #000, transparent 80%);
  mask-image: radial-gradient(80% 70% at 50% 0%, #000, transparent 80%);
}
.section::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  width: 680px; height: 680px; border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 45, 37, 0.38), transparent 68%);
  filter: blur(34px);
  animation: blobdrift 18s ease-in-out infinite;
}
#servicios::after { top: -220px; right: -180px; }
#sectores::after  { bottom: -240px; left: -200px; background: radial-gradient(circle, rgba(255, 122, 61, 0.34), transparent 68%); animation-duration: 22s; }
#nosotros::after  { top: 20%; right: -260px; }
#proceso::after   { top: -200px; left: 35%; background: radial-gradient(circle, rgba(255, 122, 61, 0.30), transparent 68%); animation-duration: 26s; }
#contacto::after  { bottom: -240px; right: -180px; animation-duration: 20s; }

@keyframes blobdrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -36px) scale(1.18); }
}

/* Dispositivo en vista explosionada (fondo de "Cómo trabajamos") */
.deco-device {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, 92%);
  opacity: 0.6;
  z-index: 0; pointer-events: none;
  filter: drop-shadow(0 0 16px rgba(255, 90, 40, 0.45));
}
.deco-device svg { width: 100%; height: auto; display: block; }
.deco-device polygon { stroke-width: 2; }
.ed-layer { transform-box: fill-box; transform-origin: center; will-change: transform; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 54px; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
.section-head p { color: var(--muted); margin-top: 14px; font-size: 1.05rem; }

.grid { display: grid; gap: 24px; }
.grid-services { grid-template-columns: repeat(2, 1fr); }
.grid-sectors { grid-template-columns: repeat(4, 1fr); }

/* Service cards with media */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.card:hover { transform: translateY(-6px); border-color: rgba(224, 45, 37, 0.45); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.card:hover .card-media img { transform: scale(1.08); }
.card-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(20, 27, 48, 0.85) 100%);
}
.card-badge {
  position: absolute; left: 18px; bottom: -22px; z-index: 2;
  width: 50px; height: 50px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 24px -8px rgba(224, 45, 37, 0.7);
}
.card-badge svg { width: 26px; height: 26px; }
.card-body { padding: 34px 26px 28px; }
.service-card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.card-body > p { color: var(--muted); margin-bottom: 16px; }
.card-list li { color: var(--muted); font-size: 0.92rem; padding-left: 22px; position: relative; margin-bottom: 7px; }
.card-list li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
}

/* Sectors */
.pill-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.pill-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 100% 0%, rgba(224,45,37,0.12), transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}
.pill-card:hover { transform: translateY(-6px); border-color: rgba(255, 90, 60, 0.4); }
.pill-card:hover::before { opacity: 1; }
.pill-num {
  font-family: "Sora", sans-serif; font-weight: 800;
  font-size: 2.4rem;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.pill-card h3 { font-size: 1.18rem; margin: 8px 0 8px; position: relative; }
.pill-card p { color: var(--muted); font-size: 0.94rem; position: relative; }

/* Split */
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.split-copy h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin-bottom: 18px; }
.split-copy p { color: var(--muted); margin-bottom: 16px; }
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.value h4 { color: var(--brand-2); font-size: 1rem; margin-bottom: 4px; }
.value p { color: var(--muted); font-size: 0.88rem; margin: 0; }

/* About figure with image + glass overlay */
.about-figure { position: relative; }
.about-figure > img {
  width: 100%; border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3; object-fit: cover;
}
.about-glass {
  position: absolute; right: -16px; bottom: -20px;
  width: 64%;
  background: rgba(15, 21, 40, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid; gap: 9px;
}
.glass-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.9rem; font-weight: 500;
}
.glass-row .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--grad); flex: none; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.step { position: relative; padding-top: 8px; }
.step-num {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: "Sora", sans-serif; font-weight: 700; font-size: 1.2rem;
  color: var(--brand-2);
  margin-bottom: 16px;
}
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 0.94rem; }

/* Contact form */
.contact-list { margin-top: 26px; display: grid; gap: 14px; }
.contact-list li { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.contact-list svg { width: 22px; height: 22px; color: var(--brand-2); flex: none; }
.contact-list a:hover { color: var(--brand-2); }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  display: grid;
  gap: 16px;
  box-shadow: var(--shadow);
}
.field { display: grid; gap: 7px; }
.field label { font-size: 0.88rem; font-weight: 500; color: var(--muted); }
.field input, .field textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(224, 45, 37, 0.18);
}
.field textarea { resize: vertical; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 0.86rem; color: var(--muted); }
.checkbox input { margin-top: 4px; accent-color: var(--brand); }
.checkbox a { color: var(--brand-2); text-decoration: underline; }
.form-note { font-size: 0.9rem; min-height: 1.2em; }
.form-note.ok { color: #4ade80; }
.form-note.err { color: #ff7a8a; }

/* CTA band with background image */
.cta-band { position: relative; overflow: hidden; }
.cta-media { position: absolute; inset: 0; z-index: 0; }
.cta-media img { width: 100%; height: 100%; object-fit: cover; }
.cta-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(224, 45, 37, 0.92), rgba(255, 122, 61, 0.82));
  mix-blend-mode: multiply;
}
.cta-band::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,16,32,0.2), rgba(11,16,32,0.55));
}
.cta-inner { position: relative; z-index: 2; text-align: center; padding: 90px 24px; }
.cta-inner h2 { color: #fff; font-size: clamp(1.8rem, 3.8vw, 2.6rem); text-shadow: 0 2px 20px rgba(0,0,0,0.3); }
.cta-inner p { color: rgba(255,255,255,0.92); margin: 12px 0 28px; font-size: 1.1rem; }
.cta-inner .btn-primary { background: #fff; color: var(--brand); box-shadow: 0 12px 30px -12px rgba(0,0,0,0.5); }
.cta-inner .btn-primary:hover { background: #f1f1f1; }

/* Footer */
.site-footer { background: var(--bg-2); padding: 60px 0 28px; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand img { height: 32px; margin-bottom: 14px; }
.footer-brand p { color: var(--muted); font-size: 0.92rem; max-width: 300px; }
.footer-col h4 { font-size: 0.95rem; margin-bottom: 14px; }
.footer-col ul { display: grid; gap: 9px; }
.footer-col a { color: var(--muted); font-size: 0.92rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--brand-2); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 44px; padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.86rem;
  flex-wrap: wrap; gap: 12px;
}
.legal-links { display: flex; gap: 20px; }
.legal-links a:hover { color: var(--brand-2); }

/* To top */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: var(--grad); color: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.to-top svg { width: 22px; height: 22px; }
.to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top[hidden] { display: grid; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ===== Legal pages ===== */
.legal-page { padding: 130px 0 80px; }
.legal-page .container { max-width: 800px; }
.legal-page h1 { font-size: 2.2rem; margin-bottom: 8px; }
.legal-page .updated { color: var(--muted); font-size: 0.9rem; margin-bottom: 36px; }
.legal-page h2 { font-size: 1.3rem; margin: 32px 0 12px; }
.legal-page p, .legal-page li { color: var(--muted); margin-bottom: 12px; }
.legal-page ul { list-style: disc; padding-left: 22px; }
.legal-page a { color: var(--brand-2); text-decoration: underline; }
.back-link { display: inline-block; margin-top: 40px; color: var(--brand-2); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero { min-height: auto; padding: 130px 0 70px; }
  .split { grid-template-columns: 1fr; }
  .grid-services { grid-template-columns: 1fr; }
  .grid-sectors { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .about-glass { position: static; width: 100%; margin-top: 16px; }
  .scroll-cue { display: none; }

  .nav-toggle { display: flex; }
  .primary-nav {
    position: fixed; inset: 72px 0 auto 0;
    background: rgba(11, 16, 32, 0.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden;
    transition: max-height 0.35s var(--ease);
  }
  .primary-nav.open { max-height: 380px; }
  .primary-nav ul { flex-direction: column; align-items: stretch; padding: 16px 24px; gap: 4px; }
  .primary-nav a { padding: 13px 14px; }
}
@media (max-width: 540px) {
  .grid-sectors, .steps, .values, .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
  .section { padding: 64px 0; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .hero-img { transform: none; }
}
