/* ============================================
   Cami Compagnoni — Site Institucional
   Paleta, tipografia e sistema base
   ============================================ */

:root {
  /* Paleta principal */
  --creme: #F5EFE6;
  --bege: #E8DCC8;
  --vinho: #5C1A2E;
  --vinho-hover: #741f39;
  --preto: #1A1A1A;
  --canela: #A0562E;
  --canela-soft: #c4794f;

  /* Cinzas derivados quentes */
  --creme-dark: #ebe4d6;
  --bege-dark: #d9c9ae;
  --preto-soft: #2a2422;
  --creme-border: rgba(26, 26, 26, 0.12);

  /* Tipografia */
  --serif: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Escala */
  --container: 1240px;
  --narrow: 720px;

  /* Variação de direção (set via Tweaks) */
  --direction: 'classic';
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--sans);
  background: var(--creme);
  color: var(--preto);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'kern', 'liga';
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* Tipografia base */
h1, h2, h3, h4 { font-family: var(--serif); color: var(--vinho); font-weight: 500; line-height: 1.08; letter-spacing: -0.01em; }
h1 { font-size: clamp(48px, 7vw, 96px); }
h2 { font-size: clamp(36px, 4.5vw, 64px); }
h3 { font-size: clamp(24px, 2.4vw, 36px); }
p { color: var(--preto); font-size: 17px; line-height: 1.65; }
a { color: inherit; text-decoration: none; }

.serif { font-family: var(--serif); }
.sans { font-family: var(--sans); }
.italic { font-style: italic; }
.vinho { color: var(--vinho); }
.canela { color: var(--canela); }
.preto { color: var(--preto); }
.creme-bg { background: var(--creme); }
.bege-bg { background: var(--bege); }
.vinho-bg { background: var(--vinho); color: var(--creme); }
.vinho-bg h1, .vinho-bg h2, .vinho-bg h3 { color: var(--creme); }

.label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--canela);
  font-weight: 500;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--canela);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 32px; }
.narrow { max-width: var(--narrow); margin: 0 auto; padding: 0 32px; }
@media (max-width: 700px) {
  .container, .narrow { padding: 0 20px; max-width: 100vw; overflow-x: clip; }
  h1 { font-size: clamp(36px, 10vw, 56px); }
  h2 { font-size: clamp(28px, 7vw, 44px); }
  h3 { font-size: clamp(22px, 5vw, 28px); }
  p { font-size: 16px; }
  .pullquote { font-size: clamp(22px, 6vw, 30px); margin: 32px 0; padding: 14px 0; }
  .divider { margin: 32px 0; }
}

/* ============================================
   Nav
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--creme);
  border-bottom: 1px solid var(--creme-border);
  backdrop-filter: blur(8px);
  background: rgba(245, 239, 230, 0.92);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
@media (max-width: 700px) {
  .nav-inner { padding: 16px 20px; }
  .nav-logo { font-size: 18px; }
}
.nav-logo {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--vinho);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.nav-logo .last { font-style: italic; }
.nav-links {
  display: flex;
  gap: 36px;
  align-items: center;
}
.nav-link {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--preto);
  position: relative;
  padding: 6px 0;
  cursor: pointer;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--vinho); }
.nav-link.active { color: var(--vinho); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--canela);
}
.nav-cta {
  padding: 10px 20px;
  background: var(--vinho);
  color: var(--creme);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.06em;
  transition: background 0.2s;
  cursor: pointer;
  border: none;
  font-family: var(--sans);
}
.nav-cta:hover { background: var(--vinho-hover); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle svg { width: 22px; height: 22px; color: var(--vinho); }

@media (max-width: 900px) {
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--creme); flex-direction: column; gap: 0; padding: 16px; border-bottom: 1px solid var(--creme-border); }
  .nav-links.open { display: flex; }
  .nav-link { padding: 16px 8px; border-bottom: 1px solid var(--creme-border); }
  .nav-link:last-of-type { border-bottom: none; }
  .nav-toggle { display: block; }
  .nav-cta { display: none; }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  transition: all 0.25s;
  text-decoration: none;
}
.btn-primary { background: var(--vinho); color: var(--creme); }
.btn-primary:hover { background: var(--vinho-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--vinho); border: 1px solid var(--vinho); }
.btn-ghost:hover { background: var(--vinho); color: var(--creme); }
.btn-canela { background: transparent; color: var(--canela); border: 1px solid var(--canela); }
.btn-canela:hover { background: var(--canela); color: var(--creme); }


/* ============================================
   Placeholder images
   ============================================ */
.photo-ph {
  background:
    repeating-linear-gradient(135deg,
      var(--bege) 0px,
      var(--bege) 12px,
      var(--bege-dark) 12px,
      var(--bege-dark) 13px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--canela);
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.photo-ph::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(160,86,46,0.05), rgba(92,26,46,0.08));
}
.photo-ph > span {
  position: relative;
  z-index: 1;
  background: var(--creme);
  padding: 6px 12px;
  border: 1px solid var(--canela);
  color: var(--canela);
}

/* ============================================
   Sections
   ============================================ */
section { padding: 100px 0; }
@media (max-width: 700px) { section { padding: 64px 0; } }

/* Dividers */
.divider {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--canela);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin: 48px 0;
}

/* Ornament */
.ornament {
  font-family: var(--serif);
  font-style: italic;
  color: var(--canela);
  font-size: 24px;
  text-align: center;
  margin: 24px 0;
}

/* Pull quote */
.pullquote {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 44px);
  font-style: italic;
  color: var(--vinho);
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
  padding: 20px 0;
  border-top: 1px solid var(--canela);
  border-bottom: 1px solid var(--canela);
  margin: 48px 0;
}

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeUp 0.7s ease-out both; }
.fade-in-1 { animation-delay: 0.05s; }
.fade-in-2 { animation-delay: 0.15s; }
.fade-in-3 { animation-delay: 0.25s; }
.fade-in-4 { animation-delay: 0.35s; }

/* Page transition */
.page { animation: pageIn 0.45s ease-out; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   DIRECTION VARIANTS
   Três direções estéticas, todas fiéis ao manual
   ============================================ */

/* Direction: classic (livro elegante, editorial clássico) */
[data-direction="classic"] h1 { font-weight: 500; }
[data-direction="classic"] .hero-artwork { aspect-ratio: 3/4; }

/* Direction: bold (capa de livro forte, tipografia gigante) */
[data-direction="bold"] h1 { font-size: clamp(64px, 11vw, 160px); font-weight: 700; letter-spacing: -0.03em; line-height: 0.92; }
[data-direction="bold"] h2 { font-size: clamp(42px, 6vw, 80px); font-weight: 600; }
[data-direction="bold"] .hero-artwork { aspect-ratio: 4/5; }
[data-direction="bold"] .nav-logo { font-size: 20px; font-weight: 600; }

/* Direction: diary (mais íntimo, mais respiro, tipografia itálica) */
[data-direction="diary"] h1 { font-style: italic; font-weight: 400; }
[data-direction="diary"] h2 { font-style: italic; font-weight: 400; }
[data-direction="diary"] .hero-artwork { aspect-ratio: 1/1; }
[data-direction="diary"] section { padding: 140px 0; }
[data-direction="diary"] .container { max-width: 1100px; }

/* Tweaks panel */
.tweaks-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--creme);
  border: 1px solid var(--vinho);
  border-radius: 12px;
  padding: 20px;
  width: 280px;
  max-width: calc(100vw - 32px);
  z-index: 200;
  box-shadow: 0 8px 40px rgba(92,26,46,0.15);
  font-family: var(--sans);
  display: none;
}
@media (max-width: 500px) {
  .tweaks-panel { bottom: 12px; right: 12px; left: 12px; width: auto; padding: 16px; }
}
.tweaks-panel.visible { display: block; animation: fadeUp 0.3s ease-out; }
.tweaks-panel h4 {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--vinho);
  margin-bottom: 4px;
}
.tweaks-panel .tp-sub {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--canela);
  margin-bottom: 16px;
}
.tweaks-group { margin-bottom: 16px; }
.tweaks-group label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--preto);
  margin-bottom: 8px;
  opacity: 0.7;
}
.tweaks-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.tweaks-option {
  padding: 10px 6px;
  background: transparent;
  border: 1px solid var(--creme-border);
  border-radius: 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--preto);
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.15s;
}
.tweaks-option:hover { border-color: var(--canela); }
.tweaks-option.active { background: var(--vinho); color: var(--creme); border-color: var(--vinho); }

.tweaks-swatch {
  width: 100%;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.tweaks-swatch.active { border-color: var(--preto); }

/* Footer */
.footer {
  background: var(--vinho);
  color: var(--creme);
  padding: 80px 0 32px;
}
@media (max-width: 700px) {
  .footer { padding: 48px 0 24px; }
  .footer-grid { gap: 32px; padding-bottom: 32px; }
}
.footer h3 { color: var(--creme); font-style: italic; }
.footer a { color: var(--creme); opacity: 0.8; transition: opacity 0.2s; cursor: pointer; }
.footer a:hover { opacity: 1; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(245, 239, 230, 0.2);
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 440px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; padding-bottom: 32px; }
  .footer-col h4 { margin-bottom: 12px; }
}
.footer-col h4 {
  color: var(--canela-soft);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 20px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; font-size: 14px; }
.footer-bottom {
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.7;
  letter-spacing: 0.04em;
}
@media (max-width: 700px) { .footer-bottom { flex-direction: column; gap: 12px; } }

/* ============================================
   MOBILE SYSTEM OVERRIDES
   Passada de polimento para mobile (≤ 700px)
   ============================================ */
@media (max-width: 700px) {
  /* Stats row: stack or wrap, no horizontal overflow */
  .stat-row { gap: 20px !important; padding-top: 24px !important; margin-top: 40px !important; flex-wrap: wrap !important; }
  .stat-row > div { flex: 1 1 calc(33.333% - 20px); min-width: 0; }

  /* Hero cover tilt creates overflow — flatten on mobile */
  .hero-cover { transform: none !important; max-width: 360px; margin: 0 auto; }
  .hero-badge-circle { width: 70px !important; height: 70px !important; font-size: 11px !important; top: -12px !important; right: 8px !important; }

  /* Doors cards — less padding, no forced min-height */
  .door-card { min-height: auto !important; padding: 32px 24px !important; }
  .door-card h3 { font-size: 30px !important; }

  /* Manifesto & newsletter — less vertical padding */
  .section-tall { padding: 72px 0 !important; }

  /* Posts grid: remove the gap-as-line effect — looks off in 1col */
  .posts-grid { background: transparent !important; gap: 16px !important; }
  .posts-grid article { min-height: auto !important; padding: 28px 24px !important; border: 1px solid var(--creme-border); }
  .posts-grid article h3 { font-size: 22px !important; }

  /* Archetype teaser rows */
  .arc-row { grid-template-columns: 60px 1fr auto !important; padding: 20px 22px !important; gap: 16px !important; }
  .arc-row .arc-num { font-size: 32px !important; }
  .arc-row .arc-name { font-size: 19px !important; }

  /* Section headers with CTA — stack */
  .section-head { flex-direction: column !important; align-items: flex-start !important; gap: 16px !important; }
  .section-head .btn { width: 100%; justify-content: center; }

  /* Hero CTAs: full width, stack */
  .hero-ctas { flex-direction: column !important; align-items: stretch !important; }
  .hero-ctas .btn { justify-content: center; width: 100%; }

  /* Cards/inputs with generous padding */
  .form-pill { border-radius: 28px !important; padding: 6px !important; }
  .form-pill input { font-size: 14px !important; }

  /* Big quote marks smaller */
  .big-quote { font-size: 28px !important; margin-bottom: 12px !important; }

  /* Generic section padding */
  section { padding: 56px 0 !important; }

  /* Eyebrow cleanup */
  .eyebrow { font-size: 10px !important; letter-spacing: 0.22em !important; }

  /* Nav: show CTA in mobile menu */
  .nav-links.open .nav-cta { display: inline-flex !important; margin-top: 12px; width: 100%; justify-content: center; }
}

/* Prevent horizontal overflow globally from transforms */
main { overflow-x: hidden; }

/* ============================================
   MOBILE — SITE-WIDE OVERRIDES (pass 2)
   Cobre Sobre, Arquétipo, Diário, Contato
   ============================================ */
@media (max-width: 700px) {
  /* Sobre — hero tilt flatten */
  .sobre-hero-grid > div:last-child { transform: none !important; padding: 12px !important; }

  /* Sobre — credenciais: stackar cedo para caber em telas pequenas */
  .cred-grid { grid-template-columns: 1fr 1fr !important; }
  .cred-grid > div { padding: 20px 10px !important; min-width: 0; overflow: hidden; }
  .cred-grid > div > div:first-child { font-size: 32px !important; }
  .cred-grid > div > div:last-child { font-size: 10px !important; letter-spacing: 0.1em !important; word-break: break-word; }

  /* Sobre — roles grid: padding menor, min-height menor */
  .roles-grid > div { padding: 28px 22px !important; min-height: auto !important; }
  .roles-grid h3 { font-size: 26px !important; }

  /* Sobre — timeline: reduzir offset do indicador */
  section .narrow > div[style*="paddingLeft: 48"],
  section .narrow > div[style*="padding-left: 48"] { padding-left: 36px !important; }

  /* Arquétipo — landing grid carta prévia */
  .qlanding-grid > div:last-child > div { padding: 28px 22px !important; }
  .qlanding-grid > div:last-child > div > div:nth-child(2) { font-size: 18px !important; }

  /* Arquétipo — steps numbers menores */
  .steps-grid > div > div:first-child { font-size: 40px !important; }

  /* Arquétipo — arcs grid cards */
  .arcs-grid > div { padding: 24px 22px !important; min-height: auto !important; }
  .arcs-grid h3 { font-size: 24px !important; }

  /* Arquétipo — quiz options */
  section .narrow > div button[class*="fade-in"] {
    padding: 18px 20px !important;
    font-size: 15px !important;
  }

  /* Arquétipo — result sidebar não sticky em mobile */
  .qresult-grid > div:last-child { position: static !important; top: auto !important; padding: 28px 22px !important; }

  /* Arquétipo — checkout summary */
  .checkout-grid > div:last-child { padding: 24px 20px !important; }

  /* Diário — post cards padding */
  .diary-grid > article { padding: 24px 22px !important; min-height: auto !important; }
  .diary-grid > article h3 { font-size: 22px !important; }
  .diary-grid { gap: 12px !important; background: transparent !important; }
  .diary-grid > article { border: 1px solid var(--creme-border); }

  /* Diário — featured: destacado maior em mobile */
  .featured-grid > div:first-child { padding: 12px !important; }

  /* Diário — post reader: fonte body */
  section .narrow > div[style*="fontSize: 18"] p,
  section .narrow p[style*="fontSize: 18"] { font-size: 17px !important; line-height: 1.7 !important; }

  /* Contato — tabs stack */
  .tabs-grid > button { padding: 20px 18px !important; }
  .tabs-grid > button > div:first-child { font-size: 19px !important; }

  /* Contato — sidebar cards */
  .contact-grid > aside > div { padding: 24px 22px !important; }

  /* Inputs maiores pra toque */
  input[type="text"], input[type="email"], textarea {
    font-size: 16px !important; /* evita zoom no iOS */
  }

  /* Botões grandes em formulários full width */
  form .btn { width: 100% !important; justify-content: center !important; }
}

/* Telas muito pequenas: stackar credenciais em 1 coluna */
@media (max-width: 460px) {
  .cred-grid { grid-template-columns: 1fr !important; }
  .cred-grid > div { border-right: none !important; border-bottom: 1px solid var(--creme-border) !important; }
  .cred-grid > div:last-child { border-bottom: none !important; }
}

/* ============================================
   CÓDIGO INTERNO — grids responsivos
   ============================================ */
.ci-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.ci-cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ci-passos-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ci-sobre-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 56px; align-items: center; }

@media (max-width: 900px) {
  .ci-grid-2 { grid-template-columns: 1fr; gap: 32px; }
  .ci-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .ci-passos-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .ci-sobre-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 600px) {
  .ci-cards-grid, .ci-passos-grid { grid-template-columns: 1fr; }
  .ci-sobre-grid > div:first-child { max-height: 320px; }
}

/* ============================================
   DESAFIO DO CASAL — grids responsivos
   ============================================ */
.desafio-fase-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 40px;
  align-items: start;
  padding: 40px 0;
  border-top: 1px solid var(--creme-border);
}
.desafio-para-quem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

@media (max-width: 800px) {
  .desafio-para-quem-grid { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 600px) {
  .desafio-fase-row { grid-template-columns: 1fr; gap: 12px; padding: 32px 0; }
}
