@font-face {
  font-family: Alegreya;
  src: url("/assets/alegreya-latin.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}

:root {
  --paper: #f8f7f2;
  --ink: #222b24;
  --green: #204638;
  --muted: #525d54;
  --line: #c8cdc4;
  --wash: #ecefe8;
  --display: Alegreya, Georgia, serif;
  font:
    16px/1.55 system-ui,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
img,
video {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3,
p,
figure {
  margin: 0;
}
ul {
  padding-left: 1.25em;
}
a {
  color: var(--green);
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-thickness: 2px;
}
button,
input,
textarea,
select {
  font: inherit;
}
:focus-visible {
  outline: 3px solid #9c4c22;
  outline-offset: 4px;
}

.wrap {
  width: min(1140px, calc(100% - 56px));
  margin-inline: auto;
}

.skip {
  position: absolute;
  z-index: 6;
  top: 8px;
  left: 8px;
  background: var(--paper);
  padding: 8px 12px;
  transform: translateY(-150%);
}

.skip:focus {
  transform: none;
}
.site-header {
  border-bottom: 1px solid var(--line);
}
.one-page .site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
}
.one-page [id] {
  scroll-margin-top: 90px;
}
.one-page #contenido:target {
  outline: none;
}

@media (prefers-reduced-motion: no-preference) {
  html:has(.one-page) {
    scroll-behavior: smooth;
  }
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px 24px;
  min-height: 68px;
}

.brand {
  color: var(--ink);
  font: 750 1.65rem/1 var(--display);
  text-decoration: none;
  white-space: nowrap;
}

.header-row nav {
  display: flex;
  flex-wrap: wrap;
  gap: 3px clamp(9px, 2.1vw, 24px);
  align-items: center;
}

.header-row nav a {
  padding-block: 9px;
  color: var(--ink);
  font-size: 0.89rem;
  font-weight: 650;
  text-decoration: none;
}

.header-row nav a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

main {
  padding-block: clamp(25px, 5vw, 62px) 35px;
}
main:focus {
  outline: none;
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 750;
  line-height: 1.04;
}
h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  letter-spacing: -0.025em;
}
h2 {
  font-size: clamp(1.55rem, 3.2vw, 2.4rem);
  letter-spacing: -0.025em;
}
h3 {
  font-size: clamp(1.24rem, 2.2vw, 1.65rem);
  letter-spacing: -0.015em;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.86rem;
}
.collection-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px 25px;
}

.home-heading p,
.page-title p {
  color: var(--muted);
  margin-top: 9px;
}
.home-heading {
  padding-bottom: 21px;
  border-bottom: 1px solid var(--line);
}
.one-page main {
  padding-top: clamp(20px, 3vw, 34px);
}
.home-heading h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.65rem);
}
.collection-heading {
  margin: 20px 0 12px;
}
.collection-heading p {
  font-size: 0.85rem;
  color: var(--muted);
}
.page-title {
  margin-bottom: clamp(18px, 3vw, 29px);
}
.page-title h1 {
  font-size: clamp(2.25rem, 5vw, 4.15rem);
}

.animation-grid,
.register {
  display: grid;
  gap: clamp(12px, 2vw, 24px);
  list-style: none;
  padding: 0;
  margin: 0;
}

.animation-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.locality-art {
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 3 / 2;
}
.page-section {
  margin-top: clamp(36px, 7vw, 76px);
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.page-section > .collection-heading {
  margin-top: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  width: fit-content;
  padding: 8px 15px;
  border: 1px solid transparent;
  color: white;
  background: var(--green);
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: #2b5a48;
}
.back {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.subsection {
  margin-top: 32px;
}
.subsection > h3 {
  margin-bottom: 12px;
}
.locality-stories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 4vw, 40px);
  margin-top: 26px;
}

.locality-stories figure {
  margin-bottom: 11px;
}
.photo-credit {
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--muted);
}
.locality-stories p,
.prose p {
  margin-top: 9px;
}
.story-title {
  font-weight: 650;
}

.motion-frame {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--wash);
  cursor: pointer;
}

.motion-frame video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  pointer-events: none;
}

.motion-wide video {
  aspect-ratio: 2;
}
.animation-grid figcaption {
  margin-top: 5px;
  font-size: 0.9rem;
}

.register video {
  width: 100%;
  height: auto;
  aspect-ratio: 1.25;
  object-fit: contain;
  background: #eeeae2;
}

.reader {
  margin-top: clamp(14px, 2vw, 20px);
}

.reader-heading,
.reader-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px 12px;
}

.reader-heading {
  margin-bottom: 10px;
  align-items: baseline;
}
.reader-heading a {
  font-size: 0.85rem;
}

.reader-desk {
  --reading-height: max(180px, min(490px, calc(100svh - 226px)));
  container-type: inline-size;
  position: relative;
  isolation: isolate;
  padding: clamp(8px, 1vw, 14px);
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 36%, #f3efe2, #e6dfcc);
  border: 1px solid #d6d0c1;
  overflow: clip;
  overflow-anchor: none;
  touch-action: pan-y pinch-zoom;
}

.reader-desk[aria-busy="true"] {
  cursor: progress;
}

.reader-pages {
  --leaf-size: min(100cqi, var(--reading-height));
  --book-columns: minmax(0, 1fr);
  position: relative;
  width: var(--leaf-size);
  height: var(--leaf-size);
}

.reader-spread,
.turn-scene {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: var(--book-columns);
  grid-template-rows: minmax(0, 1fr);
}

.reader-pages[data-turning] > .reader-spread {
  visibility: hidden;
}

.reader-spread > .book-leaf,
.turn-scene > .book-leaf {
  grid-column: 1;
  grid-row: 1;
}

.book-leaf {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

@media (min-width: 900px) {
  .reader-pages {
    --leaf-size: min(50cqi, var(--reading-height));
    --book-columns: repeat(2, minmax(0, 1fr));
    width: calc(2 * var(--leaf-size));
  }

  .reader-spread > [data-side="right"],
  .turn-scene > [data-side="right"] {
    grid-column: 2;
  }
  .reader-spread[data-view="front"] {
    transform: translateX(-25%);
  }
  .reader-spread[data-view="back"] {
    transform: translateX(25%);
  }
}

.book-cover {
  position: relative;
  padding: 0 6px 5px 0;
  border-radius: 3px 7px 6px 3px;
  background: repeating-linear-gradient(0deg, #c2b091 0 1px, #eee0c0 1px 3px);
  box-shadow:
    0 3px 0 #24372b,
    3px 2px 0 #344737,
    0 9px 14px #3e2d2055;
}

.book-cover button,
.cover-face {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vh, 18px);
  width: 100%;
  height: 100%;
  padding: 8% 9% 8% 13%;
  overflow: hidden;
  border: 1px solid #4e6147;
  border-radius: 3px 5px 5px 3px;
  background:
    linear-gradient(90deg, #324c41, #13291f 6px, #40584a 12px, transparent 22px),
    repeating-linear-gradient(130deg, #ffffff0a 0 1px, transparent 1px 3px), #263e32;
  color: #f5e8c9;
  text-align: center;
}

.book-cover button {
  cursor: pointer;
}
.book-cover button:hover {
  color: #fff5dd;
}
.cover-title {
  max-width: 14ch;
  font: 750 clamp(1.25rem, min(5cqi, 5.2svh), 2.6rem)/1 var(--display);
  text-wrap: balance;
}
.cover-art {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
}
.cover-edition {
  color: #f5e8c9;
  font-size: 0.77rem;
}
.back-cover {
  padding: 0 0 5px 6px;
  box-shadow:
    0 3px 0 #24372b,
    -3px 2px 0 #344737,
    0 9px 14px #3e2d2055;
}
.back-cover .cover-face {
  padding-inline: 10% 15%;
  background:
    linear-gradient(270deg, #324c41, #13291f 6px, #40584a 12px, transparent 22px),
    repeating-linear-gradient(130deg, #ffffff0a 0 1px, transparent 1px 3px), #263e32;
}

.back-title {
  font: 750 clamp(1.15rem, min(4cqi, 4.4svh), 1.8rem)/1.1 var(--display);
}
.cover-face p {
  max-width: 26ch;
  font-size: clamp(0.75rem, 2.7svh, 0.95rem);
  overflow: auto;
}
.back-cover .cover-edition {
  border-top: 1px solid #bda57780;
  padding-top: 8px;
}

.reader-board {
  border: 4px solid #31493a;
  background: #d5d6b9;
}

.reader-sheet,
.reader-board {
  position: relative;
  border-radius: 2px 5px 5px 2px;
}

.reader-sheet {
  overflow: hidden;
  background: #fff8e9;
  box-shadow: 0 1px 2px #382e203d;
}

@media (min-width: 900px) {
  .reader-sheet[data-side="left"],
  .reader-board[data-side="left"] {
    border-radius: 5px 1px 1px 5px;
  }
  :is(.reader-sheet, .reader-board)::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  :is(.reader-sheet, .reader-board)[data-side="left"]::after {
    background: linear-gradient(270deg, #30231438, transparent 7%);
  }
  :is(.reader-sheet, .reader-board)[data-side="right"]::after {
    background: linear-gradient(90deg, #30231438, transparent 7%);
  }
}

.reader-sheet canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.reader-loading {
  position: absolute;
  z-index: 2;
  bottom: 7px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.85rem;
  padding: 4px 9px;
}

.turn-scene {
  perspective: 16000px;
  pointer-events: none;
}
.turn-leaf {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: var(--leaf-size);
  transform-origin: left center;
  transform-style: preserve-3d;
  z-index: 1;
}

@media (min-width: 900px) {
  .turn-leaf[data-direction="forward"] {
    left: 50%;
  }
  .turn-leaf[data-direction="backward"] {
    transform-origin: right center;
  }
}

.turn-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}
.turn-reverse {
  transform: rotateY(180deg);
}
.turn-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #30231455, transparent 80%);
}
.turn-face:has(> [data-side="left"]) .turn-shade {
  background: linear-gradient(270deg, #30231455, transparent 80%);
}

.reader-controls {
  margin-bottom: 8px;
}
.reader-count {
  color: var(--muted);
  font-size: 0.88rem;
}

.reader-controls button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--green);
  padding: 5px 11px;
  font-size: 0.91rem;
  font-weight: 650;
  cursor: pointer;
}

.reader-controls button:hover:not(:disabled) {
  background: var(--wash);
}
.reader-controls button:disabled {
  color: var(--muted);
  opacity: 0.55;
  cursor: default;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.register {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.register img {
  width: 100%;
  height: auto;
  aspect-ratio: 1.6;
  object-fit: cover;
}
.register figcaption {
  margin-top: 6px;
}
.register figcaption p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}
.empty {
  max-width: 66ch;
  color: var(--muted);
}
.prose {
  max-width: 70ch;
}
.prose p:first-child {
  margin-top: 0;
}
.marks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 28px;
}

.marks li {
  max-width: 180px;
  font-size: 0.86rem;
  font-weight: 650;
}
.marks img {
  max-height: 74px;
  max-width: 155px;
  width: auto;
  height: auto;
}
.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
  border-top: 1px solid var(--line);
  padding-block: 11px 26px;
  color: var(--muted);
  font-size: 0.83rem;
}

.admin-form {
  display: grid;
  gap: 6px;
  max-width: 620px;
}
.admin-form label:not(.check) {
  margin-top: 6px;
  font-weight: 650;
}
.admin-form input:not([type="checkbox"]),
.admin-form select,
.admin-form textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: white;
  padding: 7px 9px;
  border: 1px solid var(--line);
}

.admin-form input[type="file"] {
  padding: 7px;
}
.check {
  display: flex;
  gap: 7px;
  align-items: baseline;
}
.admin-form .button {
  margin-top: 8px;
}
.notice {
  padding: 8px 11px;
  margin-bottom: 8px;
  background: var(--wash);
  border-left: 3px solid var(--green);
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 16px;
}
.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--green);
  text-decoration: underline;
  cursor: pointer;
}
.entries {
  list-style: none;
  padding: 0;
  max-width: 760px;
  border-top: 1px solid var(--line);
}
.entries li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.entries small {
  display: block;
  color: var(--muted);
}
.delete-form {
  margin-top: 24px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.delete-form button {
  margin-left: 10px;
}

@media (max-width: 770px) {
  .wrap {
    width: calc(100% - 40px);
  }
  .header-row {
    display: grid;
    gap: 2px;
    padding-block: 11px 5px;
  }
  .header-row nav {
    gap: 0 15px;
  }
  .one-page main {
    padding-top: 22px;
  }
  .home-heading {
    padding-bottom: 14px;
  }
  .reader {
    margin-top: 14px;
  }
  .one-page [id] {
    scroll-margin-top: 102px;
  }
}

@media (max-width: 530px) {
  .wrap {
    width: calc(100% - 32px);
  }
  .header-row nav a {
    font-size: 0.82rem;
    padding-block: 7px;
  }
  .home-heading {
    padding-bottom: 18px;
  }
  .home-heading h1 {
    font-size: clamp(2.4rem, 10vw, 3.5rem);
  }
  .home-heading p {
    margin-top: 6px;
  }
  .collection-heading {
    align-items: baseline;
    margin-top: 16px;
  }
  .collection-heading p {
    font-size: 0.78rem;
  }
  .animation-grid {
    gap: 8px;
  }
  .animation-grid figcaption {
    font-size: 0.79rem;
  }
  .locality-stories,
  .register {
    grid-template-columns: minmax(0, 1fr);
  }
  .one-page [id] {
    scroll-margin-top: 115px;
  }
  .reader-controls {
    gap: 4px;
  }
  .reader-controls button {
    padding-inline: 7px;
    font-size: 0.85rem;
  }
  .reader-count {
    font-size: 0.8rem;
  }
}

.prototype-note {
  padding: 10px 0;
  color: var(--muted);
  font-size: 0.875rem;
}

:root {
  --media-radius: 16px;
}

.reader-desk,
.motion-frame,
.locality-art,
.register img,
.register video {
  border-radius: var(--media-radius);
}

.motion-frame {
  overflow: clip;
}
.cover-art,
.reader-controls button,
.button {
  border-radius: 8px;
}
