/* ==========================================================================
   rafapiqueras.es — hoja de estilos
   Sistema: carta náutica nocturna. Navy profundo, líneas batimétricas en
   verde vidrio, un solo acento cálido (naranja boya) para la acción.
   Tipografía: Bricolage Grotesque (titulares) + IBM Plex Sans (texto).
   ========================================================================== */

/* ---------- Fuentes autoalojadas (sin peticiones a terceros) ---------- */
@font-face {
  font-family: "Bricolage";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/bricolage-latin.woff2") format("woff2-variations");
  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: "Bricolage";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/bricolage-latin-ext.woff2") format("woff2-variations");
  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: "Plex"; font-style: normal; font-display: swap; font-weight: 400; src: url("../fonts/plex-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: "Plex"; font-style: normal; font-display: swap; font-weight: 500; src: url("../fonts/plex-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: "Plex"; font-style: normal; font-display: swap; font-weight: 600; src: url("../fonts/plex-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: "Plex"; font-style: normal; font-display: swap; font-weight: 400; src: url("../fonts/plex-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: "Plex"; font-style: normal; font-display: swap; font-weight: 500; src: url("../fonts/plex-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: "Plex"; font-style: normal; font-display: swap; font-weight: 600; src: url("../fonts/plex-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; }

/* ---------- Tokens ---------- */
:root {
  --abismo: #0b1a2b;
  --marea: #112640;
  --marea-2: #173252;
  --espuma: #eaf1f6;
  --bruma: #a7bacb;
  --bruma-2: #7a91a6;
  --boya: #ff7a3d;
  --boya-2: #ffa070;
  --boya-soft: rgba(255, 122, 61, 0.14);
  --vidrio: #7fd6c8;
  --vidrio-soft: rgba(127, 214, 200, 0.14);
  --linea: rgba(234, 241, 246, 0.12);
  --linea-2: rgba(234, 241, 246, 0.22);

  --font-display: "Bricolage", "Segoe UI", system-ui, sans-serif;
  --font-body: "Plex", "Segoe UI", system-ui, sans-serif;

  --maxw: 1180px;
  --gutter: clamp(18px, 4.5vw, 56px);
  --section: clamp(80px, 11vw, 150px);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;

  --nav-h: 66px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--abismo);
  color: var(--espuma);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1.1em; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 0.98; }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); }
h3 { font-size: clamp(1.25rem, 1.8vw, 1.5rem); letter-spacing: -0.012em; }
h4 { font-size: 1.05rem; letter-spacing: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--boya); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--boya); color: var(--abismo); }

.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.section { position: relative; padding-block: var(--section); }
.section + .section { padding-top: 0; }
.hero + .section { padding-top: clamp(48px, 7vw, 96px); }
.section__head { max-width: 42rem; margin-bottom: clamp(32px, 5vw, 56px); }
.section__head p { color: var(--bruma); font-size: 1.1rem; margin: 0; }
.muted { color: var(--bruma); }
.small { font-size: 0.9rem; }

.skip { position: absolute; left: 12px; top: -60px; padding: 10px 14px; background: var(--boya); color: var(--abismo); border-radius: var(--r-sm); z-index: 100; font-weight: 600; }
.skip:focus { top: 12px; }

/* Enlaces de texto: subrayado fino en boya al pasar */
.link {
  color: var(--espuma);
  text-decoration: underline;
  text-decoration-color: var(--linea-2);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.25s;
}
.link:hover { text-decoration-color: var(--boya); }

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  border: 1px solid transparent;
  transition: transform 0.35s var(--ease), background 0.25s, border-color 0.25s, color 0.25s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--boya); color: var(--abismo); }
.btn--primary:hover { background: var(--boya-2); }
.btn--ghost { border-color: var(--linea-2); color: var(--espuma); background: rgba(234, 241, 246, 0.03); }
.btn--ghost:hover { border-color: var(--espuma); background: rgba(234, 241, 246, 0.07); }

/* Chip de estado (solo cuando el proyecto sigue en marcha) */
.status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--linea-2);
  font-size: 0.8rem; font-weight: 500; color: var(--bruma);
  background: rgba(11, 26, 43, 0.55);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--vidrio); box-shadow: 0 0 0 3px var(--vidrio-soft); }

/* Etiquetas de tecnología */
.tags { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.tags li { font-size: 0.82rem; color: var(--bruma); padding: 4px 9px; border: 1px solid var(--linea); border-radius: 6px; line-height: 1.3; }

/* ==========================================================================
   Fondo de carta náutica (SVG generado en JS) y capas parallax
   ========================================================================== */
.chart-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.chart-bg__layer { position: absolute; inset: -12% -4%; will-change: transform; }
.chart-bg__layer svg { width: 100%; height: 100%; }
.chart-bg__layer path { fill: none; stroke: var(--vidrio); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-bg__layer--far path { opacity: 0.09; }
.chart-bg__layer--near path { opacity: 0.16; stroke-width: 1.2; }
.chart-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 70% 30%, rgba(127, 214, 200, 0.07), transparent 70%),
    linear-gradient(to bottom, transparent 55%, var(--abismo) 100%);
}

/* ==========================================================================
   Navegación: cristal fijo
   ========================================================================== */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(11, 26, 43, 0.42);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid rgba(234, 241, 246, 0.08);
  transition: background 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.nav.is-scrolled {
  background: rgba(11, 26, 43, 0.72);
  border-bottom-color: rgba(234, 241, 246, 0.13);
  box-shadow: 0 12px 40px -20px rgba(0, 0, 0, 0.6);
}
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav__brand { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 10px; }
.nav__brand .mark { width: 26px; height: 26px; }
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
  position: relative; padding: 8px 12px; border-radius: 8px;
  font-size: 0.95rem; font-weight: 500; color: var(--bruma);
  transition: color 0.2s, background 0.2s;
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--espuma); }
.nav__links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; background: var(--boya); border-radius: 2px;
}
.nav__links .nav__cta { margin-left: 8px; padding: 9px 14px; border: 1px solid var(--linea-2); color: var(--espuma); }
.nav__links .nav__cta:hover { border-color: var(--boya); background: var(--boya-soft); }
.nav__toggle { display: none; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--linea-2); font-size: 0.9rem; font-weight: 500; }

@media (max-width: 760px) {
  .nav__toggle { display: inline-flex; align-items: center; gap: 8px; }
  .nav__links {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px var(--gutter) 16px;
    /* Sin backdrop-filter anidado: Chromium lo compone mal dentro del header de cristal */
    background: linear-gradient(rgba(13, 31, 53, 0.97), rgba(11, 26, 43, 0.98));
    border-bottom: 1px solid rgba(234, 241, 246, 0.12);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.25s, transform 0.3s var(--ease), visibility 0s 0.3s;
  }
  .nav__links.is-open { opacity: 1; transform: none; visibility: visible; transition: opacity 0.25s, transform 0.3s var(--ease); }
  .nav__links a { padding: 12px 10px; font-size: 1.05rem; }
  .nav__links a[aria-current="page"]::after { display: none; }
  .nav__links .nav__cta { margin: 8px 0 0; text-align: center; justify-content: center; }
}

/* ==========================================================================
   Hero (portada)
   ========================================================================== */
.hero { position: relative; padding-top: calc(var(--nav-h) + clamp(56px, 9vw, 112px)); padding-bottom: clamp(32px, 5vw, 64px); overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero__kicker { color: var(--vidrio); font-weight: 500; margin: 0 0 18px; font-size: 1rem; }
.hero h1 { margin-bottom: 0.45em; max-width: 12ch; font-size: clamp(2.6rem, 6vw, 4.6rem); }
.hero__lead { font-size: clamp(1.1rem, 1.5vw, 1.25rem); color: var(--bruma); max-width: 36rem; margin-bottom: 30px; }
.hero__lead strong { color: var(--espuma); font-weight: 500; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__caption { margin: 14px 4px 0; font-size: 0.88rem; color: var(--bruma-2); max-width: 34rem; }
.hero__caption a { color: var(--bruma); text-decoration: underline; text-decoration-color: var(--linea-2); text-underline-offset: 0.2em; }
.hero__caption a:hover { color: var(--espuma); text-decoration-color: var(--boya); }

/* Entrada orquestada de la portada (único momento de animación automática) */
.reveal { opacity: 0; transform: translateY(18px); animation: rise 0.9s var(--ease) forwards; }
.reveal:nth-child(1) { animation-delay: 0.05s; }
.reveal:nth-child(2) { animation-delay: 0.15s; }
.reveal:nth-child(3) { animation-delay: 0.28s; }
.reveal:nth-child(4) { animation-delay: 0.4s; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero h1 { max-width: 14ch; }
}

/* ==========================================================================
   Composición HyperFrames (hero): del albarán al ERP y al portal
   Todo se mide en --k (1 % del ancho del contenedor) para que escale.
   En móvil el escenario pasa a ser cuadrado y los bloques se recolocan.
   ========================================================================== */
.hf-stage {
  --k: 1cqw;
  position: relative;
  container-type: inline-size;
  width: 100%;
  max-width: 600px;
  margin-inline: auto;
  aspect-ratio: 3 / 2;
  border-radius: var(--r-lg);
  border: 1px solid var(--linea-2);
  background:
    linear-gradient(rgba(234, 241, 246, 0.035) 1px, transparent 1px) 0 0 / 100% 12.5%,
    linear-gradient(90deg, rgba(234, 241, 246, 0.035) 1px, transparent 1px) 0 0 / 12.5% 100%,
    linear-gradient(160deg, var(--marea-2), var(--marea) 60%, #0e2037);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(234, 241, 246, 0.08);
  overflow: hidden;
}
.hf-inner { position: absolute; inset: 0; font-family: var(--font-body); }
.hf-label { position: absolute; left: calc(4.5 * var(--k)); top: calc(4 * var(--k)); font-size: calc(2.3 * var(--k)); color: var(--bruma-2); font-weight: 500; }

/* Documento */
.hf-doc {
  position: absolute; left: calc(5 * var(--k)); top: calc(12 * var(--k)); width: calc(22 * var(--k)); height: calc(34 * var(--k));
  background: #f6f8fa; border-radius: calc(1.2 * var(--k)); overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}
.hf-doc i { position: absolute; left: calc(2.5 * var(--k)); height: calc(1 * var(--k)); border-radius: var(--k); background: #cfd8e3; }
.hf-doc i:nth-child(1) { top: calc(3.5 * var(--k)); width: calc(9 * var(--k)); height: calc(1.5 * var(--k)); background: #0b1a2b; }
.hf-doc i:nth-child(2) { top: calc(7.5 * var(--k)); width: calc(13 * var(--k)); }
.hf-doc i:nth-child(3) { top: calc(10.3 * var(--k)); width: calc(11 * var(--k)); }
.hf-doc i:nth-child(4) { top: calc(14.5 * var(--k)); width: calc(15 * var(--k)); }
.hf-doc i:nth-child(5) { top: calc(17.3 * var(--k)); width: calc(15 * var(--k)); }
.hf-doc i:nth-child(6) { top: calc(20.1 * var(--k)); width: calc(12 * var(--k)); }
.hf-doc i:nth-child(7) { top: calc(25 * var(--k)); width: calc(7 * var(--k)); left: auto; right: calc(2.5 * var(--k)); }
.hf-doc i:nth-child(8) { top: calc(28 * var(--k)); width: calc(9 * var(--k)); left: auto; right: calc(2.5 * var(--k)); height: calc(1.5 * var(--k)); background: #0b1a2b; }
.hf-doc__name { position: absolute; left: calc(5 * var(--k)); top: calc(48.5 * var(--k)); width: calc(22 * var(--k)); text-align: center; font-size: calc(1.9 * var(--k)); color: var(--bruma); white-space: nowrap; }
.hf-scan {
  position: absolute; left: 0; right: 0; top: 0; height: calc(2 * var(--k));
  background: linear-gradient(to bottom, rgba(127, 214, 200, 0), rgba(127, 214, 200, 0.9));
  box-shadow: 0 0 10px 2px rgba(127, 214, 200, 0.45);
  opacity: 0;
}

/* Campos extraídos */
.hf-fields { position: absolute; left: calc(31 * var(--k)); top: calc(11 * var(--k)); display: grid; gap: calc(1.4 * var(--k)); justify-items: start; }
.hf-field {
  display: flex; align-items: center; gap: var(--k);
  padding: calc(1.1 * var(--k)) calc(1.8 * var(--k)); border-radius: calc(1.1 * var(--k));
  background: rgba(11, 26, 43, 0.7); border: 1px solid rgba(127, 214, 200, 0.35);
  font-size: calc(1.9 * var(--k)); color: var(--espuma); white-space: nowrap; line-height: 1.2;
}
.hf-field span { color: var(--bruma-2); }
.hf-field b { font-weight: 500; }

/* Bloques a3ERP y portal */
.hf-erp, .hf-portal {
  position: absolute; width: calc(30 * var(--k)); border-radius: calc(1.6 * var(--k));
  background: rgba(11, 26, 43, 0.75); border: 1px solid var(--linea-2);
  padding: calc(2 * var(--k)) calc(2.2 * var(--k));
}
.hf-erp { left: calc(65 * var(--k)); top: calc(9 * var(--k)); }
.hf-portal { left: calc(65 * var(--k)); bottom: calc(7 * var(--k)); }
.hf-block__title { font-family: var(--font-display); font-weight: 700; font-size: calc(2.6 * var(--k)); letter-spacing: -0.01em; margin-bottom: calc(1.2 * var(--k)); display: flex; align-items: center; gap: calc(1.2 * var(--k)); }
.hf-block__title::before { content: ""; width: calc(1.4 * var(--k)); height: calc(1.4 * var(--k)); border-radius: 50%; background: var(--boya); }
.hf-ledger { display: grid; gap: var(--k); }
.hf-ledger-row { display: flex; align-items: center; justify-content: space-between; font-size: calc(1.9 * var(--k)); color: var(--bruma); padding: calc(0.9 * var(--k)) calc(1.2 * var(--k)); border-radius: calc(0.8 * var(--k)); background: rgba(234, 241, 246, 0.05); transform-origin: left center; }
.hf-ledger-row b { color: var(--espuma); font-weight: 500; }
.hf-check { width: calc(2.6 * var(--k)); height: calc(2.6 * var(--k)); border-radius: 50%; background: var(--vidrio); color: var(--abismo); display: grid; place-items: center; font-size: calc(1.8 * var(--k)); font-weight: 700; }
.hf-portal__row { display: flex; align-items: center; gap: calc(1.4 * var(--k)); font-size: calc(1.9 * var(--k)); color: var(--bruma); }
.hf-portal__doc { flex: none; width: calc(3.2 * var(--k)); height: calc(4 * var(--k)); border-radius: calc(0.5 * var(--k)); background: #f6f8fa; position: relative; }
.hf-portal__doc::after { content: ""; position: absolute; left: calc(0.6 * var(--k)); right: calc(0.6 * var(--k)); top: var(--k); height: calc(0.5 * var(--k)); background: #cfd8e3; box-shadow: 0 var(--k) 0 0 #cfd8e3, 0 calc(2 * var(--k)) 0 0 #cfd8e3; }

/* Conectores (uno para escritorio y otro para móvil) */
.hf-links { position: absolute; inset: 0; width: 100%; height: 100%; }
.hf-links path { fill: none; stroke: var(--vidrio); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 400; stroke-dashoffset: 400; opacity: 0.85; }
.hf-links--mobile { display: none; }

@media (max-width: 600px) {
  .hf-stage { --k: 1.3cqw; aspect-ratio: 1 / 1; max-width: 460px; }
  .hf-doc { left: calc(4.6 * var(--k)); top: calc(10 * var(--k)); }
  .hf-doc__name { left: calc(4.6 * var(--k)); top: calc(46.5 * var(--k)); }
  .hf-fields { left: calc(31 * var(--k)); top: calc(9 * var(--k)); }
  .hf-erp, .hf-portal { width: calc(33 * var(--k)); top: auto; bottom: calc(4.6 * var(--k)); }
  .hf-erp { left: calc(4.6 * var(--k)); }
  .hf-portal { left: calc(42 * var(--k)); }
  .hf-links--desktop { display: none; }
  .hf-links--mobile { display: block; }
}

/* Respeto a reduced motion: estado final fijo */
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
  .btn, .tile__media img { transition: none; }
}

/* ==========================================================================
   Proyectos (portada e índice)
   ========================================================================== */
.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.5vw, 28px); }
.tile { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tile--featured { grid-column: span 2; }
.tile__media {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  border: 1px solid var(--linea); background: var(--marea);
  aspect-ratio: 16 / 10;
}
.tile--featured .tile__media { aspect-ratio: 16 / 9; }
.tile__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.tile:hover .tile__media img, .tile:focus-within .tile__media img { transform: scale(1.035); }
.tile__media .status { position: absolute; left: 12px; top: 12px; }
.tile__body { display: grid; gap: 8px; }
.tile h3 { margin: 0; font-size: clamp(1.15rem, 1.6vw, 1.4rem); }
.tile--featured h3 { font-size: clamp(1.4rem, 2.4vw, 2rem); }
.tile h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-md); }
.tile h3 a:hover { color: var(--boya-2); }
.tile p { margin: 0; color: var(--bruma); font-size: 0.98rem; }
.tile .tags { margin-top: 2px; }

@media (max-width: 960px) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .projects { grid-template-columns: 1fr; }
  .tile--featured { grid-column: span 1; }
}

/* ==========================================================================
   Servicios: lista editorial (no tarjetas)
   ========================================================================== */
.services { border-top: 1px solid var(--linea); }
.services li {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 16px clamp(24px, 4vw, 64px);
  padding: clamp(22px, 3vw, 34px) 0;
  border-bottom: 1px solid var(--linea);
}
.services h3 { margin: 0; }
.services p { margin: 0 0 10px; color: var(--bruma); }
.services ul { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.services ul li { display: inline; padding: 0; border: 0; font-size: 0.9rem; color: var(--bruma-2); grid-template-columns: none; }
.services ul li::before { content: "—"; margin-right: 6px; color: var(--vidrio); }
@media (max-width: 700px) { .services li { grid-template-columns: 1fr; gap: 8px; } }

/* ==========================================================================
   Trayectoria: línea temporal (es una secuencia real)
   ========================================================================== */
.timeline { display: grid; gap: 0; }
.timeline li {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 12px 24px;
  padding: 18px 0; border-top: 1px solid var(--linea); position: relative;
}
.timeline li:last-child { border-bottom: 1px solid var(--linea); }
.timeline time, .timeline .when { color: var(--vidrio); font-weight: 500; font-size: 0.95rem; padding-top: 3px; }
.timeline h3, .timeline h4 { margin: 0 0 4px; font-size: 1.15rem; }
.timeline p { margin: 0; color: var(--bruma); font-size: 0.97rem; max-width: 60ch; }
@media (max-width: 600px) { .timeline li { grid-template-columns: 1fr; gap: 4px; } }

/* Herramientas */
.chips { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.chips li { padding: 9px 14px; border: 1px solid var(--linea-2); border-radius: 10px; font-size: 0.95rem; color: var(--espuma); background: rgba(234, 241, 246, 0.02); }

/* ==========================================================================
   Contacto
   ========================================================================== */
.contact { border-top: 1px solid var(--linea); }
.contact__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 5vw, 80px); align-items: start; }
.contact__mail {
  display: inline-block; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em;
  font-size: clamp(1.6rem, 4.2vw, 3.1rem); line-height: 1.05; color: var(--espuma);
  border-bottom: 3px solid var(--boya); padding-bottom: 4px; margin: 6px 0 22px;
  overflow-wrap: anywhere; transition: color 0.25s, border-color 0.25s;
}
.contact__mail:hover { color: var(--boya-2); }
.contact__list { display: grid; gap: 14px; padding-top: 10px; }
.contact__list li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--linea); }
.contact__list li:last-child { border-bottom: 1px solid var(--linea); }
.contact__list span { color: var(--bruma-2); font-size: 0.92rem; padding-top: 2px; }
@media (max-width: 800px) { .contact__grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Pie
   ========================================================================== */
.footer { border-top: 1px solid var(--linea); padding: 28px 0 40px; color: var(--bruma-2); font-size: 0.9rem; }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.footer nav { display: flex; gap: 20px; }
.footer a:hover { color: var(--espuma); }

/* ==========================================================================
   Páginas de proyecto
   ========================================================================== */
.phero { position: relative; padding-top: calc(var(--nav-h) + clamp(44px, 7vw, 90px)); padding-bottom: clamp(28px, 4vw, 48px); overflow: hidden; }
.phero .wrap { position: relative; z-index: 1; }
.crumb { display: inline-flex; align-items: center; gap: 8px; color: var(--bruma); font-size: 0.95rem; margin-bottom: 22px; }
.crumb:hover { color: var(--espuma); }
.crumb svg { width: 16px; height: 16px; }
.phero h1 { font-size: clamp(2.3rem, 5.2vw, 4.2rem); max-width: 16ch; margin-bottom: 0.4em; }
.phero__lead { font-size: clamp(1.1rem, 1.5vw, 1.3rem); color: var(--bruma); max-width: 40rem; margin-bottom: 28px; }
.meta { display: flex; flex-wrap: wrap; gap: 10px 36px; margin: 0; padding: 18px 0; border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); }
.meta div { display: grid; gap: 2px; }
.meta dt { font-size: 0.82rem; color: var(--bruma-2); }
.meta dd { margin: 0; font-weight: 500; }

/* Captura con parallax dentro de un marco */
.shot { margin: 0; position: relative; z-index: 1; }
.shot__frame {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  border: 1px solid var(--linea-2); background: var(--marea);
  aspect-ratio: 16 / 10;
  box-shadow: 0 50px 100px -50px rgba(0, 0, 0, 0.8);
}
.shot__frame img { position: absolute; left: 0; top: -8%; width: 100%; height: 116%; object-fit: cover; will-change: transform; }
.shot figcaption { margin-top: 12px; color: var(--bruma-2); font-size: 0.9rem; }

/* Cuerpo del proyecto: texto + lateral */
.pbody { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(32px, 6vw, 96px); align-items: start; padding-top: clamp(48px, 7vw, 96px); }
.prose { max-width: 66ch; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-top: 2.2em; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--bruma); }
.prose strong { color: var(--espuma); font-weight: 500; }
.prose ul { padding-left: 1.1em; list-style: disc; margin-bottom: 1.1em; }
.prose li { margin-bottom: 0.35em; }
.prose li::marker { color: var(--vidrio); }
.aside { position: sticky; top: calc(var(--nav-h) + 24px); display: grid; gap: 28px; }
.aside h3 { font-size: 1rem; margin: 0 0 10px; color: var(--bruma-2); font-family: var(--font-body); font-weight: 500; }
.aside .tags li { font-size: 0.92rem; padding: 6px 11px; color: var(--espuma); }
@media (max-width: 900px) { .pbody { grid-template-columns: 1fr; } .aside { position: static; } }

/* Cómo funciona: pasos (secuencia real, por eso van numerados) */
.flow { counter-reset: paso; display: grid; gap: 0; margin: 20px 0 8px; border-left: 2px solid var(--linea-2); }
.flow li { counter-increment: paso; position: relative; padding: 4px 0 26px 30px; }
.flow li:last-child { padding-bottom: 6px; }
.flow li::before {
  content: counter(paso);
  position: absolute; left: -16px; top: 2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--abismo); border: 2px solid var(--vidrio); color: var(--vidrio);
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  display: grid; place-items: center;
}
.flow h3 { margin: 0 0 4px; font-size: 1.12rem; }
.flow p { margin: 0; }

/* Paginación entre proyectos */
.pager { margin-top: clamp(56px, 8vw, 110px); border-top: 1px solid var(--linea); display: grid; grid-template-columns: 1fr 1fr; }
.pager a { padding: 26px 0; display: grid; gap: 6px; color: var(--bruma); }
.pager a:last-child { text-align: right; border-left: 1px solid var(--linea); padding-left: 24px; }
.pager a:first-child { padding-right: 24px; }
.pager a span { font-size: 0.85rem; color: var(--bruma-2); }
.pager a strong { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--espuma); letter-spacing: -0.01em; transition: color 0.2s; }
.pager a:hover strong { color: var(--boya-2); }
@media (max-width: 600px) { .pager { grid-template-columns: 1fr; } .pager a:last-child { text-align: left; border-left: 0; border-top: 1px solid var(--linea); padding-left: 0; } }

/* Lista de webs gestionadas */
.sites { border-top: 1px solid var(--linea); margin-bottom: 1.4em; }
.sites li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--linea); align-items: center; }
.sites a { color: var(--espuma); font-weight: 500; }
.sites a:hover { color: var(--boya-2); }
.sites span { color: var(--bruma-2); font-size: 0.9rem; }

/* ==========================================================================
   Sobre mí
   ========================================================================== */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.about__photo { position: sticky; top: calc(var(--nav-h) + 24px); }
.about__photo .shot__frame { aspect-ratio: 4 / 5; }
.about__photo .shot__frame img { height: 114%; top: -7%; }
.about h1 { font-size: clamp(2.3rem, 5vw, 4rem); }
.about .prose p:first-of-type { font-size: 1.15rem; color: var(--espuma); }
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about__photo { position: static; max-width: 420px; }
}

/* Páginas legales / 404 */
.plain { padding-top: calc(var(--nav-h) + clamp(44px, 7vw, 90px)); }
.plain h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
.plain .prose h2 { font-size: 1.4rem; margin-top: 1.8em; }
.notfound { min-height: 70vh; display: grid; align-content: center; }
.notfound h1 { font-size: clamp(3rem, 12vw, 9rem); line-height: 1; color: var(--vidrio); }
