/* Merlin VR · landing de formación industrial
   Identidad corporativa de Merlin (vr.merlinsoftware.es / merlinsoftware.es):
   tinta, crema, petróleo y cielo; Archivo Black para titulares (aquí en caja normal),
   Space Grotesk para el texto y JetBrains Mono para etiquetas cortas.
   Firma visual: tarjetas con borde fino y sombra dura desplazada. */

:root {
  /* Marca */
  --ink: #0F0F0F;
  --cream: #EFE9D9;
  --paper: #FBF9F4;
  --petrol: #094B66;
  --petrol-deep: #06374C;
  --petrol-line: #24617C;
  --sky: #38BDF8;          /* solo acciones (CTA), siempre con texto tinta */
  --sky-hover: #7DD3FC;
  --sky-2: #BAE6FD;
  --sky-6: #0284C7;        /* foco y sombra dura sobre petróleo */
  --sky-7: #0369A1;        /* numeraciones y eyebrows en claro (≥4.5:1) */

  /* Texto */
  --text: #0F0F0F;
  --body: #3A3833;
  --muted: #5C5648;
  --on-dark: #EFE9D9;
  --on-dark-body: #CFD3C9;
  --on-dark-muted: #A9C3CF;
  --on-dark-accent: #7DD3FC;

  /* Líneas */
  --line: #E2DCCD;
  --line-strong: #BDB5A1;
  --line-cream: #D6CEB9;

  /* Estado */
  --ok: #0369A1;
  --warning: #8A5A00;
  --error: #B3261E;

  --f-display: "Archivo Black", "Arial Black", Impact, sans-serif;
  --f-sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 80px;
  --gutter: 24px;

  accent-color: var(--sky-7);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after, ::backdrop { transition-duration: 0s !important; transition-delay: 0s !important; animation-duration: 0s !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 16px/1.55 var(--f-sans);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--sky-7); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--petrol); }
::selection { background: var(--sky); color: var(--ink); }
:focus-visible { outline: 2px solid var(--sky-6); outline-offset: 2px; border-radius: 2px; }
.section-petrol :focus-visible, .hero :focus-visible, .site-footer :focus-visible { outline-color: var(--sky); }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: fixed; left: 12px; top: 12px; z-index: 100; padding: 10px 14px; border-radius: 6px;
  background: var(--sky); color: var(--ink); font-weight: 500; text-decoration: none; transform: translateY(-200%);
}
.skip:focus { transform: none; }

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

/* ---------- Tipografía ---------- */
.eyebrow {
  font: 500 12px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--sky-7);
}
.eyebrow-on-dark { color: var(--on-dark-accent); }
.eyebrow-muted { color: var(--muted); }
.mono-label { font: 500 11px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; }
.h2 {
  font: 400 38px/1.12 var(--f-display); letter-spacing: -.012em; color: var(--petrol); text-wrap: balance;
}
.lead { font-size: 17px; line-height: 1.6; color: var(--body); text-wrap: pretty; }
.num { font: 500 13px var(--f-mono); color: var(--sky-7); }
.head-text { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 6px; border: 1px solid transparent; text-decoration: none; font-weight: 500; cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
  white-space: nowrap;
}
.btn-sm { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--sky); color: var(--ink); border-color: var(--ink); }
.btn-primary:hover { background: var(--sky-hover); color: var(--ink); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
/* Sombra dura de marca en fondos claros */
.form-card .btn-primary, .site-header.is-solid .btn-primary, .mobile-bar .btn-primary { box-shadow: 3px 3px 0 var(--ink); }
.form-card .btn-primary:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.hero .btn-primary, .section-petrol .btn-primary { border-color: var(--sky); }
.btn-ghost-dark { height: 52px; padding: 0 22px; color: var(--on-dark); border-color: rgba(239, 233, 217, .6); background: transparent; }
.btn-ghost-dark:hover { background: var(--cream); color: var(--petrol); border-color: var(--cream); }
.btn-outline-light {
  height: 48px; padding: 0 20px; font-size: 15px; background: transparent; color: var(--on-dark); border-color: var(--cream);
}
.btn-outline-light:hover { background: var(--cream); color: var(--petrol); }
.btn-secondary { background: var(--paper); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.play-tri { width: 0; height: 0; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.play-tri-lg { border-left-width: 20px; border-top-width: 13px; border-bottom-width: 13px; margin-left: 5px; }
.link-arrow { font-size: 15px; font-weight: 500; white-space: nowrap; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; align-self: flex-start; font: 500 10.5px/1.4 var(--f-mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 3px; border: 1px solid transparent; white-space: nowrap;
}
.badge-on-dark { font-size: 11px; padding: 5px 9px; background: var(--sky-2); color: var(--petrol); }
.badge-demo { background: var(--sky-2); color: #075985; border-color: var(--sky-2); }
.badge-prop { background: #fff; color: var(--body); border-color: var(--line-strong); }
.badge-impl { background: var(--petrol); color: var(--cream); border-color: var(--petrol); }

/* ---------- Cabecera ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; color: var(--on-dark);
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
  border-bottom: 1px solid transparent;
}
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; transition: height .2s var(--ease); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-logo { height: 34px; width: auto; }
.brand-logo--ink { display: none; }
.brand-chip { font: 500 11px var(--f-mono); color: var(--on-dark-muted); padding: 2px 6px; border: 1px solid var(--petrol-line); border-radius: 4px; }
.main-nav { display: flex; gap: 28px; font-size: 15px; }
.main-nav a { color: var(--on-dark); text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.main-nav a:hover { border-bottom-color: currentColor; }
.menu-toggle { display: none; }
.mobile-menu { display: none; }

.site-header.is-solid { background: rgba(251, 249, 244, .97); border-bottom-color: var(--line); color: var(--text); backdrop-filter: saturate(1.2) blur(6px); }
.site-header.is-solid .header-inner { height: 72px; }
.site-header.is-solid .brand-logo--cream { display: none; }
.site-header.is-solid .brand-logo--ink { display: block; }
.site-header.is-solid .brand-chip { color: var(--muted); border-color: var(--line); }
.site-header.is-solid .main-nav a { color: var(--text); }

/* ---------- 01 Portada ---------- */
.hero {
  position: relative; background: var(--petrol-deep); color: var(--on-dark); min-height: 720px;
  display: flex; flex-direction: column; padding-top: var(--header-h); overflow: hidden;
}
.hero-media { position: absolute; inset: 0; overflow: hidden; background: var(--petrol-deep); }
.hero-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.hero-video { position: absolute; inset: 0; opacity: 0; transition: opacity .8s var(--ease); }
.hero-video.is-ready { opacity: 1; }
.hero-video iframe, .hero-video video {
  position: absolute; top: 50%; left: 50%; width: 100%; height: 100%; min-width: 177.78vh; min-height: 56.25vw;
  transform: translate(-50%, -50%) scale(1.25); border: 0; pointer-events: none; object-fit: cover;
}
/* El clip propio no tiene interfaz que esconder: sin escala, recortado con object-fit */
.hero-video video { inset: 0; top: 0; left: 0; min-width: 0; min-height: 0; transform: none; object-position: 60% 50%; }
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--petrol-deep) 0%, rgba(6, 55, 76, .9) 42%, rgba(6, 55, 76, .38) 100%);
}
.hero-badge { position: absolute; right: 28px; top: 104px; z-index: 2; }
.hero-content { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; gap: 24px; padding-top: 64px; padding-bottom: 64px; }
.hero h1 {
  font: 400 60px/1.04 var(--f-display); letter-spacing: -.02em; max-width: 680px; text-wrap: balance; color: #fff;
}
.hero-lead { font-size: 19px; line-height: 1.55; color: var(--on-dark-body); max-width: 540px; }
.hero-actions { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.hero-strip { position: relative; z-index: 2; border-top: 1px solid var(--petrol-line); background: rgba(6, 55, 76, .86); }
.hero-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; padding-top: 24px; padding-bottom: 24px; }
.hero-facts li { display: flex; flex-direction: column; gap: 4px; }
.hero-facts strong { font-size: 16px; font-weight: 700; color: #fff; }
.hero-facts span { font-size: 14px; color: var(--on-dark-muted); }
.video-toggle {
  position: absolute; right: 24px; bottom: calc(100% + 24px); z-index: 3; display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(239, 233, 217, .5);
  background: rgba(6, 55, 76, .7); color: var(--on-dark); font-size: 14px; cursor: pointer;
}
.video-toggle:hover { background: var(--petrol-deep); border-color: var(--cream); }
.vt-icon { width: 10px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.video-toggle[aria-pressed="true"] .vt-icon { width: 0; height: 0; border-right: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }

/* ---------- 02 Capacidad ---------- */
.capacity { background: var(--paper); border-bottom: 1px solid var(--line); }
.capacity-grid { display: grid; grid-template-columns: 220px repeat(4, minmax(0, 1fr)); gap: 32px; align-items: start; padding-top: 40px; padding-bottom: 40px; }
.capacity-grid > h2 { padding-top: 4px; }
.cap-item { display: flex; flex-direction: column; gap: 6px; border-left: 1px solid var(--line); padding-left: 20px; }
.cap-item strong { font-size: 17px; font-weight: 700; color: var(--petrol); }
.cap-item span { font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ---------- Secciones ---------- */
.section { padding: 96px 0; background: var(--paper); }
.section-cream { background: var(--cream); }
.section-petrol { background: var(--petrol); color: var(--on-dark); }
.section-petrol .h2 { color: var(--on-dark); }
.section-petrol .lead { color: var(--on-dark-body); }
.section-petrol a:not(.btn) { color: var(--on-dark-accent); }
.section-petrol a:not(.btn):hover { color: #fff; }
.stack-48 { display: flex; flex-direction: column; gap: 48px; }
.stack-40 { display: flex; flex-direction: column; gap: 40px; }
.stack-28 { display: flex; flex-direction: column; gap: 28px; }
.stack-24 { display: flex; flex-direction: column; gap: 24px; }
.stack-18 { display: flex; flex-direction: column; gap: 18px; }
.split-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: end; }
.row-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

/* ---------- 03 Problema ---------- */
.problem-card { background: var(--cream); border-radius: 8px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.problem-card h3 { font-size: 21px; font-weight: 700; color: var(--petrol); line-height: 1.25; }
.problem-card p { font-size: 15px; line-height: 1.6; color: var(--body); }
.problem-for { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-cream); font-size: 13px; color: var(--muted); }

/* ---------- 04 Demostración ---------- */
.demo-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; }
.demo-player-col { display: flex; flex-direction: column; gap: 12px; }
.player {
  position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--petrol-deep);
  display: flex; align-items: center; justify-content: center;
}
.player-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) brightness(.62); }
.player::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(6, 55, 76, .85) 0%, rgba(6, 55, 76, 0) 45%); pointer-events: none; }
.player.is-loaded::after { display: none; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 3; }
.play-btn {
  position: relative; z-index: 2; width: 76px; height: 76px; border-radius: 50%; border: 1px solid var(--ink);
  background: var(--sky); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink); transition: background-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.play-btn:hover { background: var(--sky-hover); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.player-note { position: absolute; z-index: 2; bottom: 14px; font: 500 11px var(--f-mono); color: var(--on-dark-body); text-transform: uppercase; letter-spacing: .04em; }
.player-note-l { left: 16px; }
.player-note-r { right: 16px; }
.chapters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.chapters button {
  width: 100%; min-height: 44px; display: flex; flex-direction: column; gap: 4px; padding: 10px 0 4px; text-align: left;
  background: none; border: 0; border-top: 2px solid var(--petrol-line); cursor: pointer; color: var(--on-dark);
  transition: border-color .18s var(--ease);
}
.chapters button:hover, .chapters button.is-active { border-top-color: var(--sky); }
.ch-t { font: 500 11px var(--f-mono); color: var(--on-dark-accent); }
.ch-l { font-size: 13px; line-height: 1.35; }

.webdemo-card {
  background: var(--petrol-deep); border: 1px solid var(--petrol-line); border-radius: 8px; padding: 28px;
  display: flex; flex-direction: column; gap: 18px; box-shadow: 6px 6px 0 var(--sky-6);
}
.webdemo-card h3 { font-size: 21px; font-weight: 700; color: #fff; }
.webdemo-card > p { font-size: 15px; line-height: 1.55; color: var(--on-dark-body); }
.req-list { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.req-list div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--petrol-line); padding-bottom: 10px; }
.req-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.req-list dt { color: var(--on-dark-muted); }
.req-list dd { color: var(--on-dark); text-align: right; }
.webdemo-card .btn-outline-light { margin-top: auto; }
/* Sin ratón la demo web no funciona: la tarjeta se reduce al aviso y al enlace por email */
.webdemo-mobile { font-size: 15px; line-height: 1.55; color: var(--on-dark-body); }
.webdemo-card.is-compact { gap: 12px; }
.webdemo-card.is-compact > .webdemo-intro, .webdemo-card.is-compact .req-list { display: none; }
.small-on-dark { font-size: 13px; line-height: 1.45; color: var(--on-dark-muted); }

/* ---------- 05 Aplicaciones ---------- */
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.legend li { display: flex; align-items: center; gap: 6px; }
.sw { width: 9px; height: 9px; border-radius: 2px; }
.sw-demo { background: var(--sky); border: 1px solid #075985; }
.sw-prop { border: 1.5px solid var(--muted); }
.sw-impl { background: var(--petrol); }
.app-card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; background: #fff; }
.app-img { position: relative; aspect-ratio: 3 / 2; background: #E8E8E6; }
.app-img { overflow: hidden; }
.app-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.img-chip { position: absolute; left: 14px; bottom: 14px; font: 500 11px var(--f-mono); color: var(--muted); background: #fff; padding: 4px 8px; border-radius: 3px; }
.app-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.app-body h3 { font-size: 20px; font-weight: 700; color: var(--petrol); }
.app-body p { font-size: 15px; line-height: 1.55; color: var(--body); }
.industries { background: var(--cream); border-radius: 8px; padding: 24px 28px; display: flex; justify-content: space-between; align-items: center; gap: 32px; }
.industries ul { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; font-size: 15px; }

/* ---------- 06 Adaptación ---------- */
.adapt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 64px; align-items: start; }
.adapt-rows div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-top: 1px solid var(--line-cream); }
.adapt-rows div:last-child { border-bottom: 1px solid var(--line-cream); }
.adapt-rows dt { font-weight: 700; color: var(--petrol); }
.adapt-rows dd { font-size: 15px; line-height: 1.55; color: var(--body); }
.contrib { display: flex; flex-direction: column; gap: 8px; }
.contrib strong { font-size: 15px; }
.contrib p { font-size: 15px; line-height: 1.55; color: var(--body); }
.log-card { background: #fff; border: 1px solid var(--ink); border-radius: 10px; box-shadow: 6px 6px 0 var(--ink); overflow: hidden; }
.log-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.log-head > div { display: flex; flex-direction: column; gap: 2px; }
.log-head strong { font-size: 15px; color: var(--petrol); }
.log-head span:not(.badge) { font-size: 13px; color: var(--muted); }
.log-head .badge { align-self: center; }
.log-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.log-table td { padding: 12px 0; border-bottom: 1px solid #F0ECE2; vertical-align: middle; }
.log-table td:first-child { padding-left: 22px; width: 44px; font: 500 12px var(--f-mono); color: var(--muted); }
.log-table td:nth-child(3) { width: 96px; font: 500 12px var(--f-mono); }
.log-table td:last-child { width: 80px; padding-right: 22px; text-align: right; font: 400 12px var(--f-mono); color: var(--muted); }
.log-table .ok { color: var(--ok); }
.log-table .fix { color: var(--warning); }
.log-foot { padding: 16px 22px; background: var(--cream); display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.log-foot span { color: var(--muted); }
.log-foot strong { color: var(--petrol); }

/* ---------- 07 Método ---------- */
.phases { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid var(--petrol); counter-reset: none; }
.phases li { padding: 28px 24px 0 0; display: flex; flex-direction: column; gap: 14px; }
.phases h3 { font-size: 21px; font-weight: 700; color: var(--petrol); }
.phases p { font-size: 15px; line-height: 1.55; color: var(--body); }
.phases dl { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.phases dl div { display: flex; flex-direction: column; gap: 4px; }
.phases dt { font: 500 11px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.phases dd { font-size: 14px; }

/* ---------- 08 Equipo ---------- */
.team-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); gap: 64px; align-items: start; }
.team-right { display: flex; flex-direction: column; gap: 24px; }
.team-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.team-photos figure { display: flex; flex-direction: column; gap: 10px; }
.team-photos img { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--ink); }
.team-photos figcaption { font: 500 11px var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; border-top: 1px solid var(--line-cream); padding-top: 18px; }
.roles li { display: flex; flex-direction: column; gap: 4px; }
.roles strong { font-size: 16px; color: var(--petrol); }
.roles span { font-size: 14px; line-height: 1.45; color: var(--muted); }

/* ---------- 09 FAQ ---------- */
.faq-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: 64px; align-items: start; }
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item h3 { font: inherit; }
.faq-item button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0;
  background: none; border: 0; text-align: left; cursor: pointer; font-size: 17px; font-weight: 500; color: var(--text);
}
.faq-item button:hover { color: var(--petrol); }
.faq-icon { position: relative; flex: none; width: 20px; height: 20px; }
.faq-icon::before, .faq-icon::after { content: ""; position: absolute; left: 3px; right: 3px; top: 9px; height: 2px; background: var(--sky-7); transition: transform .18s var(--ease); }
.faq-icon::after { transform: rotate(90deg); }
.faq-item button[aria-expanded="true"] .faq-icon::after { transform: rotate(0deg); }
/* Respuesta: la fila pasa de 0fr a 1fr (altura real sin medirla); cerrar es más rápido y discreto que abrir.
   visibility saca la respuesta cerrada del foco y del lector de pantalla cuando termina la transición. */
.faq-a {
  display: grid; grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows .16s var(--ease), visibility 0s linear .16s;
}
.faq-a.is-open { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .22s var(--ease), visibility 0s; }
.faq-a p {
  min-height: 0; overflow: hidden; padding: 0 48px 0 0; font-size: 15px; line-height: 1.6; color: var(--body);
  opacity: 0; transform: translateY(-4px);
  transition: opacity .12s ease-in, transform .16s var(--ease), padding-bottom .16s var(--ease);
}
.faq-a.is-open p {
  padding-bottom: 24px; opacity: 1; transform: none;
  transition: opacity .2s var(--ease) .04s, transform .22s var(--ease), padding-bottom .22s var(--ease);
}

/* ---------- 10 Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.next-steps { margin-top: 8px; }
.next-steps .mono-label { display: block; color: var(--on-dark-muted); padding-bottom: 12px; }
.next-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--petrol-line); font-size: 15px; color: var(--on-dark); }
.next-steps li:last-child { border-bottom: 1px solid var(--petrol-line); }
.next-steps li span { font: 500 12px var(--f-mono); color: var(--on-dark-accent); padding-top: 3px; }
.contact-data { font-style: normal; display: flex; flex-direction: column; gap: 4px; font-size: 15px; color: var(--on-dark-body); }

.form-card { background: var(--paper); color: var(--text); border: 1px solid var(--ink); border-radius: 10px; padding: 36px; box-shadow: 8px 8px 0 var(--sky-6); }
/* Gana a .section-petrol a: la tarjeta es clara aunque la sección sea oscura */
.section-petrol .form-card a:not(.btn) { color: var(--sky-7); }
.section-petrol .form-card a:not(.btn):hover { color: var(--petrol); }
#contact-form { display: flex; flex-direction: column; gap: 20px; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 14px; font-weight: 500; padding: 0; }
fieldset .label { margin-bottom: 8px; }
.opt { font-weight: 400; color: var(--muted); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field input, .field textarea {
  height: 46px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 12px; font-size: 15px; background: #fff; color: var(--text); width: 100%;
  transition: border-color .15s var(--ease);
}
.field textarea { height: auto; padding: 12px; line-height: 1.5; resize: vertical; min-height: 96px; }
.field input:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--sky-6); outline-offset: 1px; border-color: var(--ink); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--error); }
::placeholder { color: #6E685A; }
.err { font-size: 13px; color: var(--error); }
.field-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.field-foot .count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.field-foot .count.is-near { color: var(--warning); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px; background: #fff; }
.segmented button { height: 42px; border: 0; border-radius: 4px; cursor: pointer; font-size: 15px; font-weight: 500; background: transparent; color: var(--text); transition: background-color .15s var(--ease), color .15s var(--ease); }
.segmented button[aria-checked="true"] { background: var(--petrol); color: #fff; }
.segmented button[aria-checked="false"]:hover { background: var(--cream); }
.checks { display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.5; color: var(--body); }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { margin: 3px 0 0; width: 16px; height: 16px; flex: none; accent-color: var(--petrol); }
.err-check { padding-left: 26px; }
.form-error { font-size: 14px; line-height: 1.5; color: var(--error); background: #FBE1DE; border-radius: 6px; padding: 12px 14px; }
.form-success { display: flex; flex-direction: column; gap: 18px; padding: 12px 0; overflow-wrap: anywhere; }
.success-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--sky-2); display: flex; align-items: center; justify-content: center; color: var(--petrol); font-size: 24px; }
.form-success h3 { font: 400 26px/1.2 var(--f-display); color: var(--petrol); outline: none; }
.form-success p { font-size: 16px; line-height: 1.6; color: var(--body); }
.form-success p.muted { font-size: 15px; }
.form-success .btn { align-self: flex-start; }

/* ---------- Footer ---------- */
.site-footer { background: var(--petrol-deep); color: var(--on-dark-muted); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 32px; padding-top: 40px; padding-bottom: 40px; font-size: 14px; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { height: 29px; width: auto; }
.site-footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.site-footer nav a { color: var(--on-dark-body); text-decoration: none; }
.site-footer nav a:hover { color: #fff; text-decoration: underline; }

/* ---------- Demo web (diálogo) ---------- */
.webdemo-dialog { width: min(1400px, 96vw); height: min(860px, 92vh); max-width: none; max-height: none; padding: 0; border: 1px solid var(--ink); border-radius: 10px; background: var(--petrol-deep); color: var(--on-dark); overflow: hidden; }
/* Entrada 240ms (sube 8px y crece desde .97); salida 160ms más discreta (baja 4px, sin escala).
   allow-discrete mantiene el diálogo en pantalla mientras sale. Sin soporte, abre y cierra en seco. */
.webdemo-dialog {
  opacity: 0; transform: translateY(4px);
  transition: opacity .16s ease-in, transform .16s ease-in, overlay .16s allow-discrete, display .16s allow-discrete;
}
.webdemo-dialog[open] {
  display: flex; flex-direction: column; opacity: 1; transform: none;
  transition: opacity .24s var(--ease), transform .24s var(--ease), overlay .24s allow-discrete, display .24s allow-discrete;
}
.webdemo-dialog::backdrop {
  background: rgba(6, 25, 35, 0);
  transition: background-color .16s ease-in, overlay .16s allow-discrete, display .16s allow-discrete;
}
.webdemo-dialog[open]::backdrop { background: rgba(6, 25, 35, .75); transition-duration: .24s; }
@starting-style {
  .webdemo-dialog[open] { opacity: 0; transform: translateY(8px) scale(.97); }
  .webdemo-dialog[open]::backdrop { background: rgba(6, 25, 35, 0); }
}
.wd-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--petrol-line); font-size: 15px; }
.wd-close { height: 40px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--cream); background: transparent; color: var(--on-dark); cursor: pointer; }
.wd-close:hover { background: var(--cream); color: var(--petrol); }
.wd-stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; }
.wd-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.wd-status { max-width: 460px; padding: 24px; text-align: center; font-size: 15px; line-height: 1.6; color: var(--on-dark-body); }
.wd-status a { color: var(--on-dark-accent); }

/* ---------- Barra móvil ---------- */
.mobile-bar { display: none; }

/* ---------- Tablet ---------- */
@media (max-width: 1023px) {
  .main-nav { gap: 18px; font-size: 14px; }
  .hero h1 { font-size: 48px; }
  .capacity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capacity-grid > h2 { grid-column: 1 / -1; }
  .split-head, .adapt-grid, .team-grid, .faq-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .demo-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
  .hero-badge { top: 92px; }
  .row-head { flex-wrap: wrap; }
}
@media (max-width: 899px) {
  .main-nav { display: none; }
  .menu-toggle {
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    width: 44px; height: 44px; border: 0; background: none; cursor: pointer; color: inherit; padding: 0;
  }
  .menu-toggle span { width: 20px; height: 2px; background: currentColor; transition: transform .18s var(--ease), opacity .18s; }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .mobile-menu:not([hidden]) {
    display: flex; flex-direction: column; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px;
  }
  .mobile-menu a { color: var(--text); text-decoration: none; font-size: 17px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .mobile-menu a:last-child { border-bottom: 0; }
  .header-cta { margin-left: auto; }
}

/* ---------- Móvil ---------- */
@media (max-width: 767px) {
  :root { --gutter: 20px; --header-h: 60px; }
  html { scroll-padding-top: 64px; }
  body { padding-bottom: 76px; }
  .site-header { background: var(--paper); color: var(--text); border-bottom-color: var(--line); }
  .site-header .header-inner, .site-header.is-solid .header-inner { height: 60px; }
  .brand-logo { height: 28px; }
  .brand-logo--cream { display: none; }
  .brand-logo--ink { display: block; }
  .brand-chip { color: var(--muted); border-color: var(--line); }
  .header-cta { display: none; }

  .hero { min-height: 0; padding-top: 60px; }
  .hero-poster { object-position: 40% 50%; }
  .hero-shade { background: linear-gradient(0deg, var(--petrol-deep) 0%, rgba(6, 55, 76, .94) 55%, rgba(6, 55, 76, .55) 100%); }
  .hero-badge { position: relative; top: auto; right: auto; margin: 20px var(--gutter) 0; align-self: flex-start; font-size: 11px; white-space: normal; }
  .hero-content { padding-top: 20px; padding-bottom: 32px; gap: 18px; }
  .hero h1 { font-size: 32px; line-height: 1.1; letter-spacing: -.015em; }
  .hero-lead { font-size: 16px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; height: 50px; }
  .hero-facts { gap: 16px; padding-top: 20px; padding-bottom: 20px; }
  .hero-facts strong { font-size: 15px; }
  .hero-facts span { font-size: 13px; }

  .capacity-grid { gap: 18px 16px; padding-top: 28px; padding-bottom: 28px; }
  .cap-item { border-left: 0; padding-left: 0; }
  .cap-item strong { font-size: 15px; }
  .cap-item span { font-size: 13px; }

  .section { padding: 56px 0; }
  .h2 { font-size: 26px; line-height: 1.16; }
  .lead { font-size: 16px; }
  .stack-48 { gap: 32px; }
  .stack-40 { gap: 28px; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .problem-card { padding: 22px; }
  .row-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .legend { flex-wrap: wrap; white-space: normal; }

  .chapters { display: flex; flex-direction: column; gap: 0; }
  .chapters button { flex-direction: row; align-items: baseline; gap: 12px; border-top-width: 1px; padding: 12px 0; }
  .player-note-r { display: none; }
  .player-note-l { font-size: 10px; }
  .play-btn { width: 60px; height: 60px; }
  .webdemo-card { padding: 22px; box-shadow: 4px 4px 0 var(--sky-6); }

  .industries { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
  .industries ul { gap: 8px 18px; }
  .adapt-rows div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .log-head { padding: 16px; flex-wrap: wrap; }
  .log-table td:first-child { padding-left: 16px; width: 36px; }
  .log-table td:nth-child(3) { width: 84px; }
  .log-table td:last-child { width: 58px; padding-right: 16px; }
  .log-foot { padding: 14px 16px; flex-direction: column; gap: 4px; }
  .log-card { box-shadow: 4px 4px 0 var(--ink); }

  .phases { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  .phases li { padding-right: 0; }
  .roles { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .team-photos { gap: 12px; }
  .faq-item button { font-size: 16px; padding: 18px 0; }
  .faq-a p { padding-right: 0; }

  .form-card { padding: 22px; box-shadow: 5px 5px 0 var(--sky-6); }
  .form-row-2 { grid-template-columns: minmax(0, 1fr); }
  /* 16px evita el zoom automático de iOS al enfocar un campo */
  .field input, .field textarea { font-size: 16px; }
  .segmented button { font-size: 14px; padding: 0 4px; letter-spacing: -.01em; white-space: nowrap; }
  .hide-mobile { display: none; }

  .footer-inner { flex-direction: column; align-items: flex-start; padding-bottom: 32px; }

  .mobile-bar {
    display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line);
    transition: transform .2s var(--ease), visibility 0s;
  }
  /* Oculta también para el teclado y el lector de pantalla una vez ha salido */
  .mobile-bar.is-hidden { transform: translateY(110%); visibility: hidden; transition: transform .2s var(--ease), visibility 0s linear .2s; }
  .mobile-bar .btn-primary { flex: 1; height: 48px; font-size: 15px; }
  .btn-square { width: 48px; height: 48px; padding: 0; border: 1px solid var(--petrol); color: var(--petrol); background: transparent; }
  .btn-square .play-tri { border-left-width: 11px; border-top-width: 7px; border-bottom-width: 7px; margin-left: 3px; }

  .video-toggle { display: none !important; }
  .webdemo-dialog { width: 100vw; height: 100dvh; border-radius: 0; }
}
