/* RoyControl | catálogo de software por suscripción. Estética HUD stealth.
   - Un solo color editable: --accent (hex). Todo lo demás se deriva de él.
   - Los neutros usan oklch() a propósito: así el convertidor solo ofrece --accent como color a cambiar.
   - Dos temas (claro / oscuro) por variables; una sola escala de radio. */

@property --len { syntax: "<length>"; inherits: false; initial-value: 10px; }

:root {
  color-scheme: light;
  --accent: #c4e84c;
  --accent-ink: oklch(0.2 0.02 125);                       /* el script lo recalcula según el color elegido */
  --accent-line: color-mix(in srgb, var(--accent) 62%, black);
  --accent-soft: color-mix(in srgb, var(--accent) 22%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 38%, transparent);
  --accent-text: var(--accent-line);

  --bg: oklch(0.965 0.004 265);
  --surface: oklch(0.985 0.003 265);
  --surface-2: oklch(0.94 0.005 265);
  --line: oklch(0.88 0.006 265);
  --line-strong: oklch(0.76 0.01 265);
  --text: oklch(0.18 0.01 265);
  --muted: oklch(0.45 0.015 265);
  --scrim: 0.8;
  --scan: 0.035;
  --nav-bg: color-mix(in oklab, var(--bg) 84%, transparent);

  --r: 4px;
  --strip-h: 24px;
  --bar-h: 60px;
  --nav-h: calc(var(--strip-h) + var(--bar-h));
  --max: 1180px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --accent-line: var(--accent);
  --accent-text: color-mix(in srgb, var(--accent) 70%, white);
  --accent-soft: color-mix(in srgb, var(--accent) 13%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 30%, transparent);
  --bg: oklch(0.14 0.005 265);
  --surface: oklch(0.175 0.006 265);
  --surface-2: oklch(0.21 0.007 265);
  --line: oklch(0.28 0.008 265);
  --line-strong: oklch(0.38 0.01 265);
  --text: oklch(0.95 0.004 265);
  --muted: oklch(0.72 0.012 265);
  --scrim: 0.78;
  --scan: 0.07;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }

.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.section { position: relative; padding-block: clamp(64px, 9vw, 120px); border-top: 1px solid var(--line); }
.section::before {
  content: ""; position: absolute; top: -1px; left: max(16px, calc((100% - var(--max)) / 2));
  width: 72px; height: 2px; background: var(--accent);
}

/* ---------- Fondo por tema (imagen/GIF/JPG o video MP4) ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.bg-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
:root[data-theme="dark"] .bg-light, :root:not([data-theme="dark"]) .bg-dark { display: none; }
.bg-vid.is-empty { display: none; }
.bg-scrim { position: absolute; inset: 0; background: color-mix(in oklab, var(--bg) calc(var(--scrim) * 100%), transparent); }

/* Capa HUD: líneas de barrido + viñeta. No intercepta clics. */
.hud-overlay {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgb(0 0 0 / var(--scan)) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgb(0 0 0 / .22) 100%);
}

/* ---------- Tipografía ---------- */
h1, h2, h3 { font-weight: 700; }
h1, h2 { text-transform: uppercase; letter-spacing: -.01em; }
h1 { font-size: clamp(1.85rem, 3.7vw, 3rem); line-height: 1.08; }
h2 { font-size: clamp(1.45rem, 2.7vw, 2.15rem); line-height: 1.14; }
h3 { font-family: var(--font-mono); font-size: 1.05rem; line-height: 1.25; text-transform: uppercase; letter-spacing: .04em; }
.lead { color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.12rem); max-width: 56ch; }
.eyebrow { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-text); }
.eyebrow::before { content: "// "; opacity: .7; }
.sec-head { max-width: 660px; margin-bottom: clamp(32px, 5vw, 56px); display: grid; gap: 14px; }

/* ---------- Marcos HUD: esquinas que se abren al pasar el cursor ---------- */
.hud { position: relative; overflow: hidden; }
.hud::before {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  --len: 12px; --c: var(--accent-line);
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / var(--len) 2px,
    linear-gradient(var(--c), var(--c)) 0 0 / 2px var(--len),
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--len) 2px,
    linear-gradient(var(--c), var(--c)) 100% 0 / 2px var(--len),
    linear-gradient(var(--c), var(--c)) 0 100% / var(--len) 2px,
    linear-gradient(var(--c), var(--c)) 0 100% / 2px var(--len),
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--len) 2px,
    linear-gradient(var(--c), var(--c)) 100% 100% / 2px var(--len);
  background-repeat: no-repeat;
  transition: --len .4s var(--ease);
}
.hud::after {
  content: ""; position: absolute; left: 0; right: 0; top: -40%; height: 40%; z-index: 2; pointer-events: none; opacity: 0;
  background: linear-gradient(to bottom, transparent, var(--accent-soft) 70%, var(--accent-glow));
}
.hud:hover::before { --len: 30px; }
.hud:hover::after { animation: sweep .95s linear 1; }
@keyframes sweep { 0% { top: -40%; opacity: 1; } 100% { top: 100%; opacity: 1; } }

/* ---------- Botones ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 22px;
  border-radius: var(--r);
  border: 1px solid var(--line-strong);
  background: transparent; color: var(--text);
  font-family: var(--font-mono); font-weight: 600; font-size: .86rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  transition: transform .2s var(--ease), border-color .2s ease, background-color .2s ease, box-shadow .3s var(--ease);
}
/* "lock-on": cuatro esquinas que se cierran sobre el botón */
.btn::before {
  content: ""; position: absolute; inset: -4px; pointer-events: none; opacity: 0;
  --c: var(--accent-line); --l: 8px;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / var(--l) 2px, linear-gradient(var(--c), var(--c)) 0 0 / 2px var(--l),
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--l) 2px, linear-gradient(var(--c), var(--c)) 100% 0 / 2px var(--l),
    linear-gradient(var(--c), var(--c)) 0 100% / var(--l) 2px, linear-gradient(var(--c), var(--c)) 0 100% / 2px var(--l),
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--l) 2px, linear-gradient(var(--c), var(--c)) 100% 100% / 2px var(--l);
  background-repeat: no-repeat;
  transform: scale(1.35);
  transition: opacity .25s ease, transform .35s var(--ease);
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent-line); }
.btn:hover::before { opacity: 1; transform: scale(1); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-acceso {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent-line); font-weight: 700;
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 22px -6px var(--accent-glow);
}
.btn-acceso:hover { box-shadow: 0 0 0 5px var(--accent-soft), 0 0 30px -4px var(--accent-glow); }
.btn-acceso .fa-arrow-right { transition: transform .25s var(--ease); }
.btn-acceso:hover .fa-arrow-right { transform: translateX(4px); }
.btn-lg { min-height: 60px; padding: 0 34px; font-size: .98rem; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; position: relative; padding-bottom: 3px;
  font-family: var(--font-mono); font-size: .84rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  transition: gap .25s var(--ease), color .2s ease;
}
.link-arrow::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); transform: scaleX(.18); transform-origin: left; transition: transform .35s var(--ease); }
.link-arrow:hover { gap: 13px; }
.link-arrow:hover::after { transform: scaleX(1); }

/* ---------- Cabecera ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.strip { height: var(--strip-h); border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.strip .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.strip-state { display: inline-flex; align-items: center; gap: 8px; }
.strip-state::before { content: ""; width: 6px; height: 6px; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); animation: blink 2.4s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.strip-clock { font-variant-numeric: tabular-nums; min-width: 8ch; text-align: right; }
.bar { height: var(--bar-h); }
.bar .wrap { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; flex: none; }
.logo { height: 30px; width: auto; transition: filter .2s ease, transform .3s var(--ease); }
.brand:hover .logo { transform: translateX(2px); animation: flick .35s steps(2) 1; }
@keyframes flick { 0% { opacity: .35; } 40% { opacity: 1; } 60% { opacity: .5; } 100% { opacity: 1; } }
:root[data-theme="dark"] .logo-light, :root:not([data-theme="dark"]) .logo-dark { display: none; }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a {
  position: relative; padding: 6px 0;
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  transition: color .2s ease;
}
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease); }
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: var(--r);
  border: 1px solid var(--line-strong); background: transparent;
  display: inline-grid; place-items: center;
  transition: border-color .2s ease, transform .25s var(--ease), color .2s ease;
}
.icon-btn:hover { border-color: var(--accent-line); color: var(--accent-text); transform: rotate(-8deg); }
.icon-btn:active { transform: scale(.94); }
.sfx-btn .fa-volume-xmark { display: none; }
.sfx-btn[aria-pressed="false"] .fa-volume-high { display: none; }
.sfx-btn[aria-pressed="false"] .fa-volume-xmark { display: inline; }

/* ---------- Hero ---------- */
.hero { min-height: calc(100dvh - var(--nav-h)); display: flex; align-items: center; padding-block: 48px 72px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero-copy { display: grid; gap: 24px; }
.hero-copy .lead { max-width: 48ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.hero-art { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.hero-art img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.hero-art::after { animation: sweep 7s linear infinite; animation-delay: 1.2s; }

/* ---------- Catálogo ---------- */
.prod-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; }
.prod {
  display: flex; flex-direction: column;
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .25s ease, transform .35s var(--ease), box-shadow .35s var(--ease);
}
.prod:hover { border-color: var(--accent-line); transform: translateY(-3px); box-shadow: 0 18px 40px -26px var(--accent-glow); }
.prod-art { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.prod-art img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.prod-body { padding: clamp(22px, 3vw, 34px); display: grid; gap: 16px; flex: 1; align-content: start; }
.prod-sub { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.prod-desc { color: var(--muted); max-width: 52ch; }
.mods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mods li {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 12px 10px 16px; font-size: .9rem; background: color-mix(in oklab, var(--bg) 80%, transparent);
  transition: border-color .2s ease, padding-left .3s var(--ease), background-color .2s ease;
}
.mods li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform .3s var(--ease); }
.mods li:hover { border-color: var(--accent-line); padding-left: 20px; background: var(--accent-soft); }
.mods li:hover::before { transform: scaleY(1); }
.prod-note { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .02em; padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.prod-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: auto; padding-top: 6px; }
.prod-bill { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- Plataforma ---------- */
.bento { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.cell {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: clamp(22px, 3vw, 32px); display: grid; gap: 10px; align-content: end; min-height: 200px;
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  transition: border-color .25s ease, transform .35s var(--ease);
}
.cell:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.cell p { color: var(--muted); max-width: 44ch; }
.cell:nth-child(1) { grid-column: span 3; }
.cell:nth-child(2) { grid-column: span 2; background: var(--accent-soft); border-color: var(--accent-line); }
.cell:nth-child(2) p { color: var(--text); }
.cell:nth-child(3) { grid-column: span 2; background: color-mix(in oklab, var(--surface-2) 88%, transparent); }
.cell:nth-child(4) {
  grid-column: span 3;
  background: repeating-linear-gradient(135deg, transparent 0 14px, var(--line) 14px 15px), color-mix(in oklab, var(--surface) 88%, transparent);
}

/* ---------- Pasos ---------- */
.rail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); }
.rail li { padding: 28px 28px 8px 0; position: relative; display: grid; gap: 8px; align-content: start; }
.rail li::before {
  content: ""; position: absolute; top: -6px; left: 0; width: 11px; height: 11px;
  background: var(--accent); border: 1px solid var(--accent-line);
  transition: transform .4s var(--ease), box-shadow .3s ease;
}
.rail li:hover::before { transform: rotate(45deg) scale(1.35); box-shadow: 0 0 16px var(--accent-glow); }
.rail h3 { font-size: 1.25rem; }
.rail p { color: var(--muted); max-width: 32ch; }

/* ---------- Facturación ---------- */
.bill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 880px; }
.bill-card {
  border: 1px solid var(--line); border-radius: var(--r); padding: 28px;
  background: color-mix(in oklab, var(--surface) 88%, transparent); display: grid; gap: 10px;
  transition: border-color .25s ease, transform .35s var(--ease);
}
.bill-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.bill-card p { color: var(--muted); }
.bill-card.is-anual { border-color: var(--accent-line); background: var(--accent-soft); }
.bill-card.is-anual p { color: var(--text); }

/* ---------- A medida ---------- */
.medida-box { display: grid; gap: 22px; max-width: 760px; }
.medida-box h2 { font-size: clamp(1.6rem, 3.6vw, 2.6rem); }

/* ---------- Banda de acceso ---------- */
.acceso-band { background: color-mix(in oklab, var(--surface) 90%, transparent); }
.acceso-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; }
.acceso-inner div { display: grid; gap: 8px; }

/* ---------- Pie ---------- */
.foot { border-top: 1px solid var(--line); padding-block: 40px; color: var(--muted); font-family: var(--font-mono); font-size: .76rem; letter-spacing: .06em; background: color-mix(in oklab, var(--bg) 80%, transparent); }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 22px; }
.foot nav a { transition: color .2s ease; }
.foot nav a:hover { color: var(--text); }

/* ---------- Entrada al hacer scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(18px); clip-path: inset(0 0 12% 0); transition: opacity .7s var(--ease), transform .7s var(--ease), clip-path .8s var(--ease); }
  .js [data-reveal].in { opacity: 1; transform: none; clip-path: inset(0); }
  .js [data-reveal][data-d="1"] { transition-delay: .09s; }
  .js [data-reveal][data-d="2"] { transition-delay: .18s; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav-links, .strip-mid { display: none; }
  .bar .wrap { justify-content: space-between; }
  .nav-actions { margin-left: auto; }
  .hero { min-height: 0; padding-block: 40px 56px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 360px; }
  .prod-grid { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .cell:nth-child(n) { grid-column: auto; min-height: 0; }
  .rail { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--line-strong); }
  .rail li { padding: 4px 0 28px 28px; }
  .rail li::before { top: 8px; left: -6px; }
  .bill-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .mods { grid-template-columns: 1fr; }
  .btn-lg, .hero-cta .btn { width: 100%; }
  .bar .btn-acceso { padding: 0 14px; }
  .logo { height: 26px; }
}
