/* ==========================================================================
   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: 500;      /* brief: 500 contra el regular en 300 */
  --fs-body: 19px;
  --lh-body: 30px;      /* brief: 1.6 × 19px (antes 22px ≈ 1.16) */
  --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: 80px;        /* títulos: home e interiores (ci-portal usa 100; acá un paso menos) */
  --lh-h1: 84px;        /* brief: ratio 1.05 */
  --fs-h2: 80px;
  --lh-h2: 84px;
  --ls-h1: -0.01em;     /* brief: -1% del tamaño */
  --h1-shift: -7px;     /* compensación óptica del margen izquierdo */

  /* Color */
  --ink: #000;
  --muted: #6b6b6b;
  --paper: #fff;
  --accent: #ff7de9;    /* la barra rosa del logo (mismo rosa del widget del escritorio) */
  --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: 100px;    /* 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: manual; hyphens: manual; /* sin corte de palabras en párrafos */
  /* 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; font-size: var(--fs-h2); line-height: var(--lh-h2); }
.works .thumb { --thumb: 40px; }
.works .title a { display: inline; }
.works .title a:hover { opacity: var(--hover-opacity); }
.works .lead-title { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--w-body); letter-spacing: var(--ls-body); max-width: 720px; margin: 28px 0 0; }
.works .lead { font-size: var(--fs-body); line-height: var(--lh-body); max-width: 720px; margin-top: 28px; }
.works .lead-title + .lead { margin-top: 0; }
/* Animación superpuesta al texto (video con fondo blanco, multiply = transparente sobre papel) */
.works li.has-anim { position: relative; }
.works .anim { position: absolute; left: 0; bottom: -60px; width: 100%; height: auto; mix-blend-mode: multiply; pointer-events: none; z-index: 2; }
@media (max-width: 720px) { .works .anim { bottom: -30px; } }
.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%; }
.logos { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px 40px; margin-bottom: 60px; }
.logos li { display: flex; align-items: center; justify-content: center; }
.logos img { width: 100%; max-width: 320px; height: auto; }
@media (max-width: 720px) { .logos { grid-template-columns: repeat(2, 1fr); gap: 16px 24px; } }
.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);
}
/* Bloques de dos columnas: apilados a la izquierda (col-a arriba como intro, col-b debajo) */
.private .sec.cols { display: block; }
.private .sec.cols .col-a { margin-bottom: 24px; }
.private .sec.cols .col-a h2, .private .sec.cols .col-a h3 { margin-top: 0; }
.private .sec.cols .col-b > p, .private .sec.cols .col-b > h4, .private .sec.cols .col-b > .caption, .private .sec.cols .col-a > p { max-width: 720px; }
.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.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 video.vid { width: 100%; margin: 40px 0; background: #000; }
.project .media { margin: 0 0 40px; }
.project .media video.vid { display: block; width: 100%; background: #000; }
.project .text .caption { font-size: var(--fs-small); color: var(--muted); }
.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: 64px; --lh-h1: 67px; --fs-h2: 64px; --lh-h2: 67px; --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: 46px; --lh-h1: 48px; --fs-h2: 46px; --lh-h2: 48px; --h1-shift: -3px; --thumb: 32px; --item-gap: 72px; --header-h: 84px; }
  .pager { flex-direction: column; }
}

/* ---------- Hub (índice de privadas) ---------- */
.hub .hub-intro { max-width: 640px; margin-bottom: 80px; }
.hub-list { list-style: none; max-width: 900px; margin-bottom: 160px; }
.hub-item { padding: 28px 0; border-top: 1px solid #ddd; }
.hub-item h2 { margin: 4px 0 8px; }
.hub-url { font-size: var(--fs-small); color: var(--muted); word-break: break-all; }
.hub-url .pw { margin-left: 12px; white-space: nowrap; }
.hub-url code { font: inherit; color: var(--ink); }
.hub-actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.hub-actions .copy { font: inherit; font-size: var(--fs-small); letter-spacing: inherit; color: var(--ink); background: none; border: 1px solid var(--ink); padding: 6px 12px; cursor: pointer; transition: opacity var(--t-link); }
.hub-actions .copy:hover { opacity: var(--hover-opacity); }
.hub-actions .copy:disabled { opacity: 0.5; cursor: default; }

/* Botones genéricos del hub / editor */
[hidden] { display: none !important; }
.btn, .hub-actions .copy, .hub-actions .del { display: inline-block; font: inherit; font-size: var(--fs-small); letter-spacing: inherit; line-height: 1; color: var(--ink); background: none; border: 1px solid var(--ink); padding: 8px 12px; cursor: pointer; text-decoration: none; transition: opacity var(--t-link); }
.btn:hover, .hub-actions .del:hover { opacity: var(--hover-opacity); }
.btn.primary { background: var(--ink); color: var(--paper); }
.hub-actions .del { border-color: #bbb; color: var(--muted); }
.hub .empty { color: var(--accent); }
.hub-h { margin: 60px 0 0; }
.hub-new { max-width: 720px; margin: 30px 0 60px; padding: 24px 0; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }
.hub-new label, .ed-settings label { display: block; font-size: var(--fs-small); color: var(--muted); margin: 14px 0 6px; }
.hub-new input, .hub-new select, .ed-settings input, .ed-settings select { width: 100%; font: inherit; letter-spacing: inherit; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--ink); padding: 6px 0; border-radius: 0; }
.hub-new input:focus, .ed-settings input:focus { outline: none; border-bottom-color: var(--accent); }
.hub-new .prefix { display: flex; align-items: baseline; gap: 4px; border-bottom: 1px solid var(--ink); }
.hub-new .prefix span { color: var(--muted); white-space: nowrap; }
.hub-new .prefix input { border: 0; }
.hub-new .row, .ed-settings .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 24px; }
.hub-new .hub-actions { margin-top: 24px; }
.hub-new .status { font-size: var(--fs-small); color: var(--accent); margin-top: 10px; }
.edit-bar { margin: 60px 0 0; }

/* Ayuda */
.help .prose { max-width: 720px; }
.help .prose ol, .help .prose ul { margin: 0 0 var(--lh-body) 1.2em; }
.help .prose li { margin-bottom: 8px; }
.help .prose h3 { margin-top: 1.5em; }
.help .prose code { font-size: 0.9em; background: #f2f2f2; padding: 1px 5px; }

/* Editor */
body.editing .site-header, body.editing .site-footer, body.editing .wa { display: none; }
body.editing main { padding-top: 0; }
.editor { padding-top: 20px; }
.ed-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 0; background: var(--header-bg); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); border-bottom: 1px solid #ddd; }
.ed-url { font-size: var(--fs-small); color: var(--muted); word-break: break-all; }
.ed-spacer { flex: 1; }
.ed-bar .status { font-size: var(--fs-small); color: var(--muted); min-width: 90px; }
.ed-settings { max-width: 900px; padding: 10px 0 24px; border-bottom: 1px solid #ddd; }
.ed-tabs { display: flex; gap: 0; margin: 24px 0 0; border-bottom: 1px solid #ddd; }
.ed-tabs .tab { font: inherit; font-size: var(--fs-small); letter-spacing: inherit; background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; margin-bottom: -1px; color: var(--muted); cursor: pointer; }
.ed-tabs .tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.ed-tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 0; }
.ed-tools button { font: inherit; font-size: var(--fs-small); letter-spacing: inherit; background: none; border: 1px solid #ccc; padding: 6px 10px; cursor: pointer; color: var(--ink); }
.ed-tools button:hover { border-color: var(--ink); }
#ed-rich { min-height: 50vh; outline: none; padding: 10px 0 120px; }
#ed-rich:focus { box-shadow: -12px 0 0 -10px var(--accent); }
#ed-rich .ed-block { position: relative; margin: 30px 0; max-width: 900px; }
#ed-rich .ed-block > img, #ed-rich .ed-block > video, #ed-rich .ed-block > figure { margin: 0; }
#ed-rich .ed-block .ed-remove { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.75); color: #fff; font: 18px/28px sans-serif; cursor: pointer; opacity: 0; transition: opacity .2s; }
#ed-rich .ed-block:hover .ed-remove { opacity: 1; }
#ed-html.drop { outline: 2px dashed var(--accent); }
#ed-rich.drop { outline: 2px dashed var(--accent); outline-offset: 8px; }
#ed-rich img { max-width: 100%; }
#ed-html { width: 100%; min-height: 60vh; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid #ddd; padding: 12px; margin: 14px 0 120px; resize: vertical; }
.ed-raw { display: block; font-size: var(--fs-small); margin-top: 14px; }
.ed-raw input { margin-right: 6px; }
#pane-html .caption { margin-top: 14px; max-width: 720px; }

/* Páginas del hub: texto a 720, tablas e imágenes más anchas */
.private .prose { max-width: none; }
.private .prose > p, .private .prose > h2, .private .prose > h3, .private .prose > h4, .private .prose > ul, .private .prose > ol, .private .prose > .caption { max-width: 720px; }
.private .prose > img, .private .prose > video { max-width: 900px; width: 100%; }

/* PDF embebido (subido desde el hub) */
.private .prose figure.pdf { max-width: 900px; margin: 30px 0 40px; }
.private .prose figure.pdf iframe { width: 100%; height: 80vh; min-height: 500px; border: 1px solid #ddd; background: #f4f4f4; display: block; }
.private .prose figure.pdf figcaption { display: flex; align-items: center; gap: 14px; margin-top: 12px; font-size: var(--fs-small); color: var(--muted); }
#ed-rich figure.pdf iframe { pointer-events: none; height: 320px; min-height: 0; }

/* Tablas en páginas privadas (presupuestos) */
.private .prose table { border-collapse: collapse; width: 100%; max-width: 900px; margin: 30px 0; font-size: 16px; line-height: 1.35; }
.private .prose th, .private .prose td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid #ddd; }
.private .prose th { font-weight: var(--w-strong); border-bottom-color: var(--ink); }
.private .prose ul, .private .prose ol { margin: 0 0 var(--lh-body) 1.2em; }
