/* Portal Exclie | Renkiso
   Layout: portada partida en dos puertas (izquierda Exclie, derecha Renkiso) que crecen al pasar el
   mouse; debajo, secciones de lectura en una columna. Cada puerta conserva el color de su marca
   (fijo, no sigue el tema); las secciones de lectura sí siguen el tema del visitante. */

:root {
  /* Exclie: azul-gris profundo + menta (del favicon oficial) */
  --ex-bg: oklch(0.155 0.012 240);
  --ex-bg-2: oklch(0.20 0.014 240);
  --ex-fg: oklch(0.96 0.005 240);
  --ex-fg-2: oklch(0.78 0.01 240);
  --ex-accent: oklch(0.74 0.13 165);
  --ex-accent-ink: oklch(0.15 0.03 165);

  /* Renkiso: papel frío + tinta + AZUL de marca (el mismo --accent de renkiso.com; Gustavo 2026-10-07, sustituye al rojo hanko de D-INV4) */
  --rk-bg: #f3f3f0;
  --rk-bg-2: #e9e9e4;
  --rk-fg: #121214;
  --rk-fg-2: #4f4f55;
  --rk-blue: #4a9eff;                       /* azul de marca: marca de agua y viñetas (no lleva texto encima) */
  --rk-seal: #1e66c8;                       /* mismo tono, más tinta: texto, bordes y fondos con texto blanco (4.98:1 sobre --rk-bg) */
  --rk-seal-soft: rgba(74, 158, 255, 0.12);

  /* Secciones de lectura (tema claro) */
  --bg: #fafaf8;
  --bg-2: #f0f0ec;
  --fg: #16161a;
  --fg-2: #5a5a62;
  --line: #dcdcd6;
  --accent: #0f766e;

  --f-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --f-mincho: "Shippori Mincho", "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --f-kanji: "Noto Serif JP", "Shippori Mincho", "Hiragino Mincho ProN", serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --measure: 62ch;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111114; --bg-2: #17171b; --fg: #ededea; --fg-2: #a3a3a8; --line: #2a2a30; --accent: #5fd4b8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111114; --bg-2: #17171b; --fg: #ededea; --fg-2: #a3a3a8; --line: #2a2a30; --accent: #5fd4b8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.12; letter-spacing: -0.02em; }
p { margin: 0; }
.eyebrow {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Puertas ---------- */
.repartidor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100svh;
  transition: grid-template-columns 0.45s var(--ease);
}
.puerta {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.5rem, 4vw, 3.5rem) var(--gutter);
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  text-decoration: none;
}
.puerta-exclie { background: var(--ex-bg); color: var(--ex-fg); }
.puerta-renkiso { background: var(--rk-bg); color: var(--rk-fg); }

/* Kanji de fondo: grande, discreto, nunca estorba al texto */
.puerta .fondo-kanji {
  position: absolute;
  right: -0.08em;
  top: 0.02em;
  font-size: clamp(14rem, 34vw, 30rem);
  line-height: 1;
  z-index: -1;
  user-select: none;
  pointer-events: none;
  font-weight: 500;
  transition: transform 0.6s var(--ease), opacity 0.6s var(--ease);
}
.puerta-exclie .fondo-kanji { font-family: var(--f-kanji); color: var(--ex-accent); opacity: 0.10; }
.puerta-renkiso .fondo-kanji { font-family: var(--f-mincho); color: var(--rk-blue); opacity: 0.11; }

.puerta .marca { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.puerta .marca img { width: 2.25rem; height: 2.25rem; border-radius: 0.5rem; }
.puerta-renkiso .marca img { width: auto; height: 1.6rem; border-radius: 0; }
.puerta .marca .nombre { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; }
.puerta-renkiso .marca .nombre { font-family: var(--f-mincho); font-weight: 700; }

.puerta h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); max-width: 16ch; }
.puerta-renkiso h2 { font-family: var(--f-mincho); font-weight: 600; }
.puerta .linea { margin-top: 0.75rem; font-size: 1.05rem; max-width: 42ch; }
.puerta-exclie .linea { color: var(--ex-fg-2); }
.puerta-renkiso .linea { color: var(--rk-fg-2); }

/* Detalle: cerrado en reposo, abre con hover/foco (escritorio) y siempre visible en móvil */
.puerta .detalle {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s var(--ease), opacity 0.35s var(--ease), margin-top 0.45s var(--ease);
  opacity: 0;
  margin-top: 0;
}
.puerta .detalle > div { overflow: hidden; min-height: 0; }
.puerta .detalle ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; max-width: 46ch; }
.puerta .detalle li { padding-left: 1.1rem; position: relative; font-size: 0.98rem; }
.puerta .detalle li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.45rem; height: 0.45rem; }
.puerta-exclie .detalle li::before { background: var(--ex-accent); border-radius: 50%; }
.puerta-renkiso .detalle li::before { background: var(--rk-blue); }

.acciones { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.25rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.1rem; border-radius: 999px;
  font: 500 0.95rem/1 var(--f-sans); text-decoration: none; cursor: pointer;
  border: 1px solid currentColor; background: transparent; color: inherit;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn svg { width: 1em; height: 1em; }
.puerta-exclie .btn-primario { background: var(--ex-accent); color: var(--ex-accent-ink); border-color: var(--ex-accent); }
.puerta-exclie .btn-primario:hover { background: oklch(0.80 0.13 165); }
.puerta-exclie .btn:not(.btn-primario):hover { background: rgba(255,255,255,0.08); }
.puerta-renkiso .btn-primario { background: var(--rk-fg); color: var(--rk-bg); border-color: var(--rk-fg); }
.puerta-renkiso .btn-primario:hover { background: var(--rk-seal); border-color: var(--rk-seal); color: #fff; }
.puerta-renkiso .btn:not(.btn-primario):hover { background: var(--rk-seal-soft); border-color: var(--rk-seal); color: var(--rk-seal); }

@media (hover: hover) and (min-width: 761px) {
  .repartidor:has(.puerta-exclie:hover),
  .repartidor:has(.puerta-exclie:focus-within) { grid-template-columns: 1.35fr 0.65fr; }
  .repartidor:has(.puerta-renkiso:hover),
  .repartidor:has(.puerta-renkiso:focus-within) { grid-template-columns: 0.65fr 1.35fr; }
  .puerta:hover .detalle, .puerta:focus-within .detalle, .puerta.abierta .detalle {
    grid-template-rows: 1fr; opacity: 1; margin-top: 1.25rem;
  }
  .puerta:hover .fondo-kanji, .puerta:focus-within .fondo-kanji { transform: translate(-2%, -2%) scale(1.04); }
}
@media (max-width: 760px), (hover: none) {
  .repartidor { grid-template-columns: 1fr; min-height: 0; }
  .puerta { min-height: 78svh; justify-content: flex-end; }
  .puerta .detalle { grid-template-rows: 1fr; opacity: 1; margin-top: 1.25rem; }
  .puerta .fondo-kanji { font-size: clamp(12rem, 60vw, 20rem); }
}

/* Franja fina al pie de las puertas */
.sello-linea {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem;
  padding: 0.9rem var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--fg-2);
  font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.sello-linea a { text-decoration: none; }
.sello-linea a:hover { color: var(--fg); }

/* ---------- Secciones de lectura ---------- */
.seccion { padding-block: clamp(3.5rem, 8vw, 7rem); padding-inline: var(--gutter); }
.seccion + .seccion { border-top: 1px solid var(--line); }
.seccion.alterna { background: var(--bg-2); }
.contenedor { max-width: 1100px; margin-inline: auto; }
.seccion .eyebrow { color: var(--accent); margin-bottom: 0.9rem; }
.seccion h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); max-width: 22ch; }
.seccion .intro { margin-top: 1rem; font-size: 1.1rem; color: var(--fg-2); max-width: var(--measure); }

.simbolos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 2.5rem; margin-top: 3rem; }
.simbolo { display: grid; gap: 1rem; min-width: 0; }
.simbolo .glifo {
  font-size: clamp(5.5rem, 12vw, 8.5rem); line-height: 1; font-weight: 500;
  display: flex; align-items: flex-end; gap: 0.1em; flex-wrap: wrap;
}
.simbolo-exclie .glifo { font-family: var(--f-kanji); color: var(--ex-accent); }
.simbolo-renkiso .glifo { font-family: var(--f-mincho); color: var(--rk-seal); }
.simbolo .lecturas { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; font-family: var(--f-mono); font-size: 0.78rem; color: var(--fg-2); }
.simbolo .lecturas b { color: var(--fg); font-weight: 500; }
.simbolo h3 { font-size: 1.35rem; margin-top: 0.25rem; }
.simbolo-renkiso h3 { font-family: var(--f-mincho); }
.simbolo p { max-width: var(--measure); color: var(--fg-2); }
.simbolo p b { color: var(--fg); font-weight: 600; }
.simbolo blockquote { margin: 0.5rem 0 0; padding-left: 1rem; border-left: 2px solid var(--accent); font-style: italic; max-width: var(--measure); }
.simbolo-renkiso blockquote { border-color: var(--rk-seal); font-family: var(--f-mincho); font-style: normal; }

.tres-kanji { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-top: 0.5rem; }
.tres-kanji div { border: 1px solid var(--line); padding: 0.9rem 0.75rem; display: grid; gap: 0.25rem; min-width: 0; }
.tres-kanji .k { font-family: var(--f-mincho); font-size: 2rem; line-height: 1; color: var(--rk-seal); }
.tres-kanji .r { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.12em; color: var(--fg-2); }
.tres-kanji .s { font-size: 0.86rem; }

/* Tipografía: muestra en vivo */
.tipos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1.25rem; margin-top: 2.5rem; }
.tipo { border: 1px solid var(--line); padding: 1.5rem; display: grid; gap: 0.75rem; min-width: 0; }
.tipo .muestra { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.1; }
.tipo-exclie .muestra { font-family: var(--f-sans); font-weight: 600; letter-spacing: -0.02em; }
.tipo-renkiso .muestra { font-family: var(--f-mincho); font-weight: 600; }
.tipo .nota { color: var(--fg-2); font-size: 0.95rem; max-width: 48ch; }
.tipo .etiqueta { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-2); }
.hanko {
  display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem;
  border: 2px solid var(--rk-seal); color: var(--rk-seal); font-family: var(--f-mincho); font-weight: 700; font-size: 1.1rem;
}

/* Cifras / hechos */
.hechos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1.25rem; margin-top: 2.5rem; }
.hecho { display: grid; gap: 0.5rem; padding: 1.25rem 0 0; border-top: 2px solid var(--accent); min-width: 0; }
.hecho .n { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hecho .t { color: var(--fg-2); max-width: 36ch; }
.enlace-flecha { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 2rem; font-weight: 500; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 0.1rem; }
.enlace-flecha:hover { color: var(--accent); }

/* ---------- Página de inversionistas ---------- */
.cabecera-doc {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem;
  padding: 0.8rem var(--gutter); background: var(--bg); border-bottom: 1px solid var(--line);
}
.cabecera-doc a { text-decoration: none; font-weight: 500; }
.cabecera-doc nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.9rem; color: var(--fg-2); }
.cabecera-doc nav a:hover { color: var(--fg); }
.doc { max-width: 76ch; margin-inline: auto; padding-block: clamp(2.5rem, 6vw, 5rem); padding-inline: var(--gutter); }
.doc > header { margin-bottom: 3rem; }
.doc h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.doc .lead { margin-top: 1rem; font-size: 1.15rem; color: var(--fg-2); }
.doc section { padding-top: 3rem; margin-top: 3rem; border-top: 1px solid var(--line); scroll-margin-top: 4.5rem; }
.doc h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 0.5rem; }
.doc h3 { font-size: 1.1rem; margin-top: 2rem; }
.doc p { margin-top: 1rem; }
.doc p + p { margin-top: 0.9rem; }
.doc strong { font-weight: 600; }
.doc .cifra { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; letter-spacing: -0.02em; margin-top: 1.5rem; padding: 1.25rem; border-left: 3px solid var(--accent); background: var(--bg-2); }
.doc .respaldo { margin-top: 1.25rem; font-size: 0.9rem; color: var(--fg-2); border-top: 1px dashed var(--line); padding-top: 0.75rem; }
.doc ul { margin: 1rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.45rem; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 1.25rem; font-size: 0.95rem; }
.doc .tabla { overflow-x: auto; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--line); }
.doc th { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-2); font-weight: 500; }
.doc td.si { color: var(--accent); font-weight: 600; }
.doc .estado { display: inline-block; font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.2rem 0.5rem; border: 1px solid var(--line); border-radius: 999px; color: var(--fg-2); margin-left: 0.4rem; vertical-align: middle; }
.doc .estado.ok { border-color: var(--accent); color: var(--accent); }
.doc .cierre { margin-top: 3rem; padding: 1.5rem; border: 1px solid var(--line); display: grid; gap: 0.75rem; }
.doc .cierre .acciones { margin-top: 0.25rem; }
.doc .btn { border-color: var(--fg); }
.doc .btn-primario { background: var(--fg); color: var(--bg); }
.doc .btn-primario:hover { background: var(--accent); border-color: var(--accent); color: #0b1a16; }

/* ---------- Pie ---------- */
.pie { padding: 2.5rem var(--gutter) calc(2.5rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); color: var(--fg-2); font-size: 0.9rem; }
.pie .contenedor { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.pie a { text-decoration: none; }
.pie a:hover { color: var(--fg); }
.pie .correo { font-family: var(--f-mono); user-select: all; }

/* ---------- Modal de video ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--gutter); background: rgba(8, 8, 10, 0.78); }
.modal .caja { width: min(960px, 100%); background: #111114; color: #ededea; border: 1px solid #2a2a30; display: grid; gap: 0; overflow: hidden; }
.modal .barra { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.75rem 1rem; border-bottom: 1px solid #2a2a30; }
.modal .barra .titulo { font-weight: 600; }
.modal .cerrar { background: none; border: 1px solid #3a3a42; color: inherit; border-radius: 999px; width: 2.2rem; height: 2.2rem; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.modal .cerrar:hover { border-color: #ededea; }
.modal .pantalla { aspect-ratio: 16 / 9; max-width: 100%; background: #0a0a0c; display: grid; place-items: center; }
.modal .pantalla iframe, .modal .pantalla video { width: 100%; height: 100%; border: 0; display: block; }
.modal .espera { text-align: center; padding: 2rem; display: grid; gap: 0.75rem; justify-items: center; color: #a3a3a8; max-width: 40ch; }
.modal .espera .k { font-family: var(--f-kanji); font-size: 3.5rem; line-height: 1; color: #ededea; }
.modal .espera a { color: #ededea; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
