/* ==========================================================================
   IntelliApps · SCOM — Sistema de diseño
   ========================================================================== */

:root {
  --ink: #08090b;
  --ink-2: #0f1115;
  --ink-3: #161920;
  --paper: #f5f5f3;
  --paper-2: #e9e8e3;
  --text: #f5f5f3;
  --text-dim: #9aa0aa;
  --text-ink: #101114;
  --text-ink-dim: #5c606a;
  --line: rgba(255, 255, 255, 0.1);
  --line-ink: rgba(16, 17, 20, 0.1);
  --blue: #0178e6;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-lg: 24px;
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1200px;
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-h); }
body {
  font-family: var(--font-sans); background: var(--ink); color: var(--text);
  line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--blue); color: #fff; }

.wrap { width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; }
.section { padding-block: clamp(72px, 10vw, 136px); }
.on-paper { background: var(--paper); color: var(--text-ink); }
.on-ink { background: var(--ink); color: var(--text); }

/* ---------- Tipografía ---------- */
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.04em; line-height: 1.02; text-wrap: balance; }
.h-xl { font-size: clamp(2.4rem, 5.6vw, 4.6rem); }
.h-lg { font-size: clamp(1.9rem, 3.8vw, 3.2rem); }
.h-md { font-size: clamp(1.35rem, 2.2vw, 1.9rem); line-height: 1.15; }
.lead { font-size: clamp(1rem, 1.25vw, 1.18rem); color: var(--text-dim); max-width: 36em; }
.on-paper .lead { color: var(--text-ink-dim); }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-dim); display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 20px; height: 1px; background: currentColor; opacity: 0.55; }
.on-paper .eyebrow { color: var(--text-ink-dim); }
.section-head { display: grid; gap: 16px; margin-bottom: clamp(36px, 5vw, 60px); max-width: 46em; }

/* ---------- Botones ---------- */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding-inline: 24px; border-radius: 999px;
  font-weight: 500; font-size: 0.9375rem; letter-spacing: -0.01em;
  transition: transform 0.35s var(--ease), background 0.25s, box-shadow 0.35s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-light { background: var(--text); color: var(--ink); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-ghost { color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); }
  .btn-light:hover { box-shadow: 0 10px 32px -12px rgba(255, 255, 255, 0.4); }
  .btn-blue:hover { box-shadow: 0 10px 32px -12px rgba(1, 120, 230, 0.65); }
  .btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
}
.btn-play-ico { width: 26px; height: 26px; margin-left: -8px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); display: grid; place-items: center; }
.btn-play-ico svg { width: 10px; height: 10px; margin-left: 1px; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 0.9375rem; color: #5dc3fe; }
.link-arrow svg { width: 14px; height: 14px; transition: transform 0.3s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- Navegación ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h); border-bottom: 1px solid transparent; transition: background 0.35s, backdrop-filter 0.35s, border-color 0.35s; }
.nav.scrolled, .nav.menu-open { background: rgba(8, 9, 11, 0.9); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); border-color: var(--line); }
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-logo img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 32px; font-size: 0.9rem; color: var(--text-dim); }
.nav-links a { transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav .btn { --h: 38px; padding-inline: 18px; font-size: 0.875rem; }
.nav-toggle { display: none; width: 40px; height: 40px; border-radius: 50%; place-items: center; background: rgba(255, 255, 255, 0.08); }
.nav-toggle svg { width: 18px; height: 18px; }
.mobile-menu { background: rgba(8, 9, 11, 0.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--line); }
.mobile-menu-inner { display: grid; gap: 4px; padding-block: 14px 22px; }
.mobile-menu-inner a:not(.btn) { padding: 12px 4px; font-size: 1rem; border-bottom: 1px solid var(--line); }
.mobile-menu-inner .btn { margin-top: 12px; width: 100%; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 92svh; display: flex; align-items: center; padding-block: calc(var(--nav-h) + 32px) 64px; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: -6% 0; z-index: -2; will-change: transform; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; filter: saturate(0.8); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, var(--ink) 12%, rgba(8, 9, 11, 0.82) 55%, rgba(8, 9, 11, 0.45) 100%), linear-gradient(0deg, var(--ink) 0%, transparent 35%);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: clamp(32px, 5vw, 64px); }
.hero-copy { display: grid; gap: 22px; justify-items: start; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

.hero-stage { display: grid; place-items: center; perspective: 1200px; }
.phone {
  position: relative; width: clamp(230px, 21vw, 290px); aspect-ratio: 9 / 18.6;
  border-radius: 42px; padding: 9px; background: linear-gradient(145deg, #2b2f37, #0b0c0f 55%);
  box-shadow: 0 0 0 1.5px #3a3e47, 0 40px 90px -28px rgba(0, 0, 0, 0.85), 0 24px 50px -20px rgba(1, 120, 230, 0.22);
  transform-style: preserve-3d; transition: transform 0.6s var(--ease); cursor: pointer;
}
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: #000; }
.phone-screen video, .phone-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; translate: -50% 0; width: 28%; height: 18px; background: #000; border-radius: 99px; z-index: 3; }
.phone-glare { position: absolute; inset: 9px; border-radius: 34px; z-index: 2; pointer-events: none; background: linear-gradient(115deg, rgba(255, 255, 255, 0.14), transparent 32%); }

/* ---------- Nosotros y Capacidades ---------- */
.about-head { display: grid; gap: 18px; max-width: 48em; margin-bottom: clamp(44px, 6vw, 72px); }
.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 48px); border-top: 1px solid var(--line-ink); padding-top: clamp(28px, 4vw, 44px); }
.cap { display: grid; gap: 10px; align-content: start; }
.cap-n { font-family: var(--font-mono); font-size: 0.75rem; color: var(--blue); letter-spacing: 0.1em; }
.cap h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.cap p { color: var(--text-ink-dim); font-size: 0.95rem; }

/* ---------- SCOM: Qué ofrece ---------- */
.scom-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.scom-tabs { display: grid; border-top: 1px solid var(--line); }
.stab {
  display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: baseline; text-align: left;
  padding: 20px 14px; border-bottom: 1px solid var(--line); opacity: 0.55;
  transition: opacity 0.3s, background 0.3s;
}
.stab-n { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); }
.stab-body { display: grid; gap: 6px; }
.stab-body b { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; letter-spacing: -0.02em; }
.stab-body span { color: var(--text-dim); font-size: 0.92rem; line-height: 1.45; }
.stab[aria-selected="true"] { opacity: 1; background: rgba(255, 255, 255, 0.03); }
.stab[aria-selected="true"] .stab-n { color: #5dc3fe; }
@media (hover: hover) { .stab:hover:not([aria-selected="true"]) { opacity: 0.85; } }

.scom-stage { display: grid; justify-items: center; gap: 22px; }
.scom-phone { cursor: default; }
.scom-meta { width: min(100%, 360px); display: grid; gap: 14px; }
.scom-meta ul { display: grid; gap: 8px; }
.scom-meta li { display: flex; gap: 10px; font-size: 0.9rem; color: #d6d9de; line-height: 1.4; }
.scom-meta li svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--blue); }

/* ---------- Catálogo de 18 procesos ---------- */
.catalog-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.filters { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--paper-2); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; padding: 8px 16px; border-radius: 999px; font-size: 0.875rem; font-weight: 500; color: var(--text-ink-dim); transition: background 0.25s, color 0.25s; }
.filter:hover { color: var(--text-ink); }
.filter[aria-pressed="true"] { background: var(--text-ink); color: #fff; }
.filter small { opacity: 0.55; margin-left: 4px; font-size: 0.75rem; }

.rail-arrows { display: flex; gap: 8px; }
.arrow-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line-ink); transition: background 0.25s, color 0.25s, opacity 0.25s; }
.arrow-btn:hover:not(:disabled) { background: var(--text-ink); color: #fff; }
.arrow-btn:disabled { opacity: 0.3; cursor: default; }
.arrow-btn svg { width: 15px; height: 15px; }

.rail { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); scrollbar-width: none; padding-bottom: 8px; }
.rail::-webkit-scrollbar { display: none; }
.pcard {
  position: relative; flex: none; width: clamp(205px, 19vw, 260px); aspect-ratio: 9 / 16; border-radius: 24px; overflow: hidden;
  scroll-snap-align: start; background: var(--ink); text-align: left; color: #fff;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
@media (hover: hover) { .pcard:hover { transform: translateY(-6px); box-shadow: 0 32px 56px -24px rgba(0, 0, 0, 0.45); } }
.pcard img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.pcard:hover img { transform: scale(1.04); }
.pcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8, 9, 11, 0.9), transparent 42%); }
.pcard-info { position: absolute; z-index: 1; left: 16px; right: 16px; bottom: 16px; display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.pcard-info small { display: block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; color: rgba(255, 255, 255, 0.68); margin-bottom: 4px; }
.pcard-info b { font-weight: 600; font-size: 0.95rem; line-height: 1.2; letter-spacing: -0.01em; }
.pcard-play { width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; flex: none; }
.pcard-play svg { width: 11px; height: 11px; margin-left: 2px; }
.pcard[hidden] { display: none; }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 0.9fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact-copy { display: grid; gap: 22px; justify-items: start; }
.contact-list { display: grid; width: 100%; margin-top: 8px; }
.contact-list a { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-block: 16px; border-top: 1px solid var(--line); font-size: 1rem; }
.contact-list span { color: var(--text-dim); font-size: 0.875rem; }
.contact-list a:hover b { color: var(--blue); }

.form { display: grid; gap: 16px; padding: clamp(22px, 3vw, 36px); border-radius: var(--radius-lg); background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.field-row { display: grid; gap: 8px; }
.field-row label { font-size: 0.8125rem; color: var(--text-dim); }
.field-row input, .field-row select {
  height: 50px; padding-inline: 16px; border-radius: 12px; background: var(--ink); color: var(--text);
  font: inherit; font-size: 16px; border: 1px solid var(--line); transition: border-color 0.25s, box-shadow 0.25s; appearance: none; width: 100%;
}
.field-row select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%239aa0aa' stroke-width='1.6'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.field-row input:focus, .field-row select:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(1, 120, 230, 0.2); }
.form .btn { width: 100%; margin-top: 4px; }
.form-note { font-size: 0.8125rem; color: var(--text-dim); text-align: center; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 36px; font-size: 0.875rem; color: var(--text-dim); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer img { height: 28px; width: auto; }
.footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer nav a:hover { color: var(--text); }

/* ---------- Modal de video ---------- */
dialog.vmodal { margin: auto; padding: 0; border: 0; background: transparent; color: var(--text); width: min(900px, 94vw); max-height: 94svh; overflow: auto; }
dialog.vmodal::backdrop { background: rgba(4, 5, 7, 0.84); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
dialog.vmodal[open] { animation: modal-in 0.35s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.vmodal-body { position: relative; display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 4vw, 48px); align-items: center; padding: clamp(20px, 3vw, 36px); border-radius: var(--radius-lg); background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line), 0 50px 100px -30px #000; }
.vmodal-phone { height: min(72svh, 620px); aspect-ratio: 9 / 16; border-radius: 24px; overflow: hidden; background: #000; }
.vmodal-phone video { width: 100%; height: 100%; object-fit: cover; }
.vmodal-info { display: grid; gap: 16px; justify-items: start; }
.vmodal-info p { color: var(--text-dim); }
.vmodal-close { position: absolute; top: 14px; right: 14px; z-index: 5; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); display: grid; place-items: center; transition: background 0.25s; }
.vmodal-close:hover { background: rgba(255, 255, 255, 0.22); }
.vmodal-close svg { width: 15px; height: 15px; }

/* ---------- Revelado ---------- */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity 0.75s var(--ease), transform 0.75s var(--ease); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .scom-grid, .contact-grid { grid-template-columns: 1fr; }
  .cap-grid { grid-template-columns: 1fr; gap: 28px; }
  .vmodal-body { grid-template-columns: 1fr; justify-items: center; padding-top: 52px; }
  .vmodal-phone { height: min(52svh, 460px); }
  .vmodal-info { justify-items: center; text-align: center; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; }
  .nav .btn { padding-inline: 14px; font-size: 0.8125rem; }
  .hero { min-height: auto; padding-block: calc(var(--nav-h) + 28px) 56px; }
  .hero::before { background: linear-gradient(180deg, rgba(8, 9, 11, 0.7) 0%, rgba(8, 9, 11, 0.88) 55%, var(--ink) 100%); }
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1 1 180px; }
  .scom-tabs { display: flex; overflow-x: auto; gap: 8px; border-top: 0; padding-bottom: 4px; scrollbar-width: none; }
  .scom-tabs::-webkit-scrollbar { display: none; }
  .stab { flex: none; grid-template-columns: auto; padding: 10px 18px; border-radius: 999px; border-bottom: 0; background: var(--ink-2); opacity: 0.75; }
  .stab-n, .stab-body span { display: none; }
  .stab-body b { font-size: 0.9375rem; }
  .stab[aria-selected="true"] { background: var(--blue); opacity: 1; }
  .rail-arrows { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01s !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
