/* ============================================================
   TOKENS E PALETAS DE CORES (TEMA CLARO POR PADRÃO)
============================================================ */
:root {
  --bg: #FFFFFF;
  --bg-alt: #F4F6F8;
  --surface: #FFFFFF;
  --border: #E2E6EA;
  --border-strong: #C7CDD3;

  --text: #1B2430;
  --text-muted: #5C6B7A;
  --text-dim: #8B97A3;

  --accent: #2E8B6F;
  --accent-bg: rgba(46, 139, 111, 0.08);
  --accent-border: rgba(46, 139, 111, 0.3);

  --warn: #BA7517;
  --warn-bg: rgba(186, 117, 23, 0.08);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --maxw: 1120px;
}

/* MODIFICADORES DE VARIÁVEIS PARA O MODO ESCURO */
[data-theme="dark"] {
  --bg: #0F141C;
  --bg-alt: #161D26;
  --surface: #1E2631;
  --border: #2C3745;
  --border-strong: #405063;

  --text: #F1F4F7;
  --text-muted: #A3B2C2;
  --text-dim: #6E7F91;

  --accent: #42B993;
  --accent-bg: rgba(66, 185, 147, 0.12);
  --accent-border: rgba(66, 185, 147, 0.4);

  --warn: #E09632;
  --warn-bg: rgba(224, 150, 50, 0.12);
}

/* ============================================================
   RESET
============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   BOTÃO DO MODO ESCURO (TOGGLE ESTILO WINDOWS 11)
============================================================ */
.theme-toggle-switch {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  outline-offset: 4px;
}

.switch-track {
  display: inline-block;
  width: 50px;
  height: 26px;
  background-color: var(--border-strong);
  border-radius: 13px;
  position: relative;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  border: 1px solid transparent;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.switch-thumb svg {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
  color: #1B2430; /* Cor do ícone por padrão */
}

/* Estado Claro (Light Mode) - Desativado */
[data-theme="light"] .switch-track {
  background-color: #E2E6EA; 
  border-color: #C7CDD3;
}
[data-theme="light"] .sun-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
[data-theme="light"] .moon-icon {
  opacity: 0;
  transform: scale(0.5) rotate(-45deg);
}

/* Estado Escuro (Dark Mode) - Ativado */
[data-theme="dark"] .switch-track {
  background-color: var(--accent);
  border-color: var(--accent);
}
[data-theme="dark"] .switch-thumb {
  transform: translateX(24px);
  background-color: #ffffff;
}
[data-theme="dark"] .switch-thumb svg {
  color: var(--accent);
}
[data-theme="dark"] .sun-icon {
  opacity: 0;
  transform: scale(0.5) rotate(45deg);
}
[data-theme="dark"] .moon-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.theme-toggle-switch:hover .switch-track {
  opacity: 0.85;
}

/* ============================================================
   FORMULÁRIO DE CONTATO
============================================================ */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 550px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 24px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.form-group input,
.form-group textarea {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

/* ============================================================
   STACK PRINCIPAL INTERATIVA E EXPANSSÍVEL
============================================================ */
.widget__stacklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stack-item {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.stack-item__visible {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.stack-item__visible i {
  font-size: 18px;
  color: var(--accent);
}
.stack-item__tooltip {
  font-size: 12px;
  color: var(--text-muted);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out, margin-top 0.25s ease;
  line-height: 1.5;
}

.stack-item:hover, .stack-item:focus-within {
  border-color: var(--accent-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  transform: translateY(-1px);
}
.stack-item:hover .stack-item__tooltip, .stack-item:focus-within .stack-item__tooltip {
  max-height: 80px;
  margin-top: 8px;
}

.timeline__item--volunteer .timeline__org {
  color: var(--accent);
}

/* ============================================================
   SHARED ELEMENTS
============================================================ */
.led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  display: inline-block;
  flex-shrink: 0;
}
.led--ok { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.led--warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}
.btn--small { padding: 9px 16px; font-size: 13px; }
.btn--full { width: 100%; justify-content: center; }
.btn--dark { background: var(--text); color: var(--bg); border: none; }
.btn--dark:hover { opacity: 0.85; }
.btn--outline { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn--outline:hover { background: var(--bg-alt); }

.link-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.link-inline:hover { text-decoration: underline; }

/* ============================================================
   HEADER
============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  opacity: 0.96;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
}
.header__brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.header__brand span { color: var(--accent); }

.header__nav { display: flex; align-items: center; gap: 28px; }
.header__nav a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.header__nav a:hover { color: var(--text); }
.header__nav-cta {
  color: var(--text) !important;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.header__nav-cta:hover { background: var(--bg-alt); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; width: 100%; background: var(--text); transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
============================================================ */
.hero { background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.hero__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 88px 32px 72px;
}
.hero__eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 600;
  line-height: 1.18;
  color: var(--text);
  margin-bottom: 22px;
  max-width: 18ch;
}
.hero__title strong { color: var(--accent); }
.hero__lede {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: 32px;
}
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ============================================================
   LAYOUT (content + sidebar)
============================================================ */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 64px;
}
.content { min-width: 0; }

/* ============================================================
   BLOCKS
============================================================ */
.block { padding: 72px 0 0; }
.block:last-child { padding-bottom: 72px; }
.block__eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.block__title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 600;
  margin-bottom: 28px;
}
.block__lede { color: var(--text-muted); max-width: 60ch; margin-bottom: 24px; }

/* ============================================================
   CARD GRID (service cards)
============================================================ */
.cardgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.servicecard {
  background: var(--surface);
  padding: 26px 28px;
}
.servicecard--feature { background: var(--bg-alt); }
.servicecard__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}
.servicecard__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}
.servicecard__desc { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; max-width: 48ch; }
.servicecard__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.servicecard__tags span {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
}
.servicecard__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.servicecard__link:hover { text-decoration: underline; }

.projectdetails {
  margin-top: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.diagram { overflow-x: auto; margin-bottom: 24px; }
.diagram__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
  white-space: nowrap;
}
.diagram__node {
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-align: center;
  line-height: 1.5;
}
.diagram__node span { font-size: 11px; color: var(--text-dim); }
.diagram__node--accent { border-color: var(--accent-border); background: var(--accent-bg); color: var(--accent); }
.diagram__arrow { color: var(--text-dim); font-size: 16px; }
.diagram__sub { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.diagram__chip {
  font-size: 12px;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid rgba(186, 117, 23, 0.3);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}

.projectdetails__list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.projectdetails__list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-muted); }
.projectdetails__list i { color: var(--accent); font-size: 16px; margin-top: 2px; flex-shrink: 0; }

/* ============================================================
   EDITORIAL
============================================================ */
.editorial { max-width: 68ch; }
.editorial p { color: var(--text-muted); margin-bottom: 18px; font-size: 15px; line-height: 1.8; }
.editorial__more { margin-top: 4px; }
.link-inline--button { margin-top: 4px; }

/* ============================================================
   TIMELINE
============================================================ */
.timeline { display: flex; flex-direction: column; max-width: 68ch; }
.timeline__item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 20px;
  position: relative;
  padding-bottom: 32px;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 20px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.timeline__item:last-child::before { display: none; }
.timeline__marker { display: flex; justify-content: center; padding-top: 5px; }
.timeline__period { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.timeline__role { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.timeline__org { font-size: 14px; color: var(--accent); margin-bottom: 10px; }
.timeline__item--current .timeline__org { color: var(--warn); }
.timeline__desc { font-size: 14px; color: var(--text-muted); max-width: 60ch; }

/* ============================================================
   CONTACT CARDS
============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 550px;
}
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 12px;
  font-size: 13px;
  color: var(--text-muted);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.contact-card i { font-size: 22px; color: var(--text); }
.contact-card:hover { border-color: var(--accent-border); background: var(--accent-bg); color: var(--accent); }

/* ============================================================
   SIDEBAR
============================================================ */
.sidebar {
  padding: 72px 0 72px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.widget {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.widget--cta { background: var(--text); border-color: var(--text); }
.widget--cta .widget__title { color: var(--bg); }
.widget__cta-text { font-size: 13px; color: var(--bg); opacity: 0.85; margin-bottom: 16px; line-height: 1.6; }

/* Botão em destaque no widget */
.widget--cta .btn {
  background: var(--bg);
  color: var(--text);
}
.widget--cta .btn:hover {
  background: var(--bg-alt);
}

.widget__statusgrid { display: flex; flex-direction: column; gap: 14px; }
.widget__label { font-size: 12px; color: var(--text-dim); margin-bottom: 2px; }
.widget__value { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--text); }
.widget__value--ok { color: var(--accent); }
.widget__value--warn { color: var(--warn); }

/* ============================================================
   FOOTER
============================================================ */
.footer { background: #11161F; color: #fff; margin-top: 24px; }
.footer .footer__title { color: #fff; }
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 32px 32px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer__title { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.footer__lede { font-size: 14px; color: rgba(255,255,255,0.65); }
.footer__socials { display: flex; gap: 16px; }
.footer__socials a {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  transition: background 0.15s ease;
}
.footer__socials a:hover { background: rgba(255,255,255,0.1); }
.footer__copy {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 32px 28px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

/* ============================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
============================================================ */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .sidebar { padding-top: 0; }
  .cardgrid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .header__nav.is-open { max-height: 380px; }
  .header__nav a { padding: 14px 24px; width: 100%; border-bottom: 1px solid var(--border); }
  .header__nav-cta { border: none; padding: 14px 24px; }
  .theme-toggle-switch { margin: 14px 24px; }
  .nav-toggle { display: flex; }
  .hero__inner { padding: 56px 20px 48px; }
  .layout, .footer__inner, .footer__copy { padding-left: 20px; padding-right: 20px; }
  .block { padding-top: 48px; }
  .contact-grid, .contact-form { max-width: 100%; }
}