/* =========================================================================
   IN Planejamento Financeiro — Landing v23
   Design tokens and layout. Premium institutional, paper-first.
   Motif height 480px: matches five equidistant journey nodes.
   blue-400 reserved for concept words only (Início, Famílias, objetivos,
   plano, Integrado, acompanhamento).
   ========================================================================= */

:root {
  --navy-primary: #020e28;
  --navy-dark: #072d5b;
  --ink: #0b1b36;
  --bone: #f7f8fb;
  --blue-400: #4e78b7;
  --blue-glow: #e2eaf8;
  --gold: #b59a5e;

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: Manrope, "Segoe UI", sans-serif;

  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 64px;
  --space-2xl: 96px;

  --pad-x: clamp(24px, 5vw, 112px);
  --ease-brand: cubic-bezier(0.2, 0.6, 0.2, 1);
  --ease-organic: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 400ms;

  --motif-line: rgba(247, 248, 251, 0.25);
  --motif-active-fill: var(--bone);
  --motif-inactive-border: rgba(247, 248, 251, 0.45);
  --motif-label: var(--bone);
  --motif-label-muted: rgba(247, 248, 251, 0.5);
  --scroll-hint: rgba(247, 248, 251, 0.5);
  --mobile-rail-bg: var(--navy-primary);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--navy-primary);
  color: var(--bone);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 16px;
  background: var(--bone);
  color: var(--ink);
  font-weight: 600;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

.accent {
  color: var(--blue-400);
}

/* ----- Sections ----- */

.section {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: var(--space-2xl) var(--pad-x);
  overflow: clip;
}

.section--navy {
  background: var(--navy-primary);
  color: var(--bone);
}

.section--bone {
  background: var(--bone);
  color: var(--ink);
}

.section--centered {
  justify-content: center;
  text-align: center;
}

.section--finale {
  flex-direction: column;
  justify-content: center;
  padding-bottom: 0;
}

/* ----- Brand lockup (animated institutional signature) ----- */

.brand-lockup {
  position: absolute;
  top: var(--space-2xl);
  left: var(--pad-x);
  z-index: 2;
  display: flex;
  align-items: stretch;
  gap: 3px;
  opacity: 0;
}

.section.is-visible .brand-lockup {
  animation: in-fade-up 720ms var(--ease-brand) 200ms both;
}

.brand-lockup__mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--bone);
}

.brand-lockup__rule {
  position: relative;
  width: 2px;
  height: 25px;
  align-self: flex-start;
  margin-top: 15px;
  flex: 0 0 auto;
}

.brand-lockup__rule-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--bone);
}

.section.is-visible .brand-lockup__rule-fill {
  animation: in-dot-to-line 700ms var(--ease-brand) 900ms both;
}

.brand-lockup__text {
  margin-left: 3px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 17px;
  gap: 1px;
  font-weight: 600;
  font-size: 8.5px;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bone);
  opacity: 0;
}

.section.is-visible .brand-lockup__text {
  animation: in-reveal-from-line 800ms var(--ease-brand) 1650ms both;
}

.section__inner {
  width: 100%;
  max-width: 720px;
}

.section__inner--hero {
  max-width: 720px;
}

.section__inner--wide {
  max-width: 880px;
  margin-left: clamp(0px, 8vw, 216px);
}

.section__inner--standard {
  max-width: 760px;
  margin-left: clamp(0px, 8vw, 216px);
}

.section__inner--center {
  max-width: 800px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section__inner--finale {
  max-width: 720px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  justify-content: center;
}

/* ----- Typography ----- */

.display-hero {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(44px, 6.6vw, 96px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.display-hero span {
  display: block;
}

.display-manifesto {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.display-institutional {
  margin: var(--space-lg) 0 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.15;
  letter-spacing: -0.005em;
}

/* Line wrappers stack; .accent stays on the same line as surrounding copy. */
.display-institutional > span:not(.accent) {
  display: block;
}

.display-institutional--center {
  text-align: center;
}

.body-institutional {
  margin: var(--space-lg) 0 0;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.65;
  text-wrap: pretty;
}

.body-secondary {
  margin: 32px 0 0;
  max-width: 42ch;
  font-size: clamp(15px, 1.2vw, 16px);
  line-height: 1.6;
}

.body-secondary--on-navy {
  color: rgba(247, 248, 251, 0.75);
}

.body-secondary--muted {
  margin: 0;
  max-width: none;
  color: rgba(247, 248, 251, 0.55);
  text-align: center;
  line-height: 1.7;
}

.signature-line {
  margin: var(--space-lg) 0 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.005em;
}

/* Line wrappers stack; .accent stays on the same line as surrounding copy. */
.signature-line > span:not(.accent) {
  display: block;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--blue-400);
}

.vision-copy {
  margin-top: var(--space-lg);
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.vision-close {
  margin: 0;
  text-align: center;
  font-weight: 500;
  font-size: clamp(15px, 1.2vw, 16px);
  line-height: 1.7;
  color: var(--bone);
}

/* ----- Hairlines ----- */

.hairline {
  height: 1px;
  flex: 0 0 auto;
}

.hairline--navy {
  width: 60px;
  background: var(--navy-primary);
}

.hairline--bone {
  width: 80px;
  background: rgba(247, 248, 251, 0.35);
  margin-top: var(--space-md);
}

.hairline--blue {
  width: 80px;
  background: var(--blue-400);
  margin-top: 32px;
}

.hairline--short {
  width: 40px;
  margin-top: var(--space-md);
  margin-inline: auto;
}

.section__inner--center > .hairline--bone {
  margin-top: var(--space-md);
}

/* ----- CTA ----- */

.cta-journey {
  margin-top: 56px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--bone);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color 240ms var(--ease-brand);
}

.cta-journey svg {
  transition: transform 240ms var(--ease-brand);
}

.cta-journey:hover,
.cta-journey:focus-visible {
  color: var(--blue-glow);
}

.cta-journey:hover svg,
.cta-journey:focus-visible svg {
  transform: translateX(4px);
}

.cta-journey:focus-visible {
  outline: 1px solid var(--blue-400);
  outline-offset: 6px;
}

/* ----- Invite + footer ----- */

.invite-block {
  margin-top: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.invite-copy {
  margin: 32px 0 0;
  max-width: 460px;
  text-align: center;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.6;
  color: rgba(247, 248, 251, 0.75);
  text-wrap: pretty;
}

.site-footer {
  width: 100%;
  margin-top: auto;
  padding: 48px var(--pad-x);
  border-top: 1px solid rgba(247, 248, 251, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.site-footer__logo {
  height: 32px;
  width: auto;
}

.site-footer__tagline {
  margin: 32px 0 0;
  max-width: 520px;
  font-size: clamp(12px, 1vw, 13px);
  line-height: 1.5;
  color: rgba(247, 248, 251, 0.6);
}

.site-footer__email {
  margin-top: 40px;
  font-weight: 500;
  font-size: clamp(12px, 1vw, 13px);
  color: rgba(247, 248, 251, 0.7);
  text-decoration: none;
  transition: color 240ms var(--ease-brand);
}

.site-footer__email:hover,
.site-footer__email:focus-visible {
  color: var(--bone);
}

.site-footer__email:focus-visible {
  outline: 1px solid var(--blue-400);
  outline-offset: 4px;
}

.site-footer__copy {
  margin: 32px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(247, 248, 251, 0.4);
}

/* ----- Journey motif ----- */

.journey-motif {
  z-index: 20;
}

.journey-motif--desktop {
  position: fixed;
  top: 50%;
  right: clamp(24px, 5vw, 112px);
  transform: translateY(-50%);
  height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
}

.journey-motif--mobile {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 14px 20px 18px;
  background: var(--mobile-rail-bg);
  transition: background 300ms var(--ease-brand), opacity 300ms var(--ease-brand);
}

.journey-motif__line {
  position: absolute;
  right: 7px;
  top: 7px;
  bottom: 7px;
  width: 1px;
  background: var(--motif-line);
  transform-origin: top;
  transform: scaleY(0);
  transition: background 300ms var(--ease-brand);
}

body.is-motif-ready .journey-motif__line:not(.journey-motif__line--horizontal) {
  animation: in-draw-y 700ms var(--ease-brand) 1300ms both;
}

.journey-motif__line--horizontal {
  left: 10%;
  right: 10%;
  top: 6px;
  bottom: auto;
  width: auto;
  height: 1px;
  transform-origin: left;
  transform: scaleX(0);
}

body.is-motif-ready .journey-motif__line--horizontal {
  animation: in-draw-x 700ms var(--ease-brand) 1300ms both;
}

.journey-motif__step {
  position: relative;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 24px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.journey-motif__step:focus-visible {
  outline: 1px solid var(--blue-400);
  outline-offset: 4px;
}

.journey-motif__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-sizing: border-box;
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--motif-inactive-border);
  opacity: 0;
  transition: background 300ms var(--ease-brand), border-color 300ms var(--ease-brand);
}

body.is-motif-ready .journey-motif__dot {
  animation: in-fade 720ms var(--ease-brand) both;
  animation-delay: calc(1500ms + var(--step-index, 0) * 90ms);
}

.journey-motif__label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  white-space: nowrap;
  color: var(--motif-label-muted);
  opacity: 0;
  transition: color 300ms var(--ease-brand);
}

body.is-motif-ready .journey-motif__label {
  animation: in-fade-up 720ms var(--ease-brand) both;
  animation-delay: calc(1600ms + var(--step-index, 0) * 90ms);
}

.journey-motif__step.is-active .journey-motif__dot,
.journey-motif__step.is-complete .journey-motif__dot {
  background: var(--motif-active-fill);
  border-color: var(--motif-active-fill);
}

.journey-motif__step.is-active .journey-motif__label {
  color: var(--motif-label);
}

body[data-active-theme="bone"] {
  --motif-line: rgba(11, 27, 54, 0.2);
  --motif-active-fill: var(--navy-primary);
  --motif-inactive-border: rgba(11, 27, 54, 0.35);
  --motif-label: var(--ink);
  --motif-label-muted: rgba(11, 27, 54, 0.5);
  --scroll-hint: rgba(11, 27, 54, 0.4);
  --mobile-rail-bg: var(--bone);
}

body[data-section="sec-5"] .journey-motif__step .journey-motif__dot {
  background: var(--motif-active-fill);
  border-color: var(--motif-active-fill);
}

body[data-section="sec-5"] .journey-motif__step .journey-motif__label {
  color: var(--motif-label);
}

/* ----- Scroll hint ----- */

.scroll-hint {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--scroll-hint);
  cursor: pointer;
  opacity: 0;
  transition: color 300ms var(--ease-brand), opacity 300ms var(--ease-brand);
}

body.is-motif-ready .scroll-hint {
  animation: in-fade 720ms var(--ease-brand) 2700ms both;
}

.scroll-hint svg {
  animation: in-nudge 2500ms var(--ease-organic) infinite;
}

.scroll-hint:focus-visible {
  outline: 1px solid var(--blue-400);
  outline-offset: 4px;
}

.scroll-hint.is-hidden {
  opacity: 0 !important;
  animation: none !important;
  pointer-events: none;
}

/* ----- Reveal animations ----- */

.reveal {
  opacity: 0;
  transform: translateY(4px);
}

.section.is-visible .reveal {
  animation: in-fade-up var(--duration) var(--ease-brand) both;
  animation-delay: var(--reveal-delay, 0ms);
}

.section.is-visible .reveal--hero {
  animation-duration: 720ms;
}

.section.is-visible .hairline.reveal {
  animation-name: in-grow;
}

.section.is-visible .hairline--blue.reveal,
.section.is-visible .hairline--bone.reveal {
  animation-name: in-grow-80;
}

.section.is-visible .hairline--short.reveal {
  animation-name: in-grow-40;
}

@keyframes in-fade-up {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes in-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes in-draw-y {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes in-draw-x {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes in-dot-to-line {
  from {
    width: 2px;
    height: 2px;
    border-radius: 50%;
  }
  to {
    width: 2px;
    height: 100%;
    border-radius: 0;
  }
}

@keyframes in-reveal-from-line {
  from {
    opacity: 0;
    transform: translateX(-10px);
    clip-path: inset(0 100% 0 0);
  }
  to {
    opacity: 1;
    transform: translateX(0);
    clip-path: inset(0 0 0 0);
  }
}

@keyframes in-grow {
  from {
    opacity: 0;
    width: 0;
  }
  to {
    opacity: 1;
    width: 60px;
  }
}

@keyframes in-grow-80 {
  from {
    opacity: 0;
    width: 0;
  }
  to {
    opacity: 1;
    width: 80px;
  }
}

@keyframes in-grow-40 {
  from {
    opacity: 0;
    width: 0;
  }
  to {
    opacity: 1;
    width: 40px;
  }
}

@keyframes in-nudge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

/* ----- Responsive ----- */

/* Desktop: keep editorial line breaks exact (no soft-wrap mid-phrase). */
@media (min-width: 1024px) {
  .display-manifesto,
  .display-institutional--center,
  #sec-4 .display-institutional {
    white-space: nowrap;
  }

  .display-institutional > span:not(.accent),
  .signature-line > span:not(.accent) {
    white-space: nowrap;
  }
}

@media (max-width: 1023px) {
  .section__inner--wide,
  .section__inner--standard {
    margin-left: 0;
  }

  .journey-motif__label {
    letter-spacing: 0.1em;
  }
}

@media (max-width: 767px) {
  .section {
    padding: 72px 24px 96px;
  }

  .section--finale {
    padding-bottom: 0;
  }

  .brand-lockup {
    top: 40px;
    left: 24px;
  }

  .brand-lockup__mark {
    font-size: 40px;
  }

  .brand-lockup__rule {
    height: 22px;
    margin-top: 12px;
  }

  .brand-lockup__text {
    padding-top: 14px;
    font-size: 7.5px;
  }

  .cta-journey {
    margin-top: 40px;
  }

  .invite-block {
    margin-top: 56px;
  }

  .journey-motif--desktop {
    display: none;
  }

  .journey-motif--mobile {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }

  .journey-motif--mobile .journey-motif__step {
    flex: 1 1 0;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
  }

  .journey-motif--mobile .journey-motif__dot {
    width: 12px;
    height: 12px;
  }

  .journey-motif--mobile .journey-motif__label {
    font-size: 8px;
    letter-spacing: 0.08em;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }

  .scroll-hint {
    right: 20px;
    bottom: 88px;
  }

  .site-footer {
    padding: 32px 24px 48px;
  }

  .site-footer__tagline,
  .site-footer__email,
  .site-footer__copy {
    margin-top: 24px;
  }
}

@media (max-width: 374px) {
  .display-hero {
    font-size: 40px;
  }

  .journey-motif--mobile .journey-motif__label {
    font-size: 7px;
  }
}

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

  .reveal,
  .section.is-visible .reveal,
  .section.is-visible .hairline.reveal,
  .brand-lockup,
  .brand-lockup__rule-fill,
  .brand-lockup__text,
  .journey-motif__line,
  .journey-motif__dot,
  .journey-motif__label,
  .scroll-hint,
  body.is-motif-ready .journey-motif__line,
  body.is-motif-ready .journey-motif__line--horizontal,
  body.is-motif-ready .journey-motif__dot,
  body.is-motif-ready .journey-motif__label,
  body.is-motif-ready .scroll-hint {
    opacity: 1;
    transform: none;
    clip-path: none;
    animation: none;
  }

  .brand-lockup__rule-fill {
    height: 100%;
    border-radius: 0;
  }

  .scroll-hint svg {
    animation: none;
  }
}
