/* =====================================================================
   DESIGN SYSTEM · João Nelson & Anny Gabrielly
   Direção: "old money" — papelaria fina, marinho profundo, marfim de
   linho, ouro envelhecido. Tipografia didone em caixa-alta cruzada por
   caligrafia; microtextos espaçados nos cantos; relevos secos e cera.
   ===================================================================== */
:root {
  color-scheme: light;

  /* ---- Cor: marinho ---- */
  --navy-950: #0a1429;
  --navy-900: #0f1c38;
  --navy-800: #152649;
  --navy-700: #1d335f;
  --navy-600: #2b4677;

  /* ---- Cor: marfim / papel ---- */
  --ivory-50: #fbf8f2;
  --ivory-100: #f4eee3;
  --ivory-200: #ebe2d1;
  --ivory-300: #ddd1ba;

  /* ---- Cor: ouro envelhecido ---- */
  --gold-300: #e6d3a3;
  --gold-400: #cdb07a;
  --gold-500: #b39157;
  --gold-600: #8e6d35;
  --foil-escuro: linear-gradient(105deg, #6a4d1e 0%, #9c7a3b 25%, #caa965 42%, #8f6e33 58%, #b38f50 80%, #6a4d1e 100%);
  --foil: linear-gradient(105deg, #8e6d35 0%, #c9a867 22%, #f1e0b0 38%, #c7a462 52%, #9b7a3e 70%, #d9bf86 88%, #8e6d35 100%);

  /* ---- Papéis semânticos (usados pelas páginas) ---- */
  --paper: var(--ivory-100);
  --paper-2: var(--ivory-200);
  --card: var(--ivory-50);
  --ink: var(--navy-900);
  --ink-soft: #3c4a66;
  --blue: var(--navy-600);
  --blue-deep: var(--navy-800);
  --muted: #7a7566;
  --gold: var(--gold-500);
  --gold-soft: var(--gold-300);
  --wash: var(--ivory-200);
  --sky: var(--ivory-200);
  --line: rgba(15, 28, 56, 0.16);
  --line-gold: rgba(179, 145, 87, 0.55);
  --line-ivory: rgba(244, 238, 227, 0.22);
  --ok: #4d6b4f;
  --erro: #9b3b2f;

  /* ---- Tipografia ---- */
  --display: "Bodoni Moda", "Didot", "Bodoni 72", serif;   /* caixa-alta de alto contraste */
  --serif: "Cormorant Garamond", "Cormorant", Georgia, serif; /* texto e itálicos */
  --script: "Pinyon Script", "Snell Roundhand", cursive;      /* caligrafia sobreposta */
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;        /* microtextos espaçados */

  --t-mega: clamp(3.6rem, 1.4rem + 10vw, 9.5rem);
  --t-hero: clamp(3.2rem, 1.6rem + 7vw, 7rem);
  --t-h2: clamp(2.3rem, 1.5rem + 3.2vw, 4.2rem);
  --t-lead: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
  --t-base: clamp(1rem, 0.95rem + 0.2vw, 1.075rem);
  --t-micro: 0.66rem;
  --track-micro: 0.34em;

  /* ---- Espaço e forma ---- */
  --gutter: clamp(1rem, 0.5rem + 3vw, 3rem);
  --section: clamp(5rem, 3.5rem + 7vw, 10rem);
  --radius: 1px;

  /* ---- Movimento ---- */
  --dur: 300ms;
  --dur-slow: 1100ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* ---- Texturas ---- */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .25 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --linen:
    repeating-linear-gradient(0deg, rgba(120, 100, 70, 0.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(120, 100, 70, 0.03) 0 1px, transparent 1px 4px);
  --fibers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.03 .35' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: var(--grain), var(--linen);
  color: var(--ink);
  font-family: var(--serif);
  font-size: calc(var(--t-base) * 1.08);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--gold-300); color: var(--navy-900); }
:focus-visible { outline: 1px solid var(--gold-500); outline-offset: 4px; }

/* ============ Superfícies ============ */
.papel-marfim { background-color: var(--ivory-100); background-image: var(--grain), var(--linen); color: var(--ink); }
.papel-marinho {
  background-color: var(--navy-900);
  background-image: var(--grain), var(--fibers), radial-gradient(120% 90% at 50% 30%, var(--navy-800), var(--navy-950));
  color: var(--ivory-100);
  --line: var(--line-ivory);
}

/* Moldura em baixo-relevo: dois filetes, o externo em ouro */
.moldura { position: relative; }
.moldura::before, .moldura::after { content: ""; position: absolute; pointer-events: none; }
.moldura::before { inset: clamp(10px, 2vw, 18px); border: 1px solid var(--line-gold); }
.moldura::after { inset: calc(clamp(10px, 2vw, 18px) + 5px); border: 1px solid var(--line); }

/* ============ Tipografia ============ */
.micro, .label {
  font-family: var(--sans); font-size: var(--t-micro); font-weight: 500;
  letter-spacing: var(--track-micro); text-transform: uppercase;
  color: var(--gold-500);
}
.papel-marinho .micro, .papel-marinho .label { color: var(--gold-400); }
.display { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.01em; line-height: 0.9; }
.serif { font-family: var(--serif); font-weight: 400; }
.italic { font-style: italic; }
.script { font-family: var(--script); font-weight: 400; text-transform: none; letter-spacing: 0; }
.foil {
  background: var(--foil-escuro); -webkit-background-clip: text; background-clip: text; color: transparent;
  /* a caligrafia estoura a caixa da letra: folga para o dourado não cortar os floreios */
  padding: 0.18em 0.42em; margin: -0.18em -0.42em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.papel-marinho .foil { background: var(--foil); -webkit-background-clip: text; background-clip: text; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1; letter-spacing: 0; text-wrap: balance; }
h2 { font-size: var(--t-h2); text-transform: uppercase; }
h2 em { font-family: var(--script); font-style: normal; text-transform: none; color: var(--gold-500); font-size: 1.1em; }
.lead { font-family: var(--serif); font-style: italic; font-size: var(--t-lead); line-height: 1.45; color: var(--ink-soft); }
.papel-marinho .lead { color: rgba(244, 238, 227, 0.78); }
.num { font-family: var(--sans); font-weight: 300; font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0.01em; }

/* Cantos editoriais (EST. 2023 · LKS) */
.cantos { position: absolute; inset: clamp(1.1rem, 3vw, 2.2rem) clamp(1.1rem, 4vw, 2.8rem) auto; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; z-index: 2; }
.cantos p { margin: 0; line-height: 1.6; }

/* Ornamento: filete com losango */
.rule { display: flex; align-items: center; gap: 0.9rem; justify-content: center; color: var(--gold-500); }
.rule::before, .rule::after { content: ""; height: 1px; width: min(18vw, 6rem); background: currentColor; opacity: 0.6; }
.rule i { width: 6px; height: 6px; border: 1px solid currentColor; rotate: 45deg; }

/* ============ Botões ============ */
.btn {
  --bg: var(--navy-900); --fg: var(--ivory-100);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.8rem;
  min-height: 3.4rem; padding: 1rem 2.2rem;
  border: 0; border-radius: var(--radius);
  background: var(--bg); color: var(--fg);
  font: 500 0.7rem/1 var(--sans); letter-spacing: 0.3em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; isolation: isolate; overflow: hidden;
  box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 5px var(--line-gold);
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--foil); background-size: 200% 100%;
  transform: scaleX(0); transform-origin: left;
  transition: transform 600ms var(--ease);
}
.btn:hover { color: var(--navy-950); }
.btn:hover::after { transform: scaleX(1); }
.btn:active { transform: scale(0.98); }
.btn--ghost { --bg: transparent; --fg: var(--navy-900); box-shadow: inset 0 0 0 1px var(--navy-900); }
.papel-marinho .btn { --bg: var(--ivory-100); --fg: var(--navy-900); }
.btn[disabled] { opacity: 0.5; cursor: progress; }
.btn .seta { transition: transform var(--dur) var(--ease); }
.btn:hover .seta { transform: translateX(4px); }

/* ============ Formulários ============ */
.campo { display: grid; gap: 0.35rem; }
.campo > span { font-family: var(--sans); font-size: var(--t-micro); letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.campo input, .campo textarea, .campo select {
  width: 100%;
  font: 400 1.25rem/1.4 var(--serif);
  color: var(--ink);
  background: transparent;
  border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0.55rem 0;
  transition: border-color var(--dur) var(--ease);
}
.campo textarea { resize: vertical; min-height: 5.5rem; }
.campo input:focus, .campo textarea:focus { outline: none; border-bottom-color: var(--gold-500); }
.escondido { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.aviso { font-size: 0.95rem; min-height: 1.4em; margin: 0; }
.aviso.erro { color: var(--erro); }
.aviso.ok { color: var(--ok); }

/* ============ Revelação ao rolar ============ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.reveal.visivel { opacity: 1; transform: none; }

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

@media (max-width: 600px) {
  .btn { padding: 1rem 1.2rem; letter-spacing: 0.2em; gap: 0.6rem; min-height: 3.5rem; }
}
