:root {
  --paper: #f7f1e6;
  --paper-2: #fffaf3;
  --ink: #241f1a;
  --muted: #6f6256;
  --line: #d8c8b2;
  --terracotta: #a84f2a;
  --terracotta-dark: #73351f;
  --green: #315f45;
  --river: #2f6f88;
  --gold: #c79035;
  --charcoal: #171615;
  --shadow: 0 18px 45px rgba(55, 38, 25, .13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, "Segoe UI", Roboto, Ubuntu, Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: var(--river);
  text-decoration-thickness: .08em;
  text-underline-offset: .2em;
}

a:hover {
  color: var(--terracotta-dark);
}

img {
  display: block;
  max-width: 100%;
  border-radius: 8px;
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0 0 .7rem;
}

h1 {
  font-size: 5rem;
  max-width: 920px;
}

h2 {
  font-size: 2.25rem;
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.2rem;
}

.skip-link {
  position: absolute;
  left: .75rem;
  top: .75rem;
  z-index: 100;
  transform: translateY(-160%);
  background: var(--paper-2);
  color: var(--ink);
  padding: .45rem .7rem;
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: .9rem;
  min-height: 64px;
  padding: .75rem 4%;
  background: rgba(23, 22, 21, .93);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  color: #fffaf3;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: #fffaf3;
  font-weight: 750;
  text-decoration: none;
}

.brand:hover {
  color: #f6d8a4;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  color: #f5cf8f;
  font-size: .78rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
}

.site-nav a {
  border-radius: 6px;
  color: #f8f1e8;
  padding: .5rem .65rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, .1);
  color: #f7d69a;
}

.nav-toggle {
  display: none;
  width: 2.4rem;
  height: 2.4rem;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 6px;
  background: transparent;
  color: #fffaf3;
  font-size: 1.2rem;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.section {
  padding: clamp(2.5rem, 6vw, 5rem) 0;
}

.section.compact {
  padding: clamp(2rem, 4vw, 3.5rem) 0;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.3rem;
}

.section-title p {
  max-width: 620px;
  color: var(--muted);
}

.kicker,
.eyebrow {
  color: var(--terracotta-dark);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: .65rem;
  text-transform: uppercase;
}

.museum-hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: clamp(520px, 76vh, 720px);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(12, 11, 10, .83), rgba(12, 11, 10, .35) 56%, rgba(12, 11, 10, .08)),
    url("../img/hero-santiago-historia.png") center / cover no-repeat;
  color: #fffaf3;
}

.museum-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 8rem;
  background: linear-gradient(0deg, var(--paper), transparent);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1120px, 92%);
  margin: 0 auto;
  padding: 4rem 0 6rem;
}

.hero-inner p {
  max-width: 720px;
  font-size: 1.2rem;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .45);
}

.hero-inner .eyebrow {
  color: #f7d69a;
}

.hero-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  border: 1px solid var(--terracotta);
  border-radius: 6px;
  padding: .65rem 1rem;
  background: transparent;
  color: var(--terracotta-dark);
  font-weight: 700;
  text-decoration: none;
}

.btn:hover {
  background: rgba(168, 79, 42, .08);
  text-decoration: none;
}

.btn.primary {
  background: var(--terracotta);
  color: #fffaf3;
}

.btn.primary:hover {
  background: var(--terracotta-dark);
  color: #fffaf3;
}

.btn.ghost {
  border-color: rgba(255, 255, 255, .55);
  color: #fffaf3;
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, .12);
  color: #fffaf3;
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
  max-width: 850px;
  margin-top: 2rem;
}

.hero-facts div,
.stat {
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  padding: .85rem;
  background: rgba(23, 22, 21, .45);
  backdrop-filter: blur(4px);
}

.hero-facts dt,
.stat strong {
  display: block;
  color: #f6d8a4;
  font-size: 1.25rem;
  font-weight: 850;
}

.hero-facts dd,
.stat span {
  margin: .15rem 0 0;
  color: #fff6e7;
  font-size: .93rem;
}

.intro-grid,
.grid.two,
.grid.three {
  display: grid;
  gap: 1rem;
}

.intro-grid,
.grid.two {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
}

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

.lead {
  color: #463a30;
  font-size: 1.18rem;
}

.museum-card,
.callout,
.figure,
.source-panel,
.timeline li,
.data-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.museum-card,
.callout,
.data-card {
  padding: 1rem;
}

.museum-card h3,
.callout h3,
.data-card h3 {
  color: var(--terracotta-dark);
}

.museum-card p:last-child,
.callout p:last-child,
.data-card p:last-child {
  margin-bottom: 0;
}

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

.card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-media {
  aspect-ratio: 16 / 9;
  background: #e7d8c2;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1rem;
}

.card-body .btn {
  align-self: start;
  margin-top: auto;
}

.tag-list,
.room-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .8rem 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li,
.room-tags li {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(49, 95, 69, .08);
  color: #294b3a;
  font-size: .86rem;
  padding: .25rem .55rem;
}

.timeline {
  position: relative;
  display: grid;
  gap: .8rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  padding: 1rem 1rem 1rem 4.9rem;
}

.timeline time {
  position: absolute;
  left: 1rem;
  top: 1rem;
  display: grid;
  place-items: center;
  width: 3.15rem;
  min-height: 1.8rem;
  border-radius: 999px;
  background: var(--green);
  color: #fffaf3;
  font-size: .68rem;
  font-weight: 850;
  text-align: center;
}

.timeline strong {
  display: block;
  color: var(--terracotta-dark);
  margin-bottom: .2rem;
}

.timeline p {
  color: var(--muted);
  margin-bottom: 0;
}

.artifact-band {
  background: linear-gradient(180deg, #eadbc4, #f7f1e6);
}

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

.figure,
.gallery .thumb {
  margin: 0;
  overflow: hidden;
}

.figure img,
.gallery .thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0;
  object-fit: cover;
}

.figure.contain img {
  object-fit: contain;
  background: #f3eadb;
}

figcaption,
.thumb span {
  display: block;
  color: var(--muted);
  font-size: .9rem;
  padding: .75rem;
}

.gallery .thumb {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: inherit;
  text-decoration: none;
}

.gallery .thumb span {
  position: absolute;
  inset: auto .6rem .6rem;
  border-radius: 6px;
  background: rgba(23, 22, 21, .76);
  color: #fffaf3;
  padding: .35rem .5rem;
}

.source-panel {
  padding: 1.1rem;
}

.source-panel ol {
  margin-bottom: 0;
}

.source-panel li + li {
  margin-top: .45rem;
}

.room-hero {
  padding: clamp(2.4rem, 6vw, 5rem) 0 2rem;
  background:
    linear-gradient(90deg, rgba(49, 95, 69, .14), transparent),
    linear-gradient(180deg, #fffaf3, var(--paper));
  border-bottom: 1px solid var(--line);
}

.room-hero h1 {
  color: var(--terracotta-dark);
  font-size: 4.2rem;
}

.room-hero p {
  max-width: 820px;
}

.split-visual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .75fr);
  gap: 1.2rem;
  align-items: center;
}

.data {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
}

.data th,
.data td {
  padding: .7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data th {
  background: rgba(199, 144, 53, .16);
  color: var(--terracotta-dark);
}

.data tr:last-child td {
  border-bottom: 0;
}

.route-map {
  position: relative;
  min-height: 310px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 30%, rgba(47, 111, 136, .22), transparent 18%),
    radial-gradient(circle at 78% 45%, rgba(168, 79, 42, .18), transparent 20%),
    linear-gradient(135deg, #fffaf3, #e8dcc9);
  overflow: hidden;
}

.route-map::before {
  content: "";
  position: absolute;
  inset: 45% 8% auto;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--river), var(--gold), var(--terracotta));
}

.route-points {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .7rem;
  margin: 0;
  padding: 7.6rem 1rem 1rem;
  list-style: none;
}

.route-points li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 243, .88);
  padding: .75rem;
}

.route-points strong {
  display: block;
  color: var(--terracotta-dark);
}

.quote-strip {
  border-left: 5px solid var(--gold);
  padding: 1rem 1.2rem;
  background: rgba(199, 144, 53, .13);
  color: #3f342b;
}

.carousel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--charcoal);
}

.carousel .track {
  display: flex;
  transition: transform .45s ease;
}

.carousel .slide {
  position: relative;
  min-width: 100%;
}

.carousel .slide img {
  width: 100%;
  height: clamp(280px, 48vw, 520px);
  border-radius: 0;
  object-fit: cover;
}

.carousel .slide img.contain {
  object-fit: contain;
  background: #fbf4e8;
}

.carousel .caption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 720px;
  border-radius: 6px;
  background: rgba(23, 22, 21, .76);
  color: #fffaf3;
  padding: .75rem;
}

.carousel .ctrl {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: rgba(23, 22, 21, .68);
  color: #fffaf3;
  font-size: 1.8rem;
  line-height: 1;
  transform: translateY(-50%);
}

.carousel .prev {
  left: .75rem;
}

.carousel .next {
  right: .75rem;
}

.carousel .dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: .45rem;
  display: flex;
  justify-content: center;
  gap: .35rem;
}

.carousel .dots button {
  width: .7rem;
  height: .7rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
}

.carousel .dots button.active {
  background: #fffaf3;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1rem;
  background: rgba(10, 9, 8, .88);
}

.lightbox.show {
  display: flex;
}

.lightbox img {
  max-width: 92vw;
  max-height: 72vh;
  background: #fff;
  object-fit: contain;
}

.lightbox-caption {
  max-width: 820px;
  color: #fffaf3;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: .8rem;
  right: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fffaf3;
  font-size: 1.8rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #171615;
  color: #e9ddcf;
  padding: 1.4rem 4%;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1120px, 92%);
  margin: 0 auto;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  color: #f6d8a4;
}

@media (max-width: 980px) {
  .cards,
  .grid.three,
  .collection-grid,
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intro-grid,
  .grid.two,
  .split-visual {
    grid-template-columns: 1fr;
  }

  .hero-facts {
    grid-template-columns: 1fr;
  }

  .route-points {
    grid-template-columns: repeat(2, 1fr);
    padding-top: 5rem;
  }
}

@media (max-width: 760px) {
  .site-nav {
    position: absolute;
    top: 64px;
    right: 4%;
    left: 4%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: .2rem;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    background: #171615;
    padding: .5rem;
  }

  .site-nav.show {
    display: flex;
  }

  .nav-toggle {
    display: grid;
    place-items: center;
  }

  .museum-hero {
    min-height: auto;
  }

  .hero-inner {
    padding: 2.25rem 0 2.6rem;
  }

  h1 {
    font-size: 2.7rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  .room-hero h1 {
    font-size: 2.45rem;
  }

  .hero-inner p,
  .lead {
    font-size: 1rem;
  }

  .hero-actions {
    margin-top: .9rem;
  }

  .btn {
    min-height: 2.45rem;
    padding: .55rem .8rem;
  }

  .hero-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .35rem;
    margin-top: 1rem;
  }

  .hero-facts div {
    min-height: 4rem;
    padding: .5rem .4rem;
  }

  .hero-facts dt {
    font-size: .88rem;
  }

  .hero-facts dd {
    display: none;
  }

  .section-title,
  .footer-inner {
    align-items: start;
    flex-direction: column;
  }

  .cards,
  .grid.three,
  .collection-grid,
  .gallery,
  .route-points {
    grid-template-columns: 1fr;
  }

  .carousel .caption {
    position: static;
    border-radius: 0;
  }
}
