/* Metaurbis: la cuenta completa. Los signos y los números cuelgan en una columna al margen
   (una manzana más una calle del símbolo), una raya de 2 px cierra cada cuenta y el + del logo firma el resultado. */
:root {
  --bg: #FFFFFF;
  --bg-alt: #F4EFF2;
  --line: #E9E2E7;
  --ink: #241B26;
  --muted: #6B6070;
  --accent: #B63A7E;
  --on-accent: #FFFFFF;
  --raya: #241B26;
  --logo-ink: #241B26;
  --logo-plus: #B63A7E;
  --footer-bg: #1C1720;
  --footer-line: transparent;
  --on-dark: #FFFFFF;
  --on-dark-muted: #B9AEB8;
  --accent-on-dark: #E06AA6;

  --font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --t-nota: 0.875rem;
  --t-ui: 1rem;
  --t-texto: clamp(1.0625rem, 1rem + 0.25vw, 1.125rem);
  --t-bajada: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  --t-h3: clamp(1.3125rem, 1.2rem + 0.4vw, 1.5rem);
  --t-sub: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
  --t-h2: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  --t-cifra: clamp(2.5rem, 2.2rem + 1vw, 3rem);
  --t-h1: clamp(2rem, 1.5rem + 2.6vw, 3.5rem);
  --renglon: 1.6875rem;
  --medida: 34em;
  --wrap: 1200px;
  --gutter: clamp(20px, 4.5vw, 64px);
  --manzana: clamp(26px, 6vw, 64px);
  --calle: clamp(14px, 2.25vw, 27px);
  --signo: calc(var(--manzana) + var(--calle));
  --section: clamp(4.25rem, 2.6rem + 5vw, 6.75rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1C1720;
    --bg-alt: #241B26;
    --line: #3A2F3D;
    --ink: #F4EFF2;
    --muted: #B9AEB8;
    --accent: #E06AA6;
    --on-accent: #241B26;
    --raya: #F4EFF2;
    --logo-ink: #FFFFFF;
    --logo-plus: #E06AA6;
    --footer-line: #3A2F3D;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #1C1720;
  --bg-alt: #241B26;
  --line: #3A2F3D;
  --ink: #F4EFF2;
  --muted: #B9AEB8;
  --accent: #E06AA6;
  --on-accent: #241B26;
  --raya: #F4EFF2;
  --logo-ink: #FFFFFF;
  --logo-plus: #E06AA6;
  --footer-line: #3A2F3D;
  color-scheme: dark;
}

@font-face {
  font-family: 'Archivo';
  src: url('../assets/fonts/archivo-variable.woff2') format('woff2');
  font-weight: 400 700;
  font-stretch: 100% 112.5%;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 84px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-texto);
  line-height: 1.5;
  font-kerning: normal;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
h1 { font-size: var(--t-h1); font-weight: 700; font-stretch: 112.5%; line-height: 1.1; letter-spacing: -0.012em; }
h2 { font-size: var(--t-h2); font-weight: 700; font-stretch: 112.5%; line-height: 1.1; letter-spacing: -0.01em; }
h3, h4 { font-size: var(--t-h3); font-weight: 600; line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 50;
  background: var(--accent); color: var(--on-accent); padding: 0.6rem 1rem; font-weight: 600; text-decoration: none;
}
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 8px); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px)); }
.nowrap { white-space: nowrap; }
.measure { max-width: var(--medida); }
.stack { display: flex; flex-direction: column; gap: var(--renglon); }
.stack-lg { display: flex; flex-direction: column; gap: calc(var(--renglon) * 2); }
.lead { font-size: var(--t-bajada); line-height: 1.45; max-width: 30em; }
.muted { color: var(--muted); }
.small { font-size: var(--t-nota); line-height: 1.5; }
.solo-impresion { display: none; }
@media (min-width: 760px) { .en-texto { margin-left: var(--signo); } }

/* Botones: la ochava del símbolo (17,3 % del alto) se dibuja en el fondo, así el foco no se recorta */
.btn {
  --o: 8px;
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.7rem 1.25rem;
  background: none; color: var(--on-accent);
  font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none;
  border: 0; border-radius: 0; cursor: pointer;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent);
  clip-path: polygon(var(--o) 0, calc(100% - var(--o)) 0, 100% var(--o), 100% calc(100% - var(--o)), calc(100% - var(--o)) 100%, var(--o) 100%, 0 calc(100% - var(--o)), 0 var(--o));
}
.btn:hover { color: var(--bg); }
.btn:hover::before { background: var(--ink); }
.btn-sm { --o: 7px; min-height: 40px; padding: 0.45rem 0.9rem; font-size: 0.9375rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.75rem; }
.enlace-accion {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  background: none; border: 0; color: var(--ink); cursor: pointer;
  font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2;
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.3em;
}
.enlace-accion:hover { color: var(--accent); }

/* Cabecera */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; margin-right: auto; padding-block: 8px; }
.brand svg { width: 150px; height: auto; display: block; }
.logo .lg-i { fill: var(--logo-ink); }
.logo .lg-p { fill: var(--logo-plus); }
.nav-main { display: flex; align-items: center; gap: 0.25rem; }
.nav-main a:not(.btn) { text-decoration: none; font-weight: 500; padding: 0.55rem 0.8rem; color: var(--ink); }
.nav-main a:not(.btn):hover { color: var(--accent); }
.nav-main a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.45em; }
.nav-main .btn { margin-left: 0.5rem; }
.menu { display: none; position: relative; }
.menu summary {
  list-style: none; cursor: pointer; min-height: 44px; min-width: 44px; padding: 0.55rem 0.2rem 0.55rem 0.6rem;
  font-weight: 600; display: inline-flex; align-items: center; gap: 0.45rem;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ""; width: 0.5rem; height: 0.5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.menu[open] summary::after { transform: translateY(2px) rotate(225deg); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 30;
  display: flex; flex-direction: column; padding: 0.5rem; background: var(--bg); border: 1.5px solid var(--ink);
}
.menu-panel a { text-decoration: none; padding: 0.75rem 0.9rem; font-weight: 500; }
.menu-panel a:hover { color: var(--accent); }
.menu-panel a[aria-current="page"] { font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.header-cta { display: none; }
@media (max-width: 900px) {
  .nav-main { display: none; }
  .menu, .header-cta { display: inline-flex; }
  .brand svg { width: 132px; }
}
@media (max-width: 359px) { .header-cta { display: none !important; } }

/* Bandas: Bruma solo en las que identifican; entre dos bandas blancas, un filete Piedra */
.band { padding-block: var(--section); }
.band-alt { background: var(--bg-alt); }
:is(.portada, .band):not(.band-alt) + .band:not(.band-alt) { border-top: 1px solid var(--line); }
.band-head { display: flex; flex-direction: column; gap: 1rem; }

/* Portada de Inicio: la cuenta */
.portada { padding-block: clamp(var(--renglon), 6vw, calc(var(--renglon) * 3)) calc(var(--renglon) * 4); }
.portada-grid { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: calc(var(--renglon) * 1.5); }
.membrete { font-size: var(--t-ui); line-height: 1.45; font-weight: 500; color: var(--muted); }
.cuenta { font-size: var(--t-bajada); line-height: 1.4; max-width: calc(var(--signo) + 32em); }
.saldo { display: grid; grid-template-columns: var(--signo) minmax(0, 1fr); align-items: baseline; }
.signo { justify-self: end; padding-right: var(--calle); font-weight: 400; }
.mas { display: block; fill: var(--logo-plus); }
.saldo > .mas { justify-self: end; margin-right: var(--calle); font-size: var(--t-h1); width: 0.686em; height: 0.686em; }
.saldo-cuerpo { display: flex; flex-direction: column; gap: calc(var(--renglon) * 0.75); min-width: 0; }
.saldo-cuerpo .lead { font-size: inherit; line-height: inherit; max-width: none; }
@media (min-width: 1024px) {
  .portada-grid { grid-template-columns: minmax(0, 1fr) max-content; column-gap: var(--calle); align-items: baseline; }
  .portada-grid > .cuenta { grid-column: 1; grid-row: 1; }
  .portada-grid > .membrete { grid-column: 2; grid-row: 1; }
  .tramo { display: block; }
}
@media (min-width: 1024px) and (max-height: 720px) { .portada { padding-top: calc(var(--renglon) * 1.5); } }
@media (prefers-reduced-motion: no-preference) {
  .saldo > .mas { animation: dar-positivo 260ms ease-out 200ms both; }
}
@keyframes dar-positivo { from { opacity: 0; transform: scale(0.4); } }
@media (forced-colors: active) { .mas { fill: CanvasText; } }

/* Números de secuencia: el número cuelga en la columna de signos, con el cuerpo de su título */
.n { font-weight: 400; font-stretch: 100%; letter-spacing: 0; color: var(--muted); font-variant-numeric: tabular-nums lining-nums; }
@media (min-width: 760px) {
  .numerado { display: grid; grid-template-columns: var(--signo) minmax(0, 1fr); align-items: baseline; margin-left: calc(-1 * var(--signo)); }
  .numerado > .n { justify-self: end; padding-right: var(--calle); }
}
@media (max-width: 759px) { .numerado > .n { margin-right: 0.25em; } }

/* Inicio */
.tres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--renglon) calc(var(--calle) * 1.5); }
.tres > li { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
@media (max-width: 899px) { .tres { grid-template-columns: minmax(0, 1fr); } }
.pasos { display: flex; flex-direction: column; gap: calc(var(--renglon) * 1.25); }
.pasos > li { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.pasos p { max-width: var(--medida); }
@media (min-width: 1024px) {
  .pasos > li { display: grid; grid-template-columns: minmax(0, 15em) minmax(0, var(--medida)); column-gap: calc(var(--calle) * 1.5); align-items: baseline; }
}
.tres.dos { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: calc(var(--medida) * 1.6); }
@media (max-width: 899px) { .tres.dos { grid-template-columns: minmax(0, 1fr); } }
/* The thesis of the firm, as a statement rather than a short heading */
.tesis { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); font-weight: 600; font-stretch: 100%; line-height: 1.3; letter-spacing: 0; max-width: 30em; }
/* Costs hang their minus sign in the signs column, like the entries of an account */
.costos { display: flex; flex-direction: column; gap: 0.6rem; max-width: var(--medida); }
.costos > li { display: grid; grid-template-columns: var(--signo) minmax(0, 1fr); align-items: baseline; margin-left: calc(-1 * var(--signo)); }
@media (max-width: 759px) {
  .costos > li { grid-template-columns: 1.25em minmax(0, 1fr); margin-left: 0; }
  .costos .signo { justify-self: start; padding-right: 0; }
}

/* Equipo: una ficha por renglón; la foto es una manzana con la ochava del símbolo */
.fichas { display: flex; flex-direction: column; gap: calc(var(--renglon) * 2); }
.ficha { display: grid; grid-template-columns: 120px minmax(0, 13em) minmax(0, var(--medida)); column-gap: calc(var(--calle) * 1.5); row-gap: 1rem; align-items: start; }
.ficha-foto {
  width: 120px; height: 120px; object-fit: cover; background: var(--line);
  clip-path: polygon(17.3% 0, 82.7% 0, 100% 17.3%, 100% 82.7%, 82.7% 100%, 17.3% 100%, 0 82.7%, 0 17.3%);
}
.ficha-iniciales { display: grid; place-items: center; color: var(--ink); font-size: 2rem; font-weight: 600; font-stretch: 112.5%; }
.ficha-id { display: flex; flex-direction: column; gap: 0.3rem; }
.ficha-id h3 { font-size: var(--t-bajada); }
.cargo { font-size: var(--t-ui); font-weight: 500; color: var(--muted); }
.ficha-texto { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.ficha .bio { font-size: var(--t-ui); line-height: 1.55; }
.perfil { font-size: var(--t-ui); font-weight: 600; }
@media (max-width: 899px) {
  .ficha { grid-template-columns: 88px minmax(0, 1fr); column-gap: 1rem; align-items: center; }
  .ficha-foto { width: 88px; height: 88px; }
  .ficha-iniciales { font-size: 1.5rem; }
  .ficha-texto { grid-column: 1 / -1; }
}

/* Contacto */
.contacto { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--renglon) clamp(2rem, 5vw, 4rem); align-items: end; }
.contacto-datos { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.email { font-size: var(--t-sub); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.email a { text-decoration: none; }
.email a:hover { text-decoration: underline; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; }
.copy-status { font-size: 0.9375rem; color: var(--muted); min-height: 1.5em; }
@media (max-width: 820px) { .contacto { grid-template-columns: minmax(0, 1fr); align-items: start; } }

/* Pie */
.site-footer { background: var(--footer-bg); border-top: 1px solid var(--footer-line); color: var(--on-dark-muted); padding-block: clamp(40px, 6vw, 72px); font-size: 0.9375rem;
  --logo-ink: var(--on-dark); --logo-plus: var(--accent-on-dark); }
.site-footer a { color: var(--on-dark); }
.site-footer a:hover { color: var(--accent-on-dark); }
.site-footer :focus-visible { outline-color: var(--accent-on-dark); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.footer-brand { display: flex; flex-direction: column; gap: 1rem; }
.footer-brand svg { width: 170px; height: auto; display: block; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: flex-end; }
.footer-nav a { text-decoration: none; font-weight: 500; }
.footer-legal { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid #3A2F3D; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-nav { display: grid; grid-template-columns: repeat(2, max-content); gap: 0.25rem 2rem; justify-content: start; }
  .footer-nav a { display: inline-block; padding-block: 0.5rem; }
}

/* Proyecto 01: carátula */
.portada-dod { padding-bottom: calc(var(--renglon) * 3); }
.caratula { display: flex; flex-direction: column; gap: var(--renglon); }
.h1-nombre, .h1-sub { display: block; }
.h1-sub { margin-top: 0.3em; font-size: var(--t-sub); font-weight: 400; font-stretch: 100%; line-height: 1.15; letter-spacing: 0; }
@media (min-width: 1024px) {
  .caratula { display: grid; grid-template-columns: minmax(0, 1fr) max-content; column-gap: var(--calle); row-gap: var(--renglon); align-items: start; }
  .caratula > * { grid-column: 1; }
  .caratula > .membrete { grid-column: 2; grid-row: 1 / span 2; }
}
.indice ol { display: grid; grid-template-columns: repeat(2, max-content); grid-template-rows: repeat(4, auto); grid-auto-flow: column; column-gap: calc(var(--calle) * 2.5); }
.indice a { display: grid; grid-template-columns: 1.6em auto; align-items: baseline; align-content: center; min-height: 44px; text-decoration: none; font-weight: 500; }
.indice a:hover .t { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
@media (max-width: 599px) { .indice ol { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; } }

/* Proyecto 01: secciones */
.statement { font-size: var(--t-sub); font-weight: 400; line-height: 1.2; max-width: 24em; }
.icon { width: 1.1em; height: 1.1em; margin-right: 0.45em; vertical-align: -0.2em; color: var(--ink); }
.icon path, .icon circle, .icon rect { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.libro { display: flex; flex-direction: column; gap: var(--renglon); }
.libro > li, .libro-saldo { display: grid; grid-template-columns: 1.75em 2.1em minmax(0, 34rem); align-items: baseline; font-size: var(--t-cifra); width: fit-content; max-width: 100%; }
/* Each figure is written once: its whole part fills a box three tabular digits wide, so the units line up and copying gives the plain figure */
.cifra { grid-column: 1 / span 2; font-weight: 600; line-height: 1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.ent { display: inline-block; width: 1.75em; text-align: right; }
.libro .texto { grid-column: 3; padding-left: var(--calle); font-size: var(--t-texto); line-height: 1.5; }
.libro .cita { margin-top: 0.25rem; font-size: var(--t-nota); color: var(--muted); }
.libro-saldo { margin-top: var(--renglon); padding-top: var(--renglon); border-top: 2px solid var(--raya); }
.libro-saldo > .mas { grid-column: 1; justify-self: end; width: 0.686em; height: 0.686em; }
.libro-saldo > p { grid-column: 3; padding-left: var(--calle); font-size: var(--t-bajada); line-height: 1.4; }
@media (max-width: 759px) {
  .libro > li { grid-template-columns: minmax(0, 1fr); row-gap: 0.35rem; }
  .cifra { grid-column: 1; }
  .ent { width: auto; text-align: left; }
  .libro .texto { grid-column: 1; padding-left: 0; }
  .libro-saldo { grid-template-columns: var(--signo) minmax(0, 1fr); font-size: var(--t-h1); }
  .libro-saldo > .mas { margin-right: var(--calle); }
  .libro-saldo > p { grid-column: 2; padding-left: 0; }
}
.source { font-size: var(--t-nota); line-height: 1.5; color: var(--muted); max-width: 46em; }
.source a { color: inherit; }
.indicadores { max-width: var(--medida); border-bottom: 1px solid var(--line); }
.indicadores li { padding-block: calc(var(--renglon) / 3); border-top: 1px solid var(--line); }

/* 404 */
.notfound { min-height: 50vh; display: flex; flex-direction: column; justify-content: center; gap: 1.25rem; padding-block: var(--section); }

@media print {
  @page { size: A4; margin: 16mm 16mm 18mm; @bottom-right { content: "Página " counter(page) " de " counter(pages); font-family: Archivo, Arial, sans-serif; font-size: 8pt; color: #444444; } }
  :root { --bg: #FFFFFF; --bg-alt: #FFFFFF; --line: #BBBBBB; --ink: #000000; --muted: #333333; --raya: #000000; color-scheme: light; }
  body { font-size: 10.5pt; }
  h1 { font-size: 26pt; } h2 { font-size: 17pt; } h2.tesis { font-size: 14pt; } h3, h4 { font-size: 12.5pt; }
  .lead, .cuenta, .libro-saldo > p { font-size: 12pt; }
  .h1-sub, .statement, .email { font-size: 15pt; }
  .libro > li, .libro-saldo { font-size: 24pt; }
  .site-header { position: static; border: 0; }
  .nav-main, .menu, .header-cta, .skip, .actions, .copy-row, .site-footer { display: none !important; }
  .solo-impresion { display: block; }
  .band, .portada, .portada-dod { padding-block: 14pt; }
  .band-alt { background: none; }
  .saldo > .mas { animation: none !important; }
  .mas { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .indice a { min-height: 0; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; overflow-wrap: anywhere; }
  a { text-decoration: none; }
  h2, h3, h4, .band-head, p:has(+ .indicadores) { break-after: avoid; }
  .cuenta, .costos, .libro > li, .libro-saldo, .ficha, .pasos > li, .tres > li, .indicadores li, .caratula { break-inside: avoid; }
}

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
