/* ID Consultoria Empresarial e Financeira — design system
   Palette: --ink (near-black navy), --paper (cool neutral), --accent (rust orange)
   Type: Fraunces (display) / Public Sans (body) / IBM Plex Mono (data, labels) */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Public+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --ink: #14181f;
  --ink-soft: #4a5262;
  --ink-faint: #838da0;
  --paper: #f3f4f7;
  --paper-raised: #ffffff;
  --line: #e1e3ea;
  --accent: #cf4d1c;
  --accent-ink: #fff7f2;
  --accent-soft: #f7e2d6;
  --focus: #2f6fed;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f0f1f4;
    --ink-soft: #b7bdc9;
    --ink-faint: #7c8494;
    --paper: #14171d;
    --paper-raised: #1c2028;
    --line: #2b303a;
    --accent: #ef7440;
    --accent-ink: #1c0e07;
    --accent-soft: #3a2418;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ink: #f0f1f4;
  --ink-soft: #b7bdc9;
  --ink-faint: #7c8494;
  --paper: #14171d;
  --paper-raised: #1c2028;
  --line: #2b303a;
  --accent: #ef7440;
  --accent-ink: #1c0e07;
  --accent-soft: #3a2418;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; text-wrap: balance; line-height: 1.12; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: "Fraunces", serif; font-weight: 600; font-size: 19px; text-decoration: none; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.brand .mark-img { height: 36px; width: auto; flex-shrink: 0; }

.logo-badge {
  display: inline-flex; align-items: center; background: #fff; padding: 12px 26px;
  border-radius: 18px; box-shadow: 0 1px 2px rgba(20,24,31,0.06), 0 8px 24px -12px rgba(20,24,31,0.18);
}
.logo-badge img { height: 108px; width: auto; display: block; }
.brand small { display: block; font-family: "Public Sans", sans-serif; font-weight: 500; font-size: 10.5px; letter-spacing: 0.06em; color: var(--ink-faint); text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { text-decoration: none; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a:hover { color: var(--accent); }
.nav-links .btn { padding: 9px 16px; font-size: 13.5px; }
.nav-links .btn-accent { color: #fff; }
.nav-toggle { display: none; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-weight: 600; font-size: 14.5px; padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  white-space: nowrap; cursor: pointer;
}
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-line { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-line:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding-block: 72px 88px; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 4.2vw, 3.6rem); font-weight: 600; }
.hero .lede { margin-top: 20px; font-size: 19px; color: var(--ink-soft); max-width: 46ch; }
.hero .cta-row { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.hero-figure { position: relative; aspect-ratio: 4/3.2; }
.chart-motif { width: 100%; height: 100%; overflow: visible; }
.chart-motif .grid-line { stroke: var(--line); stroke-width: 1; }
.chart-motif .area-fill { opacity: 0.5; }
.chart-motif .trend-line {
  stroke-dasharray: 420; stroke-dashoffset: 420;
  animation: draw-line 1.8s cubic-bezier(.4,0,.2,1) 0.15s forwards;
}
.chart-motif .pt { opacity: 0; animation: pop-in 0.4s ease-out forwards; }
.chart-motif .pt-1 { animation-delay: 0.5s; }
.chart-motif .pt-2 { animation-delay: 0.85s; }
.chart-motif .pt-3 { animation-delay: 1.2s; }
.chart-motif .pt-4 { animation-delay: 1.55s; }
.chart-motif .pt-4 .pulse-ring { animation: pulse-ring 2.2s ease-out 2s infinite; transform-origin: center; }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse-ring {
  0% { opacity: 0.55; transform: scale(1); }
  100% { opacity: 0; transform: scale(2.6); }
}
.float-chip {
  position: absolute; display: flex; align-items: center; gap: 10px;
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; box-shadow: 0 10px 30px -14px rgba(20,24,31,0.35);
  font-family: "IBM Plex Mono", monospace; opacity: 0; animation: pop-in 0.5s ease-out forwards;
}
.float-chip b { display: block; font-size: 17px; color: var(--ink); line-height: 1.1; }
.float-chip span { font-size: 10.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; font-family: "Public Sans", sans-serif; }
.float-chip .dot { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.chip-a { top: 6%; right: 2%; animation-delay: 1.7s; }
.chip-b { bottom: 8%; left: 0%; animation-delay: 1.9s; }
@media (max-width: 900px) {
  .float-chip { padding: 8px 12px; }
  .float-chip b { font-size: 15px; }
}
.page-hero { padding-block: 56px 44px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(2rem, 3.4vw, 2.7rem); font-weight: 600; }
.page-hero .lede { margin-top: 14px; font-size: 18px; color: var(--ink-soft); max-width: 62ch; }

/* ---------- Sections ---------- */
section { padding-block: 64px; }
section + section { border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 600; }
.section-head .lede { color: var(--ink-soft); max-width: 52ch; margin-top: 8px; }
.link-more { font-weight: 600; font-size: 14.5px; text-decoration: none; color: var(--accent); white-space: nowrap; }
.link-more:hover { text-decoration: underline; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  position: relative;
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px; display: flex; flex-direction: column; gap: 14px; height: 100%;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.card-badge {
  position: absolute; top: 18px; right: 18px;
  background: var(--ink); color: var(--paper);
  font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 18px 40px -20px rgba(20,24,31,0.28);
}
.card:hover .icon-chip { background: var(--accent); color: var(--accent-ink); transform: scale(1.06); }
.icon-chip {
  width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease;
}
@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
  .card:hover .icon-chip { transform: none; }
}
.icon-chip svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.card h3 { font-size: 18.5px; font-weight: 600; font-family: "Fraunces", serif; }
.card p { color: var(--ink-soft); font-size: 15px; }
.card .tag { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-faint); }
.card .sys-name { font-family: "Fraunces", serif; font-weight: 600; font-size: 17px; }
.card .audience { font-size: 13.5px; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.card .audience b { color: var(--ink); font-weight: 600; }
.card-cta { font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }

.card-clickable { cursor: pointer; }
.card-clickable .card-cta { margin-top: auto; padding-top: 4px; }
.card-clickable:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.sys-modal {
  border: none; border-radius: 18px; padding: 36px; max-width: 480px; width: calc(100% - 48px);
  background: var(--paper-raised); color: var(--ink);
  box-shadow: 0 30px 80px -30px rgba(20,24,31,0.5);
}
.sys-modal::backdrop { background: rgba(15,17,22,0.55); backdrop-filter: blur(2px); }
.sys-modal-icon {
  width: 52px; height: 52px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.sys-modal-icon svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.sys-modal #sysModalTitle { font-size: 1.5rem; margin-top: 6px; margin-bottom: 14px; }
.sys-modal #sysModalDesc { color: var(--ink-soft); font-size: 16px; margin-bottom: 26px; }
.sys-modal-close {
  position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sys-modal-close:hover { border-color: var(--accent); color: var(--accent); }
.sys-modal-close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; }
@media (max-width: 620px) {
  .sys-modal { padding: 28px 22px; }
}

/* ---------- Stats ---------- */
.stats { background: var(--ink); color: var(--paper); }
.stats .wrap { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; }
.stat b { display: block; font-family: "IBM Plex Mono", monospace; font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat span { font-size: 14px; color: color-mix(in srgb, var(--paper) 70%, transparent); }

/* ---------- Clients ---------- */
.client-chip {
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: 12px;
  padding: 22px 18px; text-align: center; font-family: "Fraunces", serif; font-weight: 600; font-size: 15.5px;
}
.client-chip span { display: block; font-family: "IBM Plex Mono", monospace; font-weight: 500; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.client-chip-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.client-chip-logo img { width: 56px; height: 56px; border-radius: 50%; object-fit: contain; padding: 5px; box-sizing: border-box; border: 1px solid var(--line); background: #fff; }
.client-chip-logo span { margin-bottom: 0; }

/* ---------- Mission cards ---------- */
.pillar { border-left: 2px solid var(--accent); padding-left: 20px; }
.pillar h3 { font-size: 16px; text-transform: uppercase; letter-spacing: 0.04em; font-family: "IBM Plex Mono", monospace; font-weight: 600; color: var(--ink-faint); margin-bottom: 10px; }
.pillar p { font-size: 17px; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--accent); color: var(--accent-ink); text-align: center; }
.cta-band h2 { color: var(--accent-ink); font-size: clamp(1.7rem, 3vw, 2.3rem); }
.cta-band p { margin-top: 12px; opacity: 0.92; font-size: 17px; }
.cta-band .cta-row { justify-content: center; margin-top: 26px; }
.cta-band .btn-line { border-color: color-mix(in srgb, var(--accent-ink) 40%, transparent); color: var(--accent-ink); }
.cta-band .btn-accent { background: var(--accent-ink); color: var(--accent); }

/* ---------- Diagnostic promo band ---------- */
.diag-promo {
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 20px;
  padding: 40px 44px;
}
.diag-promo h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-top: 10px; }
.diag-promo p { margin-top: 12px; color: var(--ink-soft); max-width: 56ch; font-size: 17px; }
.diag-promo-icon {
  width: 110px; height: 110px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.diag-promo-icon svg { width: 52px; height: 52px; stroke: currentColor; fill: none; stroke-width: 1.6; }
@media (max-width: 900px) {
  .diag-promo { flex-direction: column; text-align: center; padding: 32px 26px; }
  .diag-promo .cta-row { justify-content: center; }
}

/* ---------- Footer ---------- */
footer.site-footer { background: var(--ink); color: var(--paper); padding-block: 56px 28px; }
footer.site-footer a { text-decoration: none; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; }
.footer-grid h4 { font-family: "IBM Plex Mono", monospace; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: color-mix(in srgb, var(--paper) 55%, transparent); margin-bottom: 14px; }
.footer-grid p, .footer-grid li { font-size: 14.5px; color: color-mix(in srgb, var(--paper) 82%, transparent); }
.footer-grid li + li { margin-top: 10px; }
.footer-grid a:hover { color: var(--accent); }
.social-row { display: flex; gap: 12px; margin-top: 16px; }
.social-row a {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--paper) 25%, transparent);
  display: flex; align-items: center; justify-content: center;
}
.social-row svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.footer-bottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid color-mix(in srgb, var(--paper) 15%, transparent); font-size: 13px; color: color-mix(in srgb, var(--paper) 55%, transparent); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-figure { order: -1; max-width: 420px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats .wrap { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1080px) {
  .nav-links { position: fixed; inset: 64px 16px auto 16px; background: var(--paper-raised); border: 1px solid var(--line);
    border-radius: 14px; flex-direction: column; align-items: flex-start; padding: 18px; gap: 16px;
    box-shadow: 0 20px 40px -20px rgba(0,0,0,0.35); display: none; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: transparent; }
  .nav-toggle svg { width: 20px; height: 20px; stroke: var(--ink); fill: none; stroke-width: 1.8; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats .wrap { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; }
}

/* ---------- Scroll dynamics ---------- */
.site-nav { transition: box-shadow 0.25s ease, background 0.25s ease; }
.site-nav.scrolled {
  background: color-mix(in srgb, var(--paper) 97%, transparent);
  box-shadow: 0 10px 26px -20px rgba(20,24,31,0.5);
}

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s cubic-bezier(.2,.65,.3,1), transform 0.6s cubic-bezier(.2,.65,.3,1); }
.reveal.in-view { opacity: 1; transform: none; }
.grid > .reveal:nth-child(1), .stats .wrap > .reveal:nth-child(1) { transition-delay: 0s; }
.grid > .reveal:nth-child(2), .stats .wrap > .reveal:nth-child(2) { transition-delay: 0.08s; }
.grid > .reveal:nth-child(3), .stats .wrap > .reveal:nth-child(3) { transition-delay: 0.16s; }
.grid > .reveal:nth-child(4), .stats .wrap > .reveal:nth-child(4) { transition-delay: 0.24s; }
.grid > .reveal:nth-child(5) { transition-delay: 0.3s; }
.grid > .reveal:nth-child(6) { transition-delay: 0.36s; }
.grid > .reveal:nth-child(n+7) { transition-delay: 0.42s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Floating actions ---------- */
.wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 50;
  width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  box-shadow: 0 14px 30px -10px rgba(20,24,31,0.5);
  transform: scale(0); transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s ease;
}
.wa-float svg { width: 27px; height: 27px; fill: currentColor; }
.wa-float.show { transform: scale(1); }
.wa-float:hover { box-shadow: 0 18px 36px -8px rgba(20,24,31,0.6); }

.to-top {
  position: fixed; right: 22px; bottom: 90px; z-index: 50;
  width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center; border: none; cursor: pointer;
  box-shadow: 0 12px 26px -12px rgba(20,24,31,0.5);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top svg { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) {
  .wa-float, .to-top { transition: opacity 0.2s ease; }
}

@media (max-width: 620px) {
  .wa-float { right: 16px; bottom: 16px; width: 52px; height: 52px; }
  .to-top { right: 16px; bottom: 78px; width: 40px; height: 40px; }
}
