/* ==========================================================
   Riverworks Archive — folha de estilos
   Paleta: branco, azul-marinho, turquesa e bege areia
   ========================================================== */

:root {
  --navy: #0b2a4a;
  --navy-2: #123b66;
  --turquoise: #19b5b0;
  --teal: #0d7377;          /* turquesa escuro: seguro para texto sobre claro */
  --sand: #eadfc8;
  --sand-soft: #f6f1e5;
  --ink: #14263a;
  --muted: #4a5b6d;
  --line: #d8dfe6;
  --white: #fff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 42, 74, .12);
  --header-h: 68px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
}

[hidden] { display: none !important; }
img, svg { max-width: 100%; display: block; }
img { height: auto; }

h1, h2, h3, h4 { line-height: 1.2; color: var(--navy); margin: 0 0 .6em; letter-spacing: -.015em; }
h1 { font-size: clamp(2.2rem, 5.4vw, 4rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--navy); }

:focus-visible {
  outline: 3px solid var(--turquoise);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: -60px; left: 12px;
  z-index: 200;
  background: var(--navy);
  color: var(--white);
  padding: .6rem 1rem;
  border-radius: 0 0 8px 8px;
  transition: top .2s;
}
.skip-link:focus { top: 0; color: var(--white); }

.container { width: min(1160px, 100% - 40px); margin-inline: auto; }

/* ---------- Barra de progresso ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0;
  height: 3px; z-index: 120;
  background: transparent;
}
.progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--turquoise), var(--navy-2));
}

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 4px 18px rgba(11, 42, 74, .07); }

.header__bar {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  color: var(--navy); text-decoration: none; font-size: 1.1rem; letter-spacing: -.01em;
}
.brand:hover { color: var(--navy); }
.brand__icon { width: 34px; height: 34px; }
.brand strong { color: var(--teal); }

.main-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  position: relative;
  display: block; padding: .5rem .85rem;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .98rem;
  border-radius: 8px;
}
.main-nav a::after {
  content: ""; position: absolute; left: .85rem; right: .85rem; bottom: .2rem;
  height: 2px; background: var(--turquoise);
  transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.main-nav a:hover { color: var(--navy); }
.main-nav a:hover::after,
.main-nav a[aria-current="true"]::after { transform: scaleX(1); }
.main-nav a[aria-current="true"] { color: var(--navy); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--white); cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 20px; height: 2px; background: var(--navy);
  border-radius: 2px; transition: transform .25s, opacity .25s;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .js .main-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 30px rgba(11, 42, 74, .1);
    max-height: 0; overflow: hidden; visibility: hidden;
    transition: max-height .35s ease, visibility .35s;
  }
  .js .main-nav.is-open { max-height: 420px; visibility: visible; }
  .main-nav ul { flex-direction: column; padding: .5rem 20px 1rem; }
  .main-nav a { padding: .8rem .5rem; }
  .main-nav a::after { left: .5rem; right: auto; width: 36px; }
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .85rem 1.5rem;
  border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .2s, background-color .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--turquoise); color: var(--navy); }
.btn--primary:hover { background: #3fd0cb; color: var(--navy); }
.btn--ghost { color: var(--white); border-color: rgba(255, 255, 255, .7); }
.btn--ghost:hover { background: var(--white); color: var(--navy); }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate;
  min-height: min(88vh, 820px);
  display: flex; align-items: center;
  color: var(--white);
  background: var(--navy);
  overflow: hidden;
}
.hero__img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  animation: slow-zoom 24s ease-out both;
}
@keyframes slow-zoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.hero__overlay {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(100deg, rgba(11, 42, 74, .92) 0%, rgba(11, 42, 74, .72) 48%, rgba(11, 42, 74, .25) 100%),
    linear-gradient(0deg, rgba(11, 42, 74, .55), transparent 40%);
}
.hero__content { padding-block: 5rem 4rem; }
.hero h1 { color: var(--white); max-width: 16ch; }
.hero__lead { max-width: 56ch; font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: #e6eef6; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 2rem 0 3rem; }

.hero__content > * { animation: rise .8s ease both; }
.hero__content > :nth-child(2) { animation-delay: .08s; }
.hero__content > :nth-child(3) { animation-delay: .16s; }
.hero__content > :nth-child(4) { animation-delay: .24s; }
.hero__content > :nth-child(5) { animation-delay: .34s; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

.eyebrow {
  display: inline-block; margin: 0 0 1rem;
  font-family: var(--font-mono); font-size: .8rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--turquoise);
}
.eyebrow--dark { color: var(--teal); }

.stats {
  list-style: none; margin: 0; padding: 1.5rem 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, .3);
  max-width: 900px;
}
.stats li { display: flex; flex-direction: column; gap: .2rem; }
.stats strong { font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.1; color: var(--white); font-variant-numeric: tabular-nums; }
.stats span:not([data-count]) { font-size: .9rem; color: #cfe0ee; line-height: 1.4; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Secções ---------- */
.section { padding-block: clamp(4rem, 8vw, 7rem); }
.section--sand { background: var(--sand-soft); }
.section--navy { background: var(--navy); color: #d7e4f0; }
.section--navy h2, .section--navy h3 { color: var(--white); }

.section__head { max-width: 720px; margin-bottom: 2.5rem; }
.section__head p:last-child { color: var(--muted); font-size: 1.1rem; }
.section__head--light p:last-child { color: #c5d6e6; }

.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split--reverse { grid-template-columns: 1fr 1.05fr; }
@media (max-width: 860px) {
  .split, .split--reverse { grid-template-columns: 1fr; }
}

.figure { margin: 0; }
.figure img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow);
  background: linear-gradient(135deg, var(--navy-2), var(--teal));
}
.figure figcaption { margin-top: .7rem; font-size: .92rem; color: var(--muted); }
.figure--wide { margin-top: 3rem; }
.figure--wide img { aspect-ratio: 21 / 9; }
@media (max-width: 640px) { .figure--wide img { aspect-ratio: 4 / 3; } }

/* Imagem indisponível: mantém o espaço com um fundo gráfico */
.img-failed { position: relative; }
.img-failed img { opacity: 0; }
.img-failed::after {
  content: attr(data-fallback);
  position: absolute; inset: 0 0 auto 0;
  aspect-ratio: 3 / 2;
  display: grid; place-items: center; padding: 1rem; text-align: center;
  font-size: .9rem; color: var(--white);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 14px, transparent 14px 28px),
    linear-gradient(135deg, var(--navy), var(--teal));
}

/* ---------- Sobre ---------- */
.pillars { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.1rem; }
.pillars li { padding-left: 1.2rem; border-left: 3px solid var(--turquoise); }
.pillars h3 { margin-bottom: .2rem; font-size: 1.1rem; }
.pillars p { margin: 0; color: var(--muted); }

/* ---------- Separadores (rios) ---------- */
.tabs { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tabs__list { display: flex; flex-wrap: wrap; background: var(--navy); }
.tabs__list [role="tab"] {
  flex: 1 1 120px;
  padding: 1rem 1.2rem;
  font: inherit; font-weight: 700; color: #c5d6e6;
  background: transparent; border: 0; border-bottom: 4px solid transparent;
  cursor: pointer; transition: color .2s, background-color .2s, border-color .2s;
}
.tabs__list [role="tab"]:hover { color: var(--white); background: var(--navy-2); }
.tabs__list [role="tab"][aria-selected="true"] { color: var(--white); border-bottom-color: var(--turquoise); background: var(--navy-2); }
.tabs__list [role="tab"]:focus-visible { outline-offset: -4px; }
.tabs__panel { padding: clamp(1.4rem, 3vw, 2.4rem); animation: fade .45s ease; }
.tabs__panel[hidden] { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tabs__panel p { max-width: 70ch; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin: 1.5rem 0 0; }
.facts div { background: var(--sand-soft); border-radius: 10px; padding: 1rem 1.1rem; border-left: 4px solid var(--turquoise); }
.facts dt { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); font-weight: 600; }
.facts dd { margin: .2rem 0 0; font-weight: 600; color: var(--navy); line-height: 1.4; }

/* ---------- Linha do tempo ---------- */
.timeline { margin-top: 3.5rem; }
.timeline ol {
  list-style: none; margin: 1.5rem 0 0; padding: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 1rem;
  overflow-x: auto; padding-bottom: 1rem;
  scroll-snap-type: x proximity;
}
.timeline li {
  position: relative; scroll-snap-align: start;
  padding: 1.6rem 1rem 0;
  border-top: 3px solid var(--navy);
}
.timeline li::before {
  content: ""; position: absolute; top: -9px; left: 0;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--turquoise); border: 3px solid var(--sand-soft); box-shadow: 0 0 0 2px var(--navy);
}
.timeline time { display: block; font-family: var(--font-mono); font-weight: 700; color: var(--teal); margin-bottom: .3rem; }
.timeline p { font-size: .96rem; color: var(--muted); margin: 0; }

/* ---------- Mini-estatísticas ---------- */
.mini-stats { list-style: none; margin: 1.8rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.mini-stats li { background: var(--sand-soft); border-radius: 12px; padding: 1rem; }
.mini-stats strong { display: block; font-size: 1.4rem; color: var(--navy); line-height: 1.15; }
.mini-stats span { font-size: .85rem; color: var(--muted); line-height: 1.35; display: block; margin-top: .2rem; }
@media (max-width: 560px) { .mini-stats { grid-template-columns: 1fr; } }

/* ---------- Cartões interativos ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.5rem; }
.card { display: flex; flex-direction: column; gap: .8rem; perspective: 1200px; }

.card__inner { display: grid; flex: 1; }
.card__face {
  grid-area: 1 / 1;
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: 0 4px 16px rgba(11, 42, 74, .08);
  border: 1px solid var(--line);
}
.card__face h3 { margin-bottom: .5rem; }
.card__face p { margin: 0; color: var(--muted); }
.card__icon {
  display: grid; place-items: center;
  width: 54px; height: 54px; margin-bottom: 1rem;
  border-radius: 14px; background: var(--navy); color: var(--turquoise);
}
.card__icon svg { width: 30px; height: 30px; }

.card__toggle {
  align-self: flex-start;
  font: inherit; font-weight: 700; font-size: .95rem;
  color: var(--navy); background: transparent;
  border: 2px solid var(--navy); border-radius: 999px;
  padding: .5rem 1.1rem; cursor: pointer;
  transition: background-color .2s, color .2s;
}
.card__toggle:hover, .card__toggle[aria-pressed="true"] { background: var(--navy); color: var(--white); }

.js .card__inner { transform-style: preserve-3d; transition: transform .65s cubic-bezier(.2, .8, .2, 1); cursor: pointer; }
.js .card__face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.js .card__face--back { transform: rotateY(180deg); background: var(--navy); color: #d7e4f0; border-color: var(--navy); }
.js .card__face--back h3 { color: var(--white); }
.js .card__face--back p { color: #d7e4f0; }
.js .card.is-flipped .card__inner { transform: rotateY(180deg); }
.no-js .card__toggle { display: none; }
.no-js .card__face--back { margin-top: .8rem; grid-area: 2 / 1; background: var(--navy); color: #fff; }
.no-js .card__face--back h3, .no-js .card__face--back p { color: #fff; }

/* ---------- Acordeão ---------- */
.accordion { margin-top: 3.5rem; border-top: 1px solid var(--line); }
.acc__item { border-bottom: 1px solid var(--line); }
.acc__title { margin: 0; font-size: 1.1rem; }
.acc__btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.2rem .2rem;
  font: inherit; font-weight: 700; font-size: 1.1rem; color: var(--navy);
  background: none; border: 0; text-align: left; cursor: pointer;
}
.acc__btn:hover { color: var(--teal); }
.acc__icon {
  flex: none; position: relative; width: 28px; height: 28px; border-radius: 50%;
  background: var(--sand); transition: background-color .25s;
}
.acc__icon::before, .acc__icon::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 12px; height: 2px; background: var(--navy);
  transform: translate(-50%, -50%); transition: transform .3s;
}
.acc__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.acc__btn[aria-expanded="true"] .acc__icon { background: var(--turquoise); }
.acc__btn[aria-expanded="true"] .acc__icon::after { transform: translate(-50%, -50%) rotate(0); }

.acc__panel {
  display: grid; grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows .35s ease, visibility .35s;
}
.acc__inner { overflow: hidden; min-height: 0; }
.acc__inner p:last-child { margin-bottom: 1.2rem; }
.is-open > .acc__panel,
.is-open > h3 + .acc__panel { grid-template-rows: 1fr; visibility: visible; }
.no-js .acc__panel { grid-template-rows: 1fr; visibility: visible; }
.no-js .acc__icon, .no-js .link-btn { display: none; }
.accordion .acc__inner p { max-width: 75ch; color: var(--muted); }

/* ---------- Galeria ---------- */
.gallery {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem;
}
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr; } }

.gallery__item {
  position: relative; display: block; width: 100%; padding: 0;
  border: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--navy-2); cursor: zoom-in; color: var(--white);
  aspect-ratio: 4 / 3;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.gallery__item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}
.gallery__item:hover img, .gallery__item:focus-visible img { transform: scale(1.07); }
.gallery__label {
  position: absolute; inset: auto 0 0 0;
  display: flex; flex-direction: column; text-align: left;
  padding: 2.4rem 1rem .9rem;
  background: linear-gradient(0deg, rgba(11, 42, 74, .92), transparent);
}
.gallery__label small { color: #b9d3e6; font-family: var(--font-mono); letter-spacing: .04em; }
.gallery__item.img-failed::after { aspect-ratio: auto; inset: 0; border-radius: 0; }
.credits { margin: 1.6rem 0 0; font-size: .88rem; color: #aac3d8; }

/* Ampliação */
.lightbox {
  width: min(1000px, 94vw); max-height: 94vh;
  padding: 0; border: 0; border-radius: var(--radius);
  background: var(--navy); color: #d7e4f0; overflow: auto;
}
.lightbox::backdrop { background: rgba(5, 16, 30, .82); backdrop-filter: blur(3px); }
.lightbox[open] { animation: pop .3s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.lightbox__inner { position: relative; }
.lightbox img { width: 100%; max-height: 66vh; object-fit: contain; background: #061a2f; }
.lightbox__caption { padding: 1.2rem 1.5rem 1.5rem; }
.lightbox__caption h3 { color: var(--white); margin-bottom: .3rem; }
.lightbox__caption p { margin: 0 0 1rem; }
.lightbox__close {
  position: absolute; top: .7rem; right: .7rem; z-index: 2;
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(11, 42, 74, .85); color: var(--white);
}
.lightbox__close:hover { background: var(--turquoise); color: var(--navy); }
.lightbox__close svg { width: 20px; height: 20px; }
.lightbox__nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-family: var(--font-mono); font-size: .85rem; }
.lightbox__nav button {
  font: inherit; font-weight: 700; color: var(--white); background: transparent;
  border: 2px solid rgba(255, 255, 255, .4); border-radius: 999px; padding: .45rem 1rem; cursor: pointer;
}
.lightbox__nav button:hover { background: var(--white); color: var(--navy); }

/* ---------- Diagramas ---------- */
.diagram {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1rem, 2.5vw, 1.8rem); box-shadow: 0 6px 22px rgba(11, 42, 74, .07);
}
.diagram__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.5rem; margin-bottom: 1rem; }
.diagram__head h3 { margin: 0; font-size: 1.1rem; }
.diagram__controls { display: flex; flex-wrap: wrap; gap: .4rem; }
.diagram__controls button {
  min-width: 42px; padding: .45rem .9rem;
  font: inherit; font-weight: 700; font-size: .92rem;
  color: var(--navy); background: var(--white);
  border: 2px solid var(--navy); border-radius: 999px; cursor: pointer;
  transition: background-color .2s, color .2s;
}
.diagram__controls button:hover { background: var(--sand); }
.diagram__controls button[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.diagram__controls .diagram__play { border-color: var(--teal); color: var(--teal); }
.diagram__controls .diagram__play[aria-pressed="true"] { background: var(--teal); color: var(--white); }
.diagram svg { width: 100%; height: auto; background: var(--sand-soft); border-radius: 10px; }
.diagram__caption { margin: 1rem 0 0; color: var(--muted); min-height: 3.4em; }
.diagrams-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem; }
@media (max-width: 960px) { .diagrams-grid { grid-template-columns: 1fr; } }
.diagram + .diagrams-grid { margin-top: 1.5rem; }

.lbl { font-family: var(--font); font-size: 13px; font-weight: 600; fill: var(--navy); }
.lbl--light { fill: var(--white); }
.num circle { fill: var(--sand); stroke: var(--navy); stroke-width: 2; }
.num text { font-family: var(--font); font-weight: 700; font-size: 13px; fill: var(--navy); }
.legend { margin: 1rem 0 0; padding-left: 1.3rem; color: var(--muted); font-size: .95rem; }
.legend li { margin-bottom: .2rem; }

/* Diagrama da eclusa: estados controlados por data-step */
.lock .w-up, .lock .w-down, .lock .w-chamber { fill: var(--turquoise); opacity: .6; }
.lock .level { stroke: var(--navy); stroke-width: 1.5; stroke-dasharray: 5 4; }
.lock .gate { fill: var(--navy); transition: transform 1s ease; }
.lock .ground { fill: #d9c9a6; }
.lock .lock-water-chamber { transform-box: fill-box; transform-origin: 50% 100%; transition: transform 1.3s ease; }
.lock .boat { transition: transform 1.4s ease; }

.lock[data-step="1"] .lock-water-chamber,
.lock[data-step="2"] .lock-water-chamber { transform: scaleY(.5); }
.lock[data-step="3"] .lock-water-chamber,
.lock[data-step="4"] .lock-water-chamber { transform: scaleY(1); }

.lock[data-step="1"] .gate-d { transform: translateY(185px); }
.lock[data-step="4"] .gate-u { transform: translateY(185px); }
.lock[data-step="2"] .gate-d { transition-delay: 1.3s; }

.lock[data-step="1"] .boat { transform: translate(500px, 144px); }
.lock[data-step="2"] .boat { transform: translate(290px, 144px); }
.lock[data-step="3"] .boat { transform: translate(290px, 64px); transition-delay: .2s; }
.lock[data-step="4"] .boat { transform: translate(110px, 64px); transition-delay: 1s; }
.lock.no-anim, .lock.no-anim * { transition: none !important; }

/* ---------- Artigos ---------- */
.articles__title { margin: 3.5rem 0 1.2rem; }
.articles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 960px) { .articles { grid-template-columns: 1fr; } }
.article {
  background: var(--sand-soft); border-radius: var(--radius);
  padding: 1.6rem; border-top: 5px solid var(--turquoise);
}
.article__meta { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); margin-bottom: .5rem; font-weight: 600; }
.article p { color: var(--muted); }
.article .acc__inner p:last-child { margin-bottom: 1rem; }
.link-btn {
  font: inherit; font-weight: 700; color: var(--navy);
  background: none; border: 0; padding: .2rem 0; cursor: pointer;
  border-bottom: 2px solid var(--turquoise);
}
.link-btn:hover { color: var(--teal); }

/* ---------- Contacto ---------- */
.contact { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: stretch; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
.contact__list {
  font-style: normal;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem;
}
@media (max-width: 560px) { .contact__list { grid-template-columns: 1fr; } }
.contact__list > div { background: var(--white); border-radius: 12px; padding: 1.3rem; border-left: 4px solid var(--turquoise); }
.contact__list h3 { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); margin-bottom: .3rem; }
.contact__list p { margin: 0; font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
.contact__note { background: var(--navy); color: #d7e4f0; border-radius: var(--radius); padding: 1.8rem; }
.contact__note h3 { color: var(--white); }
.contact__note p { color: #d7e4f0; }

/* ---------- Rodapé ---------- */
.site-footer { background: #071d35; color: #b8cde0; padding-block: 2rem; font-size: .95rem; }
.footer__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem; }
.footer__bar p { margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.site-footer a { color: #d7e4f0; }
.site-footer a:hover { color: var(--turquoise); }

/* ---------- Voltar ao topo ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--navy); color: var(--white);
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px);
  transition: opacity .3s, transform .3s, background-color .2s;
}
.to-top[hidden] { display: none; }
.to-top.is-visible { opacity: 1; transform: none; }
.to-top:hover { background: var(--teal); }
.to-top svg { width: 24px; height: 24px; }

/* ---------- Animações de entrada (só com JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .gallery li.reveal:nth-child(2n) { transition-delay: .08s; }
.js .gallery li.reveal:nth-child(3n) { transition-delay: .16s; }
.js .cards .reveal:nth-child(3n+2) { transition-delay: .08s; }
.js .cards .reveal:nth-child(3n) { transition-delay: .16s; }

@media print {
  .site-header, .to-top, .progress, .nav-toggle { display: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
