/* ==========================================================================
   oscarrodrigo.com — estilos
   ========================================================================== */

@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/poppins-latin-700-normal.woff2") format("woff2"); }

:root {
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --line: #e5e5ea;
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --max: 1280px;
  --pad: clamp(16px, 4vw, 40px);
  --radius: 18px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --top-h: 112px;   /* alto de la cabecera arriba del todo */
  --logo: 72px;     /* tamaño del logo arriba del todo */
  --logo-n: 72;     /* el mismo número sin px (para la escala) */
}
@media (max-width: 700px) {
  :root { --top-h: 84px; --logo: 48px; --logo-n: 48; }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 60px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid #0071e3; outline-offset: 3px; border-radius: 4px; }

/* Cabecera ---------------------------------------------------------------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.top.is-scrolled { border-bottom-color: var(--line); }
.top__in {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  height: var(--top-h); display: flex; align-items: center; justify-content: space-between; gap: 16px;
  transition: height .45s var(--ease);
}
.logo {
  font-weight: 700; font-size: var(--logo); line-height: 1; letter-spacing: -.02em;
  transform-origin: left center; transition: transform .45s var(--ease);
}
.top.is-scrolled .top__in { height: 60px; }
.top.is-scrolled .logo { transform: scale(calc(30 / var(--logo-n))); }
main { padding-top: var(--top-h); }
.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); font-size: 14px; }
.nav a { color: var(--ink-2); transition: color .2s; }
.nav a:hover, .nav a.is-active { color: var(--ink); }
.nav .nav__cta { color: var(--ink); font-weight: 500; }
@media (max-width: 480px) { .nav { gap: 12px; font-size: 13px; } }
@media (max-width: 360px) { .nav { gap: 9px; font-size: 12px; } }

/* Hero -------------------------------------------------------------------- */
.hero { max-width: var(--max); margin: 0 auto; padding: clamp(64px, 12vw, 160px) var(--pad) clamp(40px, 7vw, 96px); }
.hero__kicker { margin: 0 0 12px; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.hero h1 { margin: 0; font-size: clamp(44px, 8.5vw, 112px); line-height: 1.02; letter-spacing: -.035em; font-weight: 700; }
.hero__lead { margin: 28px 0 0; max-width: 34ch; font-size: clamp(19px, 2vw, 24px); line-height: 1.4; color: var(--ink-2); }

/* Secciones --------------------------------------------------------------- */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 7vw, 96px) var(--pad); }
.section + .section { border-top: 1px solid var(--line); }
.section__head { display: grid; gap: 8px 48px; margin-bottom: clamp(28px, 4vw, 48px); }
@media (min-width: 900px) { .section__head { grid-template-columns: 1fr 1fr; align-items: end; } }
.section__head h2 { margin: 0; font-size: clamp(32px, 4.6vw, 56px); line-height: 1.05; letter-spacing: -.03em; font-weight: 700; }
.section__head p { margin: 0; color: var(--ink-2); font-size: 17px; max-width: 46ch; }

/* Mosaico de trabajos ----------------------------------------------------
   Cada .mosaic es una fila; cada .col una columna; cada .tile un trabajo.
   main.js calcula el ancho de cada columna según la proporción de sus
   imágenes para que todas las columnas de la fila acaben a la misma altura.
   En móvil (o sin JavaScript) los trabajos se apilan a su proporción real. */
.mosaics { --gap: clamp(12px, 1.6vw, 24px); display: grid; gap: var(--gap); container-type: inline-size; }
.col { display: grid; gap: var(--gap); }
.mosaic { display: grid; gap: var(--gap); }
.tile { margin: 0; position: relative; min-height: 0; }
.tile a {
  display: block; height: 100%; overflow: hidden;
  background: var(--bg-2); cursor: zoom-in;
}
.tile img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease), opacity .6s var(--ease);
}
.tile a:hover img { transform: scale(1.035); }

@media (min-width: 700px) {
  .mosaic.is-ready {
    display: flex;
    height: calc((100cqw - (var(--c) - 1) * var(--gap)) / var(--k));
  }
  .mosaic.is-ready .col { display: flex; flex-direction: column; flex: var(--g) 1 0; min-width: 0; }
  .mosaic.is-ready .tile { flex: var(--r) 1 0; }
}

/* Aparición suave al hacer scroll */
.js .tile { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .tile.is-in { opacity: 1; transform: none; }

/* Título del trabajo: etiqueta que aparece al pasar el ratón */
.tile figcaption {
  position: absolute; left: 14px; bottom: 14px; max-width: calc(100% - 28px);
  display: flex; flex-direction: column; gap: 1px;
  padding: 9px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
  font-size: 13px; line-height: 1.3; pointer-events: none;
  opacity: 0; transform: translateY(6px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.tile figcaption strong { font-weight: 600; }
.tile figcaption span { color: var(--ink-2); }
@media (hover: hover) {
  .tile:hover figcaption, .tile a:focus-visible + figcaption { opacity: 1; transform: none; }
}
/* En pantallas táctiles no hay hover: el título se ve en el visor */
@media (hover: none) { .tile figcaption { display: none; } }

/* Fotografía -------------------------------------------------------------- */
.mosaics + .photo-cta { margin-top: clamp(16px, 2vw, 28px); }
.photo-cta {
  position: relative; display: grid; gap: 6px;
  padding: clamp(32px, 6vw, 72px); border-radius: var(--radius);
  background: var(--ink); color: #fff; overflow: hidden;
  transition: transform .5s var(--ease);
}
.photo-cta:hover { transform: scale(.995); }
.photo-cta__label { font-size: 14px; color: #a1a1a6; }
.photo-cta__title { font-size: clamp(26px, 4vw, 48px); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; max-width: 18ch; }
.photo-cta__arrow { position: absolute; right: clamp(24px, 5vw, 64px); bottom: clamp(24px, 5vw, 64px); font-size: clamp(28px, 4vw, 48px); transition: transform .4s var(--ease); }
.photo-cta:hover .photo-cta__arrow { transform: translateX(8px); }

/* Pie --------------------------------------------------------------------- */
.foot { background: var(--bg-2); margin-top: clamp(48px, 7vw, 96px); }
.foot__in {
  max-width: var(--max); margin: 0 auto; padding: clamp(48px, 7vw, 88px) var(--pad) 40px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px;
}
.foot__brand { display: flex; align-items: center; gap: 20px; }
.foot__logo { font-weight: 700; font-size: 72px; line-height: .9; letter-spacing: -.03em; }
.foot__brand p { margin: 0; font-size: 15px; color: var(--ink-2); line-height: 1.45; }
.foot__brand strong { color: var(--ink); font-weight: 600; }
.foot__contact { display: flex; flex-direction: column; gap: 4px; text-align: right; font-size: clamp(18px, 2vw, 22px); font-weight: 500; }
.foot__contact a:hover { color: #0071e3; }
@media (max-width: 640px) { .foot__contact { text-align: left; } }
.foot__legal {
  max-width: var(--max); margin: 0 auto; padding: 18px var(--pad) 28px;
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 12px; color: var(--ink-2); border-top: 1px solid var(--line);
}
.linklike { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font-size: inherit; }
.linklike:hover { color: var(--ink); }

/* Visor (lightbox) -------------------------------------------------------- */
.lb {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: rgba(0, 0, 0, .94); color: #fff;
}
.lb::backdrop { background: rgba(0, 0, 0, .94); }
.lb[open] { display: grid; place-items: center; animation: lbIn .3s var(--ease); }
@keyframes lbIn { from { opacity: 0; } }
.lb__fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 64px 72px 24px; max-width: 100%; max-height: 100%; }
.lb__img { max-width: 100%; max-height: calc(100dvh - 140px); width: auto; height: auto; object-fit: contain; user-select: none; }
.lb__cap { font-size: 14px; color: #d2d2d7; text-align: center; }
.lb__cap strong { color: #fff; font-weight: 600; }
.lb__btn {
  position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 28px; line-height: 1;
  display: grid; place-items: center; transition: background .2s;
}
.lb__btn:hover { background: rgba(255, 255, 255, .24); }
.lb__close { top: 16px; right: 16px; }
.lb__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb__next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb__count { position: absolute; top: 28px; left: 24px; font-size: 13px; color: #a1a1a6; }
@media (max-width: 700px) {
  .lb__fig { padding: 64px 12px 24px; }
  .lb__prev, .lb__next { top: auto; bottom: 16px; transform: none; }
}

/* Aviso de cookies -------------------------------------------------------- */
.consent {
  position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px; margin: 0 auto; max-width: 520px;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .12);
  padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; font-size: 14px;
}
.consent[hidden] { display: none; }
.consent p { margin: 0; flex: 1 1 260px; color: var(--ink-2); }
.consent__btns { display: flex; gap: 8px; }
.consent button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 18px; cursor: pointer; font-size: 14px; font-weight: 500; }
.consent button.is-primary { background: var(--ink); border-color: var(--ink); color: #fff; }

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