:root {
  --ink: #14212b;
  --muted: #586675;
  --paper: #f7f4ee;
  --surface: #fffdf8;
  --line: #ded7ca;
  --deep-green: #154734;
  --green: #2f6f4e;
  --red: #b7352d;
  --gold: #c49a4a;
  --blue: #234f70;
  --shadow: 0 22px 60px rgba(20, 33, 43, 0.13);
  --radius: 8px;
  --max: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(247, 244, 238, 0.98), rgba(247, 244, 238, 0.94)),
    url("assets/palacio-sao-bento.jpg") center 18% / cover fixed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid rgba(196, 154, 74, 0.75);
  outline-offset: 4px;
}

.site-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(183, 53, 45, 0.09), transparent 28rem),
    radial-gradient(circle at 90% 20%, rgba(21, 71, 52, 0.12), transparent 28rem);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(247, 244, 238, 0.88);
  border-bottom: 1px solid rgba(222, 215, 202, 0.86);
}

.nav-inner {
  width: min(var(--max), calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--surface);
  background: linear-gradient(135deg, var(--deep-green), var(--red));
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 1rem;
  box-shadow: 0 10px 24px rgba(20, 33, 43, 0.18);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 700;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.92);
  transform: translateY(-1px);
}

.hero {
  min-height: calc(100svh - 72px);
  display: grid;
  align-items: end;
  padding: 76px 0 44px;
  color: var(--surface);
  background:
    linear-gradient(90deg, rgba(20, 33, 43, 0.86), rgba(20, 33, 43, 0.48) 48%, rgba(20, 33, 43, 0.18)),
    url("assets/palacio-sao-bento.jpg") center / cover;
  animation: reveal 520ms ease both;
}

.hero.compact {
  min-height: 470px;
  align-items: center;
  padding: 70px 0;
}

.hero-inner,
.content,
.footer-inner {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.hero-content {
  max-width: 720px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: rgba(255, 253, 248, 0.86);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 42px;
  height: 2px;
  background: var(--gold);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 6.8rem);
  font-weight: 700;
}

.compact h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
}

.lead {
  max-width: 690px;
  margin: 22px 0 0;
  color: rgba(255, 253, 248, 0.88);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 253, 248, 0.36);
  border-radius: 999px;
  color: var(--surface);
  background: rgba(255, 253, 248, 0.13);
  text-decoration: none;
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button.primary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--surface);
}

.button.dark {
  color: var(--surface);
  background: var(--ink);
  border-color: var(--ink);
}

.button:hover {
  transform: translateY(-2px);
  background: rgba(255, 253, 248, 0.22);
}

.button.primary:hover {
  background: #ffffff;
}

.button.dark:hover {
  background: var(--deep-green);
}

.content {
  padding: 64px 0 72px;
}

.section {
  padding: 64px 0;
  border-top: 1px solid var(--line);
}

.section:first-child {
  border-top: 0;
  padding-top: 0;
}

.section-header {
  max-width: 760px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.section h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.section-header p,
.text-block p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.panel {
  grid-column: span 4;
  min-height: 100%;
  padding: 24px;
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(222, 215, 202, 0.92);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(20, 33, 43, 0.07);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.panel:hover {
  transform: translateY(-4px);
  border-color: rgba(196, 154, 74, 0.72);
  box-shadow: var(--shadow);
}

.panel.large {
  grid-column: span 6;
}

.panel.full {
  grid-column: 1 / -1;
}

.panel h3 {
  font-size: 1.2rem;
}

.panel p,
.panel li {
  color: var(--muted);
}

.panel p {
  margin: 10px 0 0;
}

.meta {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 14px;
  padding: 5px 10px;
  color: var(--deep-green);
  background: rgba(47, 111, 78, 0.12);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.meta.red {
  color: var(--red);
  background: rgba(183, 53, 45, 0.12);
}

.meta.blue {
  color: var(--blue);
  background: rgba(35, 79, 112, 0.12);
}

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

.list li {
  position: relative;
  padding: 10px 0 10px 22px;
  border-top: 1px solid rgba(222, 215, 202, 0.7);
}

.list li:first-child {
  border-top: 0;
}

.list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.08em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.timeline {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 22px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item time {
  color: var(--red);
  font-weight: 900;
}

.timeline-item h3 {
  font-size: 1.12rem;
}

.timeline-item p {
  margin: 8px 0 0;
  color: var(--muted);
}

.callout {
  padding: 28px;
  color: var(--surface);
  background: linear-gradient(135deg, var(--deep-green), #203d48);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.callout h2,
.callout h3 {
  color: var(--surface);
}

.callout p,
.callout li {
  color: rgba(255, 253, 248, 0.82);
}

.source-box {
  padding: 24px;
  background: rgba(20, 33, 43, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.source-box a {
  color: var(--blue);
  font-weight: 800;
}

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

.photo-card {
  overflow: hidden;
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid rgba(222, 215, 202, 0.92);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(20, 33, 43, 0.08);
}

.photo-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  background: #ddd4c4;
}

.photo-card.portrait img {
  object-fit: contain;
  padding: 16px;
  background: #e7ddc9;
}

.photo-card figcaption {
  padding: 18px;
  color: var(--muted);
  font-size: 0.94rem;
}

.photo-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 1rem;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 50;
  padding: 10px 14px;
  color: var(--surface);
  background: var(--ink);
  border-radius: 999px;
  text-decoration: none;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 12px;
}

.site-footer {
  color: rgba(255, 253, 248, 0.78);
  background: var(--ink);
  padding: 42px 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
}

.footer-inner strong {
  color: var(--surface);
}

.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--surface);
  text-decoration: none;
  font-weight: 800;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 860px) {
  .nav-inner {
    min-height: auto;
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .nav-links a {
    white-space: nowrap;
  }

  .hero {
    min-height: 620px;
    padding: 64px 0 36px;
    background:
      linear-gradient(180deg, rgba(20, 33, 43, 0.86), rgba(20, 33, 43, 0.58)),
      url("assets/palacio-sao-bento.jpg") center / cover;
  }

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

  .panel,
  .panel.large,
  .panel.full {
    grid-column: auto;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .content {
    padding: 46px 0 56px;
  }

  .section {
    padding: 46px 0;
  }

  .panel,
  .callout,
  .source-box {
    padding: 20px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
