:root {
  --primary: #017158;
  --primary-soft: #0b8a6d;
  --bg: #f4f6f4;
  --surface: #ffffff;
  --surface-soft: #ebf0ed;
  --text: #16201d;
  --muted: #4c5f59;
  --line: #d6e1dc;
  --shadow: 0 16px 40px rgba(10, 33, 27, 0.1);
  --radius-lg: 22px;
  --radius-md: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #02a57f;
    --primary-soft: #29bf9a;
    --bg: #0f1412;
    --surface: #16201d;
    --surface-soft: #1f2c28;
    --text: #e7efe9;
    --muted: #a0b6ae;
    --line: #2a3c36;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  }
}

html[data-theme="light"] {
  --primary: #017158;
  --primary-soft: #0b8a6d;
  --bg: #f4f6f4;
  --surface: #ffffff;
  --surface-soft: #ebf0ed;
  --text: #16201d;
  --muted: #4c5f59;
  --line: #d6e1dc;
  --shadow: 0 16px 40px rgba(10, 33, 27, 0.1);
}

html[data-theme="dark"] {
  --primary: #02a57f;
  --primary-soft: #29bf9a;
  --bg: #0f1412;
  --surface: #16201d;
  --surface-soft: #1f2c28;
  --text: #e7efe9;
  --muted: #a0b6ae;
  --line: #2a3c36;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, color-mix(in srgb, var(--primary) 8%, transparent) 0%, transparent 38%),
    radial-gradient(circle at 90% 20%, color-mix(in srgb, var(--primary) 6%, transparent) 0%, transparent 30%),
    var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: clamp(150px, 18vw, 220px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 2vw, 2.2rem);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding-left: clamp(0.3rem, 1vw, 0.85rem);
  min-width: 0;
}

.brand-logo {
  width: 40%;
  min-width: 64px;
  max-width: 92px;
  height: auto;
  background: transparent;
  border: 0;
  padding: 0;
}

.brand-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.nav {
  display: flex;
  justify-content: center;
  gap: clamp(0.45rem, 0.85vw, 0.95rem);
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.35rem 0.15rem;
  border-bottom: 2px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--primary);
  border-color: var(--primary);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0.5rem;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  border-radius: 99px;
  background: var(--text);
  margin: 5px 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.48rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--primary);
  transform: translateY(-1px);
}

main {
  width: min(1150px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 4rem;
}

.section {
  margin-top: clamp(2.8rem, 6vw, 5rem);
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(1.6rem, 4vw, 3.2rem);
  align-items: center;
  min-height: min(86vh, 860px);
}

.hero-media {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.logo-stage {
  width: min(520px, 100%);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.hero-logo-2d {
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.16));
}

.hero-content h1,
h2 {
  font-family: "Gideon Roman", serif;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin: 0 0 0.8rem;
}

.hero-content h1 {
  font-size: clamp(2rem, 6vw, 4.05rem);
  max-width: 16ch;
}

.eyebrow {
  color: var(--primary);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-content p {
  max-width: 56ch;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.95rem;
}

.btn {
  display: inline-flex;
  margin-top: 0.7rem;
  padding: 0.78rem 1.2rem;
  border-radius: 999px;
  background: var(--primary);
  color: #f3fff9;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--primary) 35%, transparent);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 50%, transparent);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  box-shadow: 0 12px 24px color-mix(in srgb, var(--primary) 18%, transparent);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.4rem, 3.4vw, 2.8rem);
  align-items: center;
}

.split.reverse .split-content {
  order: 2;
}

.split.reverse .split-media {
  order: 1;
}

.split-content {
  padding: clamp(1rem, 2vw, 1.6rem);
}

.mobile-icon {
  display: none;
  color: var(--primary);
}

.split-content h2,
.mission h2,
.units h2,
.contact h2 {
  font-size: clamp(1.65rem, 4vw, 2.7rem);
}

.split-content p {
  color: var(--muted);
  margin: 0.5rem 0;
}

.split-content h3 {
  margin: 1rem 0 0.2rem;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
}

.split-media {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary) 8%, var(--surface) 92%),
    var(--surface-soft)
  );
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(0.9rem, 2vw, 1.4rem);
  box-shadow: var(--shadow);
}

.split-media.jpg-credit {
  position: relative;
  overflow: hidden;
}

.split-media.jpg-credit::after {
  content: "Equipe de midias ICR | Baixada Fluminese";
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: color-mix(in srgb, var(--text) 78%, transparent);
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  backdrop-filter: blur(2px);
  pointer-events: none;
}

.split-media img {
  border-radius: calc(var(--radius-lg) - 8px);
  min-height: 230px;
  object-fit: cover;
}

.mission {
  text-align: center;
  padding: clamp(1.4rem, 4vw, 2.2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.mission-logo {
  width: min(180px, 42vw);
  margin: 0 auto 0.8rem;
}

.mission-text {
  width: min(100%, 46ch);
  margin: 0.7rem auto 0;
  color: var(--muted);
  text-wrap: balance;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.45;
}

.text-stack .mission-text {
  width: min(100%, 72ch);
}
.pillars {
  text-align: center;
}

.pillars h2 {
  font-size: clamp(1.65rem, 4vw, 2.7rem);
  margin-bottom: 0.6rem;
}

.pillars-grid {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.pillar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 2.2vw, 1.6rem);
  box-shadow: var(--shadow);
  text-align: center;
}

.pillar-icon {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 0.85rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
  font-size: 2rem;
}

.pillar-card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.08rem;
  color: var(--text);
}

.pillar-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (max-width: 980px) {
  .pillars-grid {
    grid-template-columns: 1fr;
  }
}
.section-actions {
  margin-top: 1rem;
}

.future-events-cta {
  text-align: center;
}

.future-events-card {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(1.3rem, 3.3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.future-events-card h2 {
  font-size: clamp(1.65rem, 4vw, 2.7rem);
}

.future-events-card p {
  margin: 0;
  color: var(--muted);
}

.future-events-actions {
  justify-content: center;
  margin-top: 0.9rem;
}

.events-page-intro h1 {
  margin: 0;
  font-family: "Gideon Roman", serif;
  font-size: clamp(1.9rem, 5.2vw, 3rem);
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.events-page-intro .mission-text {
  width: min(100%, 70ch);
}

.events-only-page {
  padding-top: clamp(2rem, 6vw, 3.5rem);
}

.events-simple-header {
  margin-top: 0;
  text-align: center;
}

.events-simple-header h1 {
  margin: 0;
  font-family: "Gideon Roman", serif;
  font-size: clamp(2rem, 6vw, 3.2rem);
  letter-spacing: 0.02em;
  line-height: 1.15;
}

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

.events-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: clamp(0.9rem, 1.8vw, 1.2rem);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.events-media {
  width: clamp(320px, 42vw, 520px);
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-soft) 85%, var(--surface) 15%);
}

.events-empty {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.events-empty.error {
  color: #b42318;
}

.units p,
.contact p {
  color: var(--muted);
}

.units-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.area-group {
  background: color-mix(in srgb, var(--surface) 84%, var(--surface-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  box-shadow: var(--shadow);
}

.area-title {
  margin: 0 0 0.75rem;
  color: var(--primary);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.8rem;
}

.unit-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  box-shadow: var(--shadow);
}

.unit-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.98rem;
  letter-spacing: 0.03em;
  color: var(--primary);
  text-transform: uppercase;
}

.unit-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.unit-card .unit-address {
  font-size: 0.88rem;
}

.contact-links {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.contact-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.contact-btn:hover,
.contact-btn:focus-visible {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.pix {
  text-align: center;
}

.pix-intro {
  color: var(--muted);
  margin: 0.4rem auto 0;
  max-width: 58ch;
}

.pix-card {
  margin-top: 1rem;
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.pix-key-label {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
}

.pix-key {
  margin: 0;
  color: var(--primary);
  font-size: clamp(1.05rem, 2.4vw, 1.32rem);
  font-weight: 800;
  letter-spacing: 0.03em;
}

.pix-desktop {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
}

.pix-qr {
  width: min(280px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  background: #fff;
}

.pix-mobile {
  display: none;
}

.pix-feedback {
  margin: 0;
  min-height: 1.2rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
}

.pix-feedback.error {
  color: #b42318;
}

.doc-trigger {
  cursor: pointer;
}

.doc-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.doc-modal[hidden] {
  display: none;
}

.doc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #000 48%, transparent);
  backdrop-filter: blur(4px);
}

.doc-modal-card {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 1.4rem);
}

.doc-modal-close {
  position: absolute;
  right: 0.7rem;
  top: 0.7rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.doc-modal-eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.doc-modal-title {
  margin: 0.3rem 0 0;
  font-family: "Gideon Roman", serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.doc-modal-description {
  margin: 0.55rem 0 0;
  color: var(--muted);
}

.doc-modal-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.doc-modal-actions .btn {
  margin-top: 0;
}

.doc-preview {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-soft) 75%, var(--surface) 25%);
  padding: 0.55rem;
}

.doc-preview iframe {
  width: 100%;
  height: min(60vh, 680px);
  border: 0;
  border-radius: calc(var(--radius-md) - 6px);
  background: #fff;
}

body.modal-open {
  overflow: hidden;
}

.icon {
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
  color: var(--primary);
  font-weight: 800;
}

.icon svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.footer {
  position: relative;
  padding: 1.8rem 1rem 2.4rem;
  text-align: center;
  color: var(--muted);
}

.footer-logo {
  width: 64px;
  margin: 0 auto 0.65rem;
}

.footer-power-link {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: clamp(78px, 10vw, 112px);
  line-height: 0;
  border-radius: 10px;
  transition: transform 0.2s ease;
}

.footer-power-link:hover,
.footer-power-link:focus-visible {
  transform: translateY(-2px);
}

.footer-power-logo {
  width: 100%;
  height: auto;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: auto auto auto;
  }

  .brand {
    width: auto;
    padding-left: 0;
  }

  .brand-logo {
    min-width: 52px;
    max-width: 72px;
  }

  .menu-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: calc(100% + 6px);
    left: 0.8rem;
    right: 0.8rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 0.8rem;
    display: grid;
    gap: 0.2rem;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    overflow: visible;
  }

  .nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav a {
    font-size: 0.95rem;
    padding: 0.5rem 0.2rem;
  }

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

  .split.reverse .split-content,
  .split.reverse .split-media {
    order: initial;
  }

  .hero {
    min-height: auto;
  }

  .footer-power-link {
    right: 0.75rem;
    bottom: 0.75rem;
    width: clamp(78px, 12vw, 112px);
  }
}

@media (max-width: 620px) {
  .events-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    padding-bottom: 6.2rem;
  }

  .footer-power-link {
    left: 50%;
    right: auto;
    bottom: 0.9rem;
    transform: translateX(-50%);
    width: clamp(88px, 28vw, 122px);
  }

  .footer-power-link:hover,
  .footer-power-link:focus-visible {
    transform: translateX(-50%) translateY(-2px);
  }

  main {
    width: min(1150px, calc(100% - 1.2rem));
  }

  .brand-text {
    display: none;
  }

  .hero-content h1 {
    font-size: clamp(1.75rem, 10vw, 2.6rem);
  }

  .hero-logo-3d {
    min-height: 250px;
  }

  .split-content {
    text-align: center;
    display: grid;
    justify-items: center;
  }

  .split-content p {
    max-width: 34ch;
  }

  .split-content h3 {
    max-width: 20ch;
  }

  .split-media {
    display: none;
  }

  .mobile-icon {
    display: block;
    font-size: clamp(2.1rem, 8vw, 2.8rem);
    line-height: 1;
    margin-bottom: 0.55rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .pix-desktop {
    display: none;
  }

  .pix-mobile {
    display: grid;
    width: 100%;
  }

  .pix-mobile .btn {
    width: 100%;
    justify-content: center;
  }

  .doc-modal {
    padding: 0.6rem;
  }

  .doc-modal-card {
    max-height: 94vh;
    border-radius: 14px;
  }

  .doc-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .doc-modal-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .doc-preview iframe {
    height: 54vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
