/* ==========================================================================
   SK/Branders — hoja de estilos única
   Referencia tipográfica: ci-portal.de (cip2022_v2)
   Tokens editables en :root. Todo lo demás depende de ellos.
   ========================================================================== */

:root {
  /* Tipografía */
  --font: "aktiv-grotesk", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --w-body: 300;        /* ci-portal usa 300 en cuerpo */
  --w-title: 300;       /* ci-portal: pide 100 y cae a Light (300) */
  --w-strong: 400;      /* ci-portal no usa negrita (300); acá un paso apenas */
  --fs-body: 19px;
  --lh-body: 22px;
  --ls-body: 0.03em;
  --fs-small: 13px;     /* categoría / fecha */
  --fs-tiny: 10px;      /* ci-portal small */

  /* Escala del título (ci-portal: 100/95 → 80/75 → 55/58) */
  --fs-h1: 100px;
  --lh-h1: 95px;
  --ls-h1: -0.025em;
  --h1-shift: -7px;     /* compensación óptica del margen izquierdo */

  /* Color */
  --ink: #000;
  --muted: #6b6b6b;
  --paper: #fff;
  --accent: #e0301e;    /* la barra roja del logo */
  --header-bg: rgba(255, 255, 255, 0.85);

  /* Layout */
  --max: 1400px;
  --pad: 20px;
  --header-h: 65px;
  --top-gap: 135px;     /* ci-portal #top margin-top */
  --item-gap: 60px;     /* separación entre proyectos en la home */
  --thumb: 46px;

  /* Movimiento */
  --t-link: 0.3s;       /* ci-portal a { transition: .3s all } */
  --t-header: 0.5s;     /* ci-portal header .5s ease-in-out */
  --t-fade: 1.5s;       /* ci-portal .container 2.5s; acá 1.5s */
  --hover-opacity: 0.5; /* ci-portal a:hover opacity .5 */
}

/* ---------- Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border: 0; }
html { height: 100.01%; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  font-family: var(--font);
  font-weight: var(--w-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-hyphens: auto; hyphens: auto;
  /* sin -webkit-font-smoothing: antialiased → subpixel como ci-portal, más nítido en Mac */
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: opacity var(--t-link) ease-in-out, color var(--t-link) ease-in-out; }
a:hover { opacity: var(--hover-opacity); }
strong, b { font-weight: var(--w-strong); }
p { margin: 0; }
p + p { margin-top: var(--lh-body); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--pad); top: var(--pad); background: var(--paper); padding: 8px; z-index: 100; }

/* ---------- Header (fijo, translúcido, se esconde al bajar) ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  height: var(--header-h);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  transition: transform var(--t-header) ease-in-out;
}
.site-header.nav-up { transform: translateY(-150px); }
.site-header .inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  height: 100%; display: flex; align-items: center; gap: 2em;
}
.logo { font-size: 20px; font-weight: var(--w-body); letter-spacing: 0.03em; white-space: nowrap; }
.logo .slash { color: var(--accent); }
.nav { display: flex; gap: 15px; list-style: none; }
.nav a { display: block; }
.nav a[aria-current="page"] { font-weight: 500; }
.nav.social { margin-left: auto; color: var(--muted); }
.nav.lang a { color: var(--muted); }

/* ---------- Contenedor ---------- */
.container {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  animation: transitionIn var(--t-fade) ease-out both;
}
@keyframes transitionIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .container { animation: none; }
  a, .site-header, h1, .title { transition: none !important; }
}
main { padding-top: var(--top-gap); min-height: 70vh; }

/* ---------- Tipografía grande ---------- */
h1, .title {
  font-family: var(--font);
  font-weight: var(--w-title);
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  letter-spacing: var(--ls-h1);
  margin-left: var(--h1-shift);
  padding-top: 8px;
  width: 95%;
  -webkit-hyphens: auto; hyphens: auto;
  transition: font-size var(--t-link) ease-in-out, line-height var(--t-link) ease-in-out, opacity var(--t-link) ease-in-out;
}
h2 { font-size: 25px; line-height: 1.15; font-weight: var(--w-body); letter-spacing: 0.02em; margin: 2em 0 0.5em; }
h3 { font-size: var(--fs-body); font-weight: 500; letter-spacing: 0.02em; margin: 1.5em 0 0.25em; }
.meta { font-size: var(--fs-small); letter-spacing: 0.02em; line-height: 1.3; color: var(--muted); margin-bottom: 4px; }
.meta b, .meta strong { color: var(--ink); font-weight: var(--w-strong); }
small { font-size: var(--fs-tiny); line-height: 15px; letter-spacing: 0.08em; }

/* ---------- Home: lista de proyectos ---------- */
.works { list-style: none; margin-bottom: 200px; }
.works li { margin-bottom: var(--item-gap); }
.works .meta { margin-bottom: 6px; }
.works .title { margin: 0 0 0 var(--h1-shift); padding-top: 0; }
.works .title a { display: inline; }
.works .title a:hover { opacity: var(--hover-opacity); }
.works .thumb {
  display: inline-block; width: var(--thumb); height: var(--thumb);
  object-fit: cover; vertical-align: baseline; margin-left: 0.12em;
  transition: opacity 0.2s;
}

/* ---------- Proyecto ---------- */
.back { display: inline-block; font-size: var(--fs-small); color: var(--muted); margin-bottom: 30px; }
.project h1 { margin-bottom: 50px; }
.project .body { display: grid; grid-template-columns: minmax(0, 500px) minmax(0, 1fr); gap: 40px 80px; margin-bottom: 80px; }
.project .text { max-width: 500px; }
.project .aside { color: var(--ink); }
.project .aside p + p { margin-top: 0; }
.project .aside .label { margin-top: var(--lh-body); }
.project .aside .label:first-child { margin-top: 0; }
.project .note { font-size: var(--fs-small); color: var(--muted); margin-top: var(--lh-body); }
.gallery { list-style: none; display: grid; gap: 20px; margin-bottom: 40px; }
.gallery img { width: 100%; }
.pager { display: flex; justify-content: space-between; gap: 20px; margin: 40px 0 120px; }
.pager span { color: var(--muted); font-size: var(--fs-small); display: block; }

/* ---------- Páginas de texto ---------- */
.page h1 { margin-bottom: 50px; }
.page .prose { max-width: 640px; }
.page .prose h2 { max-width: 560px; }
.page .prose .refs { color: var(--muted); font-size: var(--fs-small); margin-top: 0.5em; }
.people { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 60px 40px; margin: 100px 0 120px; max-width: 900px; }
.people img { width: 180px; height: 180px; object-fit: cover; filter: grayscale(1); margin-bottom: 20px; }
.people .role { color: var(--muted); font-size: var(--fs-small); margin-bottom: 12px; }
.faq { max-width: 640px; margin: 100px 0 120px; }
.faq details { border-top: 1px solid #ddd; padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 500; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin-top: 10px; }

/* ---------- Formulario de contacto ---------- */
.contact { max-width: 500px; margin: 100px 0 120px; }
.contact label { display: block; font-size: var(--fs-small); color: var(--muted); margin: 18px 0 6px; }
.contact input, .contact textarea {
  width: 100%; font: inherit; letter-spacing: inherit; color: var(--ink);
  border-bottom: 1px solid var(--ink); background: transparent; padding: 6px 0; border-radius: 0;
}
.contact textarea { min-height: 120px; resize: vertical; }
.contact button { font: inherit; letter-spacing: inherit; background: var(--ink); color: var(--paper); padding: 10px 22px; margin-top: 24px; cursor: pointer; }
.contact button:hover { opacity: var(--hover-opacity); }
.contact .status { margin-top: 16px; font-size: var(--fs-small); color: var(--muted); }
.hp { position: absolute; left: -9999px; }

/* ---------- Ir arriba ---------- */
.totop { display: inline-block; margin: 20px 0 60px; font-size: 25px; }

/* ---------- Footer ---------- */
.site-footer { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad) 120px; font-size: var(--fs-body); }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 40px 60px; margin-top: 40px; }
.site-footer .col { min-width: 220px; }
.site-footer .social { display: flex; gap: 15px; list-style: none; color: var(--muted); }
.site-footer .legal { margin-top: 60px; font-size: var(--fs-small); color: var(--muted); }
.site-footer .legal a { color: var(--ink); }

/* ---------- WhatsApp ---------- */
.wa {
  position: fixed; right: 24px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%;
  background: #25d366; display: grid; place-items: center; z-index: 9; box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.wa svg { width: 30px; height: 30px; fill: #fff; }

/* ---------- Página privada: secciones importadas de Squarespace ---------- */
.private .prose.sections { max-width: none; }
.private .sec { margin: 0 0 80px; }
.private .sec > p, .private .sec > h2, .private .sec > h3, .private .sec > h4, .private .sec > .caption { max-width: 720px; }
.private .sec.hero {
  position: relative; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
  min-height: 72vh; display: flex; align-items: center; padding: 60px var(--pad);
  background-color: #222; background-size: cover; background-position: center; color: #fff;
}
.private .sec.hero h2 {
  max-width: var(--max); width: 100%; margin: 0 auto; padding: 0 var(--pad);
  font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: var(--ls-h1); font-weight: 300; color: #fff;
  text-shadow: 0 2px 30px rgba(0,0,0,.25);
}
.private .sec.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px 80px; align-items: start; }
.private .sec.cols .col-a h2, .private .sec.cols .col-a h3 { margin-top: 0; }
.private .sec.cols .col-a p { max-width: 380px; }
.accordion { border-top: 1px solid #ddd; }
.accordion details { border-bottom: 1px solid #ddd; }
.accordion summary {
  cursor: pointer; list-style: none; font-size: 25px; line-height: 1.2; font-weight: var(--w-body); letter-spacing: 0.02em;
  padding: 22px 40px 22px 0; position: relative;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: '+'; position: absolute; right: 4px; top: 18px; font-size: 28px; font-weight: 300; transition: transform var(--t-link); }
.accordion details[open] summary::after { transform: rotate(45deg); }
.accordion details > div { padding: 0 0 26px; max-width: 640px; }
.accordion details > div p + p { margin-top: 10px; }
.accordion + p, .accordion + h2, .accordion + h3 { margin-top: 30px; }
.private .has-hero > h1 { position: absolute; left: -9999px; }
.private .has-hero .prose { margin-top: calc(-1 * var(--top-gap) + var(--header-h)); }
@media screen and (max-width: 835px) {
  .private .sec.cols { grid-template-columns: 1fr; gap: 24px; }
  .private .sec.hero { min-height: 60vh; }
}

/* ---------- Página privada ---------- */
.private main { padding-top: var(--top-gap); }
.private .prose { max-width: 720px; }
.private .prose img { margin: 40px 0; }
.private .prose h2 { margin-top: 3em; }
.private .prose h4 { font-size: 25px; font-weight: var(--w-body); margin: 3em 0 0.5em; }
.private .prose .caption { font-size: var(--fs-small); color: var(--muted); }
.private-nav { display: flex; gap: 15px; flex-wrap: wrap; font-size: var(--fs-small); color: var(--muted); margin-bottom: 60px; }

/* ==========================================================================
   Breakpoints — mismos cortes que ci-portal
   ========================================================================== */
@media screen and (max-width: 1200px) {
  .project .body { grid-template-columns: minmax(0, 1fr) minmax(0, 40%); }
}
@media screen and (max-width: 1000px) {
  .project .body { grid-template-columns: 1fr; }
}
@media screen and (max-width: 835px) {
  :root { --fs-h1: 80px; --lh-h1: 75px; --top-gap: 135px; }
  .project h1, .page h1 { margin-bottom: 40px; }
  .site-header .inner { gap: 1.2em; }
  .nav.social { display: none; }
}
@media screen and (max-width: 750px) {
  /* Como ci-portal en móvil: logo en dos líneas a la izquierda, menú en dos líneas a la derecha */
  :root { --header-h: 84px; }
  .site-header .inner { flex-wrap: nowrap; align-items: flex-start; padding-top: 16px; gap: 18px; }
  .logo { line-height: 1.15; }
  .logo .l2 { display: block; }
  .nav { flex-wrap: wrap; row-gap: 2px; column-gap: 12px; line-height: 1.15; padding-top: 1px; }
  .nav.lang { margin-left: auto; flex: none; }
}
@media screen and (max-width: 485px) {
  :root { --fs-h1: 55px; --lh-h1: 58px; --h1-shift: -3px; --thumb: 32px; --item-gap: 44px; --header-h: 84px; }
  .pager { flex-direction: column; }
}
