/* ==========================================================================
   Montra Viva — base
   Reset, tokens, tipografia, botões, foco, formulários e movimento.
   ========================================================================== */

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

:root {
  --cream: #f7f2e9;
  --cream-deep: #eee5d5;
  --paper: #fcfaf4;
  --white: #fffdf9;
  --ink: #15120e;
  --ink-2: #3a342c;
  --muted: #625a4e;
  --cobalt: #1f36d8;
  --cobalt-deep: #1426a8;
  --lime: #e8c97a;
  --lime-deep: #d4b263;
  --rust: #a64b2a;
  --sage: #dde5d4;
  --clay: #d9a28a;
  --line: rgba(21, 18, 14, .14);
  --line-strong: rgba(21, 18, 14, .28);
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1280px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --radius: 16px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --focus: #1f36d8;
  --shadow-hard: 4px 4px 0 var(--ink);
  --ease: cubic-bezier(.2, .65, .25, 1);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1rem, .95rem + .18vw, 1.08rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0 0 .45em;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.028em;
  text-wrap: balance;
}

h3, h4 { line-height: 1.08; }

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0; padding: 0; }

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

[hidden] { display: none !important; }

section[id],
div[id] { scroll-margin-top: 96px; }

a {
  color: inherit;
  text-decoration-thickness: 1.5px;
  text-underline-offset: .18em;
}

a:hover { text-decoration-thickness: 2px; }

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

button { cursor: pointer; }

::selection { background: var(--lime); color: var(--ink); }

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

.on-dark :focus-visible,
.theme-dark :focus-visible { outline-color: var(--lime); }

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

.wrap--narrow { width: min(100% - (var(--gutter) * 2), 880px); }

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

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: .6rem 1rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--lime);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: top .18s ease;
}

.skip-link:focus { top: 1rem; }

/* Etiquetas editoriais ---------------------------------------------------- */
.kicker,
.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.kicker { color: var(--muted); }

.eyebrow__dot {
  width: .62rem;
  height: .62rem;
  border-radius: 50%;
  background: var(--cobalt);
  flex: none;
}

.eyebrow__dot--lime { background: var(--lime); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .22rem .55rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .06em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
}

.note {
  font-size: .86rem;
  line-height: 1.55;
  color: var(--muted);
}

.note--on-dark { color: rgba(251, 247, 239, .72); }

/* Botões ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 48px;
  padding: .78em 1.25em;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: .97rem;
  font-weight: 650;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  transition:
    transform .18s var(--ease),
    box-shadow .18s var(--ease),
    background-color .18s ease,
    border-color .18s ease,
    color .18s ease;
}

.btn svg {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  transition: transform .18s var(--ease);
}

.btn:hover { transform: translateY(-2px); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn:active { transform: translateY(0); }

.btn--ink {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.btn--ink:hover { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }

.btn--lime {
  background: var(--lime);
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn--lime:hover { background: var(--lime-deep); box-shadow: 4px 4px 0 var(--ink); }

.btn--cobalt {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #fff;
}

.btn--cobalt:hover { background: var(--cobalt-deep); border-color: var(--cobalt-deep); }

.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--ink); color: var(--cream); }

.btn--light {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.btn--light:hover { background: var(--lime); border-color: var(--lime); }

.btn--lg {
  min-height: 56px;
  padding: 1em 1.45em;
  font-size: 1.04rem;
}

.btn--sm {
  min-height: 40px;
  padding: .55em .95em;
  font-size: .86rem;
}

.btn--block { width: 100%; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1.5px solid currentColor;
  padding-bottom: .1em;
}

.link-arrow svg {
  width: 1em;
  height: 1em;
  transition: transform .18s var(--ease);
}

.link-arrow:hover svg { transform: translate(3px, -3px); }

/* Formulários ------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field { display: grid; gap: .38rem; min-width: 0; }
.field--full { grid-column: 1 / -1; }

.field > label,
.field > .field__label {
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.3;
}

.field :is(input, select, textarea) {
  width: 100%;
  min-height: 48px;
  padding: .72rem .82rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.field textarea { min-height: 118px; resize: vertical; }

.field :is(input, select, textarea):hover { border-color: var(--ink-2); }

.field :is(input, select, textarea):focus {
  border-color: var(--cobalt);
  outline: 3px solid var(--cobalt);
  outline-offset: 2px;
}

.field [aria-invalid="true"] {
  border-color: #b3261e;
  background: #fff5f4;
}

.field__hint,
.field__error {
  font-size: .8rem;
  line-height: 1.45;
}

.field__hint { color: var(--muted); }
.field__error { color: #9d1f18; font-weight: 600; }

.field__error:empty { display: none; }

.check {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .86rem;
  line-height: 1.5;
}

.check input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: .18rem;
  flex: none;
  accent-color: var(--cobalt);
}

.form-note {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  margin-top: .2rem;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--muted);
}

.form-resumo {
  margin: 0 0 .8rem;
  padding: .6rem .75rem;
  border-left: 4px solid #b3261e;
  border-radius: 0 6px 6px 0;
  background: #fff1ef;
  color: #7d1712;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.45;
}

.form-resumo:empty { display: none; }

.form-note svg { width: 1rem; height: 1rem; flex: none; margin-top: .16rem; }

.form-result {
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
}

.form-result h3 {
  margin: 0 0 .35rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.form-result p { font-size: .9rem; }

.form-result pre {
  margin: .8rem 0;
  padding: .8rem;
  max-height: 15rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-family: var(--font-mono);
  font-size: .76rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.form-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.form-result__status {
  margin-top: .55rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--cobalt);
}

.honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 110;
  height: 3px;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--cobalt), var(--lime));
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

[data-tilt] {
  transform: perspective(1200px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform .35s var(--ease);
  will-change: transform;
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9998;
  width: 20px;
  height: 20px;
  border: 1px solid #fff;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width .22s var(--ease), height .22s var(--ease), opacity .22s ease;
}

.cursor-dot.is-visible { opacity: .65; }
.cursor-dot.is-active { width: 46px; height: 46px; background: rgba(255, 255, 255, .12); }

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor-dot { display: none; }
}

/* Revelações ao percorrer ------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity .75s var(--ease),
    transform .75s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .js [data-reveal],
  .js [data-reveal].is-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .btn,
  .btn svg,
  .link-arrow svg {
    transition: none !important;
  }

  .btn:hover,
  .btn:hover svg,
  .link-arrow:hover svg {
    transform: none !important;
  }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Diálogos ---------------------------------------------------------------- */
dialog {
  width: min(100% - 2rem, 660px);
  max-width: 660px;
  max-height: min(88dvh, 780px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(23, 20, 15, .6);
  backdrop-filter: blur(4px);
}

.dialog__panel {
  position: relative;
  max-height: min(88dvh, 780px);
  overflow: auto;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 10px 10px 0 rgba(23, 20, 15, .92);
}

.dialog__close {
  position: absolute;
  top: .8rem;
  right: .8rem;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  line-height: 1;
}

.dialog__close:hover { background: var(--lime); }

.dialog__close svg { width: 18px; height: 18px; }

.dialog__panel h2 {
  padding-right: 3rem;
  font-size: clamp(1.6rem, 3.5vw, 2.15rem);
}

/* Utilitários ------------------------------------------------------------- */
.on-dark {
  background: var(--ink);
  color: var(--cream);
}

.on-dark .note { color: rgba(251, 247, 239, .72); }

.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
  .dialog__panel { box-shadow: 6px 6px 0 rgba(23, 20, 15, .92); }
}
