/* Fundo espacial compartilhado com o portfolio (home e sobre). So vale com html.has-space-bg. */
.studio-space-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: none;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

html.has-space-bg {
  background: #02060c;
}

html.has-space-bg body {
  background: transparent;
}

html.has-space-bg .studio-space-bg {
  display: block;
}

html.has-space-bg body::before {
  display: none;
}

/* Home: os dois caminhos flutuam como quadros num salao curvo. */
html.has-space-bg .home-split {
  --space-mx: 0;
  --space-my: 0;
  gap: clamp(18px, 3vw, 56px);
  min-height: 100svh;
  padding: clamp(96px, 13vh, 140px) clamp(20px, 6vw, 110px) clamp(40px, 8vh, 90px);
  perspective: 1500px;
  perspective-origin: 50% 46%;
}

html.has-space-bg .home-choice {
  min-height: 0;
  height: calc(100svh - clamp(136px, 21vh, 230px));
  background: transparent;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(210, 232, 244, 0.1);
  transform-style: preserve-3d;
  transform:
    rotateY(calc(var(--panel-turn) + var(--space-mx) * 7deg))
    rotateX(calc(var(--space-my) * -5deg))
    translateZ(var(--panel-z, 0px));
  animation: space-panel-in 1500ms cubic-bezier(0.16, 0.82, 0.18, 1) backwards, space-panel-float 9s ease-in-out 1500ms infinite;
  transition: transform 900ms cubic-bezier(0.16, 0.82, 0.18, 1), filter 800ms ease, opacity 800ms ease, box-shadow 800ms ease;
}

html.has-space-bg .home-choice-about {
  --panel-turn: 11deg;
  transform-origin: 100% 50%;
}

html.has-space-bg .home-choice-portfolio {
  --panel-turn: -11deg;
  transform-origin: 0% 50%;
  animation-delay: 140ms, 1640ms;
}

html.has-space-bg .home-choice::after {
  display: none;
}

html.has-space-bg .home-choice figure {
  -webkit-mask-image: radial-gradient(ellipse 92% 88% at 50% 46%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 92% 88% at 50% 46%, #000 62%, transparent 100%);
}

html.has-space-bg .home-choice:hover,
html.has-space-bg .home-choice:focus-visible,
html.has-space-bg .home-choice.is-active {
  --panel-turn: 0deg;
  --panel-z: 60px;
  box-shadow: 0 50px 140px rgba(0, 0, 0, 0.62), 0 0 90px rgba(140, 198, 216, 0.16), 0 0 0 1px rgba(210, 232, 244, 0.22);
}

@keyframes space-panel-in {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: rotateY(var(--panel-turn)) translateZ(-420px);
  }
}

@keyframes space-panel-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

@media (max-width: 820px) {
  html.has-space-bg .home-split {
    gap: 18px;
    padding: 92px 16px 28px;
    perspective: 1100px;
  }

  html.has-space-bg .home-choice {
    height: auto;
    min-height: calc((100svh - 150px) / 2);
  }

  html.has-space-bg .home-choice-about {
    --panel-turn: 0deg;
    transform-origin: 50% 100%;
    rotate: x 6deg;
  }

  html.has-space-bg .home-choice-portfolio {
    --panel-turn: 0deg;
    transform-origin: 50% 0%;
    rotate: x -6deg;
  }
}

/* Sobre: as secoes passam a flutuar sobre o ceu. */
html.has-space-bg .about-immersive {
  background: transparent;
}

html.has-space-bg .about-doc-hero-media {
  background: transparent;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
}

html.has-space-bg .about-footer {
  background:
    radial-gradient(70% 130% at 18% 14%, rgba(212, 175, 55, 0.08), transparent 60%),
    linear-gradient(180deg, transparent, rgba(2, 6, 12, 0.72));
}

@media (prefers-reduced-motion: reduce) {
  html.has-space-bg .home-choice {
    animation: none;
    transform: none;
  }
}

/* Home -> sobre: o retrato do Victor cresce ate cobrir a tela enquanto a camera acelera. */
.space-warp-portrait {
  position: fixed;
  z-index: 9000;
  background-position: 50% 34%;
  background-size: cover;
  box-shadow: 0 0 0 1px rgba(210, 232, 244, 0.22), 0 60px 160px rgba(0, 0, 0, 0.6);
  transition:
    left 960ms cubic-bezier(0.7, 0, 0.18, 1),
    top 960ms cubic-bezier(0.7, 0, 0.18, 1),
    width 960ms cubic-bezier(0.7, 0, 0.18, 1),
    height 960ms cubic-bezier(0.7, 0, 0.18, 1),
    filter 960ms ease,
    box-shadow 960ms ease;
  pointer-events: none;
}

.space-warp-portrait.is-expanding {
  left: 0 !important;
  top: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  box-shadow: 0 0 0 0 transparent;
  filter: brightness(0.62) saturate(0.9);
}

html.is-space-warping .home-choice:not(.is-warp-source) {
  opacity: 0;
  filter: blur(14px);
  transform: rotateY(var(--panel-turn)) translateZ(-700px);
  transition: opacity 700ms ease, filter 700ms ease, transform 900ms cubic-bezier(0.7, 0, 0.18, 1);
}

html.is-space-warping .home-choice-copy,
html.is-space-warping .site-topbar {
  opacity: 0;
  transition: opacity 360ms ease;
}

/* Chegada na pagina sobre: o mesmo retrato abre a tela e se dissolve no hero. */
html.about-warp-arrival body::after {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: url("/assets/about/victor-pimentel-home-profile-900.jpg") 50% 34% / cover no-repeat;
  filter: brightness(0.62) saturate(0.9);
  content: "";
  pointer-events: none;
  animation: about-warp-arrive 1150ms cubic-bezier(0.3, 0, 0.2, 1) forwards;
}

@keyframes about-warp-arrive {
  to {
    opacity: 0;
    filter: brightness(1.4) saturate(0.6) blur(18px);
    transform: scale(1.35);
  }
}

/* Sobre: hero com a foto se dissolvendo no espaco. */
html.has-space-bg .about-doc-hero-media::after {
  background:
    radial-gradient(ellipse at 42% 30%, transparent 0 30%, rgba(0, 0, 0, 0.2) 58%, rgba(0, 0, 0, 0.66) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.12) 52%, rgba(0, 0, 0, 0.4));
}

html.has-space-bg .about-doc-hero-media img {
  opacity: 0.74;
  filter: saturate(0.92) contrast(1.06) brightness(0.8);
  animation: none;
  will-change: transform;
}

/* Titulos surgem palavra por palavra. */
html.has-about-motion [data-split] .split-word {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
  vertical-align: top;
}

html.has-about-motion [data-split] .split-word > span {
  display: inline-block;
  transform: translate3d(0, 108%, 0);
  transition: transform 1100ms cubic-bezier(0.16, 0.82, 0.18, 1);
  transition-delay: calc(var(--split-delay, 0ms) + var(--i) * 60ms);
}

html.has-about-motion [data-split].is-split-in .split-word > span {
  transform: none;
}

html.has-about-motion [data-rise] {
  animation: about-rise 1100ms cubic-bezier(0.16, 0.82, 0.18, 1) var(--rise-delay, 0ms) both;
}

@keyframes about-rise {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translate3d(0, 26px, 0);
  }
}

/* Fotos: revelacao por cortina e profundidade no scroll. */
html.has-about-motion .about-doc-memory-board figure img,
html.has-about-motion .about-doc-eye-grid figure img,
html.has-about-motion .about-doc-team-image img {
  clip-path: inset(18% 0 18% 0);
  transform: scale(1.14);
  transition: clip-path 1300ms cubic-bezier(0.16, 0.82, 0.18, 1), transform 1600ms cubic-bezier(0.16, 0.82, 0.18, 1);
}

html.has-about-motion figure.is-visible img {
  clip-path: inset(0 0 0 0);
  transform: scale(1);
}

html.has-about-motion [data-float] {
  will-change: translate;
}

/* Linha do tempo acende conforme o scroll. */
.about-doc-timeline-rail {
  position: relative;
  --timeline-progress: 0;
}

html.has-about-motion .about-doc-timeline-rail::before {
  position: absolute;
  top: -26px;
  left: 0;
  right: 0;
  height: 1px;
  background:
    linear-gradient(90deg, rgba(212, 175, 55, 0.9), rgba(140, 198, 216, 0.9)) 0 0 / calc(var(--timeline-progress) * 100%) 100% no-repeat,
    rgba(255, 255, 255, 0.12);
  content: "";
}

html.has-about-motion .about-doc-timeline-rail article {
  transition: border-color 700ms ease, transform 900ms cubic-bezier(0.16, 0.82, 0.18, 1), box-shadow 900ms ease, opacity 1200ms ease, filter 1200ms ease;
}

html.has-about-motion .about-doc-timeline-rail article.is-lit {
  border-color: rgba(212, 175, 55, 0.42);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4), 0 0 60px rgba(212, 175, 55, 0.08);
  transform: translate3d(0, -8px, 0);
}

html.has-space-bg .about-doc-timeline-rail article {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015)),
    rgba(2, 8, 14, 0.5);
  backdrop-filter: blur(6px);
}

@media (max-width: 900px) {
  html.has-about-motion .about-doc-timeline-rail::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.about-warp-arrival body::after {
    display: none;
  }
}

/* As palavras divididas herdam a tipografia do titulo, nao o estilo de etiqueta dos spans da secao. */
html.has-about-motion [data-split] .split-word,
html.has-about-motion [data-split] .split-word > span {
  margin-top: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-transform: inherit;
  opacity: 1;
}

html.has-space-bg .about-doc-eye-copy p,
html.has-space-bg .about-doc-eye-copy span {
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* ===== Site todo: transicao entre paginas ===== */
html.is-page-warping main > *,
html.is-page-warping .site-footer,
html.is-page-warping .site-topbar,
html.is-page-warping .legal-shell > * {
  opacity: 0;
  filter: blur(10px);
  transform: scale(0.97);
  transition: opacity 420ms ease, filter 420ms ease, transform 460ms cubic-bezier(0.7, 0, 0.3, 1);
}

html.page-warp-arrival main > *,
html.page-warp-arrival .site-topbar,
html.page-warp-arrival .legal-shell > * {
  animation: page-warp-arrive 900ms cubic-bezier(0.16, 0.82, 0.18, 1) both;
}

@keyframes page-warp-arrive {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: scale(1.03);
  }
}

/* ===== Menu: vidro sobre o espaco, cabe na tela ===== */
html.has-space-bg .menu-overlay.studio-menu {
  background: rgba(2, 6, 12, 0.66) !important;
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

html.has-space-bg .studio-menu .menu-primary {
  gap: clamp(4px, 1.4vh, 14px) !important;
}

html.has-space-bg .studio-menu .menu-primary a {
  font-size: clamp(2.6rem, min(9vh, 7vw), 6.2rem) !important;
  line-height: 1.02 !important;
  transition: color 300ms ease, transform 500ms cubic-bezier(0.16, 0.82, 0.18, 1), letter-spacing 500ms ease;
}

html.has-space-bg .studio-menu .menu-primary a:hover,
html.has-space-bg .studio-menu .menu-primary a:focus-visible {
  color: #f3deaa;
  transform: translateX(14px);
}

html.has-space-bg .studio-menu .menu-primary a span {
  transition: color 300ms ease;
}

html.has-space-bg .studio-menu .menu-primary a:hover span {
  color: #e7c76a;
}

/* ===== Botoes da linguagem nova ===== */
.space-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 26px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(2, 8, 14, 0.4);
  color: #fff;
  font-family: var(--vp-sans, "Avenir Next", Arial, sans-serif);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  transition: transform 400ms cubic-bezier(0.16, 0.82, 0.18, 1), border-color 300ms ease, background 300ms ease, box-shadow 300ms ease;
  cursor: pointer;
}

.space-button:hover,
.space-button:focus-visible {
  border-color: rgba(243, 222, 170, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.space-button-gold {
  border-color: transparent;
  background: linear-gradient(135deg, #f6d58a, #b88427);
  color: #120d05;
}

.space-button-gold:hover,
.space-button-gold:focus-visible {
  border-color: transparent;
  box-shadow: 0 16px 44px rgba(212, 175, 55, 0.3);
}

/* ===== Contato ===== */
.space-contact {
  display: grid;
  min-height: 100svh;
  align-items: center;
  padding: clamp(110px, 16vh, 160px) clamp(20px, 7vw, 120px) clamp(60px, 10vh, 100px);
}

.contact-stage {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 110px);
  align-items: center;
  width: min(100%, 1180px);
  margin: 0 auto;
}

.contact-portrait {
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(210, 232, 244, 0.12);
  transform: perspective(1200px) rotateY(8deg);
  transform-origin: 100% 50%;
}

.contact-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
}

.contact-copy {
  display: grid;
  gap: 22px;
  justify-items: start;
}

.contact-copy h1 {
  margin: 0;
  color: #fff;
  font-family: var(--vp-serif, Baskerville, "Libre Baskerville", Georgia, serif);
  font-size: clamp(3rem, 6.2vw, 6.4rem);
  font-weight: 400;
  line-height: 0.95;
}

.contact-copy > p {
  max-width: 34rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.6;
}

.contact-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-facts {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 14px clamp(20px, 3vw, 44px);
  margin: 14px 0 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.contact-facts dt {
  margin-bottom: 6px;
  color: rgba(231, 199, 106, 0.85);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.contact-facts dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.95rem;
}

.contact-facts a {
  color: inherit;
}

/* ===== Orcamento ===== */
html.has-space-bg .page-hero,
html.has-space-bg .section,
html.has-space-bg main {
  background-color: transparent;
}

html.has-space-bg .page-hero-media img {
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 60%, transparent 100%);
}

html.has-space-bg .form-grid {
  padding: clamp(22px, 3vw, 38px);
  border: 1px solid rgba(210, 232, 244, 0.12);
  border-radius: 20px;
  background: rgba(3, 8, 14, 0.58);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
}

html.has-space-bg .form-grid input,
html.has-space-bg .form-grid select,
html.has-space-bg .form-grid textarea {
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: #fff !important;
  transition: border-color 300ms ease, box-shadow 300ms ease, background 300ms ease;
}

html.has-space-bg .form-grid input:focus,
html.has-space-bg .form-grid select:focus,
html.has-space-bg .form-grid textarea:focus {
  border-color: rgba(243, 222, 170, 0.7) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.12);
  outline: none;
}

html.has-space-bg .form-grid select option {
  background: #0b141e;
}

html.has-space-bg .form-grid .cinematic-button {
  min-height: 54px;
  border: 0 !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #f6d58a, #b88427) !important;
  color: #120d05 !important;
  transition: transform 400ms cubic-bezier(0.16, 0.82, 0.18, 1), box-shadow 300ms ease;
}

html.has-space-bg .form-grid .cinematic-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(212, 175, 55, 0.3);
}

/* ===== Blog ===== */
html.has-space-bg .journal-card figure {
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

html.has-space-bg .journal-card img {
  transition: transform 900ms cubic-bezier(0.16, 0.82, 0.18, 1);
}

html.has-space-bg .journal-card:hover img {
  transform: scale(1.06);
}

/* ===== Paginas legais ===== */
html.has-space-bg body.legal-page {
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
}

html.has-space-bg .legal-shell h1 {
  font-family: var(--vp-serif, Baskerville, "Libre Baskerville", Georgia, serif);
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.98;
}

html.has-space-bg .legal-shell section {
  border-color: rgba(210, 232, 244, 0.1) !important;
  background: rgba(3, 8, 14, 0.55) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html.has-space-bg .legal-shell h2 {
  color: #e7c76a;
}

/* ===== 404 ===== */
.space-404 {
  display: grid;
  min-height: 100svh;
  place-content: center;
  gap: 22px;
  padding: 24px;
  color: #fff;
  text-align: center;
}

.space-404 strong {
  color: rgba(231, 199, 106, 0.9);
  font-family: var(--vp-sans, "Avenir Next", Arial, sans-serif);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
}

.space-404 h1 {
  margin: 0;
  font-family: Baskerville, "Libre Baskerville", Georgia, serif;
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  font-weight: 400;
  line-height: 0.98;
}

.space-404 p {
  max-width: 30rem;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.space-404 nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

@media (max-width: 820px) {
  .contact-stage {
    grid-template-columns: 1fr;
  }

  .contact-portrait {
    width: min(70vw, 300px);
    transform: none;
  }

  .contact-facts {
    grid-template-columns: 1fr 1fr;
  }
}

html.has-space-bg .page-hero-media {
  background: transparent;
}

html.has-space-bg .page-hero-media::after {
  background: radial-gradient(ellipse at 58% 42%, transparent 0 40%, rgba(2, 6, 12, 0.55) 100%) !important;
}

/* ===== Cards com movimento (todas as paginas) ===== */
.space-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(246, 213, 138, 0), #f6d58a 30%, #e7c76a);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

html.has-about-motion [data-card] {
  opacity: 0;
  transform: perspective(1100px) translate3d(0, 64px, 0) rotateX(16deg) scale(0.96);
  transform-origin: 50% 100%;
  transition:
    opacity 900ms cubic-bezier(0.16, 0.82, 0.18, 1),
    transform 1200ms cubic-bezier(0.16, 0.82, 0.18, 1);
  transition-delay: calc(var(--card-i, 0) * 90ms);
}

html.has-about-motion [data-card].is-card-in {
  opacity: 1;
  transform: perspective(1100px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

html.has-about-motion [data-card].is-card-in.is-tilting {
  transition: opacity 900ms ease, transform 120ms linear;
  transition-delay: 0ms;
}

html.has-about-motion [data-card-flat].is-card-in {
  transform: none;
}

[data-card-parallax] {
  translate: 0 var(--card-py, 0);
  scale: 1.14;
}

/* ===== Orcamento: fluxo em tres passos ===== */
.budget-flow {
  --budget-gutter: clamp(16px, 6vw, 92px);
}

.budget-hero {
  min-height: 100svh;
  align-items: end;
}

.budget-hero .page-hero-media img {
  transform-origin: 50% 30%;
  will-change: transform;
}

.budget-hero-copy {
  display: grid;
  gap: clamp(16px, 2.4vw, 26px);
  justify-items: start;
}

.budget-hero .page-title {
  max-width: 11ch;
  font-size: clamp(3.4rem, 9.4vw, 9.8rem);
  line-height: 0.88;
}

.budget-hero-lede {
  max-width: 30rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.55;
}

.budget-scroll-cue {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-decoration: none;
  text-transform: uppercase;
}

.budget-scroll-cue i {
  position: relative;
  width: 1px;
  height: 46px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}

.budget-scroll-cue i::after {
  position: absolute;
  inset: 0;
  background: #f6d58a;
  content: "";
  animation: budget-cue 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes budget-cue {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(100%); }
}

.budget-steps,
.budget-choose,
.budget-compose {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: clamp(80px, 14vh, 150px) var(--budget-gutter) 0;
}

.budget-flow .story-title {
  max-width: 14ch;
  margin-top: 14px;
  font-size: clamp(2.4rem, 5.6vw, 5.8rem);
}

.budget-step-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 20px);
  margin: clamp(36px, 6vh, 60px) 0 0;
  padding: 0;
  list-style: none;
}

.budget-step-list li {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 220px;
  padding: clamp(22px, 2.4vw, 32px);
  overflow: hidden;
  border: 1px solid rgba(210, 232, 244, 0.12);
  border-radius: 20px;
  background:
    radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 0%), rgba(246, 213, 138, 0.12), transparent 55%),
    rgba(3, 8, 14, 0.52);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.budget-step-list span {
  color: rgba(231, 199, 106, 0.9);
  font-family: var(--vp-serif, Baskerville, Georgia, serif);
  font-size: clamp(2.6rem, 4vw, 3.6rem);
  line-height: 1;
}

.budget-step-list b {
  color: #fff;
  font-size: 1.06rem;
  font-weight: 700;
}

.budget-step-list p {
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
  line-height: 1.55;
}

.budget-type-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 18px);
  margin: clamp(36px, 6vh, 60px) 0 0;
  padding: 0;
  border: 0;
}

.budget-type {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4.4;
  overflow: hidden;
  border-radius: 18px;
  cursor: pointer;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(210, 232, 244, 0.12);
  isolation: isolate;
}

.budget-type input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.budget-type figure {
  position: absolute;
  inset: 0;
  z-index: -1;
  margin: 0;
  overflow: hidden;
}

.budget-type figure::after {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 30%), rgba(255, 255, 255, 0.16), transparent 45%),
    linear-gradient(180deg, rgba(2, 6, 12, 0) 35%, rgba(2, 6, 12, 0.88) 100%);
  content: "";
  transition: opacity 500ms ease;
}

.budget-type img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) brightness(0.86);
  transition: filter 700ms ease, scale 1200ms cubic-bezier(0.16, 0.82, 0.18, 1);
}

.budget-type:hover img {
  filter: saturate(1) brightness(0.95);
  scale: 1.2;
}

.budget-type-copy {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  gap: 6px;
  padding: clamp(14px, 1.6vw, 22px);
}

.budget-type-copy b {
  color: #fff;
  font-family: var(--vp-serif, Baskerville, Georgia, serif);
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  font-weight: 400;
  line-height: 1;
}

.budget-type-copy small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  line-height: 1.4;
}

.budget-type-check {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(2, 6, 12, 0.35);
  transition: background 400ms ease, border-color 400ms ease, transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.budget-type-check::after {
  width: 9px;
  height: 5px;
  border-bottom: 2px solid #120d05;
  border-left: 2px solid #120d05;
  content: "";
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0.4);
  transition: opacity 300ms ease, transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.budget-type:has(input:checked) {
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.5), 0 0 0 2px #e7c76a, 0 0 60px rgba(231, 199, 106, 0.25);
}

.budget-type:has(input:checked) .budget-type-check {
  border-color: #f6d58a;
  background: #f6d58a;
  transform: scale(1.12);
}

.budget-type:has(input:checked) .budget-type-check::after {
  opacity: 1;
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

.budget-type-grid:has(input:checked) .budget-type:not(:has(input:checked)) img {
  filter: saturate(0.4) brightness(0.55);
}

.budget-type:has(input:focus-visible) {
  outline: 2px solid #f6d58a;
  outline-offset: 4px;
}

.budget-compose {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(18px, 3vw, 40px);
  align-items: start;
  padding-bottom: clamp(90px, 16vh, 160px);
}

.budget-compose-head {
  grid-column: 1 / -1;
}

html.has-space-bg .budget-form {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.budget-form .is-wide,
.budget-form .cinematic-button,
.budget-form .form-feedback {
  grid-column: 1 / -1;
}

.budget-form .cinematic-button {
  justify-self: start;
  padding-inline: 34px !important;
  transition: translate 300ms cubic-bezier(0.16, 0.82, 0.18, 1), box-shadow 300ms ease !important;
}

.budget-preview {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
  padding: clamp(20px, 2.4vw, 28px);
  border: 1px solid rgba(210, 232, 244, 0.12);
  border-radius: 20px;
  background:
    radial-gradient(circle at var(--glare-x, 80%) var(--glare-y, 0%), rgba(37, 211, 102, 0.1), transparent 55%),
    rgba(3, 8, 14, 0.58);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
}

.budget-preview-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  color: rgba(231, 199, 106, 0.9);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.budget-preview-head span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  animation: budget-pulse 2.4s ease-out infinite;
}

@keyframes budget-pulse {
  70% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.budget-bubble {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 4px 16px 16px 16px;
  background: #0f2a22;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.budget-bubble p {
  margin: 0;
}

.budget-bubble p.is-empty {
  color: rgba(255, 255, 255, 0.42);
}

.budget-bubble.is-typing p:last-child {
  animation: budget-type-in 420ms cubic-bezier(0.16, 0.82, 0.18, 1);
}

@keyframes budget-type-in {
  from { opacity: 0.4; transform: translateY(4px); }
}

.budget-preview-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.78rem;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .budget-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .budget-type:last-child {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 10;
  }

  .budget-compose {
    grid-template-columns: 1fr;
  }

  .budget-preview {
    position: relative;
    top: 0;
  }
}

@media (max-width: 720px) {
  .budget-step-list {
    grid-template-columns: 1fr;
  }

  .budget-step-list li {
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    min-height: 0;
  }

  .budget-step-list span {
    grid-row: span 2;
    font-size: 2.4rem;
  }

  html.has-space-bg .budget-form {
    grid-template-columns: 1fr;
  }

  .budget-form .cinematic-button {
    justify-self: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .budget-scroll-cue i::after,
  .budget-preview-head span {
    animation: none;
  }
}

.budget-flow .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.budget-flow section[id] {
  scroll-margin-top: 24px;
}

@media (max-width: 720px) {
  .budget-hero .page-hero-media img {
    object-position: 74% 40%;
  }
}
