/* ============================================================
   La Trama Familiar — hoja de estilo única
   Dirección de arte: papel de archivo + tinta verde-noche + rojo sello.
   Una sola familia tipográfica de titulares (Fraunces) y una de lectura
   (Instrument Sans). Radios de 2px, reglas de 1px, cero sombras difusas.
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  --paper:      #E8E6DE;
  --paper-2:    #F2F0EA;
  --ink:        #16211C;
  --ink-2:      #0F1A16;
  --ink-soft:   #2B3830;
  --ink-muted:  #4A544C;
  --olive:      #5E6A4F;
  --seal:       #9C2B22;
  --seal-light: #D2705F;
  --cream:      #EDE7DA;
  --cream-muted:#8A9285;

  --hair:        rgba(22, 33, 28, .14);
  --hair-soft:   rgba(22, 33, 28, .08);
  --hair-dark:   rgba(237, 231, 218, .16);

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-sans:    'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-label:   ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --measure: 62ch;
  --radius: 2px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --header-h: 72px;
}

/* ---------- 2. Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4, p, ul, ol, blockquote, figure { margin: 0; }
ul, ol { padding: 0; list-style-position: inside; }

a { color: inherit; }

/* Anclas: que no aterricen bajo la cabecera fija */
:target,
section[id],
main[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

/* Foco visible y consistente */
:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
  border-radius: var(--radius);
}
.inverse :focus-visible,
.hero :focus-visible,
.site-footer :focus-visible { outline-color: var(--seal-light); }

.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--ink-2);
  color: var(--cream);
  font-size: .9rem;
  text-decoration: none;
  border-radius: var(--radius);
  transform: translateY(-200%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 3. Layout ---------- */
.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

.section { padding-block: clamp(60px, 8.5vw, 112px); }

.section-paper {
  background: var(--paper-2);
  border-block: 1px solid var(--hair-soft);
}

/* ---------- 4. Tipografía ---------- */
h1, h2, h3, .footer-mark, .ig-handle {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  letter-spacing: -.018em;
  line-height: 1.04;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  line-height: 1.06;
  max-width: 22ch;
}

h3 { font-size: clamp(1.1rem, 1.6vw, 1.32rem); line-height: 1.2; }

p { text-wrap: pretty; }

.lead-p {
  font-size: clamp(1.15rem, 1.9vw, 1.4rem);
  line-height: 1.45;
  letter-spacing: -.01em;
}

.eyebrow {
  font-family: var(--font-label);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: 20px;
}
.eyebrow-dark { color: var(--cream-muted); }

.prose { max-width: var(--measure); }
.prose > p + p { margin-top: 1.05em; }
.prose h2 { margin-bottom: .6em; }

.section-head { margin-bottom: clamp(40px, 5vw, 64px); }
.section-head p {
  margin-top: 18px;
  max-width: 46ch;
  color: var(--ink-muted);
}

/* ---------- 5. Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 26px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .005em;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color .22s var(--ease),
              border-color .22s var(--ease),
              color .22s var(--ease),
              transform .12s var(--ease);
}
.btn:active { transform: scale(.985); }

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}
.btn-primary:hover {
  background: var(--seal);
  border-color: var(--seal);
  color: var(--cream);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(22, 33, 28, .32);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--ink);
  background: rgba(22, 33, 28, .05);
}

.btn-ghost-dark {
  border-color: rgba(237, 231, 218, .38);
  color: var(--cream);
}
.btn-ghost-dark:hover {
  border-color: var(--cream);
  background: rgba(237, 231, 218, .09);
}

.btn-sm { padding: 11px 18px; font-size: .9rem; }

/* ---------- 6. Cabecera ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ink-2);
  border-bottom: 1px solid var(--hair-dark);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--cream);
  flex-shrink: 0;
}
.brand-mark { width: 34px; height: 34px; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 30px);
}
.nav-link {
  font-size: .93rem;
  color: var(--cream-muted);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.nav-link:hover { color: var(--cream); }

.site-header .btn-primary {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}
.site-header .btn-primary:hover {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--ink);
}

/* ---------- 7. Portada ---------- */
.hero {
  background: var(--ink-2);
  color: var(--cream);
  padding-block: clamp(48px, 6.5vw, 84px) clamp(56px, 7vw, 96px);
  position: relative;
  overflow: hidden;
}
/* Grano fino de retícula, sin imágenes ni desenfoques */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(237, 231, 218, .09) 1px, transparent 0);
  background-size: 26px 26px;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 72%);
}
.hero .wrap { position: relative; }

.hero-title {
  font-size: clamp(2.1rem, 5.6vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: -.028em;
  max-width: 20ch;
  margin-bottom: clamp(32px, 3.4vw, 44px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 5vw, 64px);
  align-items: start;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.02fr .98fr; }
}

.hero-text { max-width: 46ch; }

.hero-sub {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.62vw, 1.42rem);
  line-height: 1.32;
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 18px;
}
.hero-lead {
  font-size: 1rem;
  line-height: 1.62;
  color: var(--cream-muted);
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero .btn-primary {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}
.hero .btn-primary:hover {
  background: var(--seal);
  border-color: var(--seal);
  color: var(--cream);
}

/* --- Lámina (momento firma) --- */
.hero-plate { margin: 0; }

.plate {
  width: 100%;
  height: auto;
  overflow: visible;
}

.plate-label,
.plate-note {
  font-family: var(--font-label);
  font-size: 11.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  fill: rgba(237, 231, 218, .5);
}
.plate-note { fill: var(--seal-light); font-size: 10.5px; letter-spacing: .1em; text-anchor: middle; }

.plate-grid line {
  stroke: rgba(237, 231, 218, .11);
  stroke-width: 1;
}

.edge {
  stroke: rgba(237, 231, 218, .42);
  stroke-width: 1.4;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.15s var(--ease) forwards;
}
.edges .edge:nth-child(1) { animation-delay: .15s; }
.edges .edge:nth-child(2) { animation-delay: .30s; }
.edges .edge:nth-child(3) { animation-delay: .45s; }
.edges .edge:nth-child(4) { animation-delay: .60s; }
.edges .edge:nth-child(5) { animation-delay: .75s; }

.edge-cut {
  stroke: var(--seal-light);
  stroke-width: 1.3;
  stroke-dasharray: 2.6 3.4;
  stroke-dashoffset: 0;
  animation: fade-edge 1s var(--ease) 1s both;
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade-edge { from { opacity: 0; } to { opacity: .95; } }

.node circle {
  fill: var(--cream);
  stroke: none;
}
.node-main {
  fill: var(--paper) !important;
  stroke: rgba(237, 231, 218, .55);
  stroke-width: 1;
}
.node-excluded {
  fill: var(--ink-2) !important;
  stroke: var(--seal-light) !important;
  stroke-width: 1.4;
  stroke-dasharray: 2.2 2.6;
}
.node-label {
  font-family: var(--font-label);
  font-size: 13px;
  letter-spacing: .09em;
  text-transform: uppercase;
  fill: rgba(237, 231, 218, .78);
  text-anchor: middle;
}
.node-label-main {
  fill: var(--cream);
  font-weight: 600;
}

.node {
  opacity: 0;
  transform: scale(.72);
  transform-box: fill-box;
  transform-origin: center;
  animation: pop .55s var(--ease) forwards;
}
.node-a { animation-delay: .25s; }
.node-b { animation-delay: .40s; }
.node-c { animation-delay: .55s; }
.node-d { animation-delay: .70s; }
.node-e { animation-delay: .85s; }

@keyframes pop { to { opacity: 1; transform: scale(1); } }

.plate-caption {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--hair-dark);
  font-size: .88rem;
  line-height: 1.5;
  color: var(--cream-muted);
  max-width: 40ch;
}

/* ---------- 8. Banda de compromisos ---------- */
.band {
  background: var(--paper-2);
  border-bottom: 1px solid var(--hair-soft);
  padding-block: clamp(26px, 3vw, 34px);
}
.band-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.no-list {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(18px, 3.4vw, 44px);
  list-style: none;
  padding: 0;
}
.no-list li {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: .95rem;
  color: var(--ink-soft);
}
.no-mark { color: var(--seal); font-size: .78em; }

.stamp {
  flex-shrink: 0;
  transform: rotate(-4.5deg);
  border: 1.5px solid var(--seal);
  color: var(--seal);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--font-label);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .16em;
  line-height: 1.5;
  text-transform: uppercase;
  text-align: center;
}

/* ---------- 9. Cita ---------- */
.pullquote {
  margin-top: clamp(44px, 5.5vw, 72px);
  padding-left: clamp(20px, 3vw, 34px);
  border-left: 3px solid var(--seal);
  max-width: 30ch;
}
.pullquote p {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.9vw, 2rem);
  line-height: 1.24;
  letter-spacing: -.016em;
  font-weight: 400;
}

/* ---------- 10. Pilares ---------- */
.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--hair);
}
.pillar {
  padding: clamp(26px, 3vw, 34px) 0;
  border-bottom: 1px solid var(--hair);
}
.pillar-num {
  display: block;
  font-family: var(--font-label);
  font-size: .74rem;
  letter-spacing: .18em;
  color: var(--olive);
  margin-bottom: 14px;
}
.pillar h3 { margin-bottom: 10px; }
.pillar p { font-size: .97rem; color: var(--ink-muted); max-width: 40ch; }

@media (min-width: 860px) {
  .pillars {
    grid-template-columns: repeat(3, 1fr);
    border-top: none;
  }
  .pillar {
    border-bottom: none;
    border-top: 1px solid var(--hair);
    padding: 28px clamp(20px, 2.6vw, 34px) 0 0;
  }
  .pillar + .pillar {
    padding-left: clamp(20px, 2.6vw, 34px);
    border-left: 1px solid var(--hair);
  }
}

/* ---------- 11. Sección inversa (límites) ---------- */
.inverse {
  background: var(--ink-2);
  color: var(--cream);
}
.inverse h2 { max-width: 26ch; }
.inverse .section-head p { color: var(--cream-muted); }

.cases {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 clamp(28px, 4vw, 56px);
  list-style: none;
  padding: 0;
}
.cases li {
  border-top: 1px solid var(--hair-dark);
  padding: 22px 0 clamp(22px, 2.4vw, 30px);
}
.cases h3 {
  margin-bottom: 8px;
  color: var(--cream);
}
.cases p {
  font-size: .95rem;
  color: var(--cream-muted);
  max-width: 42ch;
}
@media (min-width: 760px) {
  .cases { grid-template-columns: 1fr 1fr; }
}

.inverse-note {
  margin-top: clamp(36px, 4vw, 52px);
  padding-top: 22px;
  border-top: 1px solid var(--hair-dark);
  font-size: .96rem;
  line-height: 1.6;
  color: var(--cream-muted);
  max-width: 62ch;
}

/* ---------- 12. Quién escribe ---------- */
.who-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(36px, 5vw, 64px);
}
@media (min-width: 900px) {
  .who-grid {
    grid-template-columns: 1.15fr .85fr;
    align-items: start;
  }
}

.rules {
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: clamp(24px, 2.6vw, 32px);
}
.rules-title {
  font-family: var(--font-label);
  font-size: .74rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: 18px;
  font-weight: 600;
}
.rules-list {
  list-style: none;
  padding: 0;
  counter-reset: r;
}
.rules-list li {
  position: relative;
  padding-left: 26px;
  padding-block: 11px;
  font-size: .96rem;
  border-top: 1px solid var(--hair-soft);
  counter-increment: r;
}
.rules-list li:first-child { border-top: none; padding-top: 0; }
.rules-list li::before {
  content: counter(r);
  position: absolute;
  left: 0;
  top: 13px;
  font-family: var(--font-label);
  font-size: .74rem;
  color: var(--seal);
}
.rules-list li:first-child::before { top: 2px; }

.fineprint {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
  font-size: .82rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

/* ---------- 13. Guías ---------- */
.guias-inner { max-width: 760px; }
.guias-p {
  margin-top: 20px;
  font-size: clamp(1.02rem, 1.5vw, 1.15rem);
  color: var(--ink-soft);
  max-width: 52ch;
}
.guias-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px 26px;
  margin-top: 34px;
}
.guias-note {
  font-size: .86rem;
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 34ch;
}

/* ---------- 14. Instagram ---------- */
.ig-band { border-top: 1px solid var(--hair); }
.ig-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px 40px;
}
.ig-handle {
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  margin-bottom: 6px;
}
.ig-inner p { color: var(--ink-muted); font-size: .96rem; }

/* ---------- 15. Pie ---------- */
.site-footer {
  background: var(--ink-2);
  color: var(--cream);
  padding-block: clamp(52px, 6vw, 76px) 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px 32px;
}
@media (min-width: 720px) {
  .footer-inner { grid-template-columns: 1.4fr 1fr 1fr; }
}
@media (min-width: 1000px) {
  .footer-inner { grid-template-columns: 1.5fr 1fr 1fr 1.2fr; }
}

.footer-mark {
  font-size: 1.28rem;
  margin-bottom: 10px;
}
.footer-tag {
  font-size: .92rem;
  line-height: 1.55;
  color: var(--cream-muted);
  max-width: 30ch;
}

.footer-col h4 {
  font-family: var(--font-label);
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cream-muted);
  margin-bottom: 14px;
  font-weight: 600;
}
.footer-col a {
  display: block;
  width: fit-content;
  padding-block: 5px;
  font-size: .93rem;
  color: var(--cream);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.footer-col a:hover { color: var(--seal-light); text-decoration: underline; text-underline-offset: 3px; }
.footer-note p {
  font-size: .88rem;
  line-height: 1.55;
  color: var(--cream-muted);
  max-width: 30ch;
}

.footer-bottom {
  margin-top: clamp(40px, 5vw, 60px);
  padding-block: 22px 26px;
  border-top: 1px solid var(--hair-dark);
}
.footer-bottom p {
  font-size: .8rem;
  line-height: 1.6;
  color: var(--cream-muted);
}

/* ---------- 16. Aparición al hacer scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- 17. Responsive fino ---------- */
@media (max-width: 719px) {
  .nav-optional { display: none; }
  .hero-title { max-width: 100%; }
  .no-list { flex-direction: column; gap: 10px; }
  .stamp { align-self: flex-start; }
}
@media (max-width: 420px) {
  .brand-name { font-size: .95rem; }
  .brand { gap: 8px; }
  .brand-mark { width: 28px; height: 28px; }
  .header-inner { gap: 12px; }
  .nav { gap: 10px; }
  .btn-sm { padding: 10px 14px; font-size: .85rem; }
  .hero-actions .btn { width: 100%; }
  .pullquote { max-width: 100%; }
}

/* En móvil la lámina se reduce: las etiquetas del SVG crecen en unidades del
   viewBox para que sigan siendo legibles en pantalla (nunca por debajo de ~10px). */
@media (max-width: 900px) {
  .node-label { font-size: 15px; }
  .plate-label { font-size: 13px; }
  .plate-note { font-size: 12px; }
}
@media (max-width: 520px) {
  .node-label { font-size: 21px; letter-spacing: .06em; }
  .plate-label { font-size: 16px; letter-spacing: .1em; }
  .plate-note { font-size: 15px; letter-spacing: .06em; }
  .node-label-main { font-size: 23px; }
}

/* ---------- 18. Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
  .edge { stroke-dashoffset: 0; }
  .node { opacity: 1; transform: none; }
  .edge-cut { opacity: .95; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 19. Páginas legales ---------- */
.page-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(2rem, 4.4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -.022em;
  margin-bottom: .5em;
  text-wrap: balance;
}

.legal .prose { max-width: 70ch; }
.legal .prose h2 {
  font-size: clamp(1.15rem, 1.7vw, 1.35rem);
  line-height: 1.3;
  max-width: none;
  margin-top: 2.1em;
  margin-bottom: .55em;
  letter-spacing: -.008em;
}
.legal .prose h1 + h2 { margin-top: 1.4em; }
.legal .prose p,
.legal .prose li { font-size: 1rem; line-height: 1.65; color: var(--ink-soft); }
.legal .prose p + p { margin-top: .9em; }
.legal .prose strong { color: var(--ink); font-weight: 600; }
.legal .prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--seal);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.legal .prose a:hover { color: var(--seal); }

.legal .prose ul {
  list-style: none;
  padding: 0;
  margin: 1.1em 0;
  max-width: 64ch;
}
.legal .prose li {
  position: relative;
  padding: 9px 0 9px 22px;
  border-top: 1px solid var(--hair-soft);
}
.legal .prose li:first-child { border-top: none; }
.legal .prose li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--olive);
}

.legal-date {
  margin-top: 2.6em;
  padding-top: 1.1em;
  border-top: 1px solid var(--hair);
  font-size: .85rem !important;
  color: var(--ink-muted) !important;
}
