/* Pulso Eleitoral — Design Tokens (landing pages)
   Scope: apenas HTMLs institucionais (home.html, produto.html).
   Mantido em sync com frontend/src/styles/tokens.css pela paleta/tipografia. */

:root {
  /* Surfaces — off-white quente */
  --bg-canvas: #f4f1ea;
  --bg-surface: #fbfaf6;
  --bg-elevated: #ffffff;
  --bg-sunken: #ede9df;

  /* Ink — tons frios neutros */
  --ink-900: #1a1d1a;
  --ink-800: #23271f;
  --ink-700: #3d423d;
  --ink-500: #767c73;
  --ink-400: #9ba197;
  --ink-300: #bcc0b5;
  --ink-200: #d4d7c9;
  --ink-100: #e4e6da;

  /* Accent — verde floresta */
  --accent-800: #17402c;
  --accent-700: #1e4e37;
  --accent-600: #2a6245;
  --accent-500: #3a7858;
  --accent-400: #6b9a7f;
  --accent-200: #c9d8cf;
  --accent-100: #e7ede8;
  --accent-050: #f1f5f1;

  /* Semantic — uso restrito editorial */
  --sem-confirmed: #2e6b46;
  --sem-probable: #2d5683;
  --sem-undecided: #b26a1a;
  --sem-against: #99362c;

  /* Border */
  --border-subtle: #e2e1d4;
  --border-default: #dcdecf;
  --border-strong: #c6c9b8;

  /* Type scale */
  --fs-xs: 11px;
  --fs-sm: 12.5px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;
  --fs-4xl: 40px;
  --fs-5xl: 56px;
  --fs-6xl: 72px;

  /* Radius */
  --r-xs: 3px;
  --r-sm: 5px;
  --r-md: 7px;
  --r-lg: 10px;

  /* Shadow — papel */
  --shadow-paper: 0 1px 2px rgba(26, 29, 26, 0.05);
  --shadow-paper-lg: 0 2px 6px rgba(26, 29, 26, 0.06), 0 1px 2px rgba(26, 29, 26, 0.04);

  /* Families */
  --font-sans: "Inter Tight", "Inter", system-ui, -apple-system, sans-serif;
  --font-serif: "Newsreader", "IBM Plex Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;

  /* Layout */
  --maxw: 1240px;
  --gutter: 24px;
  --density: 1;
}

[data-theme="dark"] {
  --bg-canvas: #12140f;
  --bg-surface: #181b15;
  --bg-elevated: #1f231c;
  --bg-sunken: #0d0f0b;

  --ink-900: #f1efe6;
  --ink-800: #e5e3d9;
  --ink-700: #cfcdc2;
  --ink-500: #9ba197;
  --ink-400: #7a8076;
  --ink-300: #555a52;
  --ink-200: #3b403a;
  --ink-100: #2a2e28;

  --accent-800: #a8c6b3;
  --accent-700: #8bb89c;
  --accent-600: #6ea785;
  --accent-500: #5a9372;
  --accent-400: #487a5c;
  --accent-200: #2e513e;
  --accent-100: #1c3125;
  --accent-050: #152520;

  --border-subtle: #282c25;
  --border-default: #343931;
  --border-strong: #4a4f45;

  --shadow-paper: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-paper-lg: 0 2px 8px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Base reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--ink-700);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  transition: background-color 0.2s ease, color 0.2s ease;
}
h1, h2, h3, h4, h5, h6 {
  color: var(--ink-900);
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.01em;
}
p { margin: 0; text-wrap: pretty; }
a {
  color: var(--accent-700);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-600); text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

button { font-family: inherit; }

/* Utilities */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.container-narrow {
  max-width: 860px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-700);
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: "ss01", "zero", "tnum";
}

.serif { font-family: var(--font-serif); }

.divider {
  height: 1px;
  background: var(--border-subtle);
  border: 0;
  margin: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: calc(11px * var(--density)) calc(18px * var(--density));
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(0.5px); }
.btn-primary {
  background: var(--accent-700);
  color: #f4f1ea;
  border-color: var(--accent-700);
}
.btn-primary:hover {
  background: var(--accent-600);
  border-color: var(--accent-600);
  color: #fbfaf6;
  text-decoration: none;
}
.btn-secondary {
  background: transparent;
  color: var(--ink-900);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--ink-500);
  color: var(--ink-900);
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--accent-700);
  border-color: transparent;
  padding-inline: 6px;
}
.btn-ghost:hover { color: var(--accent-600); text-decoration: underline; }

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-paper);
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent-500);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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