/* ============================================================
   Instituto Débora Rocha · Design System
   Warm editorial: cream paper, ink, brand red, terracotta.
   ============================================================ */

:root {
  --brand: #e0322a;
  --brand-deep: #b71f19;
  --brand-soft: #fde8e3;
  --clay: #c9552f;
  --gold: #d9a13c;
  --sand: #eddfc9;

  --paper: #fbf7f0;
  --paper-2: #f4ede1;
  --card: #ffffff;
  --ink: #171310;
  --ink-soft: #3c342e;
  --mute: #77706a;
  --line: rgba(23, 19, 16, 0.12);
  --line-soft: rgba(23, 19, 16, 0.07);
  --shadow-sm: 0 1px 2px rgba(23, 19, 16, 0.05), 0 8px 24px -18px rgba(23, 19, 16, 0.35);
  --shadow-md: 0 18px 50px -28px rgba(23, 19, 16, 0.45);
  --shadow-lg: 0 40px 90px -50px rgba(23, 19, 16, 0.55);

  --radius: 20px;
  --radius-lg: 32px;
  --header-h: 88px;

  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

html[data-theme="dark"] {
  --paper: #12100e;
  --paper-2: #171412;
  --card: #1c1917;
  --ink: #f6efe6;
  --ink-soft: #ddd3c9;
  --mute: #9c948c;
  --line: rgba(246, 239, 230, 0.14);
  --line-soft: rgba(246, 239, 230, 0.07);
  --brand: #f2453c;
  --brand-deep: #ff6a5f;
  --brand-soft: #2a1512;
  --sand: #3a2c1f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 50px 100px -60px rgba(0, 0, 0, 1);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--brand); color: #fff; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.022em;
  margin: 0;
  font-variation-settings: "SOFT" 0, "WONK" 0;
}

h1 em, h2 em, h3 em {
  font-style: italic;
  font-variation-settings: "SOFT" 30, "WONK" 1;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

/* ---------- layout ---------- */
.wrap {
  width: min(1240px, 100% - 48px);
  margin-inline: auto;
}
.wrap-wide { width: min(1440px, 100% - 40px); margin-inline: auto; }
.wrap-narrow { width: min(820px, 100% - 48px); margin-inline: auto; }

section { position: relative; }
.section { padding: clamp(64px, 8vw, 120px) 0; }
.section--tight { padding: clamp(48px, 5vw, 72px) 0; }
.section--paper2 { background: var(--paper-2); }

/* ---------- eyebrow / labels ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 20px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--brand);
}
.eyebrow--plain::before { display: none; }
.eyebrow .num {
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(24px, 4vw, 72px);
  align-items: end;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.section-head h2 {
  font-size: clamp(34px, 4.4vw, 60px);
}
.section-head .lead {
  color: var(--mute);
  font-size: clamp(16px, 1.35vw, 18.5px);
  max-width: 46ch;
  margin: 0;
}
.section-head--center {
  grid-template-columns: 1fr;
  text-align: center;
  justify-items: center;
}
.section-head--center .eyebrow { justify-content: center; }
.section-head--center .lead { margin-inline: auto; }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: var(--line);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 26px;
  border: 1px solid var(--btn-bd);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: transform 0.35s var(--ease-out), background-color 0.25s var(--ease),
    color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.35s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; stroke-width: 1.8; }
.btn--primary {
  --btn-bg: var(--brand);
  --btn-fg: #fff;
  --btn-bd: var(--brand);
  box-shadow: 0 10px 30px -14px rgba(224, 50, 42, 0.75);
}
.btn--primary:hover {
  --btn-bg: var(--brand-deep);
  --btn-bd: var(--brand-deep);
  box-shadow: 0 18px 40px -16px rgba(224, 50, 42, 0.6);
}
.btn--ink { --btn-bg: var(--ink); --btn-fg: var(--paper); --btn-bd: var(--ink); }
.btn--ghost:hover { --btn-bd: var(--ink); background: var(--ink); color: var(--paper); }
.btn--light { --btn-bg: rgba(255,255,255,.1); --btn-fg: #fff; --btn-bd: rgba(255,255,255,.35); }
.btn--sm { padding: 10px 18px; font-size: 14px; }
.btn--lg { padding: 17px 30px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--wa { --btn-bg: #1faa53; --btn-fg: #fff; --btn-bd: #1faa53; }
.btn--wa:hover { --btn-bg: #178c43; --btn-bd: #178c43; color: #fff; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.3s var(--ease), gap 0.3s var(--ease), color 0.3s var(--ease);
}
.link-arrow:hover { border-color: var(--brand); color: var(--brand); gap: 14px; }

/* skip link */
.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 300;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 16px; }

/* focus */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- top bar ----------
   Sempre escura, nos dois temas: é a faixa de contraste fixo da marca.
   Isso evita texto claro sobre fundo claro quando o tema escuro está ativo. */
.topbar {
  background: #14110f;
  color: rgba(251, 247, 240, 0.76);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  transition: height 0.35s var(--ease), opacity 0.3s var(--ease);
  overflow: hidden;
  height: 40px;
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 40px;
}
.topbar a { display: inline-flex; align-items: center; gap: 7px; transition: color 0.2s; color: rgba(251, 247, 240, 0.76); }
.topbar a:hover { color: #fff; }
.topbar .sep { opacity: 0.3; }
.topbar .push { margin-left: auto; }
.topbar svg { width: 14px; height: 14px; opacity: 0.8; }
.topbar .tag {
  display: inline-flex; align-items: center; gap: 7px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}
.topbar .tag:hover { color: #fff; }
.topbar .tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: #ff5a4d;
  box-shadow: 0 0 0 3px rgba(255, 90, 77, 0.28);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(18px);
  -webkit-backdrop-filter: saturate(1.5) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header.is-stuck {
  border-bottom-color: var(--line-soft);
  box-shadow: 0 12px 30px -28px rgba(0, 0, 0, 0.5);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
  transition: height 0.3s var(--ease);
}
.site-header.is-stuck .header__inner { height: 72px; }

.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand img { height: 46px; width: auto; transition: height 0.3s var(--ease); }
.site-header.is-stuck .brand img { height: 38px; }
.brand .logo-cream { display: none; }
html[data-theme="dark"] .brand .logo-ink { display: none; }
html[data-theme="dark"] .brand .logo-cream { display: block; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav a {
  position: relative;
  padding: 9px 13px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: 999px;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--line-soft); }
.nav a.is-active { color: var(--brand); }
.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 13px; right: 13px; bottom: 3px;
  height: 1.5px;
  background: var(--brand);
  border-radius: 2px;
}
.nav .has-sub { position: relative; }

.header__actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.3s var(--ease-out);
}
.icon-btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .icon-sun { display: none; }
html[data-theme="dark"] .icon-btn .icon-sun { display: block; }
html[data-theme="dark"] .icon-btn .icon-moon { display: none; }

.burger { display: none; }

/* mobile drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--paper);
  transform: translateY(-102%);
  transition: transform 0.55s var(--ease-out);
  display: flex;
  flex-direction: column;
  padding: 20px clamp(18px, 5vw, 28px) calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.drawer.is-open { transform: translateY(0); }
.drawer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-shrink: 0;
}
.drawer__top .brand img { height: 40px; width: auto; }
.drawer__top .logo-cream { display: none; }
html[data-theme="dark"] .drawer__top .logo-ink { display: none; }
html[data-theme="dark"] .drawer__top .logo-cream { display: block; }
.drawer nav { display: flex; flex-direction: column; }
.drawer nav a {
  font-family: var(--font-display);
  font-size: clamp(26px, 7.4vw, 38px);
  line-height: 1.14;
  letter-spacing: -0.02em;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color 0.25s var(--ease), padding-left 0.35s var(--ease-out);
}
.drawer nav a:hover,
.drawer nav a.is-active { color: var(--brand); padding-left: 6px; }
.drawer nav a svg {
  width: 18px; height: 18px;
  opacity: 0.34;
  flex-shrink: 0;
  transition: opacity 0.25s, transform 0.35s var(--ease-out);
}
.drawer nav a:hover svg { opacity: 0.9; transform: translateX(3px); }
.drawer__foot {
  margin-top: auto;
  padding-top: 26px;
  display: grid;
  gap: 10px;
}
.drawer__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 6px;
}
.drawer__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
  flex-shrink: 0;
}
.drawer .btn--ghost:hover { background: transparent; color: var(--brand); --btn-bd: var(--brand); }
.drawer__foot .meta {
  font-size: 13.5px;
  color: var(--mute);
  line-height: 1.6;
  margin-top: 8px;
}
.drawer__foot .meta a { color: var(--ink); font-weight: 600; }

/* ---------- reveal animation ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
[data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  background: #14110f;
  color: #e9e1d7;
  padding: clamp(56px, 7vw, 96px) 0 0;
  overflow: hidden;
}
.site-footer::after {
  content: "";
  position: absolute;
  width: 620px; height: 620px;
  right: -220px; top: -260px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(224, 50, 42, 0.22), transparent 68%);
  pointer-events: none;
}
.site-footer .wrap { position: relative; z-index: 2; }
.footer__top {
  display: grid;
  grid-template-columns: 1.5fr 0.85fr 1.05fr 1.25fr;
  gap: clamp(24px, 4vw, 56px);
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer__brand img {
  display: block;
  height: auto;
  width: clamp(196px, 22vw, 260px);
  max-width: 100%;
  margin-bottom: 22px;
}
.footer__brand p { color: #a89e94; font-size: 14.5px; max-width: 34ch; line-height: 1.6; }
.footer h3 {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8d837a;
  margin: 6px 0 20px;
}
.footer__links { display: grid; gap: 9px; }
.footer__links a { color: #d7cec4; font-size: 15px; width: fit-content; transition: color 0.2s, transform 0.3s var(--ease-out); }
.footer__links a:hover { color: #fff; transform: translateX(3px); }
.footer__contact p { font-size: 14.5px; color: #a89e94; margin-bottom: 14px; line-height: 1.55; }
.footer__contact a { color: #e9e1d7; }
.footer__contact a:hover { color: #fff; }
.newsletter form { display: flex; gap: 8px; margin-top: 4px; }
.newsletter input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 14.5px;
}
.newsletter input::placeholder { color: #8a8078; }
.newsletter input:focus { outline: none; border-color: rgba(255, 255, 255, 0.45); background: rgba(255,255,255,.09); }
.newsletter button {
  display: grid; place-items: center;
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: 12px; border: 0;
  background: var(--brand); color: #fff; cursor: pointer;
  transition: background-color 0.2s, transform 0.3s var(--ease-out);
}
.newsletter button:hover { background: #f2453c; transform: translateY(-2px); }
.newsletter button svg { width: 18px; height: 18px; }
.newsletter .note { font-size: 12.5px; color: #857b72; margin-top: 12px; }
.newsletter .feedback { font-size: 13px; margin-top: 10px; }
.newsletter .feedback.ok { color: #8fd6a4; }
.newsletter .feedback.err { color: #ff9b93; }

.footer__wa-lead {
  font-size: 14.5px;
  line-height: 1.6;
  color: #a89e94;
  margin: 0 0 16px;
  max-width: 32ch;
}
.footer__wa .btn--wa { width: 100%; justify-content: center; }
.footer__wa-note {
  font-size: 12.5px;
  color: #8d837a;
  margin: 12px 0 0;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px 0 calc(26px + env(safe-area-inset-bottom));
  font-size: 13px;
  color: #877d74;
}
.footer__bottom .socials { display: flex; gap: 8px; }
.footer__bottom .socials a {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background-color 0.2s, border-color 0.2s, transform 0.3s var(--ease-out);
}
.footer__bottom .socials a:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255,255,255,.3); transform: translateY(-2px); }
.footer__bottom svg { width: 16px; height: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  .nav a { padding: 9px 10px; font-size: 14px; }
}
@media (max-width: 1000px) {
  .topbar { display: none; }
  :root { --header-h: 74px; }
  .nav { display: none; }
  .burger { display: inline-grid; }
  .brand img { height: 40px; }
  .header__actions { margin-left: auto; }
  .footer__top { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 36px); }
  .section-head { grid-template-columns: 1fr; gap: 16px; }
  .footer__top { grid-template-columns: 1fr; gap: 32px; }
  .footer__wa-lead {
  font-size: 14.5px;
  line-height: 1.6;
  color: #a89e94;
  margin: 0 0 16px;
  max-width: 32ch;
}
.footer__wa .btn--wa { width: 100%; justify-content: center; }
.footer__wa-note {
  font-size: 12.5px;
  color: #8d837a;
  margin: 12px 0 0;
}

.footer__bottom { justify-content: center; text-align: center; }
  .header__inner { gap: 10px; }
  .header__actions .btn { display: none; }
  .header__actions { gap: 6px; }
  .brand img { height: 36px; }
}
