/* RMEI landing — strict black/white editorial minimal theme.
   Display: Fraunces (serif). Body: Manrope (sans).
   No gradients, no color accents: ink/paper only. */

:root {
  --paper: #fafaf8;
  --paper-deep: #f1f0ec;
  --ink: #111110;
  --ink-soft: #3d3d3a;
  --ink-mute: #6f6e69;
  --line: #dcdad3;
  --line-strong: #111110;
  --card: #ffffff;
  --radius: 14px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  --max: 1120px;
  --shadow: 0 1px 0 rgba(17, 17, 16, 0.06), 0 18px 44px -28px rgba(17, 17, 16, 0.35);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Subtle paper grain via layered radial dots (monochrome, no gradients of color) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: radial-gradient(rgba(17, 17, 16, 0.055) 1px, transparent 1px);
  background-size: 22px 22px;
}

main,
.site-footer {
  position: relative;
  z-index: 1;
}

.container {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 5.4vw, 4.1rem); margin: 0.6rem 0 1rem; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 0.5rem 0 0.75rem; }
h3 { font-size: 1.28rem; margin: 0.4rem 0 0.5rem; }

p { margin: 0 0 1rem; }

a { color: inherit; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  transition: top 0.2s ease;
}

.skip-link:focus { top: 0.75rem; }

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px -22px rgba(17, 17, 16, 0.45);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: 2rem;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.site-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.site-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

.nav-cta {
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.45rem 1.05rem;
}

.nav-cta:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  width: 44px;
  height: 40px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 5px 9px;
  background: var(--ink);
}

/* Hero */
.hero {
  padding: 8.5rem 0 3.5rem;
  border-bottom: 1.5px solid var(--line-strong);
}

.hero-copy { max-width: 46rem; }

.kicker {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

.kicker .rule {
  display: inline-block;
  width: 2.6rem;
  height: 2px;
  background: var(--ink);
}

.lede {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 36rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1.6rem 0 2rem;
}

.btn {
  display: inline-block;
  border-radius: 999px;
  padding: 0.8rem 1.55rem;
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-block { width: 100%; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.hero-stats dt {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.hero-stats dd { margin: 0.2rem 0 0; font-weight: 700; }

/* Sections + cards */
.section { padding: 4.5rem 0; }
.section-alt {
  background: var(--ink);
  color: var(--paper);
}

.section-alt .kicker { color: #cfcdc5; }
.section-alt .kicker .rule { background: var(--paper); }

.section-head { max-width: 46rem; margin-bottom: 2.2rem; }
.section-lede { color: var(--ink-soft); }
.section-alt .section-lede { color: #cfcdc5; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 2px 0 rgba(17, 17, 16, 0.08), 0 26px 50px -30px rgba(17, 17, 16, 0.5);
}

.card-index {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0;
}

.card p { color: var(--ink-soft); }
.card ul {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.93rem;
}

/* Process: editorial ledger. Hairlines separate real phases (content
   dividers, not decoration). Two-column verb/body rows on desktop,
   single stacked column under 768px. */
.process {
  list-style: none;
  margin: 2.2rem 0 0;
  padding: 0;
  border-top: 1px solid #3a3a37;
}

.process-phase {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 0.6rem 2.5rem;
  align-items: baseline;
  padding: 1.7rem 0;
  border-bottom: 1px solid #3a3a37;
}

.process-phase h3 {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.process-phase p {
  margin: 0;
  color: #cfcdc5;
  max-width: 38rem;
}

/* Narrative stagger: phases enter in the order they happen. */
.process .process-phase:nth-child(2) { transition-delay: 0.08s; }
.process .process-phase:nth-child(3) { transition-delay: 0.16s; }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2.5rem;
  align-items: start;
}

.contact-points {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.55rem;
}

.form {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 1.7rem;
}

.field { margin-bottom: 1.05rem; }

label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

input, select, textarea {
  width: 100%;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  padding: 0.7rem 0.85rem;
}

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: #000;
  background: #ececea;
}

.field-error {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: #000;
}

.form-status {
  min-height: 1.5em;
  font-weight: 600;
  border-radius: 10px;
  padding: 0;
}

.form-status.is-success,
.form-status.is-error {
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  border: 1.5px solid var(--ink);
}

.form-status.is-success { background: var(--ink); color: var(--paper); }
.form-status.is-error { background: var(--paper-deep); color: var(--ink); }

.form-hint { font-size: 0.84rem; color: var(--ink-mute); margin: 0.8rem 0 0; }

/* Footer: 4 columns (brand / navigation / services / contact) + bottom bar */
.site-footer {
  border-top: 1.5px solid var(--line-strong);
  padding: 2.6rem 0 1.6rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.footer-logo {
  display: block;
  height: 2.75rem;
  width: auto;
  margin-bottom: 0.7rem;
}

.footer-note, .footer-meta {
  color: var(--ink-mute);
  font-size: 0.9rem;
  margin: 0.4rem 0 0;
}

.footer-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.8rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-links a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.93rem;
}

.footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

.footer-cta { margin-top: 0.9rem; }

.footer-bottom {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding-top: 1.2rem;
}

.footer-meta a {
  font-weight: 600;
  text-decoration: none;
}

.footer-meta a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Legal pages: readable prose, same type scale */
.legal { max-width: 46rem; }

.legal h2 {
  font-size: 1.25rem;
  margin: 2.2rem 0 0.6rem;
}

.legal h2:first-child { margin-top: 0; }

.legal p,
.legal li {
  color: var(--ink-soft);
  line-height: 1.7;
}

.legal ul {
  padding-left: 1.2rem;
  display: grid;
  gap: 0.4rem;
}

/* Subtle reveal on scroll (progressively enhanced by JS) */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Clickable service cards: stretched accessible link, reveal untouched */
.card { position: relative; }

.card-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

/* Stretched clickable area over the whole card */
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.card-link:hover { text-decoration-thickness: 2.5px; }

.card-link:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Detail pages: hero, problem/solution, deliverables, cross-nav */
.detail-hero { padding: 8.5rem 0 3rem; }

.detail-hero .lede { max-width: 42rem; }

.breadcrumb {
  display: inline-block;
  margin-bottom: 1.2rem;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
}

.breadcrumb:hover { background: var(--ink); color: var(--paper); }

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  margin: 1.6rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.detail-meta dt {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.detail-meta dd { margin: 0.15rem 0 0; font-weight: 700; }

.problem-solution {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.problem-card,
.solution-card {
  border-radius: var(--radius);
  padding: 1.6rem;
  border: 1.5px solid var(--ink);
}

.problem-card { background: var(--paper-deep); }

.solution-card {
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
}

.solution-card p { color: #cfcdc5; }

.problem-card h3,
.solution-card h3 { margin-top: 0; }

.deliverables {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.deliverables li {
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--card);
  padding: 0.9rem 1.1rem;
  font-size: 0.94rem;
}

.deliverables li strong { display: block; }

.cta-band {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
}

.cta-band p { color: var(--ink-soft); max-width: 34rem; margin-inline: auto; }

.related {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

/* Workflow timeline: vertical rail with progressing line (CSS-only).
   JS only toggles .is-visible on .flow; staggered cards reuse .reveal. */
.flow {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 0.5rem 3.2rem;
}

/* Static track */
.flow::before {
  content: "";
  position: absolute;
  left: 1.05rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

/* Progress fill: grows when visible; marching dashes ride on it (desktop) */
.flow-fill {
  position: absolute;
  left: 1.05rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.6s ease 0.2s;
}

.flow.is-visible .flow-fill { transform: scaleY(1); }

.flow-step {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.1rem;
}

.flow-step:last-child { margin-bottom: 0; }

/* Node dot on the rail */
.flow-step::before {
  content: "";
  position: absolute;
  left: -2.55rem;
  top: 1.6rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--paper);
  border: 2.5px solid var(--ink);
}

/* Stagger: cards enter one after another once observed */
.flow .flow-step:nth-child(2) { transition-delay: 0.08s; }
.flow .flow-step:nth-child(3) { transition-delay: 0.16s; }
.flow .flow-step:nth-child(4) { transition-delay: 0.24s; }
.flow .flow-step:nth-child(5) { transition-delay: 0.32s; }
.flow .flow-step:nth-child(6) { transition-delay: 0.4s; }

.flow-step-index {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 0.2rem;
}

.flow-step p { color: var(--ink-soft); margin-bottom: 0; }

/* Animated dash connector between steps (desktop only) */
@media (min-width: 901px) {
  .flow.is-visible .flow-fill {
    background-image: repeating-linear-gradient(
      to bottom,
      var(--ink) 0,
      var(--ink) 5px,
      transparent 5px,
      transparent 11px
    );
    background-size: 2px 22px;
    animation: dash-advance 1.1s linear infinite;
  }
}

@keyframes dash-advance {
  to { background-position-y: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card:hover { transform: none; }
  .flow-fill { transform: none; transition: none; animation: none; }
  .flow.is-visible .flow-fill { animation: none; }
}

/* Responsive */
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 72px;
    right: 1.25rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    background: var(--card);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.7rem;
    min-width: 220px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 0.6rem 0.8rem; border-radius: 8px; }
  .site-nav a:hover { background: var(--paper-deep); }
  .cards, .hero-stats { grid-template-columns: 1fr; }
  .process-phase { grid-template-columns: 1fr; gap: 0.4rem; padding: 1.4rem 0; }
  .hero { padding-top: 7rem; }
  .detail-hero { padding-top: 7rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .problem-solution, .deliverables { grid-template-columns: 1fr; }
  .flow { padding-left: 2.6rem; }
  .flow-step::before { left: -2.05rem; }
}

/* ==========================================================================
   Extensiones de diseño editorial: Herramientas, Principios IA y Sectores
   ========================================================================== */

/* Badges y etiquetas editoriales */
.badge-standalone {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--paper-deep);
  color: var(--ink);
  margin-bottom: 0.8rem;
}

.badge-inverted {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.tool-tags li {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.tool-notice {
  margin-top: 2rem;
  padding: 1.2rem 1.4rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-deep);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.tool-notice p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  max-width: 44rem;
}

/* Principios de IA (en sección oscura o clara) */
.ai-principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 2.2rem;
}

.ai-card {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 2px solid var(--paper);
  border-radius: var(--radius);
  padding: 1.6rem;
  background: rgba(255, 255, 255, 0.04);
}

.ai-card h3 {
  color: var(--paper);
  margin-top: 0;
  font-size: 1.25rem;
}

.ai-card p {
  color: #cfcdc5;
  font-size: 0.94rem;
  margin-bottom: 0;
}

.ai-card-index {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: #9d9c96;
  margin: 0 0 0.5rem;
}

/* Grid de sectores */
.sector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}

.sector-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sector-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 0 rgba(17, 17, 16, 0.08), 0 24px 44px -26px rgba(17, 17, 16, 0.45);
}

.sector-card h3 {
  margin-top: 0;
  font-size: 1.25rem;
}

.sector-card p {
  margin-bottom: 0.8rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.sector-meta {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  display: block;
  margin-bottom: 0.35rem;
}

/* Responsive para nuevos componentes */
@media (max-width: 900px) {
  .ai-principles-grid { grid-template-columns: 1fr; }
  .sector-grid { grid-template-columns: 1fr; }
}

