/* Víctor Sans de Amores — hoja de estilo única, sin dependencias externas. */

:root {
  --fondo: #fcfbf9;
  --fondo-alt: #f4f1eb;
  --tarjeta: #ffffff;
  --texto: #1a1815;
  --texto-suave: #57524a;
  --borde: #e4dfd5;
  --borde-suave: #eee9e0;
  --acento: #b0431a;
  --acento-vivo: #d4551f;
  --acento-claro: #fbeade;
  --sombra: 0 1px 2px rgba(26, 24, 21, .04), 0 8px 24px -12px rgba(26, 24, 21, .12);
  --sombra-alta: 0 2px 4px rgba(26, 24, 21, .05), 0 16px 32px -12px rgba(26, 24, 21, .18);
  --ancho: 47rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #141317;
    --fondo-alt: #1b1a1f;
    --tarjeta: #1f1d23;
    --texto: #efece7;
    --texto-suave: #a9a29a;
    --borde: #322f39;
    --borde-suave: #29262f;
    --acento: #e8a878;
    --acento-vivo: #f0b98d;
    --acento-claro: #2a2229;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
    --sombra-alta: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 32px -12px rgba(0, 0, 0, .6);
  }
}

:root[data-theme="dark"] {
  --fondo: #141317; --fondo-alt: #1b1a1f; --tarjeta: #1f1d23;
  --texto: #efece7; --texto-suave: #a9a29a;
  --borde: #322f39; --borde-suave: #29262f;
  --acento: #e8a878; --acento-vivo: #f0b98d; --acento-claro: #2a2229;
  --sombra: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  --sombra-alta: 0 2px 4px rgba(0,0,0,.35), 0 16px 32px -12px rgba(0,0,0,.6);
}

:root[data-theme="light"] {
  --fondo: #fcfbf9; --fondo-alt: #f4f1eb; --tarjeta: #ffffff;
  --texto: #1a1815; --texto-suave: #57524a;
  --borde: #e4dfd5; --borde-suave: #eee9e0;
  --acento: #b0431a; --acento-vivo: #d4551f; --acento-claro: #fbeade;
  --sombra: 0 1px 2px rgba(26,24,21,.04), 0 8px 24px -12px rgba(26,24,21,.12);
  --sombra-alta: 0 2px 4px rgba(26,24,21,.05), 0 16px 32px -12px rgba(26,24,21,.18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 400 1.0625rem/1.7 ui-sans-serif, system-ui, -apple-system, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* grano finísimo: da calidez sin que se perciba como textura */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

.envoltorio { max-width: var(--ancho); margin: 0 auto; padding: 0 1.5rem; }

a { color: var(--acento); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--acento-vivo); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 3px; border-radius: 3px; }

/* ── barra superior ───────────────────────────────────────── */
.barra {
  border-bottom: 1px solid var(--borde-suave);
  padding: .9rem 0;
  font-size: .9375rem;
  background: color-mix(in srgb, var(--fondo) 85%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.barra .envoltorio { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.barra strong { font-weight: 650; letter-spacing: -.01em; }
.barra nav a {
  margin-left: 1.1rem; color: var(--texto-suave); text-decoration: none;
  transition: color .18s ease;
}
.barra nav a:hover { color: var(--acento); }

/* ── portada ──────────────────────────────────────────────── */
.portada {
  padding: 4rem 0 3rem;
  position: relative;
  background:
    radial-gradient(70rem 26rem at 12% -12%, var(--acento-claro) 0%, transparent 62%),
    linear-gradient(180deg, var(--fondo-alt) 0%, transparent 78%);
}
.portada h1 {
  font-size: clamp(2.15rem, 6vw, 3.35rem);
  line-height: 1.08;
  margin: 0 0 1rem;
  letter-spacing: -.035em;
  font-weight: 750;
}
/* portada a dos columnas: texto + retrato */
.portada-rejilla {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: start;
}
.portada-texto { min-width: 0; }

.retrato { display: block; line-height: 0; }
.retrato img {
  width: 11.5rem; height: 11.5rem;
  border-radius: 1rem;
  object-fit: cover;
  display: block;
  border: 1px solid var(--borde);
  box-shadow: var(--sombra-alta);
  rotate: 1.5deg;
  transition: rotate .3s ease, box-shadow .3s ease;
}
.retrato img:hover { rotate: 0deg; }

@media (max-width: 52rem) {
  .portada-rejilla { grid-template-columns: 1fr; gap: 1.75rem; }
  .retrato { order: -1; }
  .retrato img { width: 7rem; height: 7rem; border-radius: .85rem; }
}

.social { display: flex; gap: .4rem; margin: 1.6rem 0 0; }
.social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.35rem; height: 2.35rem;
  border-radius: .55rem;
  color: var(--texto-suave);
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  transition: color .16s ease, border-color .16s ease, transform .16s ease;
}
.social a:hover {
  color: var(--acento);
  border-color: color-mix(in srgb, var(--acento) 45%, var(--borde));
  transform: translateY(-2px);
}

.portada .rotulo {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--acento);
  background: var(--tarjeta);
  border: 1px solid color-mix(in srgb, var(--acento) 25%, transparent);
  border-radius: 999px;
  padding: .38rem .9rem .38rem .75rem;
  margin-bottom: 1.4rem;
  font-weight: 650;
  box-shadow: var(--sombra);
}
.portada .rotulo::before {
  content: ""; width: .5rem; height: .5rem; border-radius: 50%;
  background: #2e9e5b; flex: none;
  box-shadow: 0 0 0 0 rgba(46, 158, 91, .55);
  animation: latido 2.4s ease-out infinite;
}
@keyframes latido {
  0%   { box-shadow: 0 0 0 0 rgba(46,158,91,.5); }
  70%  { box-shadow: 0 0 0 .5rem rgba(46,158,91,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,158,91,0); }
}
.portada p.entrada {
  font-size: 1.1875rem; color: var(--texto-suave);
  margin: 0 0 2rem; max-width: 40rem;
}

.botones { display: flex; flex-wrap: wrap; gap: .75rem; }
.boton {
  display: inline-block; padding: .78rem 1.4rem; border-radius: .6rem;
  text-decoration: none; font-weight: 650; font-size: .9375rem;
  border: 1px solid var(--acento);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.boton.principal {
  background: var(--acento); color: var(--fondo);
  box-shadow: var(--sombra);
}
.boton.principal:hover {
  background: var(--acento-vivo); color: var(--fondo);
  transform: translateY(-2px); box-shadow: var(--sombra-alta);
}
.boton.secundario { color: var(--acento); background: var(--tarjeta); }
.boton.secundario:hover { background: var(--acento-claro); transform: translateY(-2px); }

/* ── cifras de la portada ─────────────────────────────────── */
.cifras {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 3rem 0 0;
  padding: 1.6rem 0 0;
  border-top: 1px solid var(--borde);
}
.cifras div { min-width: 0; }
.cifras dt {
  font-size: clamp(1.9rem, 4.4vw, 2.6rem);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.045em;
  background: linear-gradient(150deg, var(--acento-vivo), var(--acento));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.cifras dd {
  margin: .45rem 0 0;
  font-size: .8125rem;
  line-height: 1.4;
  color: var(--texto-suave);
}
@media (max-width: 40rem) {
  .cifras { grid-template-columns: repeat(2, 1fr); gap: 1.4rem 1rem; }
}

/* ── secciones ────────────────────────────────────────────── */
section { padding: 3.25rem 0; border-top: 1px solid var(--borde-suave); }
section h2 {
  font-size: 1.625rem; margin: 0 0 1.75rem;
  letter-spacing: -.02em; font-weight: 700;
  position: relative; padding-left: .9rem;
}
section h2::before {
  content: ""; position: absolute; left: 0; top: .18em; bottom: .18em;
  width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--acento-vivo), var(--acento));
}
section h3 { font-size: 1.0625rem; margin: 0 0 .45rem; font-weight: 650; }

/* ── servicios ────────────────────────────────────────────── */
.servicio {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: .75rem;
  padding: 1.35rem 1.4rem;
  margin-bottom: .85rem;
  box-shadow: var(--sombra);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.servicio:hover {
  transform: translateY(-3px);
  box-shadow: var(--sombra-alta);
  border-color: color-mix(in srgb, var(--acento) 35%, var(--borde));
}
.servicio:last-child { margin-bottom: 0; }
.servicio p { margin: 0; color: var(--texto-suave); }
.servicio .formato {
  display: inline-block; margin-top: .8rem;
  font-size: .8125rem; color: var(--acento);
  background: var(--acento-claro);
  padding: .25rem .7rem; border-radius: 999px;
  font-weight: 650; letter-spacing: .01em;
}

/* ── trayectoria ──────────────────────────────────────────── */
.hitos { list-style: none; margin: 0; padding: 0 0 0 1.1rem; position: relative; }
.hitos::before {
  content: ""; position: absolute; left: 0; top: .9rem; bottom: .9rem;
  width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--acento) 0%, var(--borde) 100%);
}
.hitos li {
  display: grid; grid-template-columns: 7rem 1fr; gap: 1rem;
  padding: .7rem 0 .7rem 1.15rem;
  font-size: .9688rem; position: relative;
}
.hitos li::before {
  content: ""; position: absolute; left: -.3rem; top: 1.25rem;
  width: .55rem; height: .55rem; border-radius: 50%;
  background: var(--fondo); border: 2px solid var(--borde);
}
.hitos li:first-child::before { border-color: var(--acento); background: var(--acento); }
.hitos .cuando { color: var(--texto-suave); font-variant-numeric: tabular-nums; }
@media (max-width: 32rem) {
  .hitos li { grid-template-columns: 1fr; gap: .15rem; }
}

/* ── pila tecnológica ─────────────────────────────────────── */
.pila { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.pila li {
  font-size: .875rem;
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: .45rem; padding: .3rem .7rem;
  color: var(--texto-suave);
  transition: border-color .16s ease, color .16s ease, transform .16s ease;
}
.pila li:hover {
  border-color: color-mix(in srgb, var(--acento) 45%, var(--borde));
  color: var(--acento); transform: translateY(-1px);
}

/* ── preguntas ────────────────────────────────────────────── */
.pregunta { padding: 1.2rem 0; border-bottom: 1px solid var(--borde-suave); }
.pregunta:last-child { border-bottom: 0; }
.pregunta h3 { color: var(--texto); padding-left: 1.1rem; position: relative; }
.pregunta h3::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: .4rem; height: .4rem; border-radius: 50%;
  background: var(--acento);
}
.pregunta p { margin: 0; color: var(--texto-suave); padding-left: 1.1rem; }

/* ── contacto ─────────────────────────────────────────────── */
#contacto, #contact {
  background:
    radial-gradient(50rem 20rem at 88% 110%, var(--acento-claro) 0%, transparent 62%),
    linear-gradient(0deg, var(--fondo-alt) 0%, transparent 70%);
}

/* ── pie ──────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--borde-suave);
  padding: 2.25rem 0 3.5rem;
  font-size: .875rem; color: var(--texto-suave);
}
footer a { color: var(--texto-suave); }
footer a:hover { color: var(--acento); }

/* contenido ancho que no debe desbordar */
pre, table { overflow-x: auto; max-width: 100%; }
img { max-width: 100%; height: auto; }

/* respeta a quien pide menos movimiento */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
