:root {
  color: #f2ead8;
  background: #171713;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #171713;
  --bone: #f2ead8;
  --accent: #ef9b70;
  --line: rgba(242, 234, 216, 0.22);
  --muted: rgba(242, 234, 216, 0.66);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--ink);
  color: var(--bone);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, a { color: inherit; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid #f1b281; outline-offset: 4px; }
.icon { display: block; width: 18px; height: 18px; }

.site-frame { min-height: 100svh; background: var(--ink); }
.skip-link { position: fixed; top: -90px; left: 18px; z-index: 100; padding: 12px 16px; background: var(--bone); color: var(--ink); }
.skip-link:focus { top: 18px; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 40;
  width: 0;
  height: 3px;
  background: #e88458;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 18px 24px;
  background: linear-gradient(to bottom, rgba(16, 17, 15, 0.8), transparent);
  transition: background 180ms ease, border-color 180ms ease, backdrop-filter 180ms ease;
}

.topbar.is-scrolled {
  border-bottom: 1px solid var(--line);
  background: rgba(23, 23, 19, 0.92);
  backdrop-filter: blur(12px);
}

.brand { justify-self: start; font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; font-weight: 700; text-decoration: none; }
.topnav { display: flex; align-items: center; justify-content: center; gap: 16px; }
.topnav a, .topnav button { padding: 4px 0; border: 0; background: transparent; color: rgba(242, 234, 216, 0.72); cursor: pointer; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.075em; text-decoration: none; text-transform: uppercase; transition: color 160ms ease; }
.topnav a:hover, .topnav button:hover, .topnav a.active { color: var(--bone); }
.edition { justify-self: end; color: var(--muted); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }

.hero { position: relative; display: grid; min-height: 100svh; overflow: hidden; align-items: end; background: #2b2b23; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center; filter: saturate(0.72) contrast(1.08); }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12, 15, 15, 0.18), rgba(15, 14, 11, 0.28) 35%, rgba(15, 14, 11, 0.92) 100%), linear-gradient(90deg, rgba(15, 14, 11, 0.72), transparent 72%); }
.hero-content { position: relative; z-index: 1; padding: 150px 0 56px; }
.kicker { margin: 0; color: var(--accent); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.hero h1 { max-width: 900px; margin: 18px 0 22px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.5rem, 9.6vw, 8.4rem); font-weight: 400; letter-spacing: -0.055em; line-height: 0.88; }
.hero h1 em { color: var(--accent); font-weight: 400; }
.hero-lede { max-width: 610px; margin: 0; color: rgba(242, 234, 216, 0.84); font-size: clamp(1rem, 2vw, 1.24rem); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 34px; }

.primary-action { display: inline-flex; align-items: center; justify-content: space-between; gap: 30px; min-height: 62px; padding: 15px 18px; border: 1px solid transparent; background: var(--bone); color: var(--ink); cursor: pointer; font-weight: 750; text-decoration: none; transition: background 160ms ease, color 160ms ease, border-color 160ms ease; }
.primary-action:hover { border-color: var(--bone); background: rgba(23, 23, 19, 0.7); color: var(--bone); }
.primary-action:hover .icon { filter: invert(1); }

.hero-facts { position: absolute; right: 24px; bottom: 58px; z-index: 2; display: grid; grid-template-columns: repeat(3, max-content); gap: 34px; margin: 0; }
.hero-facts div { min-width: 80px; }
.hero-facts dt { font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 400; line-height: 1.1; }
.hero-facts dd { margin: 6px 0 0; color: rgba(242, 234, 216, 0.62); font-size: 0.67rem; letter-spacing: 0.1em; text-transform: uppercase; }

.chapter { padding: 120px 0; scroll-margin-top: 64px; }
.territory { overflow: hidden; background: var(--bone); color: var(--ink); }

.chapter-head { display: grid; grid-template-columns: 150px minmax(0, 1fr) 340px; align-items: start; gap: 30px; margin-bottom: 60px; }
.chapter-number { padding-top: 8px; color: #7c3928; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.12em; }
.chapter-head h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.7rem, 5.3vw, 4.9rem); font-weight: 400; letter-spacing: -0.04em; line-height: 0.98; }
.chapter-head p { max-width: 42ch; margin: 7px 0 0; color: #5e594f; }

.territory-overview { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.7fr); gap: 20px; }
.territory-explorer { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; min-width: 0; }
.territory-view-nav { min-width: 0; }
.territory-view-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-height: 36px; border-top: 1px solid rgba(23, 23, 19, 0.22); color: #7c3928; font-size: 0.68rem; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; }
.territory-view-heading span, .territory-view-heading small { padding-top: 9px; }
.territory-view-heading small { color: #777065; font-size: 0.6rem; font-weight: 650; letter-spacing: 0.08em; }
.territory-view-options { display: grid; gap: 6px; }

.territory-view-options button { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; min-height: 65px; padding: 6px; border: 1px solid rgba(23, 23, 19, 0.14); background: transparent; color: #5c564b; cursor: pointer; text-align: left; transition: border-color 160ms ease, background 160ms ease, color 160ms ease; }
.territory-view-options button:hover { border-color: rgba(124, 57, 40, 0.58); }
.territory-view-options button.active { border-color: #7c3928; background: #e8ddc5; color: var(--ink); }
.territory-view-options img { width: 58px; height: 51px; object-fit: cover; }
.territory-view-options span { overflow-wrap: anywhere; font-size: 0.62rem; font-weight: 750; letter-spacing: 0.07em; line-height: 1.25; text-transform: uppercase; }

.territory-feature { position: relative; min-height: 560px; margin: 0; overflow: hidden; background: #d7c49e; }
.territory-image-viewport { position: absolute; inset: 0; overflow: hidden; background: #312f28; }
.territory-image-subject { width: 100%; height: 100%; object-fit: cover; user-select: none; animation: territory-reveal 360ms ease both; }
.territory-image-backdrop { position: absolute; inset: -24px; width: calc(100% + 48px); height: calc(100% + 48px); object-fit: cover; filter: blur(18px) brightness(0.5) saturate(0.72); transform: scale(1.04); }
.territory-feature.is-contained .territory-image-subject { position: relative; z-index: 1; object-fit: contain; }
.territory-feature.is-panorama .territory-image-viewport { overflow-x: auto; overflow-y: hidden; cursor: grab; overscroll-behavior-inline: contain; scrollbar-color: rgba(242, 234, 216, 0.68) rgba(23, 23, 19, 0.28); scrollbar-width: thin; touch-action: pan-x; }
.territory-feature.is-panorama .territory-image-viewport.is-panning { cursor: grabbing; }
.territory-feature.is-panorama .territory-image-subject { width: auto; max-width: none; object-fit: contain; }
.territory-map-switch { position: absolute; z-index: 5; top: 14px; right: 14px; left: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; background: rgba(23, 23, 19, 0.9); color: var(--bone); }
.territory-map-switch[hidden] { display: none; }
.territory-map-switch span { padding: 0 6px; color: var(--accent); font-size: 0.58rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.territory-map-switch button { min-height: 34px; padding: 7px 10px; border: 1px solid var(--line); background: transparent; color: var(--bone); cursor: pointer; font-size: 0.64rem; }
.territory-map-switch button.active { border-color: var(--accent); background: var(--accent); color: var(--ink); }
.zoomable-image { cursor: zoom-in; }
.hero-image-zoom { padding: 8px 0; border: 0; border-bottom: 1px solid rgba(242, 234, 216, 0.45); background: transparent; color: var(--bone); cursor: pointer; font-size: 0.72rem; }
.hero-image-zoom:hover { color: var(--accent); border-color: var(--accent); }
.zoomable-image:focus-visible { outline: 3px solid var(--accent); outline-offset: -4px; }

.territory-feature figcaption { position: absolute; z-index: 3; inset: auto 18px 18px; max-width: min(560px, calc(100% - 36px)); padding: 11px 13px; background: rgba(23, 23, 19, 0.88); color: var(--bone); font-size: 0.74rem; }
.territory-feature figcaption strong, .territory-feature figcaption span { display: block; }
.territory-feature figcaption strong { margin-bottom: 2px; color: var(--accent); font-size: 0.62rem; letter-spacing: 0.09em; text-transform: uppercase; }

.panorama-hint, .panorama-controls { position: absolute; z-index: 2; top: 16px; }
.panorama-hint { left: 16px; padding: 8px 10px; background: rgba(23, 23, 19, 0.82); color: var(--bone); font-size: 0.64rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; pointer-events: none; }
.panorama-controls { right: 16px; display: flex; gap: 6px; }
.panorama-controls button { display: grid; width: 38px; height: 38px; padding: 0; border: 1px solid rgba(242, 234, 216, 0.45); background: rgba(23, 23, 19, 0.84); color: var(--bone); cursor: pointer; place-items: center; }
.panorama-controls button:hover { border-color: var(--bone); background: var(--bone); color: var(--ink); }
.panorama-controls button:hover .icon { filter: invert(1); }

.territory-facts { display: grid; gap: 1px; background: rgba(23, 23, 19, 0.16); }
.territory-facts article { display: grid; align-content: center; padding: 30px; background: #e8ddc5; }
.territory-facts strong { color: #7c3928; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.8rem, 5vw, 4.5rem); font-weight: 400; line-height: 1; }
.territory-facts p { max-width: 34ch; margin: 12px 0 0; color: #4d483f; }

@keyframes territory-reveal {
  from { opacity: 0.3; transform: scale(1.012); }
  to { opacity: 1; transform: scale(1); }
}

.before {
  overflow: hidden;
  background: #171713;
  color: var(--bone);
}

.before .chapter-number { color: var(--accent); }
.before .chapter-head p { color: var(--muted); }

.piuras-sequence {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.55fr);
  gap: 20px;
  align-items: stretch;
}

.piura-figure {
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(242, 234, 216, 0.18);
  background: #22221c;
}

.piura-frame {
  position: relative;
  overflow: hidden;
  background: #eee9da;
}

.piura-images {
  position: relative;
  aspect-ratio: 1512 / 1069;
  overflow: hidden;
  isolation: isolate;
}
.piura-composite { display: none; width: 100%; height: 100%; }
.piura-images.is-layer-ready .piura-composite { display: block; }
.piura-images.is-layer-ready img { display: none; }

.piura-images img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: normal;
  filter: none;
  transform: scale(1.006);
  transition: opacity 1200ms ease, filter 1200ms ease, transform 1800ms ease;
}

.piura-images img.active {
  opacity: 1;
  pointer-events: auto;
  filter: contrast(1) saturate(1);
  transform: scale(1);
}

.piura-glare {
  position: absolute;
  inset: -25%;
  z-index: 2;
  opacity: 0;
  background: radial-gradient(circle at 42% 48%, rgba(255, 248, 219, 0.98) 0, rgba(255, 241, 195, 0.58) 16%, rgba(239, 155, 112, 0.18) 36%, transparent 67%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.piura-images.is-flaring .piura-glare { animation: piura-flare 1350ms ease-out both; }

@keyframes piura-flare {
  0% { opacity: 0; transform: translateX(-18%) scale(0.84); }
  34% { opacity: 0.78; }
  100% { opacity: 0; transform: translateX(18%) scale(1.12); }
}

.piura-player {
  position: absolute;
  inset: 14px 14px auto;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: #5a554b;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.piura-selection-label { max-width: 320px; padding: 8px 10px; background: rgba(246, 244, 232, 0.94); }

.piura-toggle {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(23, 23, 19, 0.28);
  background: rgba(242, 234, 216, 0.88);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.piura-toggle:hover { background: var(--ink); color: var(--bone); }

.piura-caption {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 18px;
  min-height: 126px;
  padding: 22px;
  border-top: 1px solid rgba(242, 234, 216, 0.18);
}

.piura-count {
  padding-top: 4px;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.piura-caption h3 {
  margin: 0 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 2.5vw, 2.15rem);
  font-weight: 400;
  line-height: 1.08;
}

.piura-caption p { max-width: 62ch; margin: 0; color: var(--muted); font-size: 0.86rem; }

.piura-timeline {
  display: grid;
  grid-template-rows: repeat(5, minmax(78px, 1fr));
  border-top: 1px solid rgba(242, 234, 216, 0.2);
}

.piura-timeline button {
  display: grid;
  grid-template-columns: 14px 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 12px;
  min-width: 0;
  padding: 17px 16px;
  border: 0;
  border-bottom: 1px solid rgba(242, 234, 216, 0.2);
  background: transparent;
  color: rgba(242, 234, 216, 0.62);
  cursor: pointer;
  text-align: left;
  transition: background 240ms ease, color 240ms ease, padding 240ms ease;
}

.piura-timeline button:hover { color: var(--bone); }
.piura-timeline button.active { padding-left: 21px; background: #27251f; color: var(--bone); }
.piura-timeline button span { grid-row: 1 / 3; padding-top: 2px; color: var(--accent); font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; }
.piura-timeline button strong { font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; }
.piura-timeline button small { color: rgba(242, 234, 216, 0.5); font-size: 0.7rem; }
.piura-layer-panel { min-width: 0; border: 1px solid var(--line); background: #20201b; }
.piura-layer-heading { display: grid; gap: 12px; padding: 18px 16px; }
.piura-layer-heading > div { display: grid; gap: 7px; }
.piura-layer-heading span { color: var(--accent); font-size: 0.59rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.piura-layer-heading strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.2rem; font-weight: 400; }
.piura-layer-heading small { color: var(--muted); font-size: 0.72rem; line-height: 1.5; }
.piura-timeline .layer-swatch { grid-row: 1 / 3; align-self: center; }
.piura-timeline button.active .layer-swatch { box-shadow: 0 0 0 3px #20201b, 0 0 0 4px currentColor; }
.layer-swatch { display: inline-block; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; }
.layer-early { background: #d3bd26; }
.layer-late { background: #c88624; }
.layer-inca { background: #ce3540; }
.layer-colonial { background: #3b53dc; }
.layer-current { background: #27af77; }
.layer-base { background: #918774; }
.layer-water { background: #68cfda; }
.piura-base-legend { display: grid; gap: 9px; padding: 15px 18px; color: var(--muted); font-size: 0.67rem; }
.piura-base-legend span { display: flex; align-items: center; gap: 8px; }
.piura-credit { margin: 14px 0 0 170px; color: rgba(242, 234, 216, 0.5); font-size: 0.72rem; }
.piura-credit strong { color: rgba(242, 234, 216, 0.8); font-weight: 600; }

.sequence-note {
  max-width: 760px;
  margin: 28px 0 0 170px;
  color: rgba(242, 234, 216, 0.62);
  font-size: 0.8rem;
}

.sequence-note strong { color: var(--bone); }

.archive-chapter {
  overflow: clip;
  background:
    radial-gradient(circle at 78% 18%, rgba(239, 155, 112, 0.08), transparent 30%),
    linear-gradient(180deg, #2a251f 0%, #24201b 100%);
  color: var(--bone);
}

.archive-head .chapter-number { color: var(--accent); }
.archive-head p { color: var(--muted); }

.archive-interface {
  display: block;
  min-height: 0;
  overflow: visible;
  border: 1px solid var(--line);
  background: #1b1e1d;
}

.archive-list {
  min-width: 0;
  border-bottom: 1px solid var(--line);
  background: #20211d;
}

.archive-list-head {
  padding: 18px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.archive-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.archive-tabs button {
  display: grid;
  gap: 5px;
  min-height: 132px;
  padding: 20px 16px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: rgba(242, 234, 216, 0.62);
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.archive-tabs button:hover { background: rgba(242, 234, 216, 0.06); color: var(--bone); }
.archive-tabs button:last-child { border-right: 0; }
.archive-tabs button.active { background: #292923; color: var(--bone); box-shadow: inset 0 -4px var(--accent); }
.archive-tabs span { color: var(--accent); font-size: 0.58rem; font-weight: 800; letter-spacing: 0.1em; }
.archive-tabs strong { align-self: end; font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; line-height: 1.12; }
.archive-tabs small { color: rgba(242, 234, 216, 0.48); font-size: 0.69rem; }

.source-detail { min-width: 0; }

.source-toolbar {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: #20231f;
}

.source-toolbar > div:first-child { display: grid; gap: 3px; min-width: 0; }
.source-location { overflow-wrap: anywhere; color: var(--accent); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.075em; text-transform: uppercase; }
.source-status { color: var(--muted); font-size: 0.68rem; }

.source-view-switch {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  background: #171713;
}

.source-view-switch button {
  min-height: 34px;
  padding: 7px 11px;
  border: 0;
  background: transparent;
  color: rgba(242, 234, 216, 0.58);
  cursor: pointer;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.source-view-switch button:hover { color: var(--bone); }
.source-view-switch button.active { background: var(--accent); color: var(--ink); }

.source-content {
  display: block;
  min-height: 0;
  background: #181b19;
}

.facsimile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  align-self: stretch;
  border-right: 1px solid var(--line);
  background: #252521;
}

.facsimile-viewport {
  height: 576px;
  overflow: auto;
  background-color: #1b1b18;
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% auto;
  scrollbar-color: rgba(239, 155, 112, 0.7) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.source-image { display: block; width: 100%; min-height: 100%; object-fit: contain; object-position: top center; background: #eeeae0; }

.facsimile-viewport[data-focus="top"] { flex: 0 0 auto; width: calc(100% - 52px); height: auto; margin: auto 26px; aspect-ratio: 2.08 / 1; overflow: hidden; border: 1px solid rgba(242, 234, 216, 0.24); background-position: center top; box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28); }
.facsimile-viewport[data-focus="bottom"] { flex: 0 0 auto; width: calc(100% - 52px); height: auto; margin: auto 26px; aspect-ratio: 1.08 / 1; overflow: hidden; border: 1px solid rgba(242, 234, 216, 0.24); background-position: center bottom; box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28); }
.facsimile-viewport[data-focus="top"] .source-image,
.facsimile-viewport[data-focus="bottom"] .source-image { width: 100%; height: 100%; min-height: 0; visibility: hidden; }
.facsimile-viewport[data-focus="full"] { background-image: none !important; }

.facsimile figcaption {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 15px;
  background: #24241f;
  color: var(--bone);
  margin-top: auto;
}

.facsimile figcaption > div { display: grid; gap: 2px; }
.facsimile figcaption span { color: var(--accent); font-size: 0.56rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.facsimile figcaption strong { font-family: Georgia, "Times New Roman", serif; font-size: 0.96rem; font-weight: 400; }
.source-expand { flex: 0 0 auto; min-height: 34px; padding: 7px 10px; border: 1px solid rgba(242, 234, 216, 0.28); background: transparent; color: var(--bone); cursor: pointer; font-size: 0.57rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.source-expand:hover { border-color: var(--accent); color: var(--accent); }

.source-reading {
  min-width: 0;
  padding: clamp(30px, 4vw, 52px);
  overflow: visible;
  background: #f7f1e6;
  color: var(--ink);
}
.source-reading-enriched { display: grid; grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.45fr); column-gap: 56px; }
.source-reading-head { grid-column: 1; grid-row: 1 / 4; }
.source-reading-enriched .tei-key, .source-full-text, .source-reading-enriched .source-note { grid-column: 2; }
.source-full-text { color: #302c25; font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; line-height: 1.85; }
.source-full-text h4 { margin: 0 0 20px; color: #8a3d2b; font-family: inherit; font-size: 1.25rem; font-weight: 400; font-style: italic; }
.source-full-text p { margin: 0; }
.source-full-text p + p { margin-top: 24px; }
.tei-token { border-bottom: 1px dotted currentColor; cursor: help; text-decoration-skip-ink: auto; transition: background 160ms ease; }
.tei-token:hover, .tei-token:focus { border-bottom-style: solid; outline: none; background: rgba(176, 131, 55, 0.12); }
.tei-place-token { color: #984832; }
.tei-person-token { color: #3f697a; }
.tei-date-token { color: #5b713e; }
.tei-choice-token { color: #8c692d; }
.tei-role-token, .tei-measure-token { color: #6e5b88; }
.tei-gap-token { color: #70695f; font-style: italic; }
.tei-tooltip { position: fixed; z-index: 10020; max-width: min(300px, calc(100vw - 24px)); padding: 11px 14px; border: 1px solid rgba(239, 155, 112, 0.45); background: #25231e; color: var(--bone); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22); font: 0.76rem/1.5 Arial, sans-serif; pointer-events: none; }

.source-type { color: #8a3d2b; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.source-title { margin: 13px 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 3.2vw, 3.2rem); font-weight: 400; letter-spacing: -0.035em; line-height: 1; }
.source-summary { margin: 0 0 26px; color: #5f594f; font-size: 0.82rem; }
.source-quote { margin: 0; color: #292822; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.13rem, 1.8vw, 1.43rem); font-style: italic; line-height: 1.55; }
.source-note { margin: 28px 0 0; padding-top: 16px; border-top: 1px solid rgba(23, 23, 19, 0.18); color: #6b655b; font-size: 0.73rem; }
.source-note.is-pending { padding: 14px; border: 1px solid rgba(138, 61, 43, 0.34); background: #eee0cb; color: #65372d; }

.tei-intro { margin: 0 0 16px; color: #5f594f; font-size: 0.78rem; }
.tei-key { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-bottom: 16px; }
.tei-key span { display: inline-flex; align-items: center; gap: 5px; color: #625c53; font-size: 0.63rem; }
.tei-key i { width: 8px; height: 8px; border-radius: 50%; }
.tei-key code { color: #35332d; font-size: 0.65rem; }
.tei-place { background: #b45d45; }
.tei-person { background: #4f7381; }
.tei-date { background: #6c8056; }
.tei-choice { background: #b08337; }
.tei-gap { background: #77716a; }

.tei-code {
  max-height: 355px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid rgba(23, 23, 19, 0.2);
  background: #20231f;
  color: #e8dfcf;
  font: 0.72rem/1.65 "Courier New", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}

.tei-interpretation {
  margin-bottom: 15px;
  padding: 18px;
  border: 1px solid rgba(23, 23, 19, 0.2);
  background: #eee4d3;
  color: #37342e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.62;
}

.tei-interpretation p { margin: 0; }
.tei-interpretation p + p { margin-top: 12px; }
.tei-interpretation mark { padding: 1px 3px; border-radius: 2px; color: inherit; }
.tei-place-mark { background: #e7b6a7; }
.tei-person-mark { background: #b8d0d7; }
.tei-date-mark { background: #cbd8b8; }
.tei-choice-mark { background: #ead3a7; }
.tei-gap-mark { border-bottom: 1px dashed #746f68; background: #d8d3cb; color: #625e58; }

.tei-raw { border-top: 1px solid rgba(23, 23, 19, 0.18); }
.tei-raw summary { padding: 12px 0; color: #5e574e; cursor: pointer; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.tei-raw[open] summary { color: #8a3d2b; }

.archive-note {
  max-width: 780px;
  margin: 25px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.archive-note strong { color: var(--bone); }

.objects {
  margin-top: 112px;
  padding-top: 46px;
  border-top: 1px solid rgba(242, 234, 216, 0.22);
}

.objects-head {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 340px;
  align-items: start;
  gap: 30px;
  margin-bottom: 38px;
}

.objects-head > span {
  padding-top: 7px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.objects-head h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.objects-head p { margin: 7px 0 0; color: var(--muted); }

.archive-chapter .objects { border-color: var(--line); }

.archive-materials { margin-top: 52px; padding-top: 28px; }
.archive-materials-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.archive-materials-head > div { display: grid; gap: 5px; }
.archive-materials-head span { color: var(--accent); font-size: 0.6rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.archive-materials-head strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.8rem; font-weight: 400; }
.archive-materials-head p { max-width: 560px; margin: 0; color: var(--muted); font-size: 0.76rem; }
.archive-materials .object-grid img { aspect-ratio: 16 / 9; }
.archive-materials .object-grid .object-card > span { min-height: 116px; padding: 15px 17px; }
.archive-materials .object-grid strong { font-size: 1.5rem; }
.archive-materials .object-grid em { margin-top: 12px; font-size: 0.72rem; }

.object-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.object-grid .object-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(242, 234, 216, 0.18);
  background: #20201a;
  color: var(--bone);
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms ease, transform 180ms ease;
}

.object-grid .object-card:hover { border-color: var(--accent); }
.object-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; filter: saturate(0.7) contrast(1.04); transition: filter 220ms ease, transform 400ms ease; }
.object-grid .object-card:hover img { filter: saturate(1) contrast(1.04); }
.object-grid .object-card > span { display: grid; min-height: 144px; padding: 18px; }
.object-grid small { color: var(--accent); font-size: 0.58rem; font-weight: 800; letter-spacing: 0.1em; }
.object-grid strong { margin-top: 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.8rem; font-weight: 400; }
.object-grid em { align-self: end; margin-top: 20px; color: var(--muted); font-size: 0.77rem; font-style: normal; }

.object-dialog {
  width: min(960px, calc(100% - 36px));
  max-height: min(820px, calc(100svh - 36px));
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(242, 234, 216, 0.26);
  background: #171713;
  color: var(--bone);
}

.object-dialog[open] { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.55fr); }
.object-dialog::backdrop { background: rgba(8, 8, 6, 0.86); backdrop-filter: blur(8px); }
.object-dialog-close { position: absolute; top: 14px; right: 14px; z-index: 2; min-height: 38px; padding: 8px 13px; border: 1px solid rgba(242, 234, 216, 0.34); background: rgba(23, 23, 19, 0.9); color: var(--bone); cursor: pointer; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.object-dialog-media { min-height: 520px; background: #0e0e0c; }
.object-dialog-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.object-dialog-copy { display: grid; align-content: end; padding: 38px 30px; }
.object-dialog-copy span { color: var(--accent); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.object-dialog-copy h3 { margin: 12px 0 14px; font-family: Georgia, "Times New Roman", serif; font-size: 2.8rem; font-weight: 400; }
.object-dialog-copy p { margin: 0; color: var(--muted); }

.source-dialog {
  width: min(1080px, calc(100% - 34px));
  max-height: calc(100svh - 34px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(242, 234, 216, 0.28);
  background: #171713;
  color: var(--bone);
}

.source-dialog[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.source-dialog::backdrop { background: rgba(8, 8, 6, 0.9); backdrop-filter: blur(8px); }
.source-dialog-close { position: fixed; top: 28px; right: 28px; z-index: 2; min-height: 38px; padding: 8px 13px; border: 1px solid rgba(242, 234, 216, 0.38); background: rgba(23, 23, 19, 0.94); color: var(--bone); cursor: pointer; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.source-dialog-media { min-height: 0; overflow: auto; background: #0e0e0c; text-align: center; }
.source-dialog-media img { display: block; width: auto; max-width: 100%; min-height: 100%; margin-inline: auto; object-fit: contain; }
.source-dialog-caption { padding: 18px 22px; border-top: 1px solid var(--line); }
.source-dialog-caption span { color: var(--accent); font-size: 0.58rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.source-dialog-caption h3 { margin: 5px 0 3px; font-family: Georgia, "Times New Roman", serif; font-size: 1.5rem; font-weight: 400; }
.source-dialog-caption p { margin: 0; color: var(--muted); font-size: 0.72rem; }

.image-zoom-dialog { width: min(1280px, calc(100% - 32px)); height: min(900px, calc(100svh - 32px)); max-height: calc(100svh - 32px); padding: 0; overflow: hidden; border: 1px solid var(--line); background: #171713; color: var(--bone); }
.image-zoom-dialog[open] { display: flex; flex-direction: column; }
.image-zoom-dialog::backdrop { background: rgba(8, 8, 6, 0.92); backdrop-filter: blur(8px); }
.image-zoom-toolbar { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.image-zoom-toolbar > div:first-child { display: grid; gap: 3px; min-width: 0; }
.image-zoom-toolbar span { color: var(--accent); font-size: 0.58rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.image-zoom-toolbar strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.2rem; font-weight: 400; }
.image-zoom-actions { display: flex; flex: 0 0 auto; gap: 5px; }
.image-zoom-actions button { min-width: 38px; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line); background: #25251f; color: var(--bone); cursor: pointer; font-size: 0.72rem; }
.image-zoom-actions button:hover { border-color: var(--accent); color: var(--accent); }
.image-zoom-viewport { flex: 1; min-height: 0; padding: 18px; overflow: auto; background: #12130f; text-align: center; }
.image-zoom-viewport img { display: block; max-width: none; height: auto; margin: auto; }
.image-zoom-caption { flex: 0 0 auto; margin: 0; padding: 13px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.74rem; }

.flying-city { overflow: hidden; background: #252b2f; color: var(--bone); }
.flying-city-head .chapter-number { color: var(--accent); }
.flying-city-head h2 span { display: block; }
.flying-city-head p { color: var(--muted); }

.flight-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  min-height: 680px;
  overflow: hidden;
  border: 1px solid rgba(242, 234, 216, 0.22);
  background: #181d20;
}

.flight-map-wrap { position: relative; min-width: 0; min-height: 680px; background: #1b2225; isolation: isolate; }
.flight-map { width: 100%; height: 100%; min-height: 680px; background: radial-gradient(circle at 55% 44%, #5f675f, #263033 72%); }

.flight-map-toolbar {
  position: absolute;
  inset: 16px 16px auto;
  z-index: 600;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  pointer-events: none;
}

.flight-map-toolbar > div {
  display: grid;
  gap: 3px;
  max-width: 300px;
  padding: 10px 12px;
  border: 1px solid rgba(242, 234, 216, 0.24);
  background: rgba(20, 23, 22, 0.88);
  backdrop-filter: blur(9px);
}

.flight-map-toolbar span { color: var(--accent); font-size: 0.56rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.flight-map-toolbar strong { font-family: Georgia, "Times New Roman", serif; font-size: 1rem; font-weight: 400; }
.flight-map-toolbar small { margin-top: 3px; color: rgba(242, 234, 216, 0.58); font-size: 0.61rem; }

.flight-network-toggle {
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid rgba(242, 234, 216, 0.36);
  background: rgba(20, 23, 22, 0.9);
  color: var(--bone);
  cursor: pointer;
  pointer-events: auto;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(9px);
}

.flight-network-toggle:hover,
.flight-network-toggle[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--ink); }

.flight-map-fallback {
  position: absolute;
  inset: 0;
  z-index: 3;
  place-content: center;
  gap: 8px;
  padding: 30px;
  background: radial-gradient(circle at 58% 42%, rgba(239, 155, 112, 0.2), transparent 32%), repeating-linear-gradient(0deg, transparent 0 39px, rgba(242, 234, 216, 0.04) 40px), repeating-linear-gradient(90deg, transparent 0 39px, rgba(242, 234, 216, 0.04) 40px), #1c2225;
  text-align: center;
}

.flight-map-fallback:not([hidden]) { display: grid; }
.flight-map-fallback span { color: var(--muted); font-size: 0.8rem; }

.flight-legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 600;
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  padding: 9px 11px;
  border: 1px solid rgba(242, 234, 216, 0.2);
  background: rgba(20, 23, 22, 0.86);
  color: rgba(242, 234, 216, 0.72);
  font-size: 0.61rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: auto;
  backdrop-filter: blur(8px);
}

.flight-legend button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.flight-legend button:hover,
.flight-legend button:focus-visible { border-color: rgba(239, 155, 112, 0.68); color: var(--bone); outline: none; }
.flight-legend button[aria-pressed="true"] { border-color: var(--accent); background: rgba(239, 155, 112, 0.14); color: var(--bone); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.legend-piura { border: 2px solid var(--accent); background: #202629; }
.legend-related { background: var(--accent); box-shadow: 0 0 0 2px rgba(239, 155, 112, 0.24); }

.flight-panel { display: flex; flex-direction: column; min-width: 0; padding: 30px; background: #20262a; }
.flight-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.flight-tabs button { min-width: 0; padding: 10px 4px; border: 1px solid rgba(242, 234, 216, 0.2); background: transparent; color: rgba(242, 234, 216, 0.62); cursor: pointer; font-size: 0.7rem; }
.flight-tabs button:hover { border-color: rgba(239, 155, 112, 0.7); color: var(--bone); }
.flight-tabs button.active { border-color: var(--accent); background: var(--accent); color: var(--ink); }

.flight-story { display: flex; flex: 1; flex-direction: column; justify-content: center; min-height: 330px; padding: 34px 0; }
.flight-step { color: var(--accent); font-size: 0.59rem; font-weight: 800; letter-spacing: 0.12em; }
.flight-year { margin-top: 18px; color: var(--accent); font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.7rem, 6vw, 5.8rem); line-height: 0.9; }
.flight-story h3 { margin: 18px 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 3vw, 2.45rem); font-weight: 400; line-height: 1.02; }
.flight-story p { margin: 0; color: var(--muted); font-size: 0.86rem; }

.flight-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; border-top: 1px solid rgba(242, 234, 216, 0.18); background: rgba(242, 234, 216, 0.12); }
.flight-meta > div { min-width: 0; padding: 13px 11px; background: #20262a; }
.flight-meta > div:last-child { grid-column: 1 / -1; }
.flight-meta dt { color: rgba(242, 234, 216, 0.46); font-size: 0.55rem; letter-spacing: 0.1em; text-transform: uppercase; }
.flight-meta dd { margin: 5px 0 0; color: var(--bone); font-size: 0.72rem; }
.flight-actor-meta dd { display: flex; align-items: center; gap: 10px; }
.flight-actor-crop { position: relative; flex: 0 0 56px; width: 56px; height: 68px; padding: 0; overflow: hidden; border: 1px solid var(--line); background: var(--bone); }
.flight-actor-image { position: absolute; width: 56px; max-width: none; height: auto; filter: grayscale(1) contrast(1.15); }
.flight-actor-crop:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.flight-actor-meta dd > span { display: grid; gap: 5px; }
.flight-actor-meta strong { font-weight: 500; }
.city-history-foundation { margin: 8px 0 0; font-size: 0.84rem; line-height: 1.5; }

.flight-network-note { margin-top: 22px; padding: 16px; border-left: 2px solid var(--accent); background: rgba(242, 234, 216, 0.045); }
.flight-network-note span { color: var(--accent); font-size: 0.58rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.flight-network-note p { margin: 7px 0 0; color: rgba(242, 234, 216, 0.58); font-size: 0.72rem; }

.flight-source-note { max-width: 850px; margin: 28px 0 0 170px; color: rgba(242, 234, 216, 0.62); font-size: 0.8rem; }
.flight-source-note strong { color: var(--bone); }

.flight-map .leaflet-tile-pane { filter: grayscale(0.82) sepia(0.22) brightness(0.7) contrast(1.08); }
.flight-map .leaflet-control-zoom { overflow: hidden; border: 1px solid rgba(242, 234, 216, 0.28); border-radius: 0; box-shadow: none; }
.flight-map .leaflet-control-zoom a { border: 0; border-bottom: 1px solid rgba(242, 234, 216, 0.18); background: rgba(20, 23, 22, 0.92); color: var(--bone); }
.flight-map .leaflet-control-zoom a:hover { background: var(--accent); color: var(--ink); }
.flight-map .leaflet-control-attribution { background: rgba(20, 23, 22, 0.76); color: rgba(242, 234, 216, 0.6); font-size: 0.55rem; }
.flight-map .leaflet-control-attribution a { color: var(--bone); }

.flight-div-icon { border: 0; background: transparent; }
.flight-marker { position: relative; display: block; width: 20px; height: 20px; border: 2px solid var(--accent); border-radius: 50%; background: #20262a; box-shadow: 0 0 0 4px rgba(24, 29, 32, 0.72); transition: width 200ms ease, height 200ms ease, margin 200ms ease, background 200ms ease, box-shadow 200ms ease; }
.flight-marker.active { width: 28px; height: 28px; margin: -4px; background: var(--accent); box-shadow: 0 0 0 9px rgba(239, 155, 112, 0.22); }
.flight-marker::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--bone); opacity: 0.78; }
.flight-marker.active::after { opacity: 0.95; }
.context-city-marker { display: block; border: 2px solid #20262a; border-radius: 50%; transition: opacity 180ms ease, background 180ms ease, box-shadow 180ms ease; }
.flight-map .context-div-icon { cursor: help; }
.context-city-marker.is-related { width: 14px; height: 14px; background: var(--accent); box-shadow: 0 0 0 4px rgba(239, 155, 112, 0.24); }
.context-city-marker.is-reference { width: 9px; height: 9px; background: var(--bone); opacity: 0.38; box-shadow: 0 0 0 2px rgba(242, 234, 216, 0.18); }

.flight-map .leaflet-tooltip { padding: 6px 8px; border: 1px solid rgba(242, 234, 216, 0.24); border-radius: 0; background: rgba(24, 29, 32, 0.92); box-shadow: none; color: var(--bone); font-size: 0.64rem; }
.flight-map .leaflet-tooltip::before { display: none; }
.flight-map .context-tooltip { color: rgba(242, 234, 216, 0.82); font-size: 0.59rem; letter-spacing: 0.04em; text-transform: uppercase; }
.flight-map .context-tooltip.is-related { border-color: rgba(239, 155, 112, 0.62); color: var(--bone); }
.flight-map .context-tooltip[role="button"] { cursor: pointer; }
.flight-map .context-tooltip[role="button"]:focus-visible { outline: 2px solid var(--bone); outline-offset: 2px; }
.flight-map .context-tooltip.is-reference { opacity: 0.72; }
.flight-map .leaflet-popup-content-wrapper { border-radius: 0; background: #20262a; color: var(--bone); }
.flight-map .leaflet-popup-pane { z-index: 750; }
.flight-map .leaflet-popup-tip { background: #20262a; }
.flight-map .leaflet-popup-content { margin: 16px; line-height: 1.45; }
.flight-map .leaflet-popup-content strong { display: block; margin-bottom: 5px; color: var(--accent); font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; font-weight: 400; }
.flight-map .leaflet-popup-content span { color: rgba(242, 234, 216, 0.66); font-size: 0.72rem; }
.flight-map .city-history-name { padding-right: 10px; font-size: 1.2rem; line-height: 1.15; }
.flight-map .city-history-current { display: block; margin-bottom: 12px; }
.city-history-period { display: block; color: var(--accent); font-size: 0.64rem; letter-spacing: 0.025em; }
.city-history-title { margin: 9px 0 7px; color: var(--bone); font-size: 0.84rem; line-height: 1.35; }
.flight-map .city-history-text { margin: 0; color: var(--bone); font-size: 0.8rem; line-height: 1.55; }
.city-history-sources { display: grid; gap: 8px; margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(242, 234, 216, 0.2); }
.flight-map .city-history-sources a { color: #efbb91; font-size: 0.68rem; line-height: 1.4; text-decoration: underline; text-underline-offset: 3px; }
.city-history-sources a:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; }
.flight-map .city-history-popup .leaflet-popup-content { max-width: calc(100vw - 96px); overflow-wrap: anywhere; }
.flight-map .city-history-popup .leaflet-popup-close-button { color: var(--bone); }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topnav { display: none; }
}

@media (max-width: 1080px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topnav { display: none; }
  .hero-facts { position: relative; right: auto; bottom: auto; grid-template-columns: repeat(3, 1fr); margin-top: 44px; }
  .chapter-head { grid-template-columns: 90px minmax(0, 1fr); }
  .chapter-head p { grid-column: 2; }
  .territory-overview { grid-template-columns: 1fr; }
  .territory-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .territory-facts article { min-height: 230px; }
  .piuras-sequence { grid-template-columns: 1fr; }
  .piura-timeline { display: flex; grid-template-rows: none; overflow-x: auto; scrollbar-width: thin; }
  .piura-timeline button { flex: 0 0 200px; min-height: 92px; }
  .sequence-note { margin-left: 90px; }
  .piura-credit { margin-left: 90px; }
  .piura-base-legend { grid-template-columns: repeat(2, max-content); gap: 18px; }
  .archive-interface { grid-template-columns: 1fr; }
  .archive-note { margin-left: 0; }
  .source-reading { padding: 34px 28px; }
  .objects-head { grid-template-columns: 90px minmax(0, 1fr); }
  .objects-head p { grid-column: 2; }
  .flight-stage { grid-template-columns: 1fr; }
  .flight-map-wrap,
  .flight-map { min-height: 580px; }
  .flight-panel { min-height: 550px; }
  .flight-source-note { margin-left: 90px; }
}

@media (max-width: 820px) {
  .archive-interface { grid-template-columns: 1fr; }
  .archive-list { border-right: 0; border-bottom: 1px solid rgba(23, 23, 19, 0.18); }
  .archive-tabs { display: flex; overflow-x: auto; scrollbar-width: thin; }
  .archive-tabs button { flex: 0 0 210px; min-height: 112px; border-right: 1px solid rgba(23, 23, 19, 0.14); border-bottom: 0; }
  .archive-tabs button.active { box-shadow: inset 0 -4px #a64b34; }
  .archive-note { margin-left: 0; }
  .source-reading-enriched { display: block; }
  .source-reading-head { max-width: 620px; }
  .source-full-text { margin-top: 22px; }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 28px, 1180px); }
  .topbar { gap: 12px; padding: 16px 14px; }
  .brand { font-size: 0.98rem; }
  .edition { max-width: 130px; font-size: 0.6rem; text-align: right; }
  .hero-content { padding-top: 120px; }
  .hero h1 { max-width: 347px; margin-top: 16px; font-size: 3.5rem; line-height: 0.88; }
  .hero-actions { align-items: flex-start; gap: 20px; margin-top: 34px; }
  .primary-action { gap: 24px; }
  .hero-facts { gap: 14px; margin-top: 44px; }
  .hero-facts div { min-width: 0; }
  .hero-facts dt { font-size: 1.5rem; line-height: 1.83; }
  .hero-facts dd { margin-top: 0; font-size: 0.67rem; }
  .chapter { padding: 82px 0; }
  .chapter-head { display: block; margin-bottom: 42px; }
  .chapter-number { display: block; margin-bottom: 14px; padding-top: 0; }
  .chapter-head p { margin-top: 18px; }
  .territory-explorer { display: flex; flex-direction: column; gap: 12px; }
  .territory-view-heading { min-height: 34px; }
  .territory-view-options { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: thin; }
  .territory-view-options button { flex: 0 0 128px; grid-template-columns: 48px minmax(0, 1fr); min-height: 64px; }
  .territory-view-options img { width: 48px; height: 50px; }
  .territory-feature { min-height: 400px; }
  .territory-map-switch { top: 10px; right: 10px; left: 10px; gap: 5px; }
  .territory-map-switch span { flex-basis: 100%; }
  .territory-map-switch button { flex: 1; }
  .panorama-hint { top: 12px; left: 12px; max-width: calc(100% - 116px); font-size: 0.56rem; }
  .panorama-controls { top: 12px; right: 12px; }
  .panorama-controls button { width: 34px; height: 34px; }
  .territory-facts { grid-template-columns: 1fr; }
  .territory-facts article { min-height: 210px; padding: 28px; }
  .before-head h2 { font-size: 3rem; }
  .piura-player { inset: 9px 9px auto; }
  .piura-player > span { max-width: 180px; font-size: 0.54rem; }
  .piura-toggle { min-height: 34px; padding: 7px 10px; }
  .piura-caption { grid-template-columns: 58px minmax(0, 1fr); gap: 10px; min-height: 150px; padding: 18px 14px; }
  .piura-caption h3 { font-size: 1.65rem; }
  .piura-caption p { font-size: 0.78rem; }
  .piura-timeline button { flex-basis: 176px; }
  .sequence-note { margin: 22px 0 0; }
  .piura-credit { margin: 14px 0 0; }
  .piura-base-legend { grid-template-columns: 1fr; gap: 9px; }
  .archive-head h2 { font-size: 2.85rem; }
  .archive-interface { margin-inline: -14px; }
  .archive-list-head { padding-inline: 14px; }
  .archive-tabs button { flex-basis: 185px; padding: 16px 14px; }
  .source-toolbar { display: grid; padding: 14px; }
  .source-view-switch { width: 100%; }
  .source-view-switch button { flex: 1; }
  .source-content { grid-template-columns: 1fr; }
  .facsimile { border-right: 0; border-bottom: 1px solid rgba(23, 23, 19, 0.18); }
  .facsimile-viewport { height: 470px; }
  .facsimile figcaption { align-items: flex-start; }
  .source-reading { max-height: none; padding: 30px 20px; }
  .source-title { font-size: 2.2rem; }
  .source-full-text { font-size: 1.08rem; line-height: 1.8; }
  .tei-code { max-height: 330px; padding: 14px; font-size: 0.66rem; }
  .archive-note { margin: 22px 0 0; }
  .objects { margin-top: 82px; padding-top: 36px; }
  .archive-materials { margin-top: 42px; padding-top: 24px; }
  .archive-materials-head { display: grid; gap: 12px; margin-bottom: 20px; }
  .archive-materials-head strong { font-size: 1.55rem; }
  .objects-head { display: block; }
  .objects-head > span { display: block; margin-bottom: 14px; padding: 0; }
  .objects-head p { margin-top: 18px; }
  .object-grid { grid-template-columns: 1fr; }
  .object-grid .object-card { display: grid; grid-template-columns: 132px minmax(0, 1fr); }
  .object-grid img { height: 100%; aspect-ratio: auto; }
  .object-grid .object-card > span { min-height: 176px; }
  .archive-materials .object-grid .object-card > span { min-height: 156px; }
  .object-dialog[open] { display: block; }
  .object-dialog-media { min-height: 58svh; }
  .object-dialog-copy { padding: 26px 22px; }
  .source-dialog-close { top: 24px; right: 24px; }
  .source-dialog-media img { min-height: auto; }
  .source-dialog-caption { padding: 16px; }
  .image-zoom-dialog { width: calc(100% - 16px); height: calc(100svh - 16px); max-height: calc(100svh - 16px); }
  .image-zoom-toolbar { display: grid; gap: 12px; padding: 12px; }
  .image-zoom-actions { justify-content: flex-end; }
  .image-zoom-viewport { padding: 8px; }
  .flying-city-head h2 { max-width: 100%; font-size: 2.55rem; }
  .flight-stage { margin-inline: -14px; }
  .flight-map-wrap,
  .flight-map { min-height: 500px; }
  .flight-map-toolbar { inset: 10px 10px auto; display: grid; justify-items: start; }
  .flight-map-toolbar > div { max-width: 245px; }
  .flight-map-wrap.is-reading-city .flight-map-toolbar { visibility: hidden; }
  .flight-network-toggle { min-height: 38px; }
  .flight-legend { right: 10px; bottom: 26px; left: 10px; gap: 9px; font-size: 0.54rem; }
  .flight-panel { min-height: auto; padding: 24px 18px; }
  .flight-story { min-height: 340px; padding: 34px 0; }
  .flight-story h3 { font-size: 2.15rem; }
  .flight-source-note { margin: 22px 0 0; }
}

@media (max-height: 720px) and (min-width: 641px) {
  .hero-content { padding-top: 110px; padding-bottom: 32px; }
  .hero h1 { max-width: 760px; font-size: clamp(3.8rem, 8vw, 6.6rem); }
  .hero-facts { bottom: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  .piura-images.is-flaring .piura-glare { animation: none; }
}

/* Zoom en el propio recuadro: nunca abre diálogos ni modifica su tamaño. */
.inline-zoom-frame { overflow: hidden; }
.inline-zoom-frame:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.inline-zoom-media { user-select: none; -webkit-user-drag: none; animation: none !important; transition: none !important; }
.inline-zoom-frame.is-zoomed { overflow: hidden !important; cursor: grab; touch-action: none !important; }
.inline-zoom-frame.is-zoom-dragging { cursor: grabbing; }
.inline-zoom-controls { position: absolute; z-index: 6; right: 12px; bottom: 12px; display: flex; gap: 3px; padding: 4px; border: 1px solid rgba(242,234,216,.35); background: #25231eee; }
.inline-zoom-controls button { min-width: 32px; min-height: 36px; padding: 5px 8px; border: 0; background: transparent; color: var(--bone); cursor: pointer; font: 700 0.65rem Arial, sans-serif; }
.inline-zoom-controls button:hover:not(:disabled) { background: var(--accent); color: var(--ink); }
.inline-zoom-controls button:disabled { opacity: .35; cursor: default; }
.hero-media { overflow: hidden; }
.source-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; background: #ded4bf; }
.source-original { position: relative; min-width: 0; height: 560px; display: flex; flex-direction: column; margin: 0; background: #ded4bf; }
.source-original-viewport { flex: 1; min-height: 0; display: grid; place-items: center; padding: 24px; }
.source-original-sheet { width: 100%; aspect-ratio: 2.08 / 1; background: #fff center top / 100% auto no-repeat; box-shadow: 0 8px 28px #3e332a20; }
.source-original-sheet[data-focus="bottom"] { aspect-ratio: 1.08 / 1; background-position: center bottom; }
.source-original-sheet[data-focus="full"] { height: 100%; aspect-ratio: auto; background-size: contain; background-position: center; }
.source-original figcaption { min-height: 72px; display: grid; align-content: center; gap: 5px; padding: 12px 20px; border-top: 1px solid #c2b69f; color: #332e26; }
.source-original figcaption span { color: #8a3d2b; font-size: .59rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.source-original figcaption strong { font: 400 1rem Georgia, serif; }
.source-reading-head { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 32px; max-width: none; padding: 28px 32px; background: #eee5d5; color: var(--ink); }
.source-reading-head .source-title { margin-bottom: 0; font-size: clamp(1.8rem, 2.7vw, 2.5rem); }
.source-reading-head .source-summary { margin: 0; line-height: 1.65; }
.source-original-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 58px; padding: 8px 20px; border-bottom: 1px solid #c2b69f; }
.source-original-tools > span, .source-reading-label { color: #8a3d2b; font-size: .62rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.source-original-tools .inline-zoom-controls { position: static; }
.source-reading-enriched { display: flex; flex-direction: column; height: 560px; padding: 0; border-left: 1px solid #c2b69f; }
.source-reading-label { display: flex; align-items: center; min-height: 58px; padding: 12px 28px; border-bottom: 1px solid #ded4bf; }
.source-reading-enriched .tei-key { flex-shrink: 0; margin: 0; padding: 16px 28px 8px; }
.source-reading-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 28px 24px; scrollbar-width: thin; scrollbar-color: #a99270 #eee5d5; }
.source-reading-scroll:focus-visible { outline: 2px solid #8a3d2b; outline-offset: -3px; }
.source-full-text { margin-top: 0; font-size: clamp(1.2rem, 1.8vw, 1.48rem); font-style: italic; line-height: 1.55; }
.source-full-text h4 { font-size: inherit; }
.source-note { font-style: normal; }
.source-scroll-hint { flex-shrink: 0; margin: 0; padding: 12px 28px; border-top: 1px solid #ded4bf; color: #7c3928; font-size: .67rem; }
.object-image-frame { display: block; position: relative; min-width: 0; aspect-ratio: 16 / 9; background: #181a17; }
.object-image-frame img { width: 100%; height: 100%; object-fit: contain; }
.archive-materials .object-grid .object-card > .object-image-frame { display: block; min-height: 0; padding: 0; }
.object-card { cursor: pointer; text-align: left; }
.object-card > span:last-child::after { content: "Ver objeto ↗"; margin-top: 8px; color: var(--accent); font-size: .65rem; }
.object-dialog-media { display: grid; place-items: center; min-height: 0; height: min(70svh, 650px); }
.object-dialog-media img { max-height: 100%; }
.flight-actor-thumbnail { flex: 0 0 76px; }
.flight-actor-crop { width: 76px; height: 92px; overflow: hidden; background: #f7f1e6; }
.flight-actor-crop .flight-actor-image { position: static; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; filter: grayscale(1); }

/* Galería de Territorio: una franja de herramientas, sin controles sobre la foto. */
.territory-explorer { grid-template-columns: 160px minmax(0, 1fr); gap: 18px; align-items: start; }
.territory-view-options { gap: 0; }
.territory-view-options button { grid-template-columns: 48px minmax(0, 1fr); gap: 10px; min-height: 76px; padding: 10px 7px; border: 0; border-left: 2px solid transparent; border-bottom: 1px solid #d7cbb5; }
.territory-view-options button.active { border-left-color: #7c3928; background: #e8ddc5; }
.territory-view-options button:hover { background: #ebe1ce; }
.territory-view-options img { width: 48px; height: 48px; }
.territory-view-options span { overflow-wrap: normal; font-size: .74rem; line-height: 1.4; font-weight: 600; letter-spacing: 0; text-transform: none; }
.territory-feature { min-width: 0; width: 100%; min-height: 0; background: #e8ddc5; }
.territory-image-viewport { position: relative; inset: auto; height: 440px; }
.territory-image-subject { display: block; }
.territory-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; min-height: 58px; padding: 8px 12px; border-bottom: 1px solid #cabea7; }
.territory-tools .panorama-hint { position: static; flex: 1; max-width: none; padding: 0; background: none; color: #6b5140; font-size: .62rem; letter-spacing: 0; text-transform: none; }
.territory-tools .panorama-controls { position: static; gap: 4px; }
.territory-tools .panorama-controls button { width: 36px; height: 38px; border: 0; }
.territory-zoom-tools .inline-zoom-controls { position: static; padding: 0; border: 0; }
.territory-zoom-tools .inline-zoom-controls button { min-height: 38px; }
.territory-feature figcaption { position: static; max-width: none; min-height: 86px; padding: 16px; background: transparent; color: #5c5142; }
.territory-feature figcaption strong { color: #7c3928; }
.territory-map-switch { position: static; padding: 12px; background: #e8ddc5; color: var(--ink); border-bottom: 1px solid #cabea7; }
.territory-map-switch span { color: #7c3928; }
.territory-map-switch button { color: #5c5142; border: 0; border-bottom: 2px solid transparent; }
.territory-map-switch button.active { border-bottom-color: #7c3928; background: transparent; color: #7c3928; }
@media (max-width: 820px) {
  .source-content { grid-template-columns: 1fr; }
  .source-original { height: 400px; }
  .source-reading-enriched { height: 540px; border-left: 0; }
  .source-reading-head { grid-template-columns: 1fr; gap: 18px; padding: 24px; }
}
@media (max-width: 640px) {
  .source-original { height: 340px; }
  .source-original-viewport { padding: 16px; }
  .source-reading-scroll { padding-inline: 20px; }
  .source-reading-enriched .tei-key, .source-reading-label, .source-scroll-hint { padding-inline: 20px; }
  .source-full-text { font-size: 1.25rem; }
  .object-image-frame { aspect-ratio: auto; }
  .object-image-frame img { height: 100%; object-fit: contain; }
  .object-dialog-media { height: 50svh; }
  .territory-explorer { align-items: stretch; }
  .territory-view-nav { width: 100%; }
  .territory-view-options button { flex-basis: 156px; border-left: 0; border-bottom-width: 2px; }
  .territory-view-options button.active { border-bottom-color: #7c3928; }
  .territory-image-viewport { height: 340px; }
  .territory-tools { gap: 6px; padding: 8px; }
  .territory-tools .panorama-hint { flex-basis: 100%; }
  .territory-map-switch span { flex-basis: 100%; }
}

/* 05 · Recorrido virtual: se abre aislado para no bloquear la página principal. */
.virtual-city { overflow: hidden; background: #171713; }
.virtual-city-head h2 span,
.present-voices-head h2 span { display: block; }
.virtual-city-head p { color: var(--muted); }
.virtual-stage { border: 1px solid var(--line); background: #0d0e0d; }
.virtual-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 70px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #1f211d; }
.virtual-toolbar > div:first-child { display: grid; gap: 2px; }
.virtual-toolbar span { color: var(--accent); font-size: .6rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.virtual-toolbar strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; font-weight: 400; }
.virtual-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.virtual-toolbar-actions a,
.virtual-toolbar-actions button { min-height: 38px; padding: 9px 12px; border: 1px solid rgba(242,234,216,.24); background: transparent; color: rgba(242,234,216,.78); cursor: pointer; font-size: .64rem; text-decoration: none; text-transform: uppercase; }
.virtual-toolbar-actions a:hover,
.virtual-toolbar-actions button:hover { border-color: var(--accent); color: var(--bone); }
.virtual-viewport { position: relative; min-height: min(68vw, 720px); background: radial-gradient(circle at 25% 35%, rgba(239,155,112,.16), transparent 26%), repeating-linear-gradient(0deg, transparent 0 47px, rgba(242,234,216,.025) 48px), repeating-linear-gradient(90deg, transparent 0 47px, rgba(242,234,216,.025) 48px), #11130f; }
.virtual-placeholder { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(220px, .72fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 7vw, 100px); padding: clamp(34px, 7vw, 96px); }
.virtual-placeholder > img { width: min(100%, 330px); justify-self: center; filter: drop-shadow(0 24px 50px rgba(0,0,0,.32)); }
.virtual-placeholder > div { max-width: 580px; }
.virtual-placeholder > div > span { color: var(--accent); font-size: .65rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.virtual-placeholder h3 { max-width: 620px; margin: 14px 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.5rem, 5vw, 5rem); font-weight: 400; letter-spacing: -.04em; line-height: .96; }
.virtual-placeholder p { max-width: 58ch; margin: 0; color: var(--muted); }
.virtual-launch { margin-top: 30px; }
.virtual-placeholder small { display: block; margin-top: 14px; color: rgba(242,234,216,.48); font-size: .66rem; }
.virtual-notes { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 1px; background: var(--line); gap: 1px; }
.virtual-notes > div { min-height: 180px; padding: 28px; background: #1f211d; }
.virtual-notes span { color: var(--accent); font-family: Georgia, "Times New Roman", serif; font-size: 2.25rem; }
.virtual-notes strong { display: block; margin-top: 16px; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 400; }
.virtual-notes p { margin: 8px 0 0; color: var(--muted); font-size: .78rem; }

/* 06 · Una sola voz: tratamiento cinematográfico sin convertirla en carrusel. */
.present-voices { overflow: hidden; background: #7c3928; color: var(--bone); }
.present-voices-head .chapter-number { color: #f2c39f; }
.present-voices-head p { color: rgba(242,234,216,.76); }
.present-testimony { position: relative; display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1fr); align-items: center; gap: clamp(34px, 8vw, 120px); padding: clamp(24px, 5vw, 70px); border: 1px solid rgba(242,234,216,.24); background: linear-gradient(120deg, #171713 0 53%, #27231d 53%); }
.present-video-wrap { position: relative; width: min(100%, 430px); justify-self: center; background: #050505; box-shadow: 0 28px 70px rgba(0,0,0,.34); }
.present-video { display: block; width: 100%; aspect-ratio: 9 / 16; max-height: 760px; background: #050505; object-fit: contain; }
.present-duration { position: absolute; right: 12px; bottom: 54px; padding: 6px 8px; background: rgba(10,10,8,.82); color: var(--bone); font-size: .63rem; letter-spacing: .08em; pointer-events: none; }
.present-copy { max-width: 560px; padding-block: 30px; }
.present-copy > span { color: var(--accent); font-size: .64rem; font-weight: 800; letter-spacing: .13em; }
.present-copy h3 { margin: 20px 0 28px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.8rem, 5.2vw, 5.8rem); font-weight: 400; letter-spacing: -.045em; line-height: .93; }
.present-copy p { max-width: 50ch; color: rgba(242,234,216,.72); font-size: .94rem; }
.present-copy p + p { margin-top: 24px; padding-top: 24px; border-top: 1px solid rgba(242,234,216,.2); }

/* 07 · Aportes moderados: invitación compacta y formulario modal. */
.community-contributions { overflow: hidden; padding-block: clamp(72px, 8vw, 100px); background: #e8ddc5; color: var(--ink); }
.community-contributions .chapter-head { margin-bottom: clamp(34px, 4vw, 48px); }
.contributions-head .chapter-number { color: #8a3d2b; }
.contributions-head p { color: #62594b; }
.contributions-invite { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(0, 1.45fr); border: 1px solid #c4b79f; background: #f7f1e6; }
.contributions-invite-copy { display: flex; flex-direction: column; align-items: flex-start; padding: clamp(28px, 3.4vw, 42px); background: #1f211d; color: var(--bone); }
.contributions-invite-copy > span,
.contribution-dialog-head > div > span,
.published-contributions > header > span { color: var(--accent); font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.contributions-invite-copy h3 { max-width: 16ch; margin: 14px 0 16px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 2.8vw, 2.75rem); font-weight: 400; letter-spacing: -.04em; line-height: .98; }
.contributions-invite-copy p { max-width: 48ch; margin: 0; color: rgba(242,234,216,.66); font-size: .78rem; line-height: 1.65; }
.contribution-open { display: inline-flex; align-items: center; justify-content: space-between; gap: 30px; min-width: 210px; min-height: 52px; margin-top: 22px; padding: 12px 16px; border: 1px solid var(--bone); background: var(--bone); color: var(--ink); cursor: pointer; font: inherit; font-size: .74rem; font-weight: 750; }
.contribution-open:hover { border-color: var(--accent); background: var(--accent); }
.contribution-open:focus-visible,
.contribution-dialog-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.contribution-steps { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.contribution-steps li { display: grid; grid-template-columns: minmax(120px, .42fr) minmax(0, 1fr); align-items: center; gap: clamp(20px, 3vw, 46px); min-width: 0; padding: clamp(24px, 3vw, 38px) clamp(30px, 4vw, 54px); border-top: 1px solid #c4b79f; }
.contribution-steps li:first-child { border-top: 0; }
.contribution-steps strong { display: flex; align-items: center; gap: 14px; font-family: Georgia, "Times New Roman", serif; font-size: 1.3rem; font-weight: 400; }
.contribution-steps strong::before { width: 28px; height: 1px; background: #8a3d2b; content: ""; }
.contribution-steps span { max-width: 42ch; color: #716758; font-size: .74rem; line-height: 1.6; }
.contribution-dialog { width: min(900px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
.contribution-dialog:not([open]) { display: none; }
.contribution-dialog::backdrop { background: rgba(12,13,11,.78); backdrop-filter: blur(3px); }
.contribution-dialog-panel { max-height: calc(100dvh - 32px); overflow-y: auto; border: 1px solid #a99b83; background: #f7f1e6; box-shadow: 0 24px 80px rgba(0,0,0,.38); }
.contribution-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; padding: 34px 44px 28px; border-bottom: 1px solid #c4b79f; }
.contribution-dialog-head > div > span { color: #8a3d2b; }
.contribution-dialog-head h3 { margin: 10px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.2rem, 4vw, 3.7rem); font-weight: 400; letter-spacing: -.04em; line-height: .96; }
.contribution-dialog-head p { margin: 12px 0 0; color: #756b5d; font-size: .68rem; }
.contribution-dialog-close { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; padding: 0; border: 1px solid #9f927d; background: transparent; color: var(--ink); cursor: pointer; font: 300 1.7rem/1 Arial, sans-serif; }
.contribution-dialog-close:hover { background: var(--ink); color: var(--bone); }
.contribution-form { min-width: 0; padding: 34px 44px 44px; }
.contribution-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 22px; }
.contribution-field { display: grid; align-content: start; gap: 9px; min-width: 0; }
.contribution-field-wide { grid-column: 1 / -1; }
.contribution-field > span { color: #3d382f; font-size: .68rem; font-weight: 750; letter-spacing: .045em; text-transform: uppercase; }
.contribution-field > span small { margin-left: 5px; color: #857a6a; font-size: .62rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.contribution-field input,
.contribution-field select,
.contribution-field textarea { width: 100%; min-width: 0; border: 1px solid #b9ad97; border-radius: 0; background: #fffdf7; color: var(--ink); font: inherit; font-size: .86rem; }
.contribution-field input,
.contribution-field select { min-height: 48px; padding: 10px 12px; }
.contribution-field textarea { display: block; resize: vertical; padding: 13px 14px; line-height: 1.6; }
.contribution-field input:focus,
.contribution-field select:focus,
.contribution-field textarea:focus { outline: 2px solid #8a3d2b; outline-offset: 2px; border-color: #8a3d2b; }
.field-limit { justify-self: end; color: #857a6a; font-size: .62rem; }
.contribution-consent { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 11px; align-items: start; margin-top: 28px; color: #5c5448; cursor: pointer; font-size: .72rem; line-height: 1.55; }
.contribution-consent input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: #8a3d2b; }
.contribution-honeypot { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.contribution-submit-row { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 22px; margin-top: 30px; }
.contribution-submit { display: inline-flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 56px; padding: 13px 17px; border: 1px solid var(--ink); background: var(--ink); color: var(--bone); cursor: pointer; font: inherit; font-size: .76rem; font-weight: 750; }
.contribution-submit:hover:not(:disabled) { background: #8a3d2b; border-color: #8a3d2b; }
.contribution-submit:disabled { cursor: wait; opacity: .62; }
.contribution-status { min-height: 2.8em; margin: 0; color: #665d50; font-size: .72rem; line-height: 1.45; }
.contribution-status[data-state="success"] { color: #356044; }
.contribution-status[data-state="error"] { color: #8a3d2b; }
.published-contributions { margin-top: 78px; padding-top: 34px; border-top: 1px solid #c4b79f; }
.published-contributions > header { display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: start; gap: 28px; margin-bottom: 34px; }
.published-contributions > header > span { color: #8a3d2b; }
.published-contributions h3 { max-width: 760px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.7rem); font-weight: 400; letter-spacing: -.035em; line-height: 1; }
.published-contributions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: #c4b79f; border: 1px solid #c4b79f; }
.published-contributions article { display: flex; flex-direction: column; min-height: 280px; padding: 32px; background: #f7f1e6; }
.published-contributions article > span { color: #8a3d2b; font-size: .61rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.published-contributions blockquote { margin: 24px 0 30px; font-family: Georgia, "Times New Roman", serif; font-size: 1.28rem; font-style: italic; line-height: 1.55; }
.published-contributions article > strong { margin-top: auto; font: 400 1rem Georgia, "Times New Roman", serif; }
.published-contributions article > p { margin: 14px 0 0; color: #716758; font-size: .67rem; }

/* Cierre editorial: créditos discretos y contador opcional servido por PHP. */
.site-footer { padding: 42px 0; border-top: 1px solid var(--line); background: #11120f; color: var(--bone); }
.site-footer-layout { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.25fr) auto; align-items: end; gap: clamp(28px, 5vw, 72px); }
.footer-identity strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 700; }
.footer-identity p { margin: 8px 0 0; color: rgba(242,234,216,.56); font-size: .68rem; }
.footer-credits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.footer-credits p { margin: 0; color: rgba(242,234,216,.74); font-size: .72rem; }
.footer-credits span { display: block; margin-bottom: 5px; color: var(--accent); font-size: .58rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.visit-counter { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; min-width: 210px; margin: 0; padding-left: 18px; border-left: 1px solid rgba(242,234,216,.2); }
.visit-counter[hidden] { display: none; }
.visit-counter span { max-width: 18ch; color: rgba(242,234,216,.6); font-size: .72rem; line-height: 1.35; }
.visit-counter strong { color: var(--accent); font-family: Georgia, "Times New Roman", serif; font-size: 2.1rem; font-weight: 400; line-height: 1; }

@media (max-width: 880px) {
  .contributions-invite { grid-template-columns: 1fr; }
  .contributions-invite-copy h3 { max-width: 18ch; }
  .contribution-steps { border-top: 1px solid #c4b79f; }
  .site-footer-layout { grid-template-columns: 1fr; align-items: start; }
  .footer-credits { grid-template-columns: 1fr; gap: 16px; }
  .visit-counter { justify-content: flex-start; padding: 16px 0 0; border-top: 1px solid rgba(242,234,216,.2); border-left: 0; }
}

@media (max-width: 820px) {
  .virtual-placeholder { grid-template-columns: 190px minmax(0, 1fr); gap: 30px; padding: 34px; }
  .virtual-placeholder h3 { font-size: 3rem; }
  .present-testimony { gap: 38px; padding: 34px; }
}

@media (max-width: 640px) {
  .community-contributions { padding-block: 64px; }
  .contributions-invite { margin-inline: -14px; }
  .contribution-steps { grid-template-rows: none; }
  .contribution-steps li { grid-template-columns: 1fr; gap: 8px; border-top: 1px solid #c4b79f; }
  .contribution-steps li:first-child { border-top: 0; }
  .contribution-dialog { width: calc(100% - 18px); max-height: calc(100dvh - 18px); }
  .contribution-dialog-panel { max-height: calc(100dvh - 18px); }
  .contribution-dialog-head { padding: 26px 22px 22px; }
  .contribution-dialog-head h3 { font-size: 2.45rem; }
  .contribution-dialog-close { flex-basis: 38px; width: 38px; height: 38px; }
  .contribution-form { padding: 26px 22px 30px; }
  .contribution-fields { grid-template-columns: 1fr; gap: 22px; }
  .contribution-field-wide { grid-column: auto; }
  .contribution-submit-row { grid-template-columns: 1fr; gap: 14px; }
  .contribution-submit { width: 100%; }
  .published-contributions > header { grid-template-columns: 1fr; gap: 12px; }
  .published-contributions-grid { grid-template-columns: 1fr; }
  .virtual-stage { margin-inline: -14px; }
  .virtual-toolbar { align-items: flex-start; }
  .virtual-toolbar-actions { align-items: stretch; flex-direction: column; }
  .virtual-toolbar-actions a,
  .virtual-toolbar-actions button { min-height: 34px; padding: 7px 9px; }
  .virtual-viewport { min-height: 690px; }
  .virtual-placeholder { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 24px; padding: 32px 24px; }
  .virtual-placeholder > img { width: 150px; justify-self: auto; }
  .virtual-placeholder h3 { font-size: 2.7rem; }
  .virtual-launch { width: 100%; }
  .virtual-notes { grid-template-columns: 1fr; }
  .virtual-notes > div { min-height: 140px; padding: 24px; }
  .present-testimony { grid-template-columns: 1fr; margin-inline: -14px; padding: 24px 18px 42px; background: linear-gradient(180deg, #171713 0 58%, #27231d 58%); }
  .present-video-wrap { width: min(100%, 360px); }
  .present-copy { padding: 10px 4px 0; }
  .present-copy h3 { font-size: 3.15rem; }
}
