@font-face {
  font-family: "Barlow Condensed";
  src: url("../assets/barlow-condensed-latin-700-normal-v1xN8_Wq.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #0c1424;
  --navy: #121d36;
  --indigo: #323568;
  --blue: #314d93;
  --sun: #ffc514;
  --paper: #f4efe5;
  --red: #b91f35;
  --teal: #146a76;
  --text: #f9f5ec;
  --muted: #bfc6d9;
  --line: rgba(255, 255, 255, 0.22);
  --max: 1320px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 108px;
  background: var(--ink);
}

body {
  margin: 0;
  color: var(--text);
  background: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--sun);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.gallery-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 40px;
  min-height: 86px;
  padding: 12px max(24px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid rgba(255, 197, 20, 0.58);
  background: rgba(12, 20, 36, 0.76);
  backdrop-filter: blur(18px) saturate(135%);
}

.brand img {
  width: min(300px, 27vw);
  height: auto;
}

.gallery-header nav {
  display: flex;
  gap: 30px;
}

.gallery-header nav a,
.back-link {
  position: relative;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.gallery-header nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 -7px;
  height: 2px;
  background: var(--sun);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.gallery-header nav a:hover::after,
.gallery-header nav a:focus-visible::after {
  transform: scaleX(1);
}

.back-link {
  justify-self: end;
  padding: 11px 15px;
  border: 1px solid var(--line);
}

.reading-progress {
  position: absolute;
  inset: auto auto -1px 0;
  width: var(--scroll-progress, 0%);
  height: 2px;
  background: var(--sun);
}

.gallery-hero {
  min-height: 100svh;
  padding: 148px max(24px, calc((100vw - var(--max)) / 2)) 40px;
  background:
    radial-gradient(circle at 75% 26%, rgba(49, 77, 147, 0.36), transparent 28%),
    linear-gradient(125deg, #0c1424 0 58%, #111a32 58% 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 0.84fr 1.16fr;
  align-items: center;
  min-height: min(650px, 70vh);
}

.hero-copy {
  z-index: 2;
  padding-right: 60px;
}

.eyebrow {
  margin: 0 0 24px;
  color: var(--sun);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(4.5rem, 8vw, 8.5rem);
}

h1 span {
  color: var(--sun);
}

h2 {
  font-size: clamp(3.8rem, 7vw, 7.4rem);
}

.hero-lead {
  max-width: 610px;
  margin: 38px 0 34px;
  color: var(--muted);
  font-size: clamp(1rem, 1.55vw, 1.25rem);
}

.hero-cta,
.archive-note a {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 2px solid var(--sun);
  text-decoration: none;
  font-weight: 600;
}

.hero-visual {
  position: relative;
  margin: 0;
}

.hero-visual::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -40px -8vw 11% 28%;
  background: var(--indigo);
}

.hero-visual img {
  width: 100%;
  aspect-ratio: 1.22;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  filter: saturate(0.9) contrast(1.03);
}

.hero-visual figcaption {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 16px;
  font-size: 0.73rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-visual figcaption span:first-child {
  color: var(--sun);
}

.hero-ledger {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-ledger div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 16px;
  padding: 18px 22px;
  border-right: 1px solid var(--line);
}

.hero-ledger div:last-child {
  border-right: 0;
}

.hero-ledger strong {
  color: var(--sun);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem;
}

.hero-ledger span {
  color: var(--muted);
  font-size: 0.83rem;
}

.timeline-section,
.archive-section {
  padding: 130px max(24px, calc((100vw - var(--max)) / 2));
  color: var(--ink);
  background: var(--paper);
}

.section-heading {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: end;
  gap: 70px;
}

.section-heading .eyebrow,
.archive-heading .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: 0;
  color: var(--red);
}

.section-heading p:last-child,
.archive-heading > p {
  max-width: 530px;
  margin: 0 0 6px;
  color: #41485a;
  font-size: 1.05rem;
}

.year-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 95px;
}

.track-line {
  position: absolute;
  z-index: 0;
  top: 8px;
  right: 0;
  left: 0;
  height: 1px;
  background: #9c9b96;
}

.year-button {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  padding: 28px 0 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.year-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 17px;
  height: 17px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: #777a7d;
  box-shadow: 0 0 0 1px #777a7d;
  transition: transform 180ms ease, background 180ms ease;
}

.year-button.is-active::before {
  background: var(--red);
  box-shadow: 0 0 0 1px var(--red);
  transform: scale(1.18);
}

.year-button b {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2.3rem;
}

.year-button small {
  color: #656b75;
}

.territory-section {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(520px, 1.28fr);
  gap: 80px;
  padding: 130px max(24px, calc((100vw - var(--max)) / 2));
  background: linear-gradient(135deg, var(--indigo), #1f2d59 70%);
}

.territory-copy {
  align-self: center;
}

.territory-copy > p:not(.eyebrow) {
  max-width: 560px;
  color: var(--muted);
}

.place-controls {
  display: grid;
  margin-top: 46px;
  border-top: 1px solid var(--line);
}

.place-button {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color 180ms ease, padding 180ms ease;
}

.place-button span {
  color: var(--muted);
}

.place-button.is-active,
.place-button:hover,
.place-button:focus-visible {
  padding-left: 14px;
  color: var(--sun);
}

.territory-map {
  align-self: center;
  border: 1px solid var(--line);
  background: rgba(12, 20, 36, 0.34);
}

.territory-map svg {
  display: block;
  width: 100%;
  height: auto;
}

.map-land {
  fill: #111d38;
  stroke: rgba(255, 255, 255, 0.14);
}

.map-river {
  fill: none;
  stroke: url(#river);
  stroke-width: 40;
  opacity: 0.6;
}

.map-route,
.map-route-secondary {
  fill: none;
  stroke: var(--sun);
  stroke-width: 3;
  stroke-dasharray: 2 13;
  stroke-linecap: round;
}

.map-route-secondary {
  stroke: #e75966;
}

.map-node {
  fill: var(--sun);
  stroke: rgba(255, 255, 255, 0.38);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  animation: mapPulse 3.8s ease-in-out infinite;
}

.node-recife {
  fill: #d83a50;
  animation-delay: 0.6s;
}

.node-archive {
  fill: #62b0b5;
  animation-delay: 1.2s;
}

.territory-map text {
  fill: var(--text);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.map-caption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.archive-heading {
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  align-items: end;
  gap: 70px;
}

.archive-heading .eyebrow {
  grid-column: 1 / -1;
}

.theme-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 24px 0 34px;
  padding-bottom: 18px;
  border-bottom: 1px solid #a9a7a1;
}

.theme-button {
  padding: 9px 14px;
  border: 1px solid #9d9d98;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.theme-button.is-active,
.theme-button:hover,
.theme-button:focus-visible {
  border-color: var(--ink);
  color: var(--paper);
  background: var(--ink);
}

.result-count {
  margin-left: auto;
  color: #515762;
  font-size: 0.85rem;
}

.archive-grid {
  columns: 3;
  column-gap: 20px;
}

.archive-card {
  position: relative;
  display: block;
  break-inside: avoid;
  min-height: 0;
  margin: 0 0 20px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--navy);
  color: var(--paper);
  cursor: zoom-in;
  text-decoration: none;
}

#archive-title:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 8px;
}

.archive-card.card-wide {
  grid-column: span 2;
}

.archive-card.card-tall {
  grid-row: span 2;
}

.archive-card[hidden] {
  display: none;
}

.archive-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 300ms ease;
}

.archive-card::after {
  content: none;
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(8, 14, 26, 0.92));
  pointer-events: none;
}

.archive-card:hover img,
.archive-card:focus-visible img {
  transform: scale(1.045);
  filter: saturate(1.12) contrast(1.04);
}

.card-meta {
  position: relative;
  z-index: 2;
  padding: 20px;
  display: grid;
  gap: 4px;
  text-align: left;
}

.card-meta b {
  font-size: 0.95rem;
}

.card-meta small {
  color: #d0d5df;
  font-size: 0.72rem;
}

.empty-state {
  padding: 40px;
  border: 1px solid #a9a7a1;
  text-align: center;
}

.archive-note {
  display: grid;
  grid-template-columns: 0.75fr 1fr;
  gap: 70px;
  padding: 120px max(24px, calc((100vw - var(--max)) / 2));
  background: var(--teal);
}

.archive-note .eyebrow {
  grid-column: 1 / -1;
  color: var(--sun);
}

.archive-note p:not(.eyebrow) {
  align-self: end;
  max-width: 600px;
  margin: 0;
}

.archive-note a {
  grid-column: 2;
  justify-self: start;
}

.gallery-footer {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 60px;
  padding: 80px max(24px, calc((100vw - var(--max)) / 2)) 28px;
  border-top: 2px solid var(--sun);
  background: var(--navy);
}

.gallery-footer > div > img {
  width: min(350px, 100%);
}

.gallery-footer p {
  color: var(--muted);
  font-size: 0.83rem;
}

.gallery-footer nav {
  display: grid;
  align-content: start;
  gap: 13px;
}

.gallery-footer nav a {
  text-decoration: none;
}

.webgreen {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 8px;
  text-decoration: none;
}

.webgreen span {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.webgreen img {
  width: 190px;
  height: auto;
}

.copyright {
  margin: 0;
}

.gallery-footer-bottom { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 30px; padding-top: 28px; border-top: 1px solid var(--line); }

.lightbox {
  width: min(94vw, 1400px);
  height: min(92vh, 980px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--text);
  background: rgba(8, 14, 26, 0.98);
}

.lightbox:not([open]) {
  display: none;
}

.archive-controls { display: none; margin-top: 48px; gap: 24px; align-items: end; justify-content: space-between; }
.motion-ready .archive-controls { display: flex; }
.select-filters { display: flex; gap: 20px; flex-wrap: wrap; }
.select-filters label { display: grid; gap: 8px; color: #394254; font-size: .78rem; font-weight: 600; }
.select-filters select { min-height: 48px; min-width: 190px; max-width: 100%; padding: 10px 38px 10px 14px; border: 1px solid #9d9d98; border-radius: 0; background: var(--paper); color: var(--ink); font: inherit; font-size: .95rem; }
.reset-filters { min-height: 48px; border: 0; border-bottom: 1px solid currentColor; background: none; color: var(--ink); cursor: pointer; }
.reset-filters[hidden] { display: none; }
.map-canvas { position: relative; }
.map-pin { display: none; position: absolute; width: 74px; height: 74px; min-width: 44px; min-height: 44px; transform: translate(-50%, -50%); border: 2px solid transparent; border-radius: 50%; background: transparent; cursor: pointer; }
.motion-ready .map-pin { display: block; }
.map-pin:hover, .map-pin:focus-visible, .map-pin[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 5px; }
.pin-iputinga { left: 51.53%; top: 37.86%; }
.pin-recife { left: 83.47%; top: 47.5%; }
.pin-archive { left: 18.06%; top: 68.57%; }
:is(a, button, select):focus-visible { outline: 3px solid currentColor; outline-offset: 5px; }
.gallery-header nav a { display: inline-flex; align-items: center; min-height: 32px; }
.timeline-section { padding-block: 88px; }
.timeline-section h2 { font-size: clamp(3rem, 5vw, 5rem); line-height: 1; }
.hero-copy, .hero-visual, .section-heading > *, .archive-heading > *, .territory-copy { min-width: 0; }
.lightbox figure { min-height: 0; }
.lightbox figcaption { line-height: 1.45; }
@media (max-width: 980px) {
  html { scroll-padding-top: 150px; }
  .gallery-header { gap: 8px 24px; }
  .gallery-header .back-link { grid-column: 2; grid-row: 1; }
  .gallery-hero { padding-top: 172px; }
}
@media (max-width: 680px) {
  .timeline-section, .archive-section, .territory-section { padding-block: 72px; }
  .archive-controls { align-items: stretch; flex-direction: column; gap: 16px; }
  .select-filters { display: grid; grid-template-columns: 1fr; gap: 14px; }
  .select-filters select { width: 100%; min-width: 0; }
  .reset-filters { align-self: start; }
  .gallery-header nav { gap: 24px; }
  .gallery-header nav a { font-size: .72rem; }
  .map-pin { width: 48px; height: 48px; }
  .hero-ledger span { font-size: .8rem; }
}

.lightbox[open] {
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
}

.lightbox::backdrop {
  background: rgba(5, 9, 17, 0.88);
  backdrop-filter: blur(8px);
}

.lightbox figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 24px 0;
}

.lightbox figure img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.lightbox figcaption {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 18px 20px 0;
  color: var(--muted);
}

.lightbox figcaption b {
  color: var(--text);
}

.lightbox button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 18px;
  font-size: 2rem;
}

.lightbox-nav {
  height: 100%;
  font-size: 1.8rem;
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible,
.lightbox-close:hover,
.lightbox-close:focus-visible {
  color: var(--sun);
}

.reveal {
  opacity: 1;
  transform: none;
  clip-path: none;
}

.motion-ready .reveal {
  opacity: 0;
  transform: translateY(42px);
  clip-path: inset(0 0 18% 0);
  transition:
    opacity 750ms ease,
    transform 950ms cubic-bezier(0.2, 0.75, 0.2, 1),
    clip-path 950ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.motion-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  clip-path: inset(0 0 0 0);
}

.archive-card.reveal:nth-child(3n + 2) {
  transition-delay: 80ms;
}

.archive-card.reveal:nth-child(3n) {
  transition-delay: 150ms;
}

@keyframes mapPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.88; }
  50% { transform: scale(1.08); opacity: 1; }
}

@media (max-width: 980px) {
  .gallery-header {
    grid-template-columns: 1fr auto;
  }

  .gallery-header nav {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    gap: 30px;
    padding: 5px 0;
  }

  .hero-grid,
  .section-heading,
  .archive-heading,
  .territory-section,
  .archive-note {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 70px;
  }

  .hero-copy {
    padding-right: 0;
  }

  .hero-visual {
    width: min(92%, 760px);
    margin-left: auto;
  }

  .territory-section,
  .archive-note {
    gap: 55px;
  }

  .archive-note a {
    grid-column: 1;
  }

  .archive-grid {
    columns: 2;
  }

  .gallery-footer {
    grid-template-columns: 1fr 1fr;
  }

  .webgreen {
    grid-column: 1;
  }
}

@media (max-width: 680px) {
  .gallery-header {
    min-height: 78px;
    gap: 10px;
    padding: 12px 20px;
  }

  .brand img {
    width: min(190px, 58vw);
  }

  .back-link {
    padding: 9px 11px;
    font-size: 0.72rem;
  }

  .gallery-hero,
  .timeline-section,
  .territory-section,
  .archive-section,
  .archive-note {
    padding-right: 20px;
    padding-left: 20px;
  }

  .gallery-hero {
    min-height: auto;
    padding-top: 160px;
  }

  .hero-grid {
    min-height: 0;
    gap: 52px;
  }

  h1 {
    font-size: clamp(3.6rem, 20vw, 7rem);
  }

  h2 {
    font-size: clamp(3.4rem, 17vw, 5rem);
  }

  .hero-visual {
    width: 100%;
  }

  .hero-visual::before {
    inset: -24px -20px 18% 30%;
  }

  .hero-visual img {
    aspect-ratio: 0.95;
  }

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

  .hero-ledger div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-ledger div:last-child {
    border-bottom: 0;
  }

  .section-heading,
  .archive-heading {
    gap: 28px;
  }

  .year-track {
    grid-template-columns: 1fr 1fr;
    gap: 30px 12px;
  }

  .track-line {
    display: none;
  }

  .year-button {
    padding: 15px;
    border-top: 1px solid #969894;
  }

  .year-button::before {
    display: none;
  }

  .year-button.is-active {
    color: var(--paper);
    background: var(--red);
  }

  .year-button.is-active small {
    color: var(--paper);
  }

  .territory-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .territory-map {
    margin: 0 -20px;
    border-right: 0;
    border-left: 0;
  }

  .theme-filter {
    align-items: stretch;
  }

  .theme-button {
    flex: 1 1 calc(50% - 10px);
  }

  .result-count {
    flex-basis: 100%;
    margin: 8px 0 0;
  }

  .archive-grid {
    columns: 1;
  }

  .archive-card.card-wide,
  .archive-card.card-tall {
    grid-column: auto;
    grid-row: auto;
  }

  .archive-card:nth-child(3n + 1) {
    min-height: 0;
  }

  .gallery-footer {
    grid-template-columns: 1fr;
    gap: 42px;
    padding: 64px 20px 24px;
  }

  .webgreen {
    grid-column: auto;
  }

  .copyright {
    grid-column: auto;
  }

  .lightbox[open] {
    grid-template-columns: 48px 1fr 48px;
  }

  .lightbox figcaption {
    display: grid;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    clip-path: none;
  }
}
