:root {
  --paper: #f3efe6;
  --paper-2: #e8e2d6;
  --ink: #1a1714;
  --ink-2: #3c3832;
  --muted: #6e675e;
  --rule: #d5cec2;
  --copper: #8c3b2a;
  --copper-ink: #6e2c22;
  --pine: #1d4638;
  --wash: #f7f4ee;
  --serif: "Source Serif 4", "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --display: Fraunces, "Source Serif 4", Palatino, serif;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --measure: 68ch;
  --wrap: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 0% -10%, rgba(140, 59, 42, 0.06), transparent 46%),
    var(--paper);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

::selection { background: #ead3cb; color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

img, svg { max-width: 100%; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--copper);
  text-underline-offset: 0.18em;
}

a:hover { color: var(--copper-ink); }

p, h1, h2, h3 { margin: 0; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: #fff;
  color: var(--ink);
  padding: 0.4rem 0.7rem;
  z-index: 10;
}

.skip:focus { top: 0.6rem; }

.wrap {
  width: min(var(--wrap), calc(100% - 2.5rem));
  margin-inline: auto;
}

.topbar {
  background: var(--ink);
  color: #efeae2;
  font-family: var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.92rem;
}

.topbar a { color: inherit; text-decoration: none; }
.topbar a:hover { color: #fff; }

.topbar-row {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.48rem 0;
}

.topbar-row p { min-width: 0; }

.nameplate { padding: 1.6rem 0 0.4rem; }

.mark {
  font-family: var(--cond);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--copper-ink);
  font-size: 0.95rem;
}

.wordmark {
  display: block;
  margin-top: 0.25rem;
  max-width: 100%;
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(2.7rem, 8vw, 6.15rem);
  line-height: 0.84;
  letter-spacing: -0.035em;
  text-decoration: none;
  color: var(--ink);
}

.wordmark span {
  display: block;
  margin-top: 0.22em;
  font-style: italic;
  font-weight: 460;
  font-size: 0.38em;
  letter-spacing: 0;
  color: var(--ink-2);
}

.mast-rule {
  height: 2px;
  margin: 1rem 0 0.85rem;
  background: var(--copper);
  transform-origin: left;
  animation: draw 700ms ease both;
}

@keyframes draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.stance {
  max-width: 46rem;
  color: var(--ink-2);
  font-size: 1.05rem;
}

.en-stand {
  max-width: 46rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-style: italic;
  font-size: 0.98rem;
}

.folio {
  padding: 0.85rem 0 0.15rem;
}

.folio-name {
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  letter-spacing: -0.03em;
  text-decoration: none;
  line-height: 1;
}

.folio-name em {
  font-weight: 460;
  font-style: italic;
  color: var(--ink-2);
}

.folio .mast-rule { margin-top: 0.7rem; }

nav {
  margin-top: 0.15rem;
  position: relative;
}

.nav-check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nav-button {
  display: none;
  font-family: var(--cond);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.45rem 0;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0.2rem 0 0.7rem;
}

.nav-links a {
  font-family: var(--cond);
  font-size: 1.05rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav-links a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--copper);
  text-underline-offset: 0.22em;
}

.sheet { padding-bottom: 4rem; }

.top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(250px, 0.82fr);
  gap: 2.4rem;
  align-items: start;
  padding-top: 1.4rem;
}

.kicker {
  font-family: var(--cond);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper-ink);
  font-size: 1rem;
}

.kicker a { text-decoration: none; }
.kicker a:hover { text-decoration: underline; }

.lead { position: relative; overflow: hidden; }

.edition-mark {
  position: absolute;
  right: 0;
  top: -0.35rem;
  font-family: var(--display);
  font-weight: 560;
  font-size: 7.5rem;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(26, 23, 20, 0.18);
  pointer-events: none;
  user-select: none;
}

.lead h1,
.story h1,
.page-head h1 {
  font-family: var(--display);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-wrap: balance;
}

.lead h1 {
  margin-top: 0.35rem;
  font-size: clamp(2.15rem, 4vw, 3.35rem);
  max-width: 16ch;
}

.lead h1 a,
.card h2 a,
.row a { text-decoration: none; }

.lead h1 a:hover,
.card h2 a:hover,
.row a:hover { color: var(--copper-ink); }

.deck {
  margin-top: 0.85rem;
  max-width: 42rem;
  font-size: 1.22rem;
  line-height: 1.4;
  font-style: italic;
  color: var(--ink-2);
}

.meta, .byline {
  margin-top: 0.85rem;
  font-family: var(--cond);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.98rem;
}

.more {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--cond);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 1.05rem;
}

.esquema {
  margin: 1.35rem 0 0;
  max-width: 520px;
}

.esquema svg {
  width: 100%;
  height: auto;
  background: var(--wash);
  border: 1px solid var(--rule);
}

.esquema figcaption,
.note {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.cuadro {
  border-top: 2px solid var(--ink);
  padding-top: 0.7rem;
  position: sticky;
  top: 1rem;
}

.cuadro h2,
.block-label,
.sources h2,
.related h2 {
  font-family: var(--cond);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 1rem;
}

.cuadro-note { margin: 0.4rem 0 0.8rem; color: var(--muted); font-size: 0.95rem; }

.cuadro ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cuadro li + li { border-top: 1px solid var(--rule); }

.cuadro a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.75rem;
  row-gap: 0.15rem;
  padding: 0.75rem 0;
  text-decoration: none;
  min-height: 44px;
}

.cuadro a:hover .cifra { color: var(--copper-ink); }

.pill {
  grid-column: 1 / -1;
  justify-self: start;
  font-family: var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
  border: 1px solid var(--rule);
  padding: 0.05rem 0.4rem;
  color: var(--ink-2);
}

.pill.servicio { color: var(--pine); border-color: #b7cfc4; }
.pill.prueba { color: var(--copper-ink); border-color: #e2c7bf; }
.pill.norma { color: #24344a; border-color: #c5ced8; }

.cifra {
  font-family: var(--display);
  font-weight: 560;
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cuadro p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.98rem;
  line-height: 1.35;
}

.block { margin-top: 2.8rem; }

.block-label { margin-bottom: 0.9rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}

.card {
  border-top: 1px solid var(--ink);
  padding-top: 0.7rem;
}

.card h2 {
  margin-top: 0.35rem;
  font-family: var(--display);
  font-weight: 560;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  line-height: 1.12;
  text-wrap: balance;
}

.card .deck {
  font-size: 1.02rem;
  margin-top: 0.55rem;
}

.rows { list-style: none; margin: 0; padding: 0; }

.row {
  display: grid;
  grid-template-columns: 8.5rem 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
}

.row a {
  font-family: var(--display);
  font-weight: 560;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.row .mins {
  font-family: var(--cond);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.95rem;
}

.next-step {
  margin-top: 2.6rem;
  padding: 1.15rem 1.2rem;
  background: var(--wash);
  border-left: 3px solid var(--copper);
}

.next-step h2 {
  font-family: var(--display);
  font-weight: 560;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.next-step p { margin-top: 0.4rem; max-width: var(--measure); }

.page-head { padding: 1.3rem 0 0.4rem; max-width: 40rem; }

.page-head h1 {
  margin-top: 0.3rem;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
}

.story { max-width: 740px; padding-top: 1.2rem; }

.story h1 { font-size: clamp(2.15rem, 4.6vw, 3.25rem); }

.story .deck { font-size: 1.28rem; }

.prose { margin-top: 1.6rem; max-width: var(--measure); }

.prose p,
.prose li { font-size: 1.125rem; line-height: 1.62; }

.prose p { margin: 0 0 1rem; }

.prose h2 {
  margin: 2.1rem 0 0.65rem;
  font-family: var(--display);
  font-weight: 560;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-wrap: balance;
}

.prose h3 {
  margin: 1.4rem 0 0.4rem;
  font-family: var(--display);
  font-style: italic;
  font-weight: 520;
  font-size: 1.25rem;
}

.prose ul { margin: 0 0 1rem; padding-left: 1.15rem; }
.prose li + li { margin-top: 0.35rem; }
.prose li::marker { color: var(--copper); }

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0 0 0 1rem;
  border-left: 2px solid var(--copper);
}

.prose blockquote p {
  font-family: var(--display);
  font-weight: 520;
  font-size: 1.45rem;
  line-height: 1.28;
  font-style: italic;
}

.sources, .related {
  margin-top: 2.2rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--ink);
  max-width: var(--measure);
}

.sources ol { margin: 0.7rem 0 0; padding-left: 1.2rem; }
.sources li { margin: 0.45rem 0; }
.sources li span { display: block; color: var(--muted); font-size: 0.92rem; }

.colophon-piece { margin-top: 0.9rem; color: var(--muted); font-size: 0.95rem; }

.related ul { list-style: none; margin: 0.7rem 0 0; padding: 0; }
.related li { padding: 0.4rem 0; border-top: 1px solid var(--rule); }
.related a { text-decoration: none; font-family: var(--display); font-weight: 560; font-size: 1.2rem; }

.toc { list-style: none; margin: 1rem 0 0; padding: 0; }
.group { margin-top: 1.6rem; }
.group h2 {
  font-family: var(--display);
  font-weight: 560;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.principles { max-width: var(--measure); margin-top: 1.2rem; }
.principles h2 {
  margin: 1.8rem 0 0.5rem;
  font-family: var(--display);
  font-weight: 560;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}
.principles p { margin: 0 0 0.85rem; }
.principles pre {
  background: var(--wash);
  border: 1px solid var(--rule);
  padding: 0.9rem 1rem;
  overflow: auto;
  font-size: 0.86rem;
  line-height: 1.45;
}

.site-footer {
  border-top: 1px solid var(--ink);
  padding: 1.3rem 0 2.4rem;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.site-footer .wrap { display: grid; gap: 0.35rem; }
.site-footer strong { font-family: var(--display); font-weight: 560; font-size: 1.15rem; }
.fine { color: var(--muted); max-width: 48rem; }

@media (max-width: 900px) {
  .top-grid, .cards { grid-template-columns: 1fr; }
  .cuadro { position: static; }
  .edition-mark { display: none; }
  .row { grid-template-columns: 1fr; gap: 0.15rem; }
}

@media (max-width: 720px) {
  .wrap { width: min(var(--wrap), calc(100% - 1.5rem)); }
  .topbar-row {
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
  }
  .nav-button { display: inline-block; }
  .nav-links { display: none; flex-direction: column; gap: 0.35rem; padding-bottom: 0.8rem; }
  .nav-check:checked ~ .nav-links { display: flex; }
  .nav-check:focus-visible + .nav-button { outline: 2px solid var(--copper); outline-offset: 3px; }
  .lead h1 { max-width: none; }
  .prose p, .prose li { font-size: 1.05rem; }
  .story .deck, .deck { font-size: 1.08rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mast-rule { animation: none; }
}

@media print {
  .topbar, nav, .cuadro, .next-step, .related, .site-footer, .esquema, .mode-switch { display: none; }
  body { background: #fff; }
  a { text-decoration: none; }
}

.topbar-row { align-items: center; flex-wrap: wrap; }

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(239, 234, 226, 0.4);
  border-radius: 999px;
  flex: 0 0 auto;
}

.mode-switch button {
  font-family: var(--cond);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #efeae2;
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  min-height: 2rem;
  cursor: pointer;
}

.mode-switch button[aria-pressed="true"] {
  background: #efeae2;
  color: var(--ink);
}

.mode-switch button:hover { color: #fff; }
.mode-switch button[aria-pressed="true"]:hover { color: var(--ink); }

.shot,
.foto-nota { display: none; }

html[data-modo="magazine"] {
  --wrap: 1200px;
}

html[data-modo="magazine"] .foto-nota {
  display: block;
  max-width: 46rem;
}

html[data-modo="magazine"] .nameplate .mast-rule {
  height: 3px;
  background: var(--ink);
  box-shadow: 0 5px 0 var(--copper);
  margin-bottom: 1.15rem;
}

html[data-modo="magazine"] .shot { display: block; margin: 0; }

html[data-modo="magazine"] .shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

html[data-modo="magazine"] .shot-frame {
  display: block;
  overflow: hidden;
  background: var(--ink);
  text-decoration: none;
}

html[data-modo="magazine"] .shot figcaption {
  font-family: var(--cond);
  letter-spacing: 0.03em;
  font-size: 0.84rem;
  line-height: 1.3;
  color: var(--muted);
}

html[data-modo="magazine"] .row .shot a {
  font-family: var(--cond);
  font-weight: 500;
  font-size: inherit;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

html[data-modo="magazine"] .shot figcaption a {
  color: inherit;
  text-decoration-color: transparent;
}

html[data-modo="magazine"] .shot figcaption a:hover {
  color: var(--copper-ink);
  text-decoration-color: var(--copper);
}

html[data-modo="magazine"] .shot-frame img {
  transition: transform 640ms ease;
}

html[data-modo="magazine"] .shot-frame:hover img { transform: scale(1.035); }

html[data-modo="magazine"] .top-grid {
  gap: 1.35rem;
  padding-top: 0.2rem;
}

html[data-modo="magazine"] .shot-hero {
  position: relative;
  margin-bottom: 1.05rem;
}

html[data-modo="magazine"] .shot-hero .shot-frame { aspect-ratio: 16 / 10; }

html[data-modo="magazine"] .shot-hero figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 2.5rem 0.95rem 0.7rem;
  color: #f6f1e8;
  background: linear-gradient(transparent, rgba(16, 14, 12, 0.84));
}

html[data-modo="magazine"] .shot-hero figcaption a,
html[data-modo="magazine"] .shot-hero figcaption a:hover { color: #f6f1e8; }

html[data-modo="magazine"] .edition-mark {
  top: 0.65rem;
  right: 0.85rem;
  z-index: 2;
  color: #f7f4ee;
  -webkit-text-stroke: 0;
  font-size: clamp(3.2rem, 6vw, 4.6rem);
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

html[data-modo="magazine"] .lead {
  overflow: visible;
  min-width: 0;
}

html[data-modo="magazine"] .lead h1 {
  max-width: min(20ch, 100%);
  font-size: clamp(2.35rem, 4.2vw, 3.7rem);
}

html[data-modo="magazine"] .cuadro {
  background: #171512;
  color: #f4efe6;
  border-top: 0;
  padding: 1rem 1rem 0.3rem;
}

html[data-modo="magazine"] .cuadro h2,
html[data-modo="magazine"] .cuadro .cifra { color: #f7f3eb; }

html[data-modo="magazine"] .cuadro-note,
html[data-modo="magazine"] .cuadro p { color: #d8d0c4; }

html[data-modo="magazine"] .cuadro li + li { border-top-color: rgba(247, 243, 235, 0.14); }

html[data-modo="magazine"] .cuadro a:hover .cifra { color: #f0c2b6; }

html[data-modo="magazine"] .pill {
  color: #f4efe6;
  border-color: rgba(244, 239, 230, 0.28);
}

html[data-modo="magazine"] .pill.servicio { color: #b7e0cc; border-color: rgba(183, 224, 204, 0.45); }
html[data-modo="magazine"] .pill.prueba { color: #f0c2b6; border-color: rgba(240, 194, 182, 0.45); }
html[data-modo="magazine"] .pill.norma { color: #c5d4ea; border-color: rgba(197, 212, 234, 0.45); }

html[data-modo="magazine"] .cards { gap: 1.05rem; }

html[data-modo="magazine"] .card {
  border-top: 0;
  background: #fffdf9;
  padding: 0 0 1rem;
  box-shadow: 0 16px 40px rgba(26, 23, 20, 0.07);
}

html[data-modo="magazine"] .card .kicker,
html[data-modo="magazine"] .card h2,
html[data-modo="magazine"] .card .deck,
html[data-modo="magazine"] .card .meta {
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

html[data-modo="magazine"] .card .kicker { display: block; padding-top: 0.8rem; }

html[data-modo="magazine"] .shot-card .shot-frame { aspect-ratio: 4 / 3; }

html[data-modo="magazine"] .shot-card figcaption { padding: 0.45rem 0.9rem 0; }

html[data-modo="magazine"] .row {
  grid-template-columns: 8.4rem 8.2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
}

html[data-modo="magazine"] .shot-thumb .shot-frame { aspect-ratio: 4 / 3; }

html[data-modo="magazine"] .shot-thumb figcaption {
  margin-top: 0.28rem;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

html[data-modo="magazine"] .story { max-width: 860px; }

html[data-modo="magazine"] .shot-story { margin-top: 1.25rem; }

html[data-modo="magazine"] .shot-story img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

html[data-modo="magazine"] .shot-story figcaption {
  margin-top: 0.45rem;
  max-width: 65ch;
}

@media (max-width: 900px) {
  html[data-modo="magazine"] .top-grid,
  html[data-modo="magazine"] .cards { grid-template-columns: minmax(0, 1fr); }

  html[data-modo="magazine"] .shot,
  html[data-modo="magazine"] .shot-frame,
  html[data-modo="magazine"] .card { min-width: 0; max-width: 100%; }

  html[data-modo="magazine"] .cuadro { position: static; }

  html[data-modo="magazine"] .row {
    grid-template-columns: 5.6rem minmax(0, 1fr);
    align-items: start;
  }

  html[data-modo="magazine"] .row .kicker,
  html[data-modo="magazine"] .row > a,
  html[data-modo="magazine"] .row .mins { grid-column: 2; }

  html[data-modo="magazine"] .edition-mark { display: block; }

  html[data-modo="magazine"] .shot-hero figcaption {
    position: static;
    padding: 0.45rem 0 0;
    color: var(--muted);
    background: none;
  }

  html[data-modo="magazine"] .shot-hero figcaption a,
  html[data-modo="magazine"] .shot-hero figcaption a:hover { color: var(--muted); }

  html[data-modo="magazine"] .shot-thumb { grid-column: 1; grid-row: 1 / span 3; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-modo="magazine"] .shot-frame img { transition: none; }
  html[data-modo="magazine"] .shot-frame:hover img { transform: none; }
}
