/* ============================================================
   Mestre das Emoções — identidade "Anatomia da Emoção"
   Papel, tinta e sinal: prancha científica, tipografia de
   periódico, anotação de medida. Sem neon, sem clínica.

   Cada programa usa o mesmo sistema com outra paleta:
   .tema-noite = Sono de Bolso ("Prancha noturna": tinta azul
   quase preta, papel ao luar e âmbar como sinal, a luz quente
   que combina com a noite).
   ============================================================ */

:root {
  --paper: #f5f1e8;
  --paper-deep: #ece6d8;
  --ink: #26221b;
  --ink-soft: #6f6759;
  --line: rgba(38, 34, 27, .18);
  --line-strong: rgba(38, 34, 27, .4);
  --signal: #c03d16;        /* vermelhão de anotação — só para sinal/estado */
  --signal-text: #a2320f;   /* variante com contraste AA para texto */
  --on-signal: #fff8ee;
  --grain: rgba(52, 44, 30, .18);
  --serif-display: "Instrument Serif", Georgia, serif;
  --serif-text: "STIX Two Text", Georgia, serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --header-h: 64px;
}

.tema-noite {
  --paper: #0f1420;
  --paper-deep: #161c2b;
  --ink: #ece4d3;
  --ink-soft: #a39d90;
  --line: rgba(236, 228, 211, .13);
  --line-strong: rgba(236, 228, 211, .3);
  --signal: #e3a14f;        /* âmbar: luz quente, pobre em azul */
  --signal-text: #e9ad5f;
  --on-signal: #1a1408;
  --grain: rgba(236, 228, 211, .06);
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-text);
  font-size: 17px;
  line-height: 1.6;
}
[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

.page-grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .3;
  background-image: radial-gradient(var(--grain) .45px, transparent .7px);
  background-size: 5px 5px;
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }

.skip-link {
  position: fixed;
  z-index: 30;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--ink);
  font: 13px var(--mono);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

/* ---------- cabeçalho ---------- */
.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
  padding: 12px 34px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; font: 18px/1 var(--serif-display); letter-spacing: .01em; }
.brand-mark { width: 24px; height: 24px; flex: none; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.brand-mark circle { fill: var(--ink); stroke: none; }
.brand-mark .tip { fill: var(--signal); }

.site-header nav { display: flex; gap: 28px; }
.site-header nav a, .header-cta {
  font: 500 12px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color .2s;
  white-space: nowrap;
}
.site-header nav a:hover, .header-cta:hover { color: var(--signal-text); }
.header-cta { color: var(--ink); border-bottom: 1px solid var(--signal); padding-bottom: 2px; }

/* ---------- vocabulário comum ---------- */
.eyebrow, .section-label, .overline {
  margin: 0;
  font: 500 12px var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.section-label::before { content: "— "; color: var(--signal-text); }

.section { max-width: 1240px; margin: auto; padding: 120px 48px; }
.section + .section { border-top: 1px solid var(--line); }
.section > .section-label + h2 { margin-top: 18px; }

h1, h2, h3 { font-family: var(--serif-display); font-weight: 400; letter-spacing: -.015em; }
h1 { line-height: .98; }
h2 { margin: 0; font-size: clamp(2.6rem, 4.6vw, 4.6rem); line-height: 1; }
h1 em, h2 em { font-style: italic; }
h3 { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: 0; }

.lede { max-width: 480px; margin: 0 0 34px; color: var(--ink-soft); font-size: 18px; line-height: 1.7; }
.copy { color: var(--ink-soft); font-size: 17px; line-height: 1.75; }
.copy p { margin: 0 0 1em; }
.copy p:first-child { color: var(--ink); }

.fig-note {
  margin: 26px 0 0;
  font: italic 14px/1.6 var(--serif-text);
  color: var(--ink-soft);
  max-width: 600px;
}

sup { line-height: 0; }
sup a { color: var(--signal-text); font: 500 .62em var(--mono); letter-spacing: .04em; }

/* ---------- botões e links ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font: 500 13px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s, border-color .25s, color .25s;
}
.button:hover { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.button[disabled] { opacity: .6; cursor: wait; }

.text-link { font: 500 13px var(--mono); letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line-strong); padding-bottom: 3px; transition: border-color .2s, color .2s; }
.text-link:hover { color: var(--signal-text); border-color: var(--signal); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.status-note { margin: 22px 0 0; font: 400 12.5px var(--mono); letter-spacing: .04em; color: var(--ink-soft); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: .94fr 1.06fr;
  gap: 48px;
  align-items: center;
  min-height: 100svh;
  max-width: 1240px;
  margin: auto;
  padding: calc(var(--header-h) + 64px) 48px 80px;
}
.hero h1 { margin: 22px 0 26px; font-size: clamp(3.2rem, 6vw, 6rem); }
.hero h1.h1-long { font-size: clamp(2.5rem, 4.3vw, 4.3rem); line-height: 1.03; }

/* assinatura de produto: símbolo próprio + nome, endossado pelo hub */
.product-lockup { display: flex; align-items: center; gap: 14px; margin: 0 0 20px; font: 32px/1 var(--serif-display); letter-spacing: .005em; }
.sleep-mark { width: 42px; height: 42px; flex: none; fill: none; stroke: var(--ink); stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.sleep-mark circle { fill: var(--signal); stroke: none; }

.mt { margin-top: 18px; }
.copy--wide { max-width: 680px; margin-top: 30px; }

/* ---------- prancha ---------- */
.plate { margin: 0; }
.plate-frame {
  position: relative;
  aspect-ratio: 720 / 780;
  max-width: 600px;
  margin-left: auto;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 25% 100%;
  background-color: color-mix(in srgb, var(--paper) 72%, var(--paper-deep));
}
.plate-frame--wide { aspect-ratio: 720 / 470; max-width: 640px; }

.corner { position: absolute; width: 11px; height: 11px; border-color: var(--ink); border-style: solid; border-width: 0; }
.corner-tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.corner-tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.corner-bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.corner-br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

.plate-meta {
  position: absolute;
  top: 12px;
  font: 500 11px var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.plate-meta-left { left: 14px; }
.plate-meta-right { right: 14px; }

.plate-caption { margin-top: 16px; max-width: 600px; margin-left: auto; }
.plate-frame--wide + .plate-caption { max-width: 640px; }
.fig-label { margin: 0; font: 500 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.fig-legend { margin: 8px 0 0; font: italic 18px/1.5 var(--serif-text); color: var(--ink); }
.fig-legend strong { font-style: normal; font-weight: 600; }
.fig-legend [data-emotion-index] { font: 500 12px var(--mono); font-style: normal; color: var(--signal-text); }
.plate-caption .fig-note { margin-top: 8px; font-size: 13px; }

/* desenho do neurônio (home) */
.dendrite { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--ink); }
.dendrite .branch path { stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.dendrite .twig path { stroke: currentColor; stroke-width: 1.05; stroke-linecap: round; opacity: .85; }
.dendrite .axon path { stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.dendrite .ghost path { stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; }
.dendrite .ghost { opacity: .13; }
.dendrite .spine { opacity: .8; }
.dendrite .soma { fill: currentColor; }
.dendrite .nucleus { fill: var(--paper); opacity: .85; }

/* hipnograma (Sono de Bolso) */
.hypno { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--ink); }
.hypno .grid line { stroke: var(--line); stroke-width: 1; }
.hypno .curve { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.hypno .deep { fill: var(--signal); opacity: .14; }
.hypno text { font: 500 13px var(--mono); fill: var(--ink-soft); letter-spacing: .04em; }
.hypno .note { font: italic 14px var(--serif-text); fill: var(--ink-soft); letter-spacing: 0; }
.hypno .onset { fill: var(--signal); }
.hypno .onset-ring { fill: none; stroke: var(--signal); stroke-width: 1.2; }

@media (prefers-reduced-motion: no-preference) {
  .dendrite .branch path, .dendrite .axon path, .hypno .curve {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: draw 1.6s cubic-bezier(.4, 0, .2, 1) backwards .15s;
  }
  .hypno .curve { animation-duration: 2.4s; }
  .dendrite .axon path { animation-delay: .55s; }
  .dendrite .twig path, .dendrite .spine circle, .dendrite .soma, .dendrite .nucleus, .hypno .onset, .hypno .onset-ring, .hypno .note { animation: fade .8s ease backwards .95s; }
}
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes fade { from { opacity: 0; } }

/* nós-terminais da prancha (home) */
.node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.node[data-n="01"] { --x: 20.8%; --y: 16.7%; }
.node[data-n="02"] { --x: 48.6%; --y: 12.2%; }
.node[data-n="03"] { --x: 79.9%; --y: 19.2%; }
.node[data-n="04"] { --x: 13.2%; --y: 55.1%; }
.node[data-n="05"] { --x: 84.7%; --y: 50%; }
.node[data-n="06"] { --x: 25.7%; --y: 82.7%; }
.node[data-n="07"] { --x: 75%; --y: 79.5%; }
.node span {
  display: block;
  width: 13px;
  height: 13px;
  margin: auto;
  border: 1.6px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  transition: background .2s, transform .2s, box-shadow .2s, border-color .2s;
}
.node::after {
  content: attr(data-n);
  position: absolute;
  top: -2px;
  left: calc(50% + 11px);
  font: 500 10.5px var(--mono);
  letter-spacing: .05em;
  color: var(--ink-soft);
  transition: color .2s;
}
.node:hover span, .node:focus-visible span { transform: scale(1.35); }
.node[aria-pressed="true"] span {
  background: var(--signal);
  border-color: var(--signal);
  transform: scale(1.35);
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--signal);
}
.node[aria-pressed="true"]::after { color: var(--signal-text); }

/* ---------- blocos de duas colunas ---------- */
.split { display: grid; grid-template-columns: .5fr 1.5fr; gap: 40px; }
.split > div > h2 { max-width: 860px; }
.split .copy { max-width: 640px; margin-top: 30px; }

/* ---------- programas (home) ---------- */
.program-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 56px;
  border: 1px solid var(--line-strong);
}
.program-card-copy { padding: 44px; display: flex; flex-direction: column; gap: 18px; }
.program-card-copy h3 { font-size: 40px; }
.program-card-copy p { margin: 0; color: var(--ink-soft); line-height: 1.7; }
.program-card-copy .actions { margin-top: auto; padding-top: 12px; }
.program-card-visual { position: relative; min-height: 300px; border-left: 1px solid var(--line); }
.program-card-visual .hypno { inset: 22px; width: calc(100% - 44px); height: calc(100% - 44px); }
.program-card-visual .hypno text { font-size: 15px; }
.program-card-visual .hypno .note { display: none; }

.programs-note { margin: 22px 0 0; color: var(--ink-soft); font-style: italic; font-size: 15px; }

/* ---------- três passos / princípios ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 56px; }
.steps article { border-top: 1px solid var(--line-strong); padding-top: 16px; }
.steps span { font: 500 12px var(--mono); color: var(--signal-text); }
.steps h3 { margin: 26px 0 10px; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.7; }

/* ---------- lista numerada (sete famílias, cinco pilares) ---------- */
.numbered { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.numbered li {
  display: grid;
  grid-template-columns: 52px 1fr;
  column-gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.numbered span { font: 500 12px var(--mono); color: var(--signal-text); padding-top: 9px; }
.numbered strong { font: 400 28px/1.15 var(--serif-display); }
.numbered p { grid-column: 2; margin: 6px 0 0; color: var(--ink-soft); font-size: 16px; line-height: 1.6; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 96px; }
.two-col .copy { margin-top: 26px; max-width: 460px; }

/* ---------- linha do tempo do ritual (Sono de Bolso) ---------- */
.ritual { list-style: none; margin: 56px 0 0; padding: 0; max-width: 820px; }
.ritual li {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 28px;
  padding: 0 0 38px;
}
.ritual li::before {
  content: "";
  position: absolute;
  left: 117px;
  top: 12px;
  bottom: -12px;
  width: 1px;
  background: var(--line-strong);
}
.ritual li:last-child::before { display: none; }
.ritual time { font: 500 14px var(--mono); letter-spacing: .04em; color: var(--signal-text); padding-top: 4px; text-align: right; padding-right: 14px; }
.ritual li > div { position: relative; padding-left: 26px; }
.ritual li > div::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 9px;
  width: 11px;
  height: 11px;
  border: 1.6px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}
.ritual li:last-child > div::before { background: var(--signal); border-color: var(--signal); box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--signal); }
.ritual h3 { font-size: 28px; }
.ritual p { margin: 6px 0 0; color: var(--ink-soft); font-size: 16px; line-height: 1.65; }

/* ---------- limites e triagem ---------- */
.band { background: color-mix(in srgb, var(--paper) 60%, #000); }
.tema-noite .band { background: #080b12; }
.band-inner { border-top: 0 !important; }
.check-box {
  margin-top: 40px;
  padding: 30px 32px;
  border: 1px solid var(--line-strong);
  max-width: 760px;
}
.check-box h3 { font-size: 24px; }
.check-box ul { margin: 16px 0 0; padding-left: 20px; color: var(--ink-soft); line-height: 1.7; }
.check-box li + li { margin-top: 8px; }

/* ---------- formulário ---------- */
.form { display: grid; gap: 20px; max-width: 560px; margin-top: 36px; }
.field { display: grid; gap: 8px; }
.field label { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.field input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: color-mix(in srgb, var(--paper) 80%, var(--paper-deep));
  color: var(--ink);
  font: 17px var(--serif-text);
}
.field input:focus { outline: 2px solid var(--signal); outline-offset: 1px; border-color: var(--signal); }
.consent { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; color: var(--ink-soft); font-size: 15px; line-height: 1.55; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--signal); }
.consent a { text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.isca { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.6em; margin: 0; font-size: 16px; }
.form-status[data-estado="ok"] { color: var(--signal-text); }
.form-status[data-estado="erro"] { color: var(--ink); border-left: 2px solid var(--signal); padding-left: 12px; }

/* ---------- assinatura, canais, referências ---------- */
.signature h2 { margin: 16px 0 0; font-size: clamp(4.2rem, 8vw, 8rem); line-height: .82; }
.signature h2 em { display: inline-block; margin-left: 12vw; }
.signature .copy { max-width: 360px; margin-top: 26px; }

.channel-links { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 48px; border-top: 1px solid var(--line-strong); }
.channel-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font: 500 12px var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
  transition: background .2s, color .2s;
}
.channel-links a:first-child { border-left: 1px solid var(--line); }
.channel-links a:hover { background: var(--ink); color: var(--paper); }
.channel-links span { color: var(--signal-text); }

.references { padding-top: 56px; padding-bottom: 90px; }
.references ol { list-style: none; margin: 26px 0 0; padding: 0; max-width: 760px; }
.references li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.references li span { font: 500 12px var(--mono); color: var(--signal-text); padding-top: 3px; }
.references li p { margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); }
.references-note { max-width: 760px; margin: 20px 0 0; font: italic 13.5px/1.6 var(--serif-text); color: var(--ink-soft); }

/* ---------- texto longo (privacidade, 404) ---------- */
.prose { max-width: 720px; margin: auto; padding: calc(var(--header-h) + 72px) 24px 100px; }
.prose h1 { font-size: clamp(2.6rem, 6vw, 4rem); margin: 18px 0 28px; }
.prose h2 { font-size: 30px; margin: 44px 0 12px; }
.prose p, .prose li { color: var(--ink-soft); line-height: 1.75; }
.prose strong { color: var(--ink); font-weight: 600; }
.draft-banner + .eyebrow { margin-top: 36px; }
.draft-banner { padding: 14px 18px; border: 1px dashed var(--signal); color: var(--ink); font: 500 13px/1.6 var(--mono); }
.pendente { background: color-mix(in srgb, var(--signal) 18%, transparent); color: var(--ink); padding: 0 4px; }

/* ---------- rodapé ---------- */
footer {
  max-width: 1240px;
  margin: auto;
  padding: 28px 48px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  color: var(--ink-soft);
  font: 400 12.5px var(--mono);
  letter-spacing: .04em;
}
footer .brand { font-size: 16px; color: var(--ink); }
footer .brand-mark { width: 20px; height: 20px; }
footer nav { display: flex; gap: 22px; }
footer nav a { text-decoration: underline; text-underline-offset: 4px; }
footer nav a:hover { color: var(--signal-text); }

/* ---------- responsivo ---------- */
@media (max-width: 960px) {
  .program-card { grid-template-columns: 1fr; }
  .program-card-visual { border-left: 0; border-top: 1px solid var(--line); min-height: 240px; }
}

@media (max-width: 860px) {
  :root { --header-h: 104px; }
  body { font-size: 16.5px; }
  .site-header { flex-wrap: wrap; row-gap: 10px; padding: 12px 20px 0; }
  .site-header nav {
    order: 3;
    flex-basis: 100%;
    gap: 22px;
    overflow-x: auto;
    padding: 10px 0 12px;
    border-top: 1px solid var(--line);
    scrollbar-width: none;
  }
  .site-header nav::-webkit-scrollbar { display: none; }

  .hero { display: block; min-height: 0; padding: calc(var(--header-h) + 40px) 20px 56px; }
  .hero h1 { font-size: clamp(2.9rem, 12.5vw, 4.4rem); }
  .plate-frame, .plate-caption { max-width: none; }
  .plate { margin-top: 44px; }

  .section { padding: 76px 20px; }
  .split, .two-col { grid-template-columns: 1fr; gap: 26px; }
  .two-col { gap: 40px; }
  .steps { grid-template-columns: 1fr; gap: 26px; margin-top: 40px; }
  .steps h3 { margin-top: 14px; }
  .program-card-copy { padding: 28px 22px; }
  .program-card-copy h3 { font-size: 34px; }

  .ritual li { grid-template-columns: 1fr; gap: 6px; padding-left: 26px; }
  .ritual li::before { left: 5px; top: 30px; }
  .ritual time { text-align: left; padding: 0; }
  .ritual li > div { padding-left: 0; }
  .ritual li > div::before { left: -26px; top: -22px; }

  .check-box { padding: 24px 20px; }
  .signature h2 em { margin-left: 16vw; }
  .channel-links { grid-template-columns: 1fr; margin-top: 34px; }
  .channel-links a, .channel-links a:first-child { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  footer { padding: 24px 20px 32px; }
}

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