/* =========================================================
   INTELIFICA DEV — hoja de estilos única
   Mismo planteamiento que intelifica.com: sin build, sin
   preprocesador. Se edita directamente esto.

   La identidad va en paralelo con la web del producto —mismas
   tipografías, misma escala grafito, mismo coral— pero la
   estructura es distinta: aquí los proyectos son un índice
   foliado a sangre, no un grid de tarjetas.
   ========================================================= */

/* ---------- 0. Tipografías autoalojadas ----------
   Copiadas de intelifica.com por el mismo motivo que allí: pedirlas a Google
   Fonts enviaría la IP de cada visitante a un tercero sin aportarle nada. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/inter-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/inter-400-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: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/inter-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/inter-500-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: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/inter-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/inter-600-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: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/space-grotesk-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/space-grotesk-500-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: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/space-grotesk-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/space-grotesk-600-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: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/space-grotesk-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/space-grotesk-700-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;
}

/* ---------- 1. Variables de marca ----------
   La escala grafito y el coral son los mismos de intelifica.com: es lo que
   hace que las dos webs se lean como la misma casa. Lo que cambia aquí es
   la retícula, que se ve, y el peso que se le da a los filetes. */
:root {
  --primary-50: #f7f7f8;
  --primary-100: #ececee;
  --primary-200: #d3d5d8;
  --primary-300: #b0b4b9;
  --primary-400: #888e95;
  --primary-500: #676d74;
  --primary-600: #4f545a;
  --primary-700: #3a3e43;
  --primary-800: #26292c;
  --primary-900: #18191b;
  --primary-950: #0e0f10;

  --accent-300: #ff9470;
  --accent-500: #ee4d2e;
  --accent-600: #d33c1f;

  --ink: #1a1b1d;
  --paper: #fbfaf8;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Space Grotesk", -apple-system, sans-serif;

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4rem;
  --space-8: 5rem;

  /* Un solo filete, dos intensidades. No hay sombras en toda la hoja: la
     estructura la sostiene la línea de 1px, igual que en la web del producto
     pero llevado más lejos —aquí la retícula se ve. */
  --rule: var(--primary-200);
  --rule-strong: var(--primary-400);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --header-bg: rgba(251, 250, 248, 0.94);

  --measure: 1180px;
}

/* ---------- 2. Modo oscuro ----------
   Mismo mecanismo que intelifica.com: se invierte la escala de grises en lugar
   de redefinir cada componente, y el coral no se toca. Así el interruptor y la
   preferencia del sistema funcionan igual en los dos sitios. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary-50:  #0e0f10;
    --primary-100: #18191b;
    --primary-200: #26292c;
    --primary-300: #3a3e43;
    --primary-400: #4f545a;
    --primary-500: #888e95;
    --primary-600: #a8adb3;
    --primary-700: #c3c7cb;
    --primary-800: #d9dbde;
    --primary-900: #ececee;
    --primary-950: #f7f7f8;

    --ink: #f1f3f5;
    --paper: #121315;
    --rule: var(--primary-200);
    --rule-strong: var(--primary-400);
    --header-bg: rgba(18, 19, 21, 0.94);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --primary-50:  #0e0f10;
  --primary-100: #18191b;
  --primary-200: #26292c;
  --primary-300: #3a3e43;
  --primary-400: #4f545a;
  --primary-500: #888e95;
  --primary-600: #a8adb3;
  --primary-700: #c3c7cb;
  --primary-800: #d9dbde;
  --primary-900: #ececee;
  --primary-950: #f7f7f8;

  --ink: #f1f3f5;
  --paper: #121315;
  --rule: var(--primary-200);
  --rule-strong: var(--primary-400);
  --header-bg: rgba(18, 19, 21, 0.94);
  color-scheme: dark;
}

html { color-scheme: light; }

/* ---------- 3. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

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

/* ---------- 4. Retícula ----------
   El contenedor lleva sus dos filetes laterales a la vista. Es la decisión
   estructural de la que cuelga todo lo demás: la página se lee como una hoja
   pautada y cada sección se apoya en esas dos líneas. */
.container {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.sheet {
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}

.section {
  border-bottom: 1px solid var(--rule);
}

/* Rótulo de sección. Sin numerar a propósito: los únicos números de la página
   son los folios del índice de trabajos, y competir con ellos los desactivaría
   como elemento de composición. */
.section-head {
  padding: var(--space-6) var(--space-4) var(--space-4);
}

.section-head h2 {
  font-size: clamp(1.375rem, 2.6vw, 1.875rem);
}

/* ---------- 5. Cabecera ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  margin-right: auto;
}

.brand img { height: 26px; width: auto; }
.logo-oscuro { display: none; }

:root[data-theme="dark"] .logo-claro { display: none; }
:root[data-theme="dark"] .logo-oscuro { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-claro { display: none; }
  :root:not([data-theme="light"]) .logo-oscuro { display: block; }
}

/* La palabra "Dev" es lo único que distingue el logotipo del de la web del
   producto. Va en una cartela coral, del tamaño justo para leerse sin competir
   con la marca. */
.brand-tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent-500);
  padding: 0.2em 0.45em;
  border-radius: 2px;
}

.header-link {
  font-size: 0.875rem;
  color: var(--primary-600);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.header-link:hover {
  color: var(--ink);
  border-bottom-color: var(--accent-500);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--primary-600);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.theme-toggle:hover { border-color: var(--rule-strong); color: var(--ink); }
.theme-toggle svg { width: 17px; height: 17px; }

.icon-sun { display: none; }
.icon-moon { display: block; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ---------- 6. Entrada ----------
   Asimétrica y alineada a la izquierda. La retícula de cuatro columnas se ve
   de verdad: son filetes de 1px pintados con un degradado repetido, no un
   adorno de fondo. En pantallas estrechas se apagan, porque a esa anchura
   dejarían de marcar columnas para convertirse en ruido. */
.hero {
  position: relative;
  border-bottom: 1px solid var(--rule);
  padding: clamp(var(--space-7), 9vw, 7.5rem) var(--space-4) var(--space-7);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to right,
    var(--rule) 0 1px,
    transparent 1px 25%
  );
  background-position: 0 0;
}

.hero > * { position: relative; }

.hero h1 {
  font-size: clamp(2.25rem, 6.2vw, 4.25rem);
  max-width: 16ch;
  margin-bottom: var(--space-4);
}

.hero h1 em {
  font-style: normal;
  color: var(--accent-500);
}

.hero-lead {
  font-size: clamp(1.0625rem, 1.8vw, 1.25rem);
  color: var(--primary-600);
  max-width: 46ch;
  margin-bottom: var(--space-5);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  font-size: 0.875rem;
  color: var(--primary-500);
  padding-top: var(--space-4);
  border-top: 1px solid var(--rule);
  max-width: 46ch;
}

.hero-meta a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-500);
  padding-bottom: 1px;
  transition: color 0.2s var(--ease);
}

.hero-meta a:hover { color: var(--accent-500); }

/* ---------- 7. Índice de trabajos ----------
   El movimiento propio de esta web. En intelifica.com los casos de uso son un
   grid de tarjetas; aquí los proyectos son las filas de un índice, separadas
   por filetes y numeradas al margen. Se lee como el índice de un libro, que es
   exactamente lo que es: una relación de trabajos, no un escaparate. */
.trabajos { list-style: none; margin: 0; padding: 0; }

.trabajo {
  border-top: 1px solid var(--rule);
  transition: background-color 0.25s var(--ease);
}

.trabajo:first-child { border-top: none; }
.trabajo:hover { background: var(--primary-50); }

.trabajo-fila {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0 var(--space-4);
  padding: var(--space-5) var(--space-4);
  align-items: start;
}

/* El folio a tamaño de titular: es el elemento que compone la columna
   izquierda y el que marca el ritmo al bajar por la página. */
.trabajo-folio {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  color: var(--primary-300);
  transition: color 0.25s var(--ease);
}

.trabajo:hover .trabajo-folio { color: var(--accent-500); }

.trabajo-titulo {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.625rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-1);
}

.trabajo-titulo a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 2px;
  transition: border-color 0.2s var(--ease);
}

.trabajo-titulo a:hover { border-bottom-color: var(--accent-500); }

.trabajo-tipo {
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--primary-500);
  margin-bottom: var(--space-3);
}

.trabajo-desc {
  color: var(--primary-600);
  max-width: 62ch;
  margin-bottom: var(--space-3);
}

.trabajo-datos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  font-size: 0.8125rem;
  color: var(--primary-500);
}

.trabajo-datos li {
  border-left: 1px solid var(--rule-strong);
  padding-left: var(--space-2);
}

/* ---------- 8. Qué construyo ---------- */
.oficio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
}

.oficio > div {
  padding: var(--space-5) var(--space-4);
  border-right: 1px solid var(--rule);
}

.oficio > div:last-child { border-right: none; }

.oficio h3 {
  font-size: 1.0625rem;
  margin-bottom: var(--space-2);
}

.oficio p {
  font-size: 0.9375rem;
  color: var(--primary-600);
}

/* ---------- 9. Enlace a la web del producto ----------
   El único puente entre los dos sitios. Va al final y en tono de nota, no de
   reclamo: quien llega aquí viene de una firma en un pie de página, no a
   comprar nada. */
.puente {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-6) var(--space-4);
}

.puente h2 { font-size: clamp(1.25rem, 2.4vw, 1.625rem); margin-bottom: var(--space-2); }
.puente p { color: var(--primary-600); max-width: 56ch; }

.enlace-fuerte {
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  color: #fff;
  background: var(--accent-500);
  padding: 0.7em 1.2em;
  border-radius: 2px;
  transition: background-color 0.2s var(--ease);
}

.enlace-fuerte:hover { background: var(--accent-600); }

/* ---------- 10. Pie ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: var(--space-5) 0;
}

/* El contenido del pie cae en la misma vertical que el de las secciones: al
   contenedor hay que sumarle el mismo acolchado que llevan ellas por dentro,
   o el pie queda medio centímetro desplazado a la izquierda. */
.site-footer .container {
  padding-left: calc(var(--space-4) * 2);
  padding-right: calc(var(--space-4) * 2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--primary-500);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
}

.site-footer a {
  color: var(--primary-500);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.site-footer a:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }

/* ---------- 11. Adaptación a pantallas estrechas ---------- */
@media (max-width: 860px) {
  .oficio { grid-template-columns: 1fr; }
  .oficio > div { border-right: none; border-bottom: 1px solid var(--rule); }
  .oficio > div:last-child { border-bottom: none; }
  .puente { grid-template-columns: 1fr; }
  /* Al apilarse, el enlace es un elemento de rejilla y se estiraría a todo el
     ancho: no es un botón de formulario, es un enlace, y debe ocupar lo que
     mide su texto. */
  .puente .enlace-fuerte { justify-self: start; }
}

@media (max-width: 640px) {
  /* Sin la retícula vertical: a esta anchura no marca columnas, solo estorba. */
  .hero::before { display: none; }

  .sheet { border-left: none; border-right: none; }

  .trabajo-fila {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .trabajo-folio { font-size: 1.5rem; }

  .header-link { display: none; }
}

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