/* RigSys · rigsys.net — sistema visual del sitio
   Tokens tomados del manual de identidad 2.0 (branding/css/manual.css). */

:root {
  --grafito: #181A1D;
  --noche: #0D0E10;
  --panel: #16181B;
  --panel-2: #1E2125;
  --rojo: #B63C3F;
  --rojo-hover: #C4474A;
  --rojo-claro: #A93236;
  --rojo-oscuro: #E29B9E;
  --acero: #7B8791;
  --porcelana: #F7F7F5;
  --blanco: #FFFFFF;

  --ink: var(--grafito);
  --ink-2: rgba(24, 26, 29, .68);
  --ink-3: rgba(24, 26, 29, .48);
  --line: rgba(24, 26, 29, .10);

  --ink-d: #F5F5F7;
  --ink-d-2: rgba(245, 245, 247, .66);
  --ink-d-3: rgba(245, 245, 247, .42);
  --line-d: rgba(245, 245, 247, .10);

  --ok: #3FA672;
  --warn: #D9A441;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4.5vw, 48px);
  --wrap: 1180px;
  --wrap-wide: 1400px;
  --section-y: clamp(96px, 14vw, 180px);

  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-xl: 36px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --nav-h: 52px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--blanco);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01", "ss03";
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--rojo); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(182, 60, 63, .22); }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.wrap-wide { width: min(100% - 2 * var(--gutter), var(--wrap-wide)); margin-inline: auto; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--blanco); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Tipografía ---------- */
.eyebrow {
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--rojo-claro);
  margin: 0 0 14px;
}
.dark .eyebrow { color: var(--rojo-oscuro); }
.display {
  font-size: clamp(44px, 8.2vw, 104px);
  line-height: 1.02;
  letter-spacing: -.045em;
  font-weight: 700;
  margin: 0;
}
.headline {
  font-size: clamp(36px, 5.6vw, 72px);
  line-height: 1.04;
  letter-spacing: -.04em;
  font-weight: 700;
  margin: 0;
}
.title {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.08;
  letter-spacing: -.032em;
  font-weight: 700;
  margin: 0;
}
.lead {
  font-size: clamp(19px, 1.9vw, 24px);
  line-height: 1.42;
  letter-spacing: -.012em;
  color: var(--ink-2);
  font-weight: 500;
  margin: 20px 0 0;
  max-width: 760px;
}
.dark .lead { color: var(--ink-d-2); }
.center { text-align: center; }
.center .lead { margin-inline: auto; }
.muted { color: var(--ink-3); }
.dark .muted { color: var(--ink-d-3); }
.grad {
  background: linear-gradient(100deg, #F5F5F7 0%, #F5F5F7 40%, #E29B9E 70%, #B63C3F 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Botones ---------- */
.btns { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; margin-top: 34px; }
.center .btns { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 24px;
  border-radius: 999px;
  font-size: 17px; font-weight: 600; letter-spacing: -.01em;
  transition: background .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn-primary { background: var(--rojo); color: #fff; }
.btn-primary:hover { background: var(--rojo-hover); box-shadow: 0 10px 30px rgba(182, 60, 63, .35); }
.btn-primary:active { transform: scale(.98); }
.btn-ghost { background: rgba(24, 26, 29, .06); color: var(--ink); }
.btn-ghost:hover { background: rgba(24, 26, 29, .1); }
.dark .btn-ghost { background: rgba(245, 245, 247, .1); color: var(--ink-d); }
.dark .btn-ghost:hover { background: rgba(245, 245, 247, .16); }
.link {
  font-size: 17px; font-weight: 500; color: var(--rojo-claro);
  display: inline-flex; align-items: center; gap: 2px;
}
.dark .link { color: var(--rojo-oscuro); }
.link::after { content: "›"; font-size: 1.25em; line-height: 1; transform: translateY(-1px); transition: transform .25s var(--ease); margin-left: 4px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link:hover::after { transform: translate(3px, -1px); }

/* ---------- Navegación ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(13, 14, 16, .72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  color: var(--ink-d);
}
.nav-inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.nav-logo { display: flex; align-items: center; height: 100%; flex: none; }
.nav-logo img { height: 22px; width: auto; }
.nav-links { display: flex; gap: 30px; margin: 0 auto; padding: 0; list-style: none; }
.nav-links a { font-size: 13px; color: rgba(245, 245, 247, .8); letter-spacing: -.005em; transition: color .2s; }
.nav-links a:hover, .nav-links a[aria-current="true"] { color: #fff; }
.nav-cta {
  flex: none; font-size: 13px; font-weight: 600; color: #fff;
  background: var(--rojo); padding: 6px 14px; border-radius: 999px; transition: background .2s;
}
.nav-cta:hover { background: var(--rojo-hover); }
.nav-toggle { display: none; width: 40px; height: 40px; margin-right: -10px; position: relative; }
.nav-toggle span { position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--ink-d); transition: transform .3s var(--ease), top .3s var(--ease); }
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 23px; }
.nav.open .nav-toggle span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.nav.open .nav-toggle span:nth-child(2) { top: 20px; transform: rotate(-45deg); }

/* ---------- Secciones ---------- */
section { position: relative; }
.dark { background: var(--noche); color: var(--ink-d); }
.porcelain { background: var(--porcelana); }
.pad { padding-block: var(--section-y); }

/* ---------- Hero ---------- */
.hero {
  padding-top: calc(var(--nav-h) + clamp(64px, 10vw, 128px));
  padding-bottom: clamp(56px, 8vw, 110px);
  overflow: hidden;
  background:
    radial-gradient(1200px 520px at 50% 108%, rgba(182, 60, 63, .22), transparent 70%),
    radial-gradient(900px 500px at 50% -10%, rgba(123, 135, 145, .14), transparent 70%),
    var(--noche);
}
.hero .display { max-width: 15ch; margin-inline: auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; color: var(--ink-d-2);
  padding: 6px 14px 6px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: 28px;
}
.hero-badge b { font-weight: 600; color: #fff; background: var(--rojo); border-radius: 999px; padding: 2px 9px; font-size: 12px; letter-spacing: .02em; }

.stage { margin-top: clamp(56px, 8vw, 96px); perspective: 1800px; }
.window {
  --tilt: 0deg;
  position: relative;
  border-radius: 14px;
  background: #121417;
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .6),
    0 50px 120px -20px rgba(0, 0, 0, .8),
    0 30px 60px -30px rgba(182, 60, 63, .35);
  overflow: hidden;
  transform: rotateX(var(--tilt)) scale(var(--scale, 1));
  transform-origin: 50% 0;
  will-change: transform;
  font-family: var(--font);
  text-align: left;
}
.win-bar {
  height: 40px; display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: linear-gradient(#1D2024, #181A1D);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.lights { display: flex; gap: 8px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.lights i:nth-child(1) { background: #FF5F57; }
.lights i:nth-child(2) { background: #FEBC2E; }
.lights i:nth-child(3) { background: #28C840; }
.win-title { flex: 1; text-align: center; font-size: 12.5px; color: rgba(245, 245, 247, .62); font-weight: 500; letter-spacing: -.005em; }
.win-title b { color: rgba(245, 245, 247, .9); font-weight: 600; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: #fff; letter-spacing: .04em; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rojo); box-shadow: 0 0 0 0 rgba(182, 60, 63, .7); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(182, 60, 63, .6); } 70% { box-shadow: 0 0 0 8px rgba(182, 60, 63, 0); } 100% { box-shadow: 0 0 0 0 rgba(182, 60, 63, 0); } }

.win-body { display: grid; grid-template-columns: 196px 1fr 240px; height: clamp(360px, 46vw, 600px); }
.win-side { border-right: 1px solid rgba(255, 255, 255, .06); padding: 14px 10px; background: rgba(255, 255, 255, .015); }
.side-h { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(245, 245, 247, .38); padding: 10px 10px 6px; }
.side-i { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 7px; font-size: 12.5px; color: rgba(245, 245, 247, .74); }
.side-i.on { background: rgba(182, 60, 63, .2); color: #fff; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--acero); }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.red { background: var(--rojo); }
.win-main { position: relative; display: flex; flex-direction: column; min-width: 0; }
.win-tools { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.seg { display: inline-flex; background: rgba(255, 255, 255, .06); border-radius: 7px; padding: 2px; }
.seg span { font-size: 11.5px; padding: 3px 10px; border-radius: 5px; color: rgba(245, 245, 247, .62); }
.seg span.on { background: rgba(255, 255, 255, .14); color: #fff; }
.chip { font-size: 11px; color: rgba(245, 245, 247, .66); padding: 3px 9px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .1); }
.chip.state { color: #fff; border-color: rgba(63, 166, 114, .5); background: rgba(63, 166, 114, .14); }
.tools-r { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.win-main canvas { flex: 1; width: 100%; height: 100%; min-height: 0; }
.win-kpi { border-left: 1px solid rgba(255, 255, 255, .06); padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.kpi { background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .06); border-radius: 10px; padding: 10px 12px; }
.kpi small { display: block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: rgba(245, 245, 247, .45); font-weight: 600; }
.kpi strong { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.02em; color: #fff; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi strong em { font-style: normal; font-size: 12px; color: rgba(245, 245, 247, .5); font-weight: 500; margin-left: 4px; }
.kpi .q { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: rgba(245, 245, 247, .5); margin-top: 4px; }
.kpi.alert { border-color: rgba(217, 164, 65, .45); background: rgba(217, 164, 65, .08); }
.kpi.alert strong { font-size: 13.5px; line-height: 1.35; font-weight: 600; letter-spacing: -.005em; }

/* ---------- Franja de protocolos ---------- */
.protocols { padding: 34px 0; border-top: 1px solid var(--line-d); overflow: hidden; }
.protocols p { text-align: center; font-size: 13px; color: var(--ink-d-3); margin: 0 0 18px; letter-spacing: .02em; }
.marquee { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee ul { display: flex; gap: 56px; padding: 0 28px; margin: 0; list-style: none; }
.marquee li { font-size: 18px; font-weight: 600; color: rgba(245, 245, 247, .55); letter-spacing: -.01em; white-space: nowrap; }
.protocols:hover .marquee { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.fade-x { -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }

/* ---------- Manifiesto ---------- */
.manifesto #manifesto-text {
  font-size: clamp(30px, 4.8vw, 64px);
  line-height: 1.12;
  letter-spacing: -.035em;
  font-weight: 700;
  margin: 0;
  max-width: 23ch;
}
.manifesto .w { color: rgba(24, 26, 29, .16); transition: color .5s var(--ease); }
.manifesto .w.on { color: var(--ink); }
.manifesto .w.acc.on { color: var(--rojo); }

/* ---------- Pilares ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: clamp(48px, 6vw, 80px); }
.pillar {
  background: var(--blanco); border-radius: var(--r-lg); padding: 36px 32px 34px;
  box-shadow: 0 1px 2px rgba(24, 26, 29, .04), 0 10px 30px rgba(24, 26, 29, .05);
}
.pillar .num { font-size: 13px; font-weight: 600; color: var(--rojo-claro); letter-spacing: .04em; }
.pillar h3 { font-size: 28px; letter-spacing: -.03em; line-height: 1.1; margin: 14px 0 12px; }
.pillar p { margin: 0; color: var(--ink-2); font-size: 17px; }
.pillar ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.pillar li { font-size: 15px; color: var(--ink-2); padding-left: 20px; position: relative; }
.pillar li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 8px; height: 2px; background: var(--rojo); border-radius: 2px; }

/* ---------- Gemelo 3D ---------- */
.twin { overflow: hidden; }
.twin-head { position: relative; z-index: 2; }
.twin-stage { position: relative; height: clamp(440px, 62vw, 760px); margin-top: clamp(24px, 4vw, 48px); }
.twin-stage canvas { width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.twin-stage canvas:active { cursor: grabbing; }
.twin-legend {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  width: min(100% - 32px, 820px);
}
.twin-legend span {
  font-size: 13px; color: var(--ink-d-2); padding: 7px 14px; border-radius: 999px;
  background: rgba(24, 26, 29, .7); border: 1px solid rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  display: inline-flex; align-items: center; gap: 8px;
}
.twin-legend i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.twin-hud {
  position: absolute; top: 18px; right: max(18px, calc((100% - var(--wrap-wide)) / 2));
  font: 500 12px/1.6 var(--mono); color: var(--ink-d-2);
  background: rgba(24, 26, 29, .66); border: 1px solid rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 12px; padding: 12px 16px; min-width: 200px;
}
.twin-hud b { color: #fff; font-weight: 600; }
.twin-hud .r { display: flex; justify-content: space-between; gap: 18px; }
.twin-specs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-d); border-radius: var(--r-md); overflow: hidden; margin-top: 40px; }
.twin-specs div { background: var(--noche); padding: 26px 24px; }
.twin-specs h4 { margin: 0 0 6px; font-size: 17px; letter-spacing: -.015em; }
.twin-specs p { margin: 0; font-size: 15px; color: var(--ink-d-2); }

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; margin-top: clamp(48px, 6vw, 72px); }
.tile {
  position: relative; overflow: hidden;
  background: var(--blanco); border-radius: var(--r-lg);
  padding: 32px; min-height: 340px;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(24, 26, 29, .04), 0 10px 30px rgba(24, 26, 29, .05);
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 2px 6px rgba(24, 26, 29, .05), 0 24px 60px rgba(24, 26, 29, .1); }
.tile.dk { background: var(--grafito); color: var(--ink-d); }
.tile.s2 { grid-column: span 2; }
.tile.s3 { grid-column: span 3; }
.tile.s4 { grid-column: span 4; }
.tile .k { font-size: 14px; font-weight: 600; color: var(--rojo-claro); margin: 0 0 8px; }
.tile.dk .k { color: var(--rojo-oscuro); }
.tile h3 { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.12; letter-spacing: -.028em; margin: 0; max-width: 20ch; }
.tile p.d { font-size: 15.5px; color: var(--ink-2); margin: 10px 0 0; max-width: 46ch; }
.tile.dk p.d { color: var(--ink-d-2); }
.tile .viz { margin-top: auto; padding-top: 26px; }

/* visualizaciones de mosaicos */
.qlist { display: grid; gap: 8px; }
.qrow { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; font-size: 13.5px; padding: 9px 12px; border-radius: 10px; background: var(--porcelana); }
.qrow code { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; letter-spacing: .02em; }
.b-ok { background: rgba(63, 166, 114, .14); color: #23774D; }
.b-warn { background: rgba(217, 164, 65, .18); color: #8A6213; }
.b-bad { background: rgba(182, 60, 63, .14); color: var(--rojo-claro); }

.scrub { position: relative; height: 92px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); overflow: hidden; }
.scrub svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scrub .head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--rojo); left: 30%; animation: scrub 9s var(--ease) infinite alternate; }
.scrub .head::before { content: ""; position: absolute; top: -1px; left: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--rojo); box-shadow: 0 0 0 4px rgba(182, 60, 63, .25); }
@keyframes scrub { from { left: 12%; } to { left: 86%; } }
.transport { display: flex; gap: 10px; align-items: center; margin-top: 12px; font: 500 12px var(--mono); color: var(--ink-d-2); }
.transport .pb { width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .1); display: grid; place-items: center; }

.states { display: flex; height: 34px; border-radius: 8px; overflow: hidden; }
.states i { display: block; height: 100%; }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.st-legend i { width: 9px; height: 9px; border-radius: 3px; display: block; }

.cursor-viz { position: relative; height: 150px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cursor-viz .tr { position: relative; border-radius: 8px; background: var(--porcelana); overflow: hidden; }
.cursor-viz svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cursor-viz .line { position: absolute; left: -4px; right: -4px; height: 1.5px; background: var(--rojo); top: 46%; animation: cur 7s var(--ease) infinite alternate; }
.cursor-viz .line::after { content: "3 482,6 m · 14:32:08"; position: absolute; right: 6px; top: -22px; font: 600 10.5px var(--mono); color: #fff; background: var(--rojo); padding: 2px 7px; border-radius: 5px; }
@keyframes cur { from { top: 22%; } to { top: 74%; } }

.screens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; perspective: 900px; }
.screens div { aspect-ratio: 16 / 10; border-radius: 6px; background: linear-gradient(160deg, #23262B, #16181B); border: 1px solid rgba(255, 255, 255, .08); position: relative; overflow: hidden; }
.screens svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.screens div::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: rgba(255, 255, 255, .05); }

.chat { display: grid; gap: 10px; }
.bubble { font-size: 14px; padding: 11px 14px; border-radius: 16px; max-width: 88%; line-height: 1.45; }
.bubble.q { background: var(--rojo); color: #fff; justify-self: end; border-bottom-right-radius: 5px; }
.bubble.a { background: var(--porcelana); color: var(--ink); border-bottom-left-radius: 5px; }
.bubble.a small { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.bubble.a small span { font: 600 11px var(--mono); color: var(--ink-2); background: var(--blanco); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; }

.alarm { display: grid; gap: 8px; }
.al { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); font-size: 14px; }
.al b { font-weight: 600; }
.al span { margin-left: auto; font: 500 12px var(--mono); color: var(--ink-d-3); }
.al.hot { border-color: rgba(182, 60, 63, .5); background: rgba(182, 60, 63, .14); }

.doc { position: relative; height: 170px; }
.doc .pg { position: absolute; width: 58%; aspect-ratio: 1 / 1.3; border-radius: 8px; background: var(--blanco); border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(24, 26, 29, .1); padding: 12px; }
.doc .pg:nth-child(1) { left: 8%; top: 18px; transform: rotate(-6deg); }
.doc .pg:nth-child(2) { left: 34%; top: 0; transform: rotate(4deg); }
.doc .pg i { display: block; height: 5px; border-radius: 3px; background: rgba(24, 26, 29, .12); margin-bottom: 6px; }
.doc .pg i:first-child { width: 50%; background: var(--rojo); height: 7px; margin-bottom: 10px; }
.doc .pg .chart { height: 46px; border-radius: 4px; margin: 8px 0; background: linear-gradient(transparent 60%, rgba(182, 60, 63, .15) 60%), repeating-linear-gradient(90deg, rgba(24, 26, 29, .08) 0 1px, transparent 1px 14%); }

/* ---------- Roles ---------- */
.roles { display: grid; grid-template-columns: 340px 1fr; gap: clamp(28px, 5vw, 72px); margin-top: clamp(48px, 6vw, 72px); align-items: start; }
.role-tabs { display: grid; gap: 4px; position: sticky; top: calc(var(--nav-h) + 32px); }
.role-tab {
  text-align: left; padding: 18px 20px; border-radius: 16px; transition: background .3s var(--ease);
  display: grid; gap: 4px;
}
.role-tab strong { font-size: 19px; letter-spacing: -.02em; color: var(--ink-3); transition: color .3s; }
.role-tab span { font-size: 14.5px; color: var(--ink-3); display: none; }
.role-tab:hover strong { color: var(--ink-2); }
.role-tab[aria-selected="true"] { background: var(--blanco); box-shadow: 0 1px 2px rgba(24, 26, 29, .04), 0 10px 30px rgba(24, 26, 29, .06); }
.role-tab[aria-selected="true"] strong { color: var(--ink); }
.role-tab[aria-selected="true"] span { display: block; color: var(--ink-2); }
.role-panel { background: var(--grafito); color: var(--ink-d); border-radius: var(--r-xl); padding: clamp(24px, 3vw, 40px); min-height: 470px; display: none; }
.role-panel.on { display: block; animation: rise .6s var(--ease-out); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.role-panel h3 { font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -.03em; line-height: 1.1; margin: 0; }
.role-panel > p { color: var(--ink-d-2); margin: 12px 0 0; max-width: 56ch; }
.ws { margin-top: 28px; display: grid; gap: 10px; grid-template-columns: repeat(6, 1fr); }
.wg { background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; padding: 14px; min-height: 104px; position: relative; overflow: hidden; }
.wg small { display: block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-d-3); font-weight: 600; }
.wg strong { display: block; font-size: 24px; letter-spacing: -.02em; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.wg strong em { font-style: normal; font-size: 12px; color: var(--ink-d-3); font-weight: 500; margin-left: 3px; }
.wg svg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 46px; }
.wg.c2 { grid-column: span 2; }
.wg.c3 { grid-column: span 3; }
.wg.c4 { grid-column: span 4; }
.wg.c6 { grid-column: span 6; }
.wg.tall { min-height: 210px; }
.wg.tall svg { height: 140px; bottom: 14px; }
.wg ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 7px; font-size: 13px; color: var(--ink-d-2); }
.wg li { display: flex; gap: 8px; align-items: center; }
.wg li span { margin-left: auto; font: 500 11.5px var(--mono); color: var(--ink-d-3); }

/* ---------- Fotografía ---------- */
.photo {
  position: relative; min-height: clamp(520px, 80vh, 860px);
  display: flex; align-items: flex-end; overflow: hidden; color: #fff;
}
.photo img.bg { position: absolute; inset: -6% 0; width: 100%; height: 112%; object-fit: cover; will-change: transform; }
.photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13, 14, 16, .2) 0%, rgba(13, 14, 16, 0) 30%, rgba(13, 14, 16, .78) 100%); }
.photo .wrap { position: relative; z-index: 2; padding-bottom: clamp(48px, 7vw, 96px); }
.photo blockquote { margin: 0; font-size: clamp(30px, 4.4vw, 58px); line-height: 1.1; letter-spacing: -.035em; font-weight: 700; max-width: 18ch; }
.photo cite { display: block; font-style: normal; margin-top: 18px; font-size: 17px; color: rgba(255, 255, 255, .72); }

/* ---------- Arquitectura ---------- */
.arch { margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: center; gap: 0; }
.arch-col { display: grid; gap: 10px; }
.arch-col h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-d-3); font-weight: 600; }
.node { padding: 13px 16px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); font-size: 14.5px; display: flex; align-items: center; gap: 10px; }
.node small { margin-left: auto; font: 500 11px var(--mono); color: var(--ink-d-3); }
.core {
  margin: 0 clamp(16px, 3vw, 44px); padding: 30px; border-radius: 26px; position: relative;
  background: linear-gradient(160deg, rgba(182, 60, 63, .22), rgba(24, 26, 29, .9) 60%);
  border: 1px solid rgba(226, 155, 158, .28);
  box-shadow: 0 30px 80px -30px rgba(182, 60, 63, .45);
}
.core img { width: 44px; height: auto; margin-bottom: 18px; }
.core h4 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.core p { margin: 6px 0 16px; font-size: 14.5px; color: var(--ink-d-2); }
.core ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: c; }
.core li { counter-increment: c; font-size: 14px; display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; background: rgba(13, 14, 16, .55); }
.core li::before { content: counter(c, decimal-leading-zero); font: 600 11px var(--mono); color: var(--rojo-oscuro); }
.flow { position: relative; height: 2px; }
.arch .wire { position: relative; }

.ent { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: clamp(56px, 7vw, 96px); }
.ent div { padding: 28px 0 0; border-top: 1px solid var(--line-d); }
.ent svg { width: 30px; height: 30px; color: var(--rojo-oscuro); margin-bottom: 18px; }
.ent h4 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.02em; }
.ent p { margin: 0; font-size: 15px; color: var(--ink-d-2); }

/* ---------- Cifras ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat strong { display: block; font-size: clamp(54px, 7vw, 96px); font-weight: 700; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat strong span { color: var(--rojo); }
.stat p { margin: 14px 0 0; font-size: 17px; color: var(--ink-2); max-width: 24ch; }

/* ---------- Proceso ---------- */
.process { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.process figure { margin: 0; border-radius: var(--r-xl); overflow: hidden; aspect-ratio: 4 / 5; }
.process figure img { width: 100%; height: 100%; object-fit: cover; }
.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 0; }
.steps li { display: grid; grid-template-columns: 56px 1fr; gap: 4px 0; padding: 24px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps .n { font: 600 14px var(--mono); color: var(--rojo-claro); padding-top: 4px; }
.steps h4 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.steps p { grid-column: 2; margin: 6px 0 0; color: var(--ink-2); font-size: 16px; }

/* ---------- FAQ ---------- */
.faq { max-width: 860px; margin: clamp(40px, 5vw, 64px) auto 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 26px 44px 26px 0; position: relative;
  font-size: clamp(18px, 1.8vw, 22px); font-weight: 600; letter-spacing: -.02em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 28px; font-weight: 300; color: var(--ink-3); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { margin: -8px 0 26px; color: var(--ink-2); max-width: 70ch; }

/* ---------- CTA final ---------- */
.cta { position: relative; overflow: hidden; text-align: center; }
.cta img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .38; }
.cta::before { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(800px 400px at 50% 50%, rgba(13, 14, 16, .35), rgba(13, 14, 16, .92)); }
.cta .wrap { position: relative; z-index: 2; }
.cta .iso { width: 72px; margin: 0 auto 28px; }
.contact-line { margin-top: 26px; font-size: 15px; color: var(--ink-d-3); }
.contact-line a { color: var(--ink-d-2); border-bottom: 1px solid rgba(245, 245, 247, .25); }

/* ---------- Footer ---------- */
.footer { background: var(--porcelana); color: var(--ink-2); font-size: 12.5px; padding: 56px 0 28px; }
.foot-top { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.foot-top img { height: 26px; width: auto; }
.foot-top .about { margin: 16px 0 0; max-width: 32ch; line-height: 1.55; font-size: 13px; }
.foot-top h5 { margin: 0 0 12px; font-size: 12.5px; color: var(--ink); font-weight: 600; }
.foot-top ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.foot-top a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.foot-bot { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; padding-top: 22px; color: var(--ink-3); }

/* ---------- Aparición ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .win-body { grid-template-columns: 1fr 210px; }
  .win-side { display: none; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile.s2, .tile.s3, .tile.s4 { grid-column: span 1; }
  .tile.wide-md { grid-column: span 2; }
  .arch { grid-template-columns: 1fr; gap: 28px; }
  .core { margin: 0; }
  .ent { grid-template-columns: repeat(2, 1fr); }
  .twin-specs { grid-template-columns: repeat(2, 1fr); }
  .foot-top { grid-template-columns: repeat(3, 1fr); }
  .foot-top > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: block; margin-left: auto; }
  .nav.open { height: auto; background: rgba(13, 14, 16, .96); }
  .nav.open .nav-inner { flex-wrap: wrap; height: auto; padding-bottom: 24px; }
  .nav.open .nav-logo { height: var(--nav-h); }
  .nav.open .nav-links { display: grid; gap: 0; width: 100%; margin: 0; order: 3; }
  .nav.open .nav-links a { display: block; font-size: 22px; font-weight: 600; padding: 12px 0; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .nav.open .nav-cta { display: inline-flex; order: 4; margin-top: 20px; font-size: 16px; padding: 10px 20px; }
  .pillars { grid-template-columns: 1fr; }
  .roles { grid-template-columns: 1fr; }
  .role-tabs { position: static; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; scrollbar-width: none; gap: 6px; margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter) 8px; }
  .role-tabs::-webkit-scrollbar { display: none; }
  .role-tab { padding: 10px 16px; border-radius: 999px; }
  .role-tab strong { font-size: 15px; }
  .role-tab[aria-selected="true"] span { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 48px; }
  .process { grid-template-columns: 1fr; }
  .process figure { aspect-ratio: 4 / 3; order: -1; }
  .twin-hud { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hide-sm { display: none; }
  .win-body { grid-template-columns: 1fr; height: 420px; }
  .win-kpi { display: none; }
  .win-title { font-size: 11px; }
  .win-tools .chip:not(.state) { display: none; }
  .bento { grid-template-columns: 1fr; }
  .tile.wide-md { grid-column: span 1; }
  .tile { padding: 26px; min-height: 0; }
  .ws { grid-template-columns: repeat(2, 1fr); }
  .wg.c2, .wg.c3 { grid-column: span 1; }
  .wg.c4, .wg.c6 { grid-column: span 2; }
  .ent { grid-template-columns: 1fr; }
  .twin-specs { grid-template-columns: 1fr; }
  .foot-top { grid-template-columns: repeat(2, 1fr); }
  .twin-stage { height: auto; }
  .twin-stage canvas { height: 460px; }
  .twin-legend { position: static; transform: none; margin: 8px auto 0; }
  .twin-legend span { font-size: 12px; padding: 6px 11px; }
  .stat p { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .manifesto .w { color: var(--ink); }
}

/* trazos de grosor constante en gráficos estirados */
svg[preserveAspectRatio="none"] path { vector-effect: non-scaling-stroke; }
