/* =====================================================================
   Design system do Cadu — tokens, tipografia e base compartilhados.
   Carregado por todas as páginas (site React e /calculadoras/).
   Fonte única de cores, fontes, botões, cabeçalho e rótulos.

   Paleta da marca (prancha do Instagram):
     #5B8DEF azul   · confiança        #34C38F verde · clareza
     #FFC857 amarelo · energia/destaque #FF8B88 coral · acolhimento
     #3D3D3D texto  · #F6EFE6 fundo
   Os tons "-ink", "-tint" e "-soft" são derivados da paleta para texto
   (contraste AA) e fundos suaves. Nunca use o azul puro para texto pequeno.
   ===================================================================== */

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('/fonts/nunito-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Caveat Brush';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/caveat-brush-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* superfícies */
  --paper: #F6EFE6;
  --paper-2: #FCF8F2;
  --paper-3: #EDE3D3;
  --white: #FFFFFF;

  /* texto */
  --ink: #3D3D3D;
  --ink-strong: #2A2A2A;
  --muted: #5E5A55;
  --line: rgba(61, 61, 61, 0.14);
  --line-strong: rgba(61, 61, 61, 0.3);

  /* azul · confiança */
  --blue: #5B8DEF;
  --blue-ink: #2F63D0;
  --blue-deep: #1F4AA8;
  --blue-tint: #E5EDFD;
  --blue-soft: #CFDDFA;
  --blue-line: rgba(47, 99, 208, 0.24);

  /* verde · clareza */
  --green: #34C38F;
  --green-ink: #17775A;
  --green-tint: #DDF3E9;
  --green-soft: #BDE8D6;
  --green-line: rgba(23, 119, 90, 0.26);

  /* amarelo · energia */
  --yellow: #FFC857;
  --yellow-ink: #7A5600;
  --yellow-tint: #FFEFC8;
  --yellow-soft: #FFE08F;
  --yellow-line: rgba(122, 86, 0, 0.26);

  /* coral · acolhimento */
  --coral: #FF8B88;
  --coral-ink: #B03733;
  --coral-tint: #FFE5E2;
  --coral-soft: #FFC9C6;
  --coral-line: rgba(176, 55, 51, 0.26);

  /* azul-noite: cartões de apoio clínico */
  --navy: #25325A;
  --navy-deep: #1C2744;
  --on-navy: #F6EFE6;
  --on-navy-muted: #C9D3EE;

  /* tipografia */
  --font-body: 'Nunito', ui-rounded, 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-hand: 'Caveat Brush', 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive;

  /* forma */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;
  --r-btn: 12px;
  --r-hand: 255px 14px 225px 14px / 14px 225px 14px 255px;

  /* profundidade (sombras quentes, nunca cinza puro) */
  --shadow-sm: 0 1px 2px rgba(61, 48, 30, 0.06), 0 6px 16px -8px rgba(61, 48, 30, 0.18);
  --shadow-md: 0 2px 4px rgba(61, 48, 30, 0.05), 0 16px 34px -16px rgba(61, 48, 30, 0.28);
  --shadow-lg: 0 4px 10px rgba(61, 48, 30, 0.07), 0 32px 64px -28px rgba(37, 50, 90, 0.5);

  --ease: cubic-bezier(0.22, 0.8, 0.3, 1);
  --page: 1120px;
  --gutter: clamp(18px, 4vw, 32px);

  /* ícone de seta reutilizável (usado com mask) */
  --arrow-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14M13 6l6 6-6 6'/></svg>");
  --check-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7.5'/></svg>");
}

/* ---------- reset enxuto ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

button, a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#root {
  min-height: 100vh;
}

h1, h2, h3, h4 {
  color: var(--ink-strong);
  font-weight: 800;
  letter-spacing: -0.022em;
  line-height: 1.12;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--blue-ink);
  color: #fff;
}

:focus-visible {
  outline: 3px solid var(--blue-ink);
  outline-offset: 3px;
  border-radius: 6px;
}

/* textura de papel, sutil: o desenho à mão pede um fundo com "tato" */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .24  0 0 0 0 .19  0 0 0 0 .12  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

/* ---------- utilidades ---------- */
.page-width {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

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

/* paletas por "tom": definem as variáveis que cartões e rótulos herdam */
.tone-blue   { --tone: var(--blue-tint);   --tone-soft: var(--blue-soft);   --tone-ink: var(--blue-ink);   --tone-line: var(--blue-line);   --tone-solid: var(--blue); }
.tone-green  { --tone: var(--green-tint);  --tone-soft: var(--green-soft);  --tone-ink: var(--green-ink);  --tone-line: var(--green-line);  --tone-solid: var(--green); }
.tone-yellow { --tone: var(--yellow-tint); --tone-soft: var(--yellow-soft); --tone-ink: var(--yellow-ink); --tone-line: var(--yellow-line); --tone-solid: var(--yellow); }
.tone-coral  { --tone: var(--coral-tint);  --tone-soft: var(--coral-soft);  --tone-ink: var(--coral-ink);  --tone-line: var(--coral-line);  --tone-solid: var(--coral); }

/* rótulo "marca-texto": a etiqueta manuscrita sobre pincelada */
.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 2px 14px 4px;
  border-radius: 8px;
  background: var(--tone, var(--blue-tint));
  color: var(--ink-strong);
  font-family: var(--font-hand);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

/* ---------- botões ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: var(--r-btn);
  background: var(--blue-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 10px 22px -10px rgba(47, 99, 208, 0.8);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), background 0.2s;
}

.button:hover {
  background: var(--blue-deep);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 16px 28px -12px rgba(31, 74, 168, 0.85);
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0);
}

.button-light {
  background: var(--yellow);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 12px 24px -10px rgba(255, 200, 87, 0.75);
  color: var(--ink-strong);
}

.button-light:hover {
  background: #FFD672;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 18px 30px -12px rgba(255, 200, 87, 0.9);
}

.button-quiet {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--blue-ink);
  color: var(--blue-ink);
}

.button-quiet:hover {
  background: var(--blue-tint);
  box-shadow: inset 0 0 0 2px var(--blue-ink);
}

/* seta desenhada por máscara: herda a cor do texto, sem depender de fonte */
.arrow::after {
  content: "";
  display: inline-block;
  flex: none;
  width: 1.05em;
  height: 1.05em;
  background: currentColor;
  -webkit-mask: var(--arrow-mask) center / contain no-repeat;
  mask: var(--arrow-mask) center / contain no-repeat;
  transition: transform 0.22s var(--ease);
}

a:hover > .arrow::after,
a.arrow:hover::after,
.arrow:hover::after {
  transform: translateX(4px);
}

/* ---------- "arco": janela onde o Cadu aparece ----------
   As ilustrações têm o papel normalizado para branco e usam multiply:
   sobre o fundo claro do arco, o jaleco continua branco e o traço fica nítido. */
.arch {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 999px 999px var(--r-md) var(--r-md);
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1.5px var(--tone-line, var(--line));
}

.arch > img {
  position: absolute;
  inset: 6% 0 0 0;
  width: 100%;
  height: 94%;
  object-fit: contain;
  object-position: 50% 100%;
  mix-blend-mode: multiply;
}

.arch-flush {
  border-radius: 999px 999px 0 0;
}

/* ---------- cabeçalho ---------- */
.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(252, 248, 242, 0.9);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink-strong);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark-face {
  position: relative;
  display: inline-block;
  flex: none;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--blue-soft);
  box-shadow: 0 0 0 2px var(--blue), 0 4px 10px -4px rgba(47, 99, 208, 0.55);
}

.wordmark-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0%;
  mix-blend-mode: multiply;
}

.wordmark-text {
  font-family: var(--font-hand);
  font-size: 1.85rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.4vw, 30px);
}

.header-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

/* sublinhado de marca-texto que cresce no hover */
.header-nav a:not(.header-cta) {
  background: linear-gradient(var(--yellow), var(--yellow)) 0 78% / 0 0.5em no-repeat;
  transition: background-size 0.3s var(--ease);
}

.header-nav a:not(.header-cta):hover {
  background-size: 100% 0.5em;
}

.header-nav .header-cta {
  min-height: 44px;
  padding: 0 22px;
  border-radius: var(--r-btn);
  background: var(--blue-ink);
  box-shadow: 0 8px 18px -10px rgba(47, 99, 208, 0.9);
  color: #fff;
  font-weight: 800;
  transition: transform 0.22s var(--ease), background 0.2s;
}

.header-nav .header-cta:hover {
  background: var(--blue-deep);
  transform: translateY(-2px);
}

@media (max-width: 760px) {
  .site-header-inner { min-height: 64px; }
  .header-nav { gap: 12px; }
  .header-nav a { font-size: 0.86rem; }
  .header-nav .header-cta { padding: 0 16px; font-size: 0.84rem; }
  .wordmark-text { font-size: 1.6rem; }
  .wordmark-face { width: 40px; height: 40px; }
}

@media (max-width: 520px) {
  .header-nav a:not(.header-cta):not(.nav-calc) { display: none; }
}

@media (max-width: 400px) {
  .header-nav .nav-calc { display: none; }
}

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

@media print {
  body::after { display: none; }
}
