/* ==========================================================================
   RED DEVIL CONSULTING — división empresarial de Red Devil Studios
   Sobria a propósito: sin efectos de juego, sin cursor custom, sin sonido.
   ========================================================================== */

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --ink: #111113;
  --ink-2: #3a3a40;
  --muted: #6b6b73;
  --line: #e6e3de;
  --line-strong: #cfcbc4;
  --accent: #b3102a;
  --accent-hover: #8f0c21;
  --accent-on-dark: #f0566a;
  --dark: #0e0e10;
  --on-dark: #f2f1ee;
  --on-dark-muted: #a3a3ab;
  --on-dark-line: rgba(255, 255, 255, 0.12);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: white; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: white;
  font-weight: 600;
  text-decoration: none;
}

.skip:focus { top: 1rem; }

/* ==========================================================================
   TOPBAR — selector de divisiones
   ========================================================================== */

.topbar {
  background: var(--dark);
  color: var(--on-dark-muted);
  font-size: 0.78rem;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.4rem;
}

.topbar__divisions { display: flex; align-items: center; gap: 1.1rem; }

.topbar__group {
  padding-right: 1.1rem;
  border-right: 1px solid var(--on-dark-line);
  color: var(--on-dark);
  font-weight: 600;
}

.topbar a { text-decoration: none; transition: color 160ms ease; }
.topbar a:hover { color: white; }
.topbar__divisions a[aria-current="page"] { color: white; box-shadow: inset 0 -2px 0 var(--accent-on-dark); padding-block: 0.6rem; }

.topbar__meta { display: none; }
@media (min-width: 720px) { .topbar__meta { display: block; } }

/* ==========================================================================
   HEADER
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 247, 0.9);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}

.header.is-scrolled { border-bottom-color: var(--line); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--accent);
  color: white;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

.brand__text { display: flex; flex-direction: column; line-height: 1; }

.brand__name {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand__div {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.brand--dark { color: var(--on-dark); }
.brand--dark .brand__div { color: var(--on-dark-muted); }

.nav { display: none; gap: 2.2rem; }
@media (min-width: 960px) { .nav { display: flex; } }

.nav a {
  position: relative;
  padding: 0.5rem 0;
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 160ms ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.1rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms var(--ease);
}

.nav a:hover, .nav a.is-active { color: var(--ink); }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); }

.header__actions { display: flex; align-items: center; gap: 0.75rem; }

.lang-switch { display: inline-flex; border: 1px solid var(--line-strong); }

.lang-switch button {
  min-width: 2.4rem;
  min-height: 2.25rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: 600 0.75rem/1 var(--sans);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: white; }

.header__actions .header__cta { display: none; }
@media (min-width: 640px) { .header__actions .header__cta { display: inline-flex; } }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.25rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line-strong);
  background: none;
  color: var(--ink);
  font: 500 0.88rem/1 var(--sans);
  cursor: pointer;
}

@media (min-width: 960px) { .menu-toggle { display: none; } }

.menu-toggle__icon { display: grid; gap: 4px; width: 14px; }
.menu-toggle__icon i { display: block; height: 1.5px; background: currentColor; transition: transform 200ms var(--ease); }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon i:first-child { transform: translateY(2.75px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon i:last-child { transform: translateY(-2.75px) rotate(-45deg); }

.mobile-nav {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.mobile-nav .wrap { display: grid; padding-block: 0.5rem 1.25rem; }

.mobile-nav a {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  text-decoration: none;
}

.mobile-nav a.mobile-nav__games {
  border-bottom: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.9rem;
}

@media (min-width: 960px) { .mobile-nav { display: none !important; } }

/* ==========================================================================
   BOTONES
   ========================================================================== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.1rem;
  padding: 0 1.6rem;
  border: 1px solid transparent;
  font: 600 0.95rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.button--small { min-height: 2.25rem; padding: 0 1rem; font-size: 0.85rem; }

.button--primary { background: var(--accent); color: white; }
.button--primary:hover { background: var(--accent-hover); }

.button--light { background: white; color: var(--ink); }
.button--light:hover { background: #f1efeb; }

.button--outline-light { border-color: rgba(255, 255, 255, 0.55); background: transparent; color: white; }
.button--outline-light:hover { border-color: white; background: rgba(255, 255, 255, 0.1); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 180ms ease;
}

.link-arrow span[aria-hidden] { transition: transform 220ms var(--ease); }
.link-arrow:hover { border-color: var(--ink); }
.link-arrow:hover span[aria-hidden] { transform: translateX(4px); }

/* ==========================================================================
   TIPOGRAFÍA DE SECCIÓN
   ========================================================================== */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before { content: ""; width: 1.75rem; height: 1px; background: currentColor; }

.section { padding: clamp(4.5rem, 9vw, 7.5rem) 0; border-top: 1px solid var(--line); }
.section--surface { background: var(--surface); }

.section__head { display: grid; gap: 1.25rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section__head .section__title { margin-top: 1.1rem; }

@media (min-width: 960px) {
  .section__head--split { grid-template-columns: 1.1fr 1fr; align-items: end; gap: 5rem; }
}

.section__title {
  max-width: 40rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.section__lead {
  max-width: 36rem;
  color: var(--ink-2);
  font-size: 1.1rem;
  line-height: 1.65;
}

/* ==========================================================================
   HERO
   ========================================================================== */

.hero { padding: clamp(3.5rem, 9vw, 7.5rem) 0 clamp(4rem, 8vw, 6.5rem); }

.hero__grid { display: grid; gap: 3.5rem; }

@media (min-width: 1000px) {
  .hero__grid { grid-template-columns: 1.45fr 1fr; align-items: end; gap: 5rem; }
}

.hero__title {
  margin-top: 1.5rem;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6.4vw, 4.9rem);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.hero__lead {
  max-width: 38rem;
  margin-top: 1.6rem;
  color: var(--ink-2);
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  line-height: 1.6;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2.4rem;
}

.facts { border-top: 2px solid var(--ink); }

.facts__label {
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.facts__grid { display: grid; grid-template-columns: 1fr 1fr; }

.fact {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1.5rem 1.5rem 1.6rem 0;
  border-top: 1px solid var(--line);
}

.fact:nth-child(even) { padding: 1.5rem 0 1.6rem 1.5rem; border-left: 1px solid var(--line); }

.fact__value {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4vw, 3.2rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums;
}

.fact__value span { color: var(--accent); }

.fact__key { color: var(--muted); font-size: 0.9rem; line-height: 1.4; }

/* ==========================================================================
   CAPACIDADES
   ========================================================================== */

.services { border-top: 1px solid var(--ink); }

.service {
  display: grid;
  gap: 1.1rem 2.5rem;
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 900px) {
  .service { grid-template-columns: 4.5rem 1.25fr 1fr; padding: 2.9rem 0; }
}

.service__num {
  padding-top: 0.5rem;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.service__title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.service__body { max-width: 34rem; margin-top: 0.85rem; color: var(--ink-2); line-height: 1.65; }

.service__list { align-self: start; list-style: none; }

.service__list li {
  display: flex;
  gap: 0.8rem;
  padding: 0.72rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

.service__list li:first-child { border-top: 0; }
@media (min-width: 900px) { .service__list li:first-child { padding-top: 0.45rem; } }

.service__list li::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  margin-top: 0.55em;
  background: var(--accent);
}

/* ==========================================================================
   POR QUÉ (oscuro)
   ========================================================================== */

.section--dark { border-top: 0; background: var(--dark); color: var(--on-dark); }
.section--dark .eyebrow { color: var(--accent-on-dark); }
.section--dark .section__lead { color: var(--on-dark-muted); }

.pillars { display: grid; gap: 2.5rem; }
@media (min-width: 860px) { .pillars { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }

.pillar { position: relative; padding-top: 1.6rem; border-top: 1px solid var(--on-dark-line); }

.pillar::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 3rem;
  height: 2px;
  background: var(--accent-on-dark);
}

.pillar__title { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; line-height: 1.2; }
.pillar__body { margin-top: 0.8rem; color: var(--on-dark-muted); line-height: 1.65; }

/* ==========================================================================
   ENFOQUE
   ========================================================================== */

.steps { display: grid; list-style: none; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, 1fr); } }

.step { position: relative; padding: 1.9rem 1.75rem 2rem 0; border-top: 1px solid var(--line-strong); }

.step::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
}

.step__num { color: var(--muted); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; font-variant-numeric: tabular-nums; }
.step__title { margin-top: 0.75rem; font-family: var(--serif); font-size: 1.45rem; font-weight: 500; line-height: 1.2; }
.step__body { margin-top: 0.65rem; color: var(--ink-2); font-size: 0.98rem; line-height: 1.6; }

/* ==========================================================================
   CASOS
   ========================================================================== */

.cases { display: grid; gap: 1.25rem; }
@media (min-width: 860px) {
  .cases { grid-template-columns: repeat(3, 1fr); }
  .case { min-height: 19rem; }
}

.case {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
}

.case--link { transition: border-color 200ms ease, box-shadow 250ms ease, transform 250ms var(--ease); }

.case--link:hover {
  border-color: var(--line-strong);
  box-shadow: 0 22px 44px -28px rgba(17, 17, 19, 0.35);
  transform: translateY(-3px);
}

.case__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.case__kicker { color: var(--accent); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.case__title { margin-top: auto; padding-top: 3rem; font-family: var(--serif); font-size: 1.8rem; font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; }
.case__body { margin-top: 0.75rem; color: var(--ink-2); line-height: 1.6; }
.case__link { display: inline-flex; gap: 0.35rem; color: var(--muted); font-size: 0.85rem; font-weight: 600; white-space: nowrap; transition: color 180ms ease; }
.case--link:hover .case__link { color: var(--accent); }

/* ==========================================================================
   TECNOLOGÍA
   ========================================================================== */

.stack {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  list-style: none;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

@media (min-width: 760px) { .stack { grid-template-columns: repeat(5, 1fr); } }

.stack li {
  display: flex;
  align-items: flex-end;
  min-height: 5.75rem;
  padding: 1.25rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
  font-weight: 500;
}

/* ==========================================================================
   CONTACTO
   ========================================================================== */

.contact { padding: clamp(4.5rem, 9vw, 7rem) 0; background: var(--accent); color: white; }

.contact__grid { display: grid; gap: 2.5rem; }
@media (min-width: 960px) { .contact__grid { grid-template-columns: 1.3fr 1fr; align-items: end; gap: 5rem; } }

.eyebrow--light { color: rgba(255, 255, 255, 0.85); }

.contact__title {
  margin-top: 1.1rem;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.contact__lead { max-width: 34rem; margin-top: 1.25rem; color: rgba(255, 255, 255, 0.86); font-size: 1.15rem; line-height: 1.6; }

.contact__email {
  display: inline-block;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  color: white;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.6vw, 1.85rem);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: border-color 180ms ease;
}

.contact__email:hover { border-color: white; }

.contact__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer { padding: 4rem 0 2rem; background: var(--dark); color: var(--on-dark-muted); font-size: 0.92rem; }

.footer__grid { display: grid; gap: 2.5rem; }
@media (min-width: 640px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .footer__grid { grid-template-columns: 1.5fr 1.2fr 0.8fr 1fr; } }

.footer__about { max-width: 22rem; margin-top: 1.25rem; line-height: 1.6; }

.footer__heading {
  margin-bottom: 1rem;
  color: var(--on-dark);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer ul { display: grid; gap: 0.65rem; list-style: none; }
.footer a { text-decoration: none; transition: color 160ms ease; }
.footer ul a:hover { color: white; }
.footer a[aria-current="page"] { color: var(--on-dark); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--on-dark-line);
  font-size: 0.82rem;
}

/* ==========================================================================
   MOVIMIENTO — sólo con JS (sin JS todo se ve de entrada)
   ========================================================================== */

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
