/* ==========================================================================
   MAR Evolutions — estilos (rediseño 2026: arquitectura de software)
   ========================================================================== */

:root {
  /* Superficies */
  --bg-0: #040A14;
  --bg-1: #07111F;
  --bg-2: #0B1626;
  --bg-3: #0F1D31;
  --paper: #EEF1F5;

  /* Texto */
  --text: #F3EFE7;
  --text-2: #C3CCD8;
  --text-3: #8E9CB0;
  --ink: #0B1626;
  --ink-2: #4A5869;

  /* Acentos */
  --blue: #3D7EFF;
  --blue-2: #7FA6FF;
  --blue-glow: rgba(61, 126, 255, 0.35);
  --gold: #C9A46A;
  --gold-2: #E2C08A;
  --gold-glow: rgba(201, 164, 106, 0.32);
  --green: #2E8B67;

  /* Líneas */
  --line: rgba(148, 172, 205, 0.14);
  --line-2: rgba(148, 172, 205, 0.26);

  --font: Inter, "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Inter, "Segoe UI Variable Display", "Segoe UI", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;

  --container: 1280px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-lg: 24px;
  --radius-md: 18px;
  --section-y: clamp(80px, 10vw, 140px);
  --header-h: 84px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 8px);
  background: var(--bg-1);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-2);
  background: var(--bg-1);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; color: var(--text); font-family: var(--font-display); text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
ul[role="list"], ol[role="list"] { list-style: none; }
figure { margin: 0; }
a { color: inherit; }
button { font: inherit; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic {
  width: 1.15em; height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 3px;
  border-radius: 8px;
}
.section-paper :focus-visible { outline-color: var(--blue); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: 16px; top: -60px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--text);
  color: var(--ink);
  border-radius: 10px;
  font-weight: 650;
  text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Tipografía compartida ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue-2);
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  flex: none;
  background: var(--gold);
}
.eyebrow-gold { color: var(--gold-2); }

h2 {
  font-size: clamp(2rem, 1.2rem + 2.7vw, 3.4rem);
  font-weight: 720;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.lead {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.7;
  color: var(--text-2);
}

.section { position: relative; padding-block: var(--section-y); }
.section-deep { background: var(--bg-1); }
.section-graphite { background: var(--bg-2); }
.section-paper { background: var(--paper); color: var(--ink-2); }
.section-paper h2, .section-paper h3 { color: var(--ink); }
.section-paper .eyebrow { color: #2459C9; }
.section-paper .eyebrow::before { background: #B08A4E; }

.section-head { max-width: 780px; margin-bottom: clamp(44px, 5vw, 72px); }
.section-sub { margin-top: 18px; color: var(--text-3); font-size: 1.0625rem; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 14px 24px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .25s var(--ease), border-color .25s var(--ease),
    box-shadow .3s var(--ease), color .25s var(--ease);
}
.btn .ic { transition: transform .3s var(--ease); }
.btn:hover .ic { transform: translateX(3px); }
.btn-lg { min-height: 60px; padding-inline: 30px; font-size: 1.0625rem; }

.btn-glass {
  color: var(--text);
  background: rgba(12, 26, 48, 0.42);
  border-color: rgba(205, 218, 236, 0.32);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn-glass:hover { background: rgba(28, 48, 80, 0.55); border-color: rgba(220, 230, 245, 0.6); }

.btn-glass-blue {
  border-color: rgba(61, 126, 255, 0.85);
  box-shadow: inset 0 0 18px rgba(61, 126, 255, 0.12), 0 10px 30px -18px var(--blue-glow);
}
.btn-glass-blue:hover {
  background: rgba(61, 126, 255, 0.16);
  border-color: #6E9DFF;
  box-shadow: inset 0 0 22px rgba(61, 126, 255, 0.2), 0 14px 34px -16px var(--blue-glow);
}
.btn-glass-gold {
  border-color: rgba(201, 164, 106, 0.85);
  box-shadow: inset 0 0 18px rgba(201, 164, 106, 0.08), 0 10px 30px -18px var(--gold-glow);
}
.btn-glass-gold:hover {
  background: rgba(201, 164, 106, 0.13);
  border-color: var(--gold-2);
  box-shadow: inset 0 0 22px rgba(201, 164, 106, 0.16), 0 14px 34px -16px var(--gold-glow);
}

/* ---------- Cabecera ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  color: var(--text);
  border-bottom: 1px solid transparent;
  transition: background-color .35s var(--ease), border-color .35s var(--ease),
    -webkit-backdrop-filter .35s var(--ease), backdrop-filter .35s var(--ease);
}
.site-header.is-scrolled,
.site-header.menu-open {
  background: rgba(7, 17, 31, 0.8);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.nav-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; }
.brand-logo { display: block; width: clamp(168px, 15vw, 214px); height: auto; }
.brand-logo .logo-mar { stroke: var(--text); }
.brand-logo .logo-evo { stroke: #B4C0CF; }

.site-nav { display: flex; align-items: center; gap: 36px; margin-inline-start: auto; }
.site-nav ul { display: flex; gap: 36px; list-style: none; }
.site-nav ul a {
  position: relative;
  display: inline-block;
  padding-block: 6px;
  color: #DCE3EC;
  font-size: 0.975rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s var(--ease);
}
.site-nav ul a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease);
}
.site-nav ul a:hover { color: var(--text); }
.site-nav ul a:hover::after { transform: scaleX(1); }
.nav-cta { min-height: 46px; padding: 10px 26px; border-radius: 14px; border-color: rgba(230, 236, 245, 0.55); }

.nav-toggle {
  display: none;
  position: relative;
  width: 46px; height: 46px;
  padding: 0;
  border: 1px solid rgba(230, 236, 245, 0.35);
  border-radius: 12px;
  background: rgba(12, 26, 48, 0.4);
  color: var(--text);
  cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  position: absolute;
  left: 50%;
  width: 18px; height: 1.6px;
  margin-left: -9px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .25s var(--ease), background-color .2s var(--ease);
}
.nav-toggle-bars { top: 50%; margin-top: -0.8px; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; left: 0; margin-left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1099.98px) {
  :root { --header-h: 68px; }

  .js .nav-toggle { display: inline-block; }
  .js .site-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 8px var(--gutter) 26px;
    background: rgba(7, 17, 31, 0.97);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 30px 40px -24px rgba(0, 0, 0, 0.7);
  }
  .js .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a {
    display: block;
    padding: 15px 2px;
    font-size: 1.0625rem;
    border-bottom: 1px solid var(--line);
  }
  .site-nav ul a::after { display: none; }
  .nav-cta { align-self: flex-start; }

  html:not(.js) .site-header { position: absolute; }
  html:not(.js) .nav-bar { height: auto; flex-wrap: wrap; padding-block: 14px; }
  html:not(.js) .site-nav { flex-wrap: wrap; gap: 12px; }
  html:not(.js) .site-nav ul { flex-direction: row; flex-wrap: wrap; gap: 4px 18px; }
  html:not(.js) .site-nav ul a { border: 0; padding: 4px 0; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--bg-1);
  padding-top: var(--header-h);
}

.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(127, 166, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 166, 255, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 70% 75% at 68% 42%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 75% at 68% 42%, #000 20%, transparent 75%);
}
.hero-glow { position: absolute; border-radius: 50%; filter: blur(10px); }
.hero-glow-blue {
  width: 70vw; height: 70vw; max-width: 1100px; max-height: 1100px;
  right: -12vw; top: -18vw;
  background: radial-gradient(circle, rgba(37, 92, 214, 0.28), rgba(37, 92, 214, 0) 62%);
}
.hero-glow-gold {
  width: 46vw; height: 46vw; max-width: 700px; max-height: 700px;
  left: -14vw; bottom: -26vw;
  background: radial-gradient(circle, rgba(201, 164, 106, 0.12), rgba(201, 164, 106, 0) 65%);
}

.hero-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0.6em;
  margin-bottom: 28px;
  padding-inline-start: 22px;
  border-inline-start: 2px solid var(--gold);
  font-size: clamp(0.72rem, 0.68rem + 0.2vw, 0.86rem);
  font-weight: 600;
  letter-spacing: 0.28em;
  line-height: 1.5;
  text-transform: uppercase;
  color: #D9DFE8;
}
.hero-eyebrow span { white-space: nowrap; }

.hero h1 {
  font-size: clamp(2.35rem, 0.8rem + 4vw, 4.9rem);
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--text);
  max-width: 8.35em;
  text-wrap: wrap;
}
.hero-lead {
  max-width: 540px;
  margin-top: 28px;
  font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.3rem);
  line-height: 1.6;
  color: var(--text-2);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }

/* ---------- Carrusel: controles ---------- */
.hero-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 16px;
}
.car-btn {
  display: inline-grid;
  place-items: center;
  width: 46px; height: 46px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(230, 236, 245, 0.42);
  background: rgba(12, 26, 48, 0.4);
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.car-btn:hover { border-color: var(--text); background: rgba(40, 64, 104, 0.5); }
.car-btn .ic { width: 20px; height: 20px; }
.car-pause .ic { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.car-pause .ic-play { display: none; }
.car-pause[aria-pressed="true"] .ic-pause { display: none; }
.car-pause[aria-pressed="true"] .ic-play { display: block; }
.car-dots { display: flex; align-items: center; }
.car-dot {
  position: relative;
  width: 30px; height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.car-dot::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 9px; height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: rgba(200, 212, 228, 0.42);
  transition: background-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}
.car-dot:hover::before { background: rgba(230, 236, 245, 0.8); }
.car-dot[aria-current="true"]::before {
  background: var(--blue);
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(61, 126, 255, 0.18), 0 0 14px var(--blue-glow);
}
.car-caption {
  flex-basis: 100%;
  max-width: 470px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-3);
}
.car-caption strong { display: block; color: var(--text); font-weight: 600; font-size: 0.95rem; }

/* ---------- Carrusel: escenas ---------- */
.scenes { position: relative; display: grid; container-type: inline-size; }
.scene {
  grid-area: 1 / 1;
  position: relative;
  min-width: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .9s var(--ease), visibility 0s linear .9s;
}
.scene.is-active { opacity: 1; visibility: visible; transition: opacity .9s var(--ease), visibility 0s; }
.scene-art { position: relative; }

.layer {
  --d: 1;
  translate: calc(var(--mx, 0) * var(--d) * 5px) calc(var(--my, 0) * var(--d) * 4px + 22px);
  scale: 0.965;
  opacity: 0;
  transition: opacity .9s var(--ease) calc(var(--d) * 0.1s), scale 1.1s var(--ease) calc(var(--d) * 0.1s),
    translate 1.1s var(--ease);
}
.scene.is-active .layer {
  translate: calc(var(--mx, 0) * var(--d) * 5px) calc(var(--my, 0) * var(--d) * 4px);
  scale: 1;
  opacity: 1;
}

/* Grafo de nodos */
.graph {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 100 / 72;
}
.graph-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ln path { fill: none; stroke-width: 1.3; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ln-blue path { stroke: rgba(85, 140, 255, 0.55); }
.ln-gold path { stroke: rgba(212, 170, 104, 0.6); }
.ln-dash path { stroke-dasharray: 5 6; }
.flow path {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 5 95;
  stroke-dashoffset: 100;
  animation: flow var(--t, 8s) linear infinite;
  animation-delay: var(--o, 0s);
  animation-play-state: paused;
}
.flow-blue path { stroke: #8DB3FF; }
.flow-gold path { stroke: #F0CF95; }
.scene.is-active .flow path { animation-play-state: running; }
@keyframes flow { to { stroke-dashoffset: 0; } }
.joint-blue circle { fill: #7FA6FF; }
.joint-gold circle { fill: var(--gold-2); }

.node {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) / 72 * 100%);
  z-index: 2;
  transform: translate(-50%, -50%);
}
.node-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  min-width: 19cqw;
  padding: 0.95em 1.15em 0.85em;
  border-radius: 0.85em;
  border: 1px solid rgba(96, 148, 255, 0.55);
  background: linear-gradient(180deg, rgba(22, 44, 82, 0.96), rgba(10, 22, 42, 0.96));
  box-shadow: inset 0 1px 0 rgba(180, 205, 255, 0.12), 0 0 22px -4px var(--blue-glow), 0 18px 30px -18px rgba(0, 0, 0, 0.8);
  color: var(--text);
  font-size: clamp(9.5px, 2.25cqw, 15.5px);
  font-weight: 560;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  animation: float 10s ease-in-out infinite;
  animation-delay: var(--f, 0s);
  animation-play-state: paused;
}
.scene.is-active .node-in { animation-play-state: running; }
.node-in .ic { width: 1.55em; height: 1.55em; color: #8DB3FF; }
.node-gold .node-in {
  border-color: rgba(212, 170, 104, 0.7);
  background: linear-gradient(180deg, rgba(58, 46, 30, 0.95), rgba(22, 22, 26, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.12), 0 0 22px -4px var(--gold-glow), 0 18px 30px -18px rgba(0, 0, 0, 0.8);
}
.node-gold .node-in .ic { color: var(--gold-2); }
.node-core { z-index: 3; }
.node-core .node-in {
  min-width: 26cqw;
  padding: 1.4em 1.4em 1.25em;
  font-size: clamp(11px, 2.7cqw, 18.5px);
  font-weight: 620;
  border-color: rgba(120, 166, 255, 0.75);
  box-shadow: inset 0 1px 0 rgba(180, 205, 255, 0.16), 0 0 0 6px rgba(61, 126, 255, 0.07),
    10px 10px 0 -2px rgba(16, 34, 64, 0.9), 10px 10px 0 -1px rgba(96, 148, 255, 0.3),
    0 0 46px -6px var(--blue-glow);
}
.node-core .node-in .ic { width: 2.2em; height: 2.2em; color: #C8D8FF; stroke-width: 1.4; }
@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -4px; }
}

/* Pasos del flujo (escena 3) */
.node-step .node-in { min-width: 25cqw; gap: 0.35em; padding: 0.85em 1em; }
.node-step em {
  font-style: normal;
  font-size: 0.7em;
  font-weight: 650;
  letter-spacing: 0.14em;
  color: var(--gold-2);
}
.node-step small { font-size: 0.72em; font-weight: 450; color: var(--text-3); }
@container (max-width: 460px) {
  .node-step small { display: none; }
  .node-step .node-in { gap: 0.25em; padding: 0.7em 0.6em; }
}

/* Paneles de producto */
.panel,
.app-window,
.toast,
.code-frag {
  color: var(--text-2);
  font-size: clamp(10px, 1.42cqw, 13.5px);
}
.panel,
.app-window {
  border-radius: 16px;
  border: 1px solid rgba(130, 164, 214, 0.24);
  background: linear-gradient(180deg, rgba(15, 30, 54, 0.95), rgba(8, 18, 34, 0.96));
  box-shadow: inset 0 1px 0 rgba(190, 210, 240, 0.08), 0 40px 70px -30px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}
.panel-main { padding: 1.5em 1.6em; min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 0.9em; }
.panel-head .ic-lg { width: 2em; height: 2em; color: #C8D8FF; stroke-width: 1.4; }
.panel-head strong { display: block; color: var(--text); font-size: 1.32em; font-weight: 620; letter-spacing: -0.01em; }
.panel-head small { display: block; color: var(--text-3); font-size: 0.92em; }
.panel-tabs {
  display: flex;
  gap: 1.8em;
  margin-top: 1.3em;
  border-bottom: 1px solid var(--line);
  font-size: 0.95em;
}
.panel-tabs span { padding-bottom: 0.7em; color: var(--text-3); }
.panel-tabs .is-on { color: var(--text); box-shadow: inset 0 -2px 0 var(--gold); }
.panel-search {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-top: 1em;
  padding: 0.6em 0.9em;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-3);
  font-size: 0.92em;
}
.rows { list-style: none; margin-top: 0.8em; }
.rows li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9em;
  padding: 0.75em 0.2em;
  border-bottom: 1px solid var(--line);
}
.rows li:last-child { border-bottom: 0; }
.rows strong, .mini strong, .events strong { display: block; color: var(--text); font-weight: 600; font-size: 1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows small, .mini small, .events small { display: block; color: var(--text-3); font-size: 0.86em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows span { min-width: 0; }
.rows time { color: var(--text-3); font-size: 0.82em; }
.rows .chev { color: var(--text-3); }

.av {
  display: inline-grid;
  place-items: center;
  width: 2.5em; height: 2.5em;
  flex: none;
  border-radius: 50%;
  color: #fff;
  font-size: 0.86em;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.av .ic { width: 1.25em; height: 1.25em; }
.av-blue { background: #2F64D6; }
.av-gold { background: #B8873F; }
.av-red { background: #B4573F; }
.av-green { background: #2E8B67; }
.av-indigo { background: #5559C2; }
.av-slate { background: #44556C; }

.panel-perms { display: grid; grid-template-columns: 31% 1fr; }
.panel-side {
  display: flex;
  flex-direction: column;
  gap: 0.15em;
  padding: 1.3em 0.7em;
  border-inline-end: 1px solid var(--line);
  background: rgba(4, 10, 20, 0.35);
}
.panel-side span {
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding: 0.62em 0.8em;
  border-radius: 8px;
  color: var(--text-3);
  white-space: nowrap;
}
.panel-side .is-on {
  color: var(--gold-2);
  background: linear-gradient(90deg, rgba(201, 164, 106, 0.22), rgba(201, 164, 106, 0.06));
  box-shadow: inset 0 0 0 1px rgba(201, 164, 106, 0.4);
}

.code-frag {
  margin: 0;
  padding: 1.4em 1.6em;
  border-left: 1px solid var(--line);
  font-family: var(--mono);
  font-size: clamp(9px, 1.2cqw, 12.5px);
  line-height: 1.75;
  color: rgba(160, 182, 214, 0.75);
  white-space: pre;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
  mask-image: linear-gradient(180deg, #000 55%, transparent);
}
.code-frag b { font-weight: 400; color: rgba(200, 214, 236, 0.8); }
.code-frag i { font-style: normal; color: #8DB3FF; }
.code-frag em { font-style: normal; color: var(--gold-2); }
.code-frag u { text-decoration: none; color: #9FD3BF; }

/* Escena 2: ventana de la plataforma */
.app-bar {
  display: flex;
  align-items: center;
  gap: 1.2em;
  padding: 0.85em 1.2em;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 10, 20, 0.35);
}
.app-dots { display: flex; gap: 0.4em; }
.app-dots i { width: 0.7em; height: 0.7em; border-radius: 50%; background: rgba(160, 180, 210, 0.3); }
.app-title { display: flex; align-items: center; gap: 0.6em; color: var(--text-3); font-size: 0.92em; }
.app-body { display: grid; grid-template-columns: 12.5em 1fr; }
.app-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  padding: 1.1em 0.7em;
  border-inline-end: 1px solid var(--line);
}
.app-nav span {
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding: 0.65em 0.8em;
  border-radius: 8px;
  color: var(--text-3);
}
.app-nav b { font-weight: 500; }
.app-nav .is-on { color: var(--text); background: rgba(61, 126, 255, 0.16); box-shadow: inset 2px 0 0 var(--blue); }
.app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
}
.app-card { padding: 1.2em 1.3em 1.3em; background: #0B182C; min-width: 0; }
.app-card h4 {
  display: flex;
  align-items: center;
  gap: 0.55em;
  margin-bottom: 0.9em;
  color: var(--text);
  font-size: 1em;
  font-weight: 620;
}
.app-card h4 .ic { color: var(--blue-2); }
.mini, .events, .files { list-style: none; display: grid; gap: 0.75em; }
.mini li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.75em; min-width: 0; }
.mini span, .events span { min-width: 0; }
.mini .av { width: 2.2em; height: 2.2em; }
.events li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.8em; }
.date {
  display: grid;
  place-items: center;
  width: 3em;
  padding: 0.3em 0;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  font-size: 0.72em;
  letter-spacing: 0.08em;
  color: var(--text-3);
  line-height: 1.2;
}
.date b { font-size: 1.6em; color: var(--text); letter-spacing: 0; }
.chip-ok, .chip-wait {
  font-style: normal;
  font-size: 0.78em;
  padding: 0.3em 0.7em;
  border-radius: 999px;
  white-space: nowrap;
}
.chip-ok { color: #9FE0C4; background: rgba(46, 139, 103, 0.2); border: 1px solid rgba(46, 139, 103, 0.5); }
.chip-wait { color: var(--gold-2); background: rgba(201, 164, 106, 0.12); border: 1px solid rgba(201, 164, 106, 0.4); }
.files li { display: flex; align-items: center; gap: 0.7em; color: var(--text-2); }
.files .ic { color: var(--gold-2); }
.members { display: flex; }
.members .av { width: 2.3em; height: 2.3em; margin-inline-end: -0.45em; box-shadow: 0 0 0 2px #0B182C; }
.roles { display: flex; flex-wrap: wrap; gap: 0.45em; margin-top: 1em; }
.roles span {
  padding: 0.25em 0.7em;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--text-3);
  font-size: 0.82em;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.9em;
  padding: 0.95em 1.2em;
  border-radius: 14px;
  border: 1px solid rgba(201, 164, 106, 0.55);
  background: linear-gradient(180deg, rgba(48, 40, 28, 0.96), rgba(20, 20, 24, 0.97));
  box-shadow: 0 0 26px -6px var(--gold-glow), 0 30px 50px -26px rgba(0, 0, 0, 0.85);
}
.toast > .ic { width: 1.5em; height: 1.5em; color: var(--gold-2); }
.toast strong { display: block; color: var(--text); font-weight: 600; }
.toast small { display: block; color: var(--text-3); font-size: 0.88em; }

/* Escena 3: paneles */
.stages, .checks { list-style: none; margin-top: 1.2em; display: grid; gap: 0.2em; }
.stages li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9em;
  padding: 0.7em 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}
.stages li:last-child { border-bottom: 0; }
.stages i { width: 0.75em; height: 0.75em; border-radius: 50%; border: 1.5px solid var(--text-3); }
.stages .done i { background: var(--blue); border-color: var(--blue); }
.stages .now i { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 164, 106, 0.18); }
.stages em { font-style: normal; font-size: 0.82em; color: var(--text-3); }
.stages .now em { color: var(--gold-2); }
.checks li { display: flex; align-items: center; gap: 0.8em; padding: 0.55em 0; color: var(--text-2); }
.checks .ic { width: 1.4em; height: 1.4em; padding: 0.22em; border-radius: 50%; color: #9FE0C4; background: rgba(46, 139, 103, 0.22); stroke-width: 2.4; }

/* ---------- Hero: móvil y tableta (composición en flujo) ---------- */
.hero-layout { position: relative; padding-top: clamp(28px, 6vw, 56px); padding-bottom: 56px; }
.hero-visual { margin-top: 44px; }
.hero-controls { margin-top: 22px; }
.scene .panel,
.scene .code-frag,
.scene .toast { display: none; }
.scene-art .graph { width: 100%; max-width: 640px; margin-inline: auto; }
.scene-ops .app-window { max-width: 760px; margin-inline: auto; }

@media (max-width: 599.98px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; white-space: normal; justify-content: space-between; }
  .hero-visual { margin-top: 36px; margin-inline: -4px; }
  .scene-ops .app-window { font-size: 10.5px; }
  .app-body { grid-template-columns: 3.4em 1fr; }
  .app-nav { padding: 0.8em 0.45em; }
  .app-nav span { justify-content: center; padding: 0.7em 0; }
  .app-nav b { display: none; }
  .app-card { padding: 0.9em 0.85em; }
  .app-title { font-size: 0.9em; }
  .events li { grid-template-columns: auto 1fr; }
  .events em { display: none; }
  .hide-sm { display: none !important; }
}

/* ---------- Hero: escritorio (composición superpuesta) ---------- */
@media (min-width: 1200px) {
  .hero {
    min-height: max(720px, 100vh);
    min-height: max(720px, 100svh);
    display: flex;
    flex-direction: column;
  }
  .hero-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 32px;
    padding-bottom: 48px;
  }
  .hero-copy { position: relative; z-index: 4; width: min(54%, 700px); }
  .hero-controls {
    position: relative;
    z-index: 4;
    width: min(46%, 560px);
    margin-top: clamp(36px, 7vh, 80px);
  }

  .hero-visual {
    position: absolute;
    z-index: 1;
    top: calc(-1 * var(--header-h));
    bottom: 0;
    left: 40%;
    right: calc(-1 * var(--gutter) - max(0px, (100vw - var(--container)) / 2));
    margin: 0;
  }
  .hero-visual::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 5;
    width: 18%;
    background: linear-gradient(90deg, var(--bg-1), rgba(7, 17, 31, 0));
    pointer-events: none;
  }
  .scenes { height: 100%; }
  .scene { height: 100%; }
  .scene-art { position: absolute; inset: 0; }
  .scene-art > * { position: absolute; margin: 0; }
  .scene .panel,
  .scene .toast { display: block; }
  .scene .code-frag { display: block; }

  /* Escena 1 */
  .scene-arch .graph { z-index: 3; left: 15%; top: calc(var(--header-h) + 1.5cqw); width: 64%; max-width: none; }
  .scene-arch .code-frag { z-index: 1; right: 0; top: calc(var(--header-h) - 1cqw); width: 30%; opacity: .55; }
  .scene.is-active .code-frag { opacity: .55; }
  .scene-arch .panel-perms {
    display: grid;
    z-index: 2;
    left: 14%;
    top: calc(var(--header-h) + 52cqw);
    width: 51%;
    transform: perspective(1600px) rotateX(12deg) rotateY(-9deg) rotateZ(4deg);
    transform-origin: 0 0;
  }
  .scene-arch .panel-comms {
    z-index: 2;
    left: 63%;
    top: calc(var(--header-h) + 57cqw);
    width: 45%;
    transform: perspective(1600px) rotateX(12deg) rotateY(-9deg) rotateZ(4deg);
    transform-origin: 0 0;
  }

  /* Escena 2 */
  .scene-ops .app-window {
    z-index: 2;
    left: 14%;
    top: calc(var(--header-h) + 5cqw);
    width: 88%;
    font-size: clamp(10px, 1.62cqw, 15px);
    max-width: none;
    transform: perspective(1800px) rotateX(8deg) rotateY(-10deg) rotateZ(2.5deg);
    transform-origin: 0 0;
  }
  .scene-ops .toast { z-index: 3; left: 52%; top: calc(var(--header-h) + 62cqw); width: auto; font-size: clamp(10px, 1.55cqw, 14.5px); }

  /* Escena 3 */
  .scene-build .graph { z-index: 3; left: 15%; top: calc(var(--header-h) + 3cqw); width: 70%; max-width: none; }
  .scene-build .panel-plan {
    z-index: 2;
    left: 11%;
    top: calc(var(--header-h) + 58cqw);
    width: 44%;
    transform: perspective(1600px) rotateX(12deg) rotateY(-9deg) rotateZ(3deg);
    transform-origin: 0 0;
  }
  .scene-build .panel-sec {
    z-index: 2;
    left: 58%;
    top: calc(var(--header-h) + 61cqw);
    width: 40%;
    transform: perspective(1600px) rotateX(12deg) rotateY(-9deg) rotateZ(3deg);
    transform-origin: 0 0;
  }
}

@media (min-width: 1200px) and (max-height: 760px) {
  .hero h1 { font-size: clamp(2.35rem, 0.6rem + 3.6vw, 4.2rem); }
  .hero-actions { margin-top: 30px; }
  .hero-lead { margin-top: 20px; }
}

/* ==========================================================================
   Visión
   ========================================================================== */
.vision-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(24px, 6vw, 96px);
  align-items: end;
}
.vision-intro h2 { max-width: 660px; }

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 48px);
  margin-top: clamp(56px, 7vw, 96px);
  list-style: none;
}
.principle { padding-top: 30px; border-top: 1px solid var(--line-2); position: relative; }
.principle::before {
  content: "";
  position: absolute;
  top: -1px; inset-inline-start: 0;
  width: 56px; height: 1px;
  background: var(--blue);
}
.principle-icon {
  display: grid;
  place-items: center;
  width: 50px; height: 50px;
  margin-bottom: 24px;
  border-radius: 14px;
  border: 1px solid rgba(96, 148, 255, 0.5);
  background: rgba(61, 126, 255, 0.08);
  color: #9DBBFF;
}
.principle-icon-gold { border-color: rgba(201, 164, 106, 0.55); background: rgba(201, 164, 106, 0.08); color: var(--gold-2); }
.principle-icon .ic { width: 24px; height: 24px; stroke-width: 1.5; }
.principle h3 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; }
.principle p { margin-top: 10px; color: var(--text-3); font-size: 1rem; line-height: 1.6; }

/* ==========================================================================
   Portafolio
   ========================================================================== */
.project {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #0D1A2D, #0A1526);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.project:hover { border-color: rgba(130, 164, 214, 0.32); box-shadow: 0 34px 60px -40px rgba(0, 0, 0, 0.9); }
.project-media { position: relative; overflow: hidden; background: var(--bg-0); }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.project:hover .project-media img { transform: scale(1.02); }

.project-body { padding: clamp(26px, 3vw, 40px); }
.project-cat {
  margin-bottom: 12px;
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-2);
}
.project h3 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2.05rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.title-sep { color: var(--gold); font-weight: 400; }
.title-alt { font-weight: 480; color: #C6D0DC; }
.project-body > p:not(.project-cat):not(.status) {
  margin-top: 14px;
  color: var(--text-3);
  font-size: 1rem;
  line-height: 1.65;
}

.capabilities { display: grid; gap: 10px; margin-top: 22px; list-style: none; }
.capabilities li {
  position: relative;
  padding-inline-start: 24px;
  color: var(--text-2);
  font-size: 0.975rem;
  line-height: 1.5;
}
.capabilities li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0; top: 0.42em;
  width: 9px; height: 9px;
  border-radius: 2px;
  border: 1.5px solid var(--blue-2);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-size: 0.8125rem;
  font-weight: 600;
}
.status-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(201, 164, 106, 0.18); }
.status-next .status-dot { background: var(--blue-2); box-shadow: 0 0 0 3px rgba(127, 166, 255, 0.18); }

.project-featured {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  border-color: rgba(201, 164, 106, 0.3);
}
.project-featured .project-media img { position: absolute; inset: 0; object-position: 45% 50%; }
.project-featured .project-body { padding: clamp(28px, 4vw, 52px); align-self: center; }

.project-row { display: grid; gap: 24px; margin-top: 24px; }
.row-a { grid-template-columns: 5fr 7fr; }
.row-b { grid-template-columns: 7fr 5fr; }

.project-card, .project-text { display: flex; flex-direction: column; }
.project-card .project-media { aspect-ratio: 3 / 2; }
.project-card .project-body,
.project-text .project-body { display: flex; flex-direction: column; flex: 1; }
.project-card .status,
.project-text .status { margin-top: auto; align-self: flex-start; }
.project-card .project-body > p:not(.project-cat):not(.status) { margin-bottom: 26px; }
.project-text .capabilities { margin-bottom: 26px; }

.project-portrait .project-media { aspect-ratio: 4 / 3; }
.project-portrait .project-media img { object-position: 50% 22%; }
.project-portrait figcaption {
  position: absolute;
  left: 14px; right: 14px; bottom: 14px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(4, 10, 20, 0.78);
  color: #D3DBE6;
  font-size: 0.78rem;
  line-height: 1.4;
}

.env-diagram {
  display: block;
  width: 100%;
  height: auto;
  padding: clamp(26px, 3vw, 40px) clamp(26px, 3vw, 40px) 0;
}
.env-diagram .d-line { fill: none; stroke: rgba(85, 140, 255, 0.5); stroke-width: 1.2; }
.env-diagram .d-gold { stroke: rgba(212, 170, 104, 0.55); }
.env-diagram .d-core { fill: rgba(22, 44, 82, 0.95); stroke: rgba(120, 166, 255, 0.75); stroke-width: 1.2; }
.env-diagram .d-node { fill: rgba(14, 28, 52, 0.95); stroke: rgba(96, 148, 255, 0.45); stroke-width: 1; }
.env-diagram .d-dot { fill: var(--gold-2); }

/* ==========================================================================
   Servicios (superficie clara)
   ========================================================================== */
.services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  list-style: none;
  border-top: 1px solid #CBD3DE;
}
.service {
  position: relative;
  padding: 34px clamp(18px, 2vw, 30px) 10px;
  border-inline-start: 1px solid #CBD3DE;
}
.service:first-child { border-inline-start: 0; padding-inline-start: 0; }
.service-num {
  display: block;
  margin-bottom: 26px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #2459C9;
}
.service-icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--gold-2);
}
.service-icon .ic { width: 22px; height: 22px; stroke-width: 1.5; }
.service h3 { font-size: 1.2rem; font-weight: 680; letter-spacing: -0.01em; line-height: 1.25; }
.service p { margin-top: 12px; color: var(--ink-2); font-size: 1rem; line-height: 1.6; }

/* ==========================================================================
   Cómo trabajamos
   ========================================================================== */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  list-style: none;
}
.steps::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 7px;
  height: 1px;
  background: linear-gradient(90deg, var(--blue), var(--gold) 60%, rgba(201, 164, 106, 0.15));
}
.step { position: relative; padding-top: 40px; }
.step-dot {
  position: absolute;
  top: 0; inset-inline-start: 0;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1.5px solid var(--gold);
}
.step:first-child .step-dot { border-color: var(--blue); }
.step-dot::after {
  content: "";
  position: absolute;
  inset: 3.5px;
  border-radius: 50%;
  background: currentColor;
  color: var(--gold);
}
.step:first-child .step-dot::after { color: var(--blue); }
.step-num {
  display: block;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.step h3 {
  margin-top: 8px;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.statement {
  max-width: 920px;
  margin: clamp(64px, 8vw, 104px) 0 0;
  padding-inline-start: clamp(20px, 3vw, 32px);
  border-inline-start: 2px solid var(--gold);
}
.statement p {
  font-size: clamp(1.375rem, 1rem + 1.4vw, 2.1rem);
  font-weight: 500;
  line-height: 1.38;
  letter-spacing: -0.012em;
  color: var(--text);
}

/* ==========================================================================
   Modelo previsto
   ========================================================================== */
.model-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.model-grid .section-head { margin-bottom: 0; }
.model { list-style: none; border-top: 1px solid var(--line-2); }
.model-item {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 24px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line-2);
}
.model-item h3 { font-size: 1.2rem; font-weight: 650; letter-spacing: -0.01em; }
.model-item h3::before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: 7px; height: 7px;
  margin-block-start: -3px;
  margin-inline-end: 12px;
  border-radius: 50%;
  background: var(--gold);
}
.model-item p { color: var(--text-3); font-size: 1rem; }

/* ==========================================================================
   Cierre
   ========================================================================== */
.closing-section { overflow: hidden; background: var(--bg-2); border-top: 1px solid var(--line); }
.closing-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(700px 380px at 92% 100%, rgba(37, 92, 214, 0.26), transparent 70%),
    radial-gradient(520px 300px at 0% 0%, rgba(201, 164, 106, 0.1), transparent 70%);
  pointer-events: none;
}
.closing-bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(127, 166, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 166, 255, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 85% 60%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 80% at 85% 60%, #000, transparent 75%);
}
.closing {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.closing-copy > p:last-child { margin-top: 22px; max-width: 580px; color: var(--text-2); font-size: 1.125rem; }
.closing-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.closing-mail { color: var(--text-3); font-size: 0.975rem; }
.closing-mail a { color: var(--text); text-decoration-color: var(--gold); text-underline-offset: 4px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  padding-block: 52px;
  background: var(--bg-0);
  color: var(--text-3);
  border-top: 1px solid var(--line);
}
.footer-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px 40px;
}
.footer-brand img { width: 200px; height: auto; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; list-style: none; }
.footer-nav a { color: #C3CDD9; font-size: 0.95rem; text-decoration: none; }
.footer-nav a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
.footer-copy { font-size: 0.875rem; }

/* ---------- Animación de entrada ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive general
   ========================================================================== */
@media (max-width: 1100px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .service:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
  .service:nth-child(n+3) { border-top: 1px solid #CBD3DE; }
  .project-featured { grid-template-columns: 1fr; }
  .project-featured .project-media { aspect-ratio: 16 / 9; }
  .model-item { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 899.98px) {
  .vision-grid { grid-template-columns: 1fr; align-items: start; }
  .principles { grid-template-columns: 1fr; gap: 36px; }
  .row-a, .row-b { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .steps::before { display: none; }
  .step { padding-top: 0; padding-inline-start: 32px; }
  .step-dot { top: 4px; }
  .model-grid { grid-template-columns: 1fr; }
  .closing { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; justify-items: start; }
  .footer-nav { justify-content: flex-start; }
}

@media (max-width: 599.98px) {
  body { font-size: 1rem; }
  .project { border-radius: var(--radius-md); }
  .project-featured .project-media { aspect-ratio: 4 / 3; }
  .project-portrait .project-media { aspect-ratio: 4 / 5; }
  .services { grid-template-columns: 1fr; }
  .service, .service:nth-child(3) { border-inline-start: 0; padding-inline: 0; }
  .service + .service { border-top: 1px solid #CBD3DE; }
  .service-num { margin-bottom: 18px; }
  .steps { grid-template-columns: 1fr; row-gap: 28px; }
  .closing-actions { align-items: stretch; }
  .closing-actions .btn { width: 100%; }
  .footer-brand img { width: 180px; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .flow { display: none; }
  .node-in { animation: none; }
  .layer, .scene.is-active .layer { translate: none; scale: none; }
  .js .reveal { opacity: 1; transform: none; }
  .btn:hover .ic, .project:hover .project-media img { transform: none; }
}

/* ==========================================================================
   Multilenguaje: selector de idioma, RTL (hebreo) y ajustes tipográficos
   ========================================================================== */
.lang { position: relative; flex: none; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(230, 236, 245, 0.35);
  border-radius: 12px;
  background: rgba(12, 26, 48, 0.4);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.lang-btn:hover { border-color: rgba(230, 236, 245, 0.75); background: rgba(40, 64, 104, 0.45); }
.lang-btn .ic { width: 17px; height: 17px; }
.lang-btn .lang-chev { width: 14px; height: 14px; transition: transform .25s var(--ease); }
.lang-btn[aria-expanded="true"] .lang-chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  z-index: 70;
  min-width: 210px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: rgba(7, 17, 31, 0.98);
  box-shadow: 0 26px 50px -22px rgba(0, 0, 0, 0.85);
}
.js .lang-menu:not(.is-open) { display: none; }
.lang-menu ul { list-style: none; margin: 0; padding: 0; }
.lang-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 12px;
  border-radius: 9px;
  color: #DCE3EC;
  font-size: 0.975rem;
  text-decoration: none;
  text-align: start;
}
.lang-menu a:hover { background: rgba(61, 126, 255, 0.14); color: var(--text); }
.lang-menu a[aria-current="page"] { color: var(--gold-2); background: rgba(201, 164, 106, 0.08); }
.lang-item-code { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; color: var(--text-3); }
html:not(.js) .lang-btn { display: none; }
html:not(.js) .lang-menu { position: static; padding: 0; border: 0; background: none; box-shadow: none; min-width: 0; }
html:not(.js) .lang-menu ul { display: flex; gap: 2px; }
html:not(.js) .lang-menu .lang-item-code { display: none; }

@media (max-width: 1099.98px) {
  .brand { margin-inline-end: auto; }
  .lang { order: 2; }
  .nav-toggle { order: 3; }
}
@media (max-width: 380px) {
  .lang-btn { padding: 0 9px; gap: 5px; }
  .lang-btn .lang-chev { display: none; }
}

/* ---------- RTL (hebreo) ---------- */
[dir="rtl"] .ic-dir { transform: scaleX(-1); }
[dir="rtl"] .btn:hover .ic-dir { transform: scaleX(-1) translateX(3px); }
[dir="rtl"] .site-nav ul a::after { transform-origin: right; }
[dir="rtl"] .panel-side .is-on { background: linear-gradient(270deg, rgba(201, 164, 106, 0.22), rgba(201, 164, 106, 0.06)); }
[dir="rtl"] .app-nav .is-on { box-shadow: inset -2px 0 0 var(--blue); }
[dir="rtl"] .steps::before { background: linear-gradient(270deg, var(--blue), var(--gold) 60%, rgba(201, 164, 106, 0.15)); }
[dir="rtl"] .code-frag { border-left: 0; border-right: 1px solid var(--line); }
/* El flujo de la escena 3 es una secuencia: en RTL se recorre de derecha a izquierda. */
[dir="rtl"] .graph-flow .node { left: calc((100 - var(--x)) * 1%); }
[dir="rtl"] .graph-flow .graph-lines { transform: scaleX(-1); }

@media (min-width: 1200px) {
  [dir="rtl"] .hero-visual {
    left: calc(-1 * var(--gutter) - max(0px, (100vw - var(--container)) / 2));
    right: 40%;
  }
  [dir="rtl"] .hero-visual::before {
    inset: 0 0 0 auto;
    background: linear-gradient(270deg, var(--bg-1), rgba(7, 17, 31, 0));
  }
  /* La composición se refleja (posiciones y perspectiva); los gráficos internos no se invierten. */
  [dir="rtl"] .scene-arch .graph { left: auto; right: 15%; }
  [dir="rtl"] .scene-arch .code-frag { right: auto; left: 6%; }
  [dir="rtl"] .scene-arch .panel-perms { left: auto; right: 14%; }
  [dir="rtl"] .scene-arch .panel-comms { left: auto; right: 63%; }
  [dir="rtl"] .scene-ops .app-window { left: auto; right: 14%; }
  [dir="rtl"] .scene-ops .toast { left: auto; right: 52%; }
  [dir="rtl"] .scene-build .graph { left: auto; right: 15%; }
  [dir="rtl"] .scene-build .panel-plan { left: auto; right: 11%; }
  [dir="rtl"] .scene-build .panel-sec { left: auto; right: 58%; }
  [dir="rtl"] .scene-arch .panel-perms,
  [dir="rtl"] .scene-arch .panel-comms {
    transform: perspective(1600px) rotateX(12deg) rotateY(9deg) rotateZ(-4deg);
    transform-origin: 100% 0;
  }
  [dir="rtl"] .scene-ops .app-window {
    transform: perspective(1800px) rotateX(8deg) rotateY(10deg) rotateZ(-2.5deg);
    transform-origin: 100% 0;
  }
  [dir="rtl"] .scene-build .panel-plan,
  [dir="rtl"] .scene-build .panel-sec {
    transform: perspective(1600px) rotateX(12deg) rotateY(9deg) rotateZ(-3deg);
    transform-origin: 100% 0;
  }
}

/* ---------- Tipografía por idioma ---------- */
/* El hebreo no usa mayúsculas: sin espaciado amplio ni tracking negativo. */
html[lang="he"] .eyebrow,
html[lang="he"] .hero-eyebrow,
html[lang="he"] .project-cat,
html[lang="he"] .step-num,
html[lang="he"] .lang-btn { letter-spacing: 0.02em; }
html[lang="he"] .hero-eyebrow { font-size: clamp(0.85rem, 0.8rem + 0.2vw, 0.98rem); }
html[lang="he"] .project-cat,
html[lang="he"] .step-num { font-size: 0.85rem; }
html[lang="he"] h1,
html[lang="he"] h2,
html[lang="he"] h3 { letter-spacing: -0.01em; }
html[lang="he"] .hero h1 { max-width: 7.5em; line-height: 1.08; }
html[lang="he"] .date { letter-spacing: 0; }

/* Ruso: palabras más largas. */
html[lang="ru"] .hero h1 { max-width: 10.5em; font-size: clamp(2.05rem, 0.7rem + 3.35vw, 4.1rem); }
html[lang="ru"] h2 { font-size: clamp(1.8rem, 1.1rem + 2.3vw, 3rem); }

@media (prefers-reduced-motion: reduce) {
  [dir="rtl"] .btn:hover .ic-dir { transform: scaleX(-1); }
}
