:root {
  --ground: #f4f6f5;
  --ink: #16232c;
  --ink-soft: #4b5a63;
  --rail-bg: #101c24;
  --teal: #2fb5a0;
  --blue: #2a6fbd;
  --gradient: linear-gradient(135deg, var(--teal), var(--blue));
  --card: #ffffff;
  --border: #d7dfe0;
  --danger-bg: #fdecea;
  --danger-border: #e0857a;
  --danger-text: #7a2416;
  --ok-bg: #e9f7f0;
  --ok-text: #1c6b45;
  --pending-bg: #fff6e0;
  --pending-text: #7a5a00;
  --focus: #2a6fbd;
  --radius: 4px;
  --mono: "Space Mono", "IBM Plex Mono", ui-monospace, monospace;
  --display: "Syne", "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--display);
  background: var(--ground);
  color: var(--ink);
  line-height: 1.55;
}

a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: -999px; top: auto;
  background: var(--ink); color: #fff; padding: 10px 16px; z-index: 100; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; top: 0; }

/* ============ CUE RAIL (public site signature device) ============ */

.page {
  display: grid;
  grid-template-columns: minmax(64px, 15%) 1fr;
  min-height: 100vh;
}

.rail {
  background: var(--rail-bg);
  color: #cfe0dc;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  border-right: 1px solid #0a1319;
}

.rail-line {
  flex: 1;
  width: 2px;
  background: #24373d;
  position: relative;
  margin: 8px 0;
}

.rail-cue {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: max-content;
  transition: transform 0.12s ease;
}
.rail-cue:active { transform: translateX(-50%) scale(0.94); }

.rail-cue .bracket {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  color: #a9c9c2;
  background: var(--rail-bg);
  padding: 2px 4px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  transition: color 0.25s;
}

.rail-cue .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #33454c;
  border: 2px solid var(--rail-bg);
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}

.rail-cue.active .dot {
  background: var(--gradient);
  transform: scale(1.3);
  box-shadow: 0 0 0 4px rgba(47, 181, 160, 0.25);
}
.rail-cue.active .bracket {
  color: var(--teal);
}
/* state is never color alone: active cues also grow a leading chevron */
.rail-cue.active .bracket::before { content: "▸ "; }
.rail-cue .bracket::before { content: "  "; }

.rail-gestao {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #cfe0dc;
  padding: 10px 6px;
  border-radius: var(--radius);
  transition: background 0.15s, transform 0.1s;
}
.rail-gestao:hover, .rail-gestao:focus-visible { background: #1b2e37; }
.rail-gestao:active { transform: scale(0.96); }
.rail-gestao .bracket { color: var(--teal); font-weight: 700; }
.rail-gestao svg { width: 16px; height: 16px; }

/* ============ MAIN COLUMN ============ */

main { min-width: 0; }

.scene {
  padding: 8vw 7vw;
  border-bottom: 1px solid var(--border);
}
/* Visible by default — content must never depend on a scroll observer firing to exist.
   ".pre-reveal" is added by JS only, as a reversible enhancement, never a gate. */
.scene.pre-reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.scene.revealed { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .scene.pre-reveal { opacity: 1; transform: none; transition: none; }
}

.scene-tag {
  font-family: var(--mono);
  color: var(--teal);
  letter-spacing: 0.04em;
  margin: 0 0 18px;
}
.scene-tag::before { content: "["; }
.scene-tag::after { content: "]"; }

.hero-mark { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; }
.hero-mark h1 { margin: 0; }
.hero-icon { height: 64px; width: auto; flex-shrink: 0; }
.hero-wordmark { height: clamp(90px, 14vw, 150px); width: auto; }

.lead { max-width: 62ch; font-size: 1.18rem; margin: 0 0 14px; }
.sub { max-width: 58ch; color: var(--ink-soft); margin: 0 0 30px; }
.rail-explainer { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); max-width: 46ch; margin: 0 0 30px; }

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

.badge-row { display: flex; flex-wrap: wrap; gap: 10px; }
.badge {
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.85rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  color: var(--ink);
}

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); margin-top: 20px; }
.grid-3 .card { background: var(--card); padding: 26px; transition: background 0.15s; }
.grid-3 .card:hover { background: #fbfdfc; }
.grid-3 .card .cue-mini { font-family: var(--mono); color: var(--teal); display: block; margin-bottom: 10px; }
.grid-3 h3 { margin: 0 0 8px; font-size: 1.05rem; }
.grid-3 p { color: var(--ink-soft); margin: 0; }

.scene p.origin { max-width: 68ch; }

.scene h2.scene-title { font-family: var(--display); font-size: 1.7rem; margin: 0 0 6px; font-weight: 700; }

/* contact / precision-fit interaction: an element that "clicks" into place, not just fades */
.contact-cue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 12px 20px;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.contact-cue:hover, .contact-cue:focus-visible {
  background: var(--ink);
  color: var(--ground);
}
.contact-cue:active {
  transform: scale(0.97) translateY(1px);
}

/* Closing scene gets a full color block — echoes the rail's dark tone, the page's one deliberate "act break". */
.scene-contact {
  background: var(--rail-bg);
  color: #cfe0dc;
  border-bottom: none;
  padding: 11vw 7vw 10vw;
}
.scene-contact .contact-title { color: #fff; font-size: clamp(2.1rem, 5vw, 3rem); }
.scene-contact .lead { color: #cfe0dc; }
.contact-cue-big { font-size: 1.25rem; padding: 18px 32px; margin-top: 8px; }
.contact-cue-big svg { width: 22px; height: 22px; flex-shrink: 0; }
.scene-contact .contact-cue-big {
  border-color: var(--teal);
  color: var(--teal);
}
.scene-contact .contact-cue-big:hover, .scene-contact .contact-cue-big:focus-visible {
  background: var(--teal);
  color: var(--rail-bg);
}

footer.site-footer {
  padding: 26px 7vw;
  font-family: var(--display);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
footer.site-footer a { color: var(--ink-soft); }

@media (max-width: 780px) {
  .page { grid-template-columns: 56px 1fr; }
  .rail-gestao { padding: 8px 2px; }
  .rail-gestao span.rail-label {
    font-size: 0.6rem;
    letter-spacing: 0;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: center;
    max-width: 48px;
    line-height: 1.3;
  }
  .scene { padding: 12vw 6vw; }
  .hero-mark { flex-direction: column; align-items: flex-start; }
  .contact-cue-big { font-size: 1rem; padding: 14px 18px; }
  .contact-cue-big svg { width: 18px; height: 18px; }
}

/* ============ OPERATE MODE — GESTÃO (founders' area) ============ */
/* Extends the public site's world (same tokens, same rules) into an Operate-mode surface: */
/* scanability and density over expression, per DESIGN.md. Gradient stays reserved for the */
/* rail's active-cue meaning — nothing here spends it on a button, fill, or badge. */

.gestao-header {
  background: var(--rail-bg);
  color: #cfe0dc;
  padding: 16px 4vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.gestao-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
}
.gestao-header .brand img { height: 28px; }
.gestao-header .brand-wordmark { height: 22px; width: auto; filter: brightness(0) invert(1); }
.gestao-header nav { display: flex; gap: 20px; font-family: var(--mono); font-size: 0.82rem; }
.gestao-header nav a { color: #a9c9c2; text-decoration: none; }
.gestao-header nav a:hover, .gestao-header nav a:focus-visible { color: var(--teal); text-decoration: underline; }

.dash-wrap { max-width: 1100px; margin: 0 auto; padding: 4vw; }
.dash-wrap h1 { font-family: var(--display); font-weight: 700; font-size: 1.7rem; color: var(--ink); margin: 0 0 4px; }
.dash-wrap .subtitle { color: var(--ink-soft); margin: 0 0 32px; }
.dash-wrap h2 { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--ink); margin: 32px 0 16px; }

.alert-panel {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.alert-panel h2 { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--danger-text); margin: 0 0 12px; }
.alert-panel ul { margin: 0; padding-left: 20px; }
.alert-panel li { color: var(--danger-text); margin-bottom: 10px; }
.alert-panel li:last-child { margin-bottom: 0; }
.alert-panel a { color: var(--danger-text); font-weight: 700; }

.evolving-note { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); font-style: italic; }

.progress-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 32px;
}
.progress-label { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--mono); font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 10px; }
.progress-label strong { color: var(--ink); font-size: 1.15rem; }
.progress-track { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress-fill { height: 100%; background: var(--teal); }

.next-steps { display: grid; gap: 12px; margin-bottom: 8px; }
.next-steps .step {
  display: flex;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.next-steps .num {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--ground);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center;
}
.next-steps .step p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.next-steps .step strong { color: var(--ink); }

.doc-category { margin: 28px 0; }
.doc-category h3 { font-family: var(--mono); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 12px; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.doc-card {
  display: block;
  background: var(--card);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.doc-card:hover, .doc-card:focus-visible { background: #fbfdfc; }
.doc-title { display: block; font-family: var(--display); font-weight: 700; color: var(--ink); font-size: 0.95rem; margin-bottom: 4px; }
.doc-desc { display: block; color: var(--ink-soft); font-size: 0.82rem; }
.doc-card.doc-pending { opacity: 0.55; }
.doc-icon { display: none; }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 6vw; background: var(--ground); }
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.login-card img { height: 48px; margin-bottom: 12px; }
.login-card .login-wordmark { height: 34px; margin-bottom: 6px; }
.login-card h1 { font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--ink); margin: 0 0 24px; }
.login-field { text-align: left; margin-bottom: 16px; }
.login-field label { display: block; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 6px; }
.login-field input {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--display);
  font-size: 1rem;
}
.login-field input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--blue); }
.login-submit {
  width: 100%; padding: 12px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--ground);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.login-submit:hover, .login-submit:focus-visible { background: transparent; color: var(--ink); }
.login-submit:active { transform: scale(0.97) translateY(1px); }
.login-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  text-align: left;
}
.login-back { display: block; margin-top: 20px; font-family: var(--mono); font-size: 0.82rem; color: var(--ink-soft); }

/* ---- Report viewer ---- */
.report-wrap { max-width: 1100px; margin: 0 auto; padding: 4vw; }
.back-link { display: inline-block; margin-bottom: 20px; font-family: var(--mono); font-size: 0.85rem; color: var(--ink); text-decoration: none; }
.back-link:hover, .back-link:focus-visible { text-decoration: underline; }
.report-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4vw;
}
.report-content h1 { font-family: var(--display); font-weight: 700; color: var(--ink); margin-top: 0; }
.report-content h2 { font-family: var(--display); font-weight: 700; color: var(--ink); margin-top: 2em; }
.report-content h3 { font-family: var(--display); font-weight: 700; color: var(--ink-soft); }
.report-content p, .report-content li { max-width: 72ch; }
.report-content table { display: block; overflow-x: auto; width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 0.9rem; }
.report-content th, .report-content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.report-content th { background: var(--ground); font-family: var(--mono); font-size: 0.85rem; }
.report-content code { font-family: var(--mono); background: var(--ground); padding: 2px 5px; border-radius: var(--radius); font-size: 0.88em; }
.report-content pre { background: var(--rail-bg); color: #cfe0dc; padding: 16px; border-radius: var(--radius); overflow-x: auto; }
.report-content pre code { background: none; color: inherit; }
.report-content blockquote { border-left: 4px solid var(--teal); margin: 1em 0; padding: 0.4em 1em; color: var(--ink-soft); background: var(--ground); }

.loading-msg, .error-msg { padding: 40px; text-align: center; color: var(--ink-soft); font-family: var(--mono); }
.error-msg { color: var(--danger-text); }

/* ---- Tool sections (financeiro / tarefas / estrategia / contatos) ---- */
.tool-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.tool-nav a {
  font-family: var(--mono); font-size: 0.82rem; padding: 8px 16px;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--ink-soft); text-decoration: none; background: var(--card);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tool-nav a:hover, .tool-nav a:focus-visible { border-color: var(--teal); color: var(--ink); }
.tool-nav a.active { background: var(--ink); color: var(--ground); border-color: var(--ink); }

.data-table { width: 100%; border-collapse: collapse; margin: 0 0 32px; font-size: 0.9rem; background: var(--card); }
.data-table th, .data-table td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top; }
.data-table th { background: var(--ground); font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }

.status-pill { display: inline-block; font-family: var(--mono); font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.status-live { background: var(--ok-bg); color: var(--ok-text); }
.status-pending { background: var(--pending-bg); color: var(--pending-text); }
.status-dead { background: var(--danger-bg); color: var(--danger-text); }

.todo-form { display: flex; gap: 10px; margin-bottom: 24px; }
.todo-form input[type="text"] {
  flex: 1; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: var(--display); font-size: 1rem;
}
.todo-form input[type="text"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--blue); }
.todo-form button {
  padding: 10px 20px; border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--ground); font-family: var(--display); font-weight: 700;
  font-size: 0.92rem; cursor: pointer; transition: background 0.12s, color 0.12s;
}
.todo-form button:hover, .todo-form button:focus-visible { background: transparent; color: var(--ink); }

.todo-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.todo-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px;
}
.todo-item form { display: contents; }
.todo-item.done { opacity: 0.55; }
.todo-item.done .todo-text { text-decoration: line-through; }
.todo-check {
  flex: none; width: 22px; height: 22px; margin-top: 1px;
  border: 1.5px solid var(--border); border-radius: 4px; background: var(--card); cursor: pointer;
}
.todo-item.done .todo-check { background: var(--teal); border-color: var(--teal); }
.todo-text { flex: 1; color: var(--ink); font-size: 0.94rem; }
.todo-meta { display: block; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); margin-top: 3px; }
.todo-delete {
  flex: none; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft);
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 9px; cursor: pointer; transition: border-color 0.12s, color 0.12s;
}
.todo-delete:hover, .todo-delete:focus-visible { border-color: var(--danger-border); color: var(--danger-text); }
.todo-empty { color: var(--ink-soft); font-style: italic; padding: 20px 0; }

.snapshot-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: 24px;
}
.snapshot-card h3 { font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--ink); margin: 0 0 10px; }
.snapshot-card p { margin: 0 0 10px; color: var(--ink-soft); }
.snapshot-card p:last-child { margin-bottom: 0; }
.snapshot-card ol, .snapshot-card ul { margin: 0; padding-left: 1.2em; color: var(--ink-soft); }
.snapshot-card li { margin-bottom: 6px; }

@media (max-width: 640px) {
  .gestao-header, .dash-wrap, .report-wrap { padding-left: 5vw; padding-right: 5vw; }
  .data-table { display: block; overflow-x: auto; }
}
