/* ------------------------------------------------------------------
   balng.dev — Valentino Gomez
   Tokens tomados del diseño Portafolio.dc.html (sistema Nocturne,
   con la paleta neutra que la propia pieza redefine sobre el sistema).
   ------------------------------------------------------------------ */

/* Geist y Geist Mono, auto-hospedadas (extraidas del mismo bundle de
   diseno que el logo) en vez de Google Fonts: sin request externo
   render-blocking y sin mandar la visita a un tercero. Cada archivo es
   una fuente variable (subset latin, alcanza para español) — un solo
   .woff2 cubre todos los pesos declarados abajo. */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("assets/fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("assets/fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0c0c0d;
  --surface: #141416;
  --text: #ededee;
  --text-strong: #ffffff;

  /* escalones de texto, de mas a menos presencia */
  --muted-1: #bebec3; /* cuerpo */
  --muted-2: #9c9ca1; /* nav, acciones secundarias */
  --muted-3: #909096; /* meta, pies */
  --muted-4: #7e7e86; /* footer */
  --muted-5: #808089; /* kicker mono — subido de #77777f: a 12px daba ~4.44:1, bajo el minimo AA de 4.5:1 */

  /* lineas */
  --line: #232326;        /* bordes de tarjeta y divisores */
  --line-soft: #2a2a2e;   /* regla superior de columnas */
  --line-mid: #33333a;    /* separador vertical */
  --border: #3d3d42;      /* boton outline */
  --border-hover: #70707a;
  --underline: #55555c;

  --radius-md: 8px;
  --radius-lg: 14px;

  --font: Geist, Inter, system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --inset-hairline: inset 0 1px 0 rgba(237, 237, 238, 0.05);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font);
  font-weight: 500;
}

a {
  color: var(--text);
  text-decoration: none;
}

a:hover {
  color: var(--text-strong);
}

img {
  max-width: 100%;
}

::selection {
  background: #2c2c30;
  color: #fff;
}

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

/* ---------- layout ---------- */

.shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 28px 128px;
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 26px 0 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 17px;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  gap: 24px;
  font-size: 14px;
}

.site-nav a {
  color: var(--muted-2);
}

.site-nav a:hover {
  color: var(--text);
}

/* ---------- hero ---------- */

.hero {
  padding: 104px 0 0;
}

.hero h1 {
  font-size: clamp(40px, 6.6vw, 60px);
  line-height: 1.03;
  letter-spacing: -0.035em;
  margin: 0 0 20px;
}

.hero p {
  font-size: 19px;
  line-height: 1.5;
  color: var(--muted-1);
  max-width: 48ch;
  margin: 0 0 32px;
  text-wrap: pretty;
}

.link-underline {
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-underline-offset: 3px;
}

.link-underline:hover {
  text-decoration-color: var(--text);
}

/* ---------- botones ---------- */

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-md);
  padding: 11px 18px;
  font-size: 14px;
  border: 1px solid transparent;
}

.btn-outline {
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--surface);
  border-color: var(--border-hover);
}

.btn-ghost {
  color: var(--muted-2);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface);
}

/* ---------- cifras ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  margin: 96px 0 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.stat {
  background: linear-gradient(to bottom, #131316, #101012 60%);
  box-shadow: var(--inset-hairline);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stat-value {
  font-weight: 500;
  font-size: 32px;
  letter-spacing: -0.025em;
}

.stat-label {
  font-size: 13px;
  color: var(--muted-3);
}

.stats-verify {
  margin: 14px 0 0;
  font-size: 13px;
}

.stats-verify a {
  color: var(--muted-2);
}

.stats-verify a:hover {
  color: var(--text);
}

/* ---------- secciones ---------- */

.section {
  padding: 112px 0 0;
}

.section-title {
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}

/* ---------- research ---------- */

.entry {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: radial-gradient(140% 120% at 8% 0%, #16161a 0%, #101012 46%, #0e0e10 100%);
  box-shadow: var(--inset-hairline);
  padding: 34px 32px;
}

.entry-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted-3);
}

.meta-sep {
  width: 1px;
  height: 12px;
  background: var(--line-mid);
  display: block;
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--muted-1);
}

.entry h3 {
  font-size: clamp(23px, 6.5vw, 30px);
  line-height: 1.14;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
  max-width: 34ch;
}

.entry-body {
  display: grid;
  gap: 14px;
  max-width: 62ch;
}

.entry-body p {
  color: var(--muted-1);
  margin: 0;
  text-wrap: pretty;
}

.entry-rule {
  height: 1px;
  background: var(--line);
  margin: 26px 0 18px;
}

.entry-note {
  color: var(--muted-3);
  margin: 0;
  font-size: 14px;
}

/* ---------- reportes ---------- */

.figure-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px;
  align-items: start;
  margin-bottom: 48px;
}

.figure {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.figure-value {
  font-weight: 500;
  font-size: clamp(46px, 7vw, 68px);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.figure-label {
  font-size: 14px;
  color: var(--muted-3);
}

.figure-note {
  font-size: 19px;
  line-height: 1.55;
  color: var(--muted-1);
  margin: 0;
  max-width: 44ch;
  text-wrap: pretty;
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 28px;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}

.column-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-5);
}

.column-title {
  font-size: 17px;
  line-height: 1.35;
  color: var(--text);
}

/* ---------- contacto ---------- */

.contact {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: radial-gradient(120% 140% at 12% 0%, #17171a 0%, #0c0c0d 68%);
  box-shadow: var(--inset-hairline);
  padding: 44px 36px;
  display: grid;
  gap: 22px;
}

.contact-body {
  position: relative;
  display: grid;
  gap: 22px;
}

.contact h2 {
  font-size: clamp(26px, 3.6vw, 34px);
  letter-spacing: -0.025em;
  margin: 0;
  max-width: 26ch;
  text-wrap: balance;
}

.contact p {
  color: var(--muted-1);
  margin: 0;
  max-width: 52ch;
  text-wrap: pretty;
}

/* marca de agua isometrica: seis copias del logo separadas en Z */
.iso3d-wrap {
  position: absolute;
  right: -18px;
  top: 50%;
  width: 200px;
  height: 200px;
  margin-top: -100px;
  perspective: 620px;
  pointer-events: none;
}

.iso3d {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: isoTurn 14s ease-in-out infinite;
}

.iso3d img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.iso3d img:nth-child(1) { opacity: 0.03;  transform: translateZ(-30px); }
.iso3d img:nth-child(2) { opacity: 0.035; transform: translateZ(-24px); }
.iso3d img:nth-child(3) { opacity: 0.04;  transform: translateZ(-18px); }
.iso3d img:nth-child(4) { opacity: 0.05;  transform: translateZ(-12px); }
.iso3d img:nth-child(5) { opacity: 0.06;  transform: translateZ(-6px); }
.iso3d img:nth-child(6) { opacity: 0.11;  transform: translateZ(0); }

@keyframes isoTurn {
  0%   { transform: rotateX(16deg) rotateY(-26deg) rotateZ(-2deg); }
  50%  { transform: rotateX(10deg) rotateY(-12deg) rotateZ(1deg); }
  100% { transform: rotateX(16deg) rotateY(-26deg) rotateZ(-2deg); }
}

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 72px 0 0;
  font-size: 13px;
  color: var(--muted-4);
}

/* ---------- preferencias / viewport ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .iso3d { animation: none !important; }
}

@media (max-width: 720px) {
  .iso3d-wrap { display: none; }
  .shell { padding: 0 20px 96px; }
  .hero { padding: 72px 0 0; }
  .section { padding: 88px 0 0; }
  .entry { padding: 28px 22px; }
  .contact { padding: 34px 24px; }
}

/* Telefonos: ademas de encoger paddings, se fuerza una sola columna donde
   el auto-fit quedaria ambiguo entre 1 y 2 (justo la ventana incomoda) y
   se afloja el nav para que no toque los bordes. */
@media (max-width: 480px) {
  .shell { padding: 0 16px 72px; }
  .site-header { padding: 20px 0 0; }
  .site-nav { gap: 16px; font-size: 13px; }
  .hero { padding: 56px 0 0; }
  .hero p { font-size: 17px; }
  .section { padding: 64px 0 0; }
  .section-title { font-size: 22px; margin-bottom: 22px; }
  .stats { grid-template-columns: 1fr; margin-top: 64px; }
  .stat { padding: 22px 20px; }
  .entry { padding: 22px 18px; }
  .entry-meta { gap: 10px; }
  .figure-row { margin-bottom: 36px; }
  .columns { grid-template-columns: 1fr; gap: 20px; }
  .contact { padding: 28px 20px; }
  .btn { padding: 10px 16px; }
}
