/* ==========================================================================
   Ágatha Vitória Borges — site
   Calm, editorial, warm. Large type with size-specific tracking, translucent
   chrome, soft depth, and motion that only ever uses transform + opacity.
   ========================================================================== */

:root {
  /* Warm paper, sage and clay: calm, earthy, never loud. */
  --bg: #f6f3ec;
  --bg-alt: #ece6da;
  --surface: #fdfcf8;
  --ink: #2b2a25;
  --ink-2: #5d594f;
  --ink-3: #8a8578;
  --line: rgb(43 42 37 / 0.1);
  --accent: #55684f;
  --accent-strong: #435440;
  --accent-soft: #e3e8da;
  --sage: #8fa184;
  --clay: #a8654a;
  --clay-soft: #f1e2d6;
  --night: #23271f;
  --night-2: #2c3127;
  --night-ink: #efece3;
  --night-ink-2: #b3b2a3;
  --success: #3d6b4a;
  --danger: #a33a2a;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'EB Garamond', 'Iowan Old Style', Georgia, serif;

  --container: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
  --nav-h: 60px;
  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;

  /* Slow, soft easing: long gentle settle, no overshoot. */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --shadow-soft: 0 1px 2px rgb(43 42 37 / 0.04), 0 12px 32px -12px rgb(43 42 37 / 0.12);
  --shadow-lift: 0 2px 4px rgb(43 42 37 / 0.04), 0 24px 56px -20px rgb(43 42 37 / 0.2);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  letter-spacing: -0.006em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

figure,
blockquote {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease);
}

.skip-link:focus {
  transform: none;
}

.container {
  width: min(var(--container), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

/* ---------- Type -------------------------------------------------------- */

/* Small sans label above serif titles: quiet structure, warm colour. */
.eyebrow {
  margin: 0 0 18px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
}

/* Serif titles. Cormorant has a small x-height, so sizes run larger than a sans
   and tracking stays near zero (it is already tightly drawn). */
.display {
  margin: 0;
  font-family: var(--font-serif);
  /* Sized so the longest word ("Autoconhecimento") fits even on 320px phones. */
  font-size: clamp(2.25rem, 0.6rem + 8.4vw, 6.25rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.012em;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}

.headline {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5.2vw, 4.25rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.display em,
.headline em {
  font-style: italic;
  color: var(--accent);
}

.lead {
  margin: 0;
  font-size: clamp(1.1875rem, 1.6vw, 1.375rem);
  line-height: 1.45;
  letter-spacing: -0.014em;
  color: var(--ink-2);
  text-wrap: pretty;
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.section-head .lead {
  margin-top: 20px;
}

/* ---------- Buttons ------------------------------------------------------ */

.button {
  --btn-bg: var(--accent);
  --btn-ink: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition:
    transform 0.5s var(--ease),
    background-color 0.25s ease,
    box-shadow 0.4s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.button:hover {
  --btn-bg: var(--accent-strong);
  box-shadow: 0 10px 28px -10px rgb(85 104 79 / 0.55);
}

/* Feedback lives on the press, and it is instant. */
.button:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

.button-small {
  min-height: 36px;
  padding: 0 16px;
  font-size: 0.875rem;
}

.button-glass {
  --btn-bg: rgb(255 255 255 / 0.7);
  --btn-ink: var(--ink);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.6);
}

.button-glass:hover {
  --btn-bg: rgb(255 255 255 / 0.92);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.8),
    0 10px 28px -12px rgb(43 42 37 / 0.35);
}

.button svg {
  width: 18px;
  height: 18px;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--accent);
  font-size: 1.0625rem;
}

.link-arrow svg {
  width: 16px;
  height: 16px;
  transition: transform 0.45s var(--ease);
}

.link-arrow:hover svg {
  transform: translateX(4px);
}

.link-arrow:hover span {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Navigation: a translucent layer content scrolls under -------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--nav-h);
  background: rgb(246 243 236 / 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  transition:
    box-shadow 0.4s ease,
    background-color 0.4s ease;
}

.nav.is-scrolled {
  background: rgb(246 243 236 / 0.82);
  box-shadow: 0 1px 0 var(--line);
}

/* Darker material while the bar floats over a dark section. */
.nav.is-dark {
  background: rgb(35 39 31 / 0.72);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.06);
}

.nav.is-dark .brand {
  color: #d9b8a0;
}

.nav.is-dark .brand-name small,
.nav.is-dark .nav-links a {
  color: var(--night-ink-2);
}

.nav.is-dark .nav-links a:hover {
  color: #fff;
  background: rgb(255 255 255 / 0.08);
}

.nav.is-dark .nav-toggle .bar {
  background: var(--night-ink);
}

.brand,
.brand-name small {
  transition: color 0.4s ease;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--accent);
}

.brand .mark {
  width: 34px;
  height: auto;
  --mark-stroke: 1.15px;
}

.mark path[stroke] {
  stroke-width: var(--mark-stroke, 1.5px);
}

.brand-name {
  display: grid;
  line-height: 1.1;
}

.brand-name strong {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1875rem;
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
}

.brand-name small {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--ink-2);
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.nav-links a:hover {
  color: var(--ink);
  background: rgb(43 42 37 / 0.05);
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  background: none;
  cursor: pointer;
}

/* Two bars that meet in the middle and rotate into an X. */
.nav-toggle .bar {
  position: absolute;
  top: calc(50% - 0.75px);
  left: 13px;
  width: 18px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.45s var(--ease);
}

.nav-toggle .bar:first-child {
  transform: translateY(-3.5px);
}

.nav-toggle .bar:nth-child(2) {
  transform: translateY(3.5px);
}

.menu-open .nav-toggle .bar:first-child {
  transform: rotate(45deg);
}

.menu-open .nav-toggle .bar:nth-child(2) {
  transform: rotate(-45deg);
}

.nav-sheet {
  display: none;
}

@media (max-width: 860px) {
  .nav-links,
  .nav .nav-cta {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  /* The sheet grows down from the bar that opened it. */
  .nav-sheet {
    display: block;
    position: fixed;
    inset: var(--nav-h) 0 auto;
    z-index: 99;
    padding: 12px var(--gutter) 32px;
    background: rgb(246 243 236 / 0.94);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 24px 48px -24px rgb(43 42 37 / 0.25);
    transform-origin: top center;
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
    visibility: hidden;
    transition:
      opacity 0.3s ease,
      transform 0.5s var(--ease),
      visibility 0s linear 0.5s;
  }

  .menu-open .nav-sheet {
    opacity: 1;
    transform: none;
    visibility: visible;
    transition:
      opacity 0.3s ease,
      transform 0.5s var(--ease),
      visibility 0s;
  }

  .nav-sheet ul {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
  }

  .nav-sheet li {
    opacity: 0;
    transform: translateY(-6px);
    transition:
      opacity 0.3s ease,
      transform 0.5s var(--ease);
  }

  .menu-open .nav-sheet li {
    opacity: 1;
    transform: none;
    transition-delay: calc(var(--i, 0) * 40ms + 60ms);
  }

  .nav-sheet a:not(.button) {
    display: block;
    padding: 12px 0;
    font-size: 1.625rem;
    font-weight: 600;
    letter-spacing: -0.022em;
    border-bottom: 1px solid var(--line);
  }

  .nav-sheet .button {
    width: 100%;
  }
}

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

main {
  display: block;
}

.section {
  padding-block: clamp(88px, 12vw, 160px);
}

.section-alt {
  background: var(--bg-alt);
}

/* ---------- Hero --------------------------------------------------------- */

.hero {
  padding-top: calc(var(--nav-h) + clamp(56px, 9vw, 112px));
  padding-bottom: clamp(48px, 8vw, 96px);
  text-align: center;
  overflow: clip;
}

.hero-copy {
  max-width: 900px;
  margin-inline: auto;
}

.hero .lead {
  max-width: 640px;
  margin: 24px auto 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 28px;
  margin-top: 36px;
}

/* Entrance: each line rises into place, one after another. */
.rise {
  animation: rise 1s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 90ms + 80ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

.hero-stage {
  --p: 0;
  position: relative;
  width: min(1240px, 100% - var(--gutter) * 2);
  margin: clamp(48px, 7vw, 88px) auto 0;
  aspect-ratio: 16 / 8.5;
  border-radius: calc(var(--r-xl) + 12px * (1 - var(--p)));
  overflow: hidden;
  background: #e7e1d4;
  transform: scale(calc(0.92 + 0.08 * var(--p)));
  transform-origin: center top;
  box-shadow: var(--shadow-lift);
  animation: stage-in 1.2s var(--ease) 0.35s both;
}

@keyframes stage-in {
  from {
    opacity: 0;
    translate: 0 40px;
  }
}

.hero-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 24%;
  transform: scale(calc(1.08 - 0.08 * var(--p)));
}

.chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.68);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.55),
    0 8px 24px -12px rgb(43 42 37 / 0.35);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.chip-a {
  left: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vw, 28px);
}

.chip-b {
  right: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vw, 28px);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34c178;
  box-shadow: 0 0 0 3px rgb(52 193 120 / 0.22);
}

@media (max-width: 700px) {
  .hero-stage {
    aspect-ratio: 4 / 5;
  }

  .chip-b {
    display: none;
  }
}

/* ---------- Scroll reveal ----------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.9s var(--ease),
    transform 1.1s var(--ease);
  transition-delay: var(--delay, 0ms);
}

.js [data-reveal='scale'] {
  transform: translateY(20px) scale(0.97);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Approach (maternidade) -------------------------------------- */

.statement {
  margin: 0;
  max-width: 1000px;
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.9vw, 3.15rem);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -0.004em;
  text-wrap: pretty;
}

/* Words light up as the paragraph scrolls through the viewport. */
.js .statement .word {
  color: rgb(43 42 37 / 0.18);
  transition: color 0.35s ease;
}

.js .statement .word.is-lit {
  color: var(--ink);
}

.approach-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 20px;
  margin-top: clamp(56px, 8vw, 96px);
}

.tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
}

.tile-image {
  aspect-ratio: 4 / 3.4;
  background: var(--bg-alt);
}

.tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.4s var(--ease);
}

.tile-image:hover img {
  transform: scale(1.03);
}

/* Next to the genogram the photo fills the row height. */
.approach-grid .tile-image {
  aspect-ratio: auto;
  min-height: 420px;
}

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

  .approach-grid .tile-image {
    min-height: 0;
    aspect-ratio: 4 / 3.4;
  }
}

/* ---------- Accompaniment (dark) ---------------------------------------- */

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

.section-night .eyebrow {
  color: #bccaa9;
}

.section-night .lead {
  color: var(--night-ink-2);
}

.bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.05fr);
  grid-auto-rows: minmax(200px, auto);
  gap: 16px;
}

.benefit {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 28px;
  border-radius: var(--r-lg);
  background: var(--night-2);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.05);
  transition:
    transform 0.6s var(--ease),
    background-color 0.4s ease,
    opacity 0.9s var(--ease);
}

.benefit:hover {
  background: #31362b;
}

.benefit-index {
  font-size: 0.875rem;
  font-weight: 600;
  color: #bccaa9;
  font-variant-numeric: tabular-nums;
}

.benefit p {
  margin: 0;
  font-size: 1.3125rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.018em;
}

.bento-photo {
  grid-column: 3;
  grid-row: 1 / span 2;
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 420px;
}

.bento-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 30%;
}

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

  .bento-photo {
    grid-column: 1 / -1;
    grid-row: auto;
    order: -1;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 560px) {
  .bento {
    grid-template-columns: 1fr;
  }

  .benefit {
    gap: 24px;
  }
}

/* ---------- Tree of life ------------------------------------------------ */

.tree {
  --parallax: 0;
  position: relative;
  display: grid;
  align-items: end;
  min-height: clamp(560px, 70vw, 720px);
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--r-xl);
  overflow: hidden;
  isolation: isolate;
}

.tree-bg {
  position: absolute;
  inset: -8% 0;
  z-index: -1;
  width: 100%;
  height: 116%;
  object-fit: cover;
  transform: translateY(calc(var(--parallax) * 6%));
}

.tree-panel {
  max-width: 560px;
  padding: clamp(28px, 4vw, 44px);
  border-radius: var(--r-lg);
  background: rgb(255 255 255 / 0.72);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.7),
    0 30px 60px -30px rgb(43 42 37 / 0.35);
}

.tree-panel .headline {
  font-size: clamp(2.4rem, 4.2vw, 3.6rem);
}

.tree-panel p {
  margin: 16px 0 0;
  color: var(--ink-2);
}

.tree-panel .tree-highlight {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--accent-strong);
  font-weight: 600;
  letter-spacing: -0.012em;
}

.tree-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.tree-actions .button {
  --btn-bg: var(--ink);
}

.tree-actions .button:hover {
  --btn-bg: #000;
  box-shadow: 0 10px 28px -12px rgb(0 0 0 / 0.45);
}

.tree-actions .button-secondary {
  --btn-bg: rgb(43 42 37 / 0.07);
  --btn-ink: var(--ink);
}

.tree-actions .button-secondary:hover {
  --btn-bg: rgb(43 42 37 / 0.12);
  box-shadow: none;
}

/* ---------- About -------------------------------------------------------- */

.about {
  display: grid;
  grid-template-columns: 5fr 6fr;
  align-items: center;
  gap: clamp(40px, 7vw, 96px);
}

.about-photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-copy .lead {
  margin-top: 24px;
}

.mission {
  position: relative;
  margin: 40px 0 0;
  padding-left: 24px;
  border-left: 1px solid var(--clay);
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.25;
}

.signature {
  margin-top: 28px;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--clay);
}

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

  .about-photo {
    max-width: 480px;
  }
}

/* ---------- Contact ------------------------------------------------------ */

.contact-grid {
  display: grid;
  grid-template-columns: 7fr 4fr;
  gap: 20px;
  align-items: start;
}

.card {
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.form-card {
  position: relative;
  padding: clamp(24px, 4vw, 44px);
  overflow: hidden;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  position: relative;
}

.field-wide {
  grid-column: 1 / -1;
}

/* Floating label: sits inside the field, rises when there is a value. */
.field input,
.field textarea {
  width: 100%;
  padding: 26px 16px 10px;
  border: 1px solid rgb(43 42 37 / 0.14);
  border-radius: var(--r-sm);
  background: #fbf9f4;
  font-size: 1.0625rem;
  line-height: 1.4;
  transition:
    border-color 0.2s ease,
    box-shadow 0.3s var(--ease),
    background-color 0.2s ease;
  appearance: none;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

.field label {
  position: absolute;
  top: 18px;
  left: 17px;
  color: var(--ink-3);
  font-size: 1.0625rem;
  pointer-events: none;
  transform-origin: left top;
  transition:
    transform 0.35s var(--ease),
    color 0.2s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgb(85 104 79 / 0.12);
}

.field input:focus + label,
.field textarea:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:not(:placeholder-shown) + label {
  transform: translateY(-10px) scale(0.76);
}

.field input:focus + label,
.field textarea:focus + label {
  color: var(--accent);
}

.field .optional {
  font-weight: 400;
}

.field-error {
  display: block;
  min-height: 0;
  margin: 6px 4px 0;
  font-size: 0.875rem;
  color: var(--danger);
}

.field-error:empty {
  display: none;
}

.field.has-error input,
.field.has-error textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgb(179 38 30 / 0.1);
}

.field.has-error label {
  color: var(--danger);
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
}

.form-note {
  margin: 0;
  max-width: 340px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-3);
}

.button[aria-busy='true'] {
  pointer-events: none;
  opacity: 0.85;
}

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgb(255 255 255 / 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.button[aria-busy='true'] .spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-alert {
  margin: 0 0 20px;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  background: #fdecea;
  color: var(--danger);
  font-weight: 500;
}

.form-alert:empty {
  display: none;
}

.form-success {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 420px;
  padding: 24px;
  text-align: center;
}

.form-success h3 {
  margin: 12px 0 0;
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 500;
}

.form-success p {
  margin: 0;
  max-width: 360px;
  color: var(--ink-2);
}

.check {
  width: 72px;
  height: 72px;
  color: var(--success);
}

.check circle {
  stroke-dasharray: 214;
  stroke-dashoffset: 214;
  animation: draw 0.9s var(--ease) 0.1s forwards;
}

.check path {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: draw 0.5s var(--ease) 0.6s forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.form-card[data-state='sent'] form {
  display: none;
}

.form-card:not([data-state='sent']) .form-success {
  display: none;
}

.form-card[data-state='sent'] .form-success {
  animation: rise 0.8s var(--ease) both;
}

.contact-aside {
  display: grid;
  gap: 12px;
}

.contact-aside h3 {
  margin: 8px 4px 6px;
  font-size: 1.0625rem;
  letter-spacing: -0.012em;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.5s var(--ease),
    box-shadow 0.4s var(--ease);
}

.contact-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.contact-link:active {
  transform: scale(0.98);
  transition-duration: 0.1s;
}

.contact-link .icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.contact-link .icon svg {
  width: 22px;
  height: 22px;
}

.contact-link span {
  display: grid;
  line-height: 1.3;
  min-width: 0;
}

.contact-link strong {
  font-weight: 600;
}

.contact-link small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-3);
  font-size: 0.875rem;
}

.contact-link .chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  flex: none;
  color: var(--ink-3);
  transition: transform 0.45s var(--ease);
}

.contact-link:hover .chevron {
  transform: translateX(3px);
}

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

@media (max-width: 560px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-footer .button {
    width: 100%;
  }
}

/* ---------- Footer ------------------------------------------------------- */

.footer {
  padding-block: 56px 40px;
  background: var(--bg-alt);
  font-size: 0.875rem;
  color: var(--ink-2);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 24px;
  color: var(--ink-3);
  font-size: 0.8125rem;
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Error page --------------------------------------------------- */

.error-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}

.error-page .mark {
  width: 72px;
  margin: 0 auto 24px;
  color: var(--accent);
}

.error-page .lead {
  margin: 16px auto 32px;
  max-width: 420px;
}

/* ---------- Accessibility preferences ----------------------------------- */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
  }

  .js [data-reveal],
  .js [data-reveal='scale'] {
    transform: none;
    transition: opacity 0.4s ease;
  }

  .hero-stage,
  .hero-stage img,
  .tree-bg {
    transform: none;
  }

  .button,
  .contact-link,
  .tile-image img {
    transition-property: background-color, box-shadow, color;
  }

  .js .statement .word {
    color: var(--ink);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .nav,
  .nav-sheet,
  .chip,
  .tree-panel,
  .button-glass {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --ink-2: #2f2a31;
    --ink-3: #4a4450;
    --line: rgb(43 42 37 / 0.3);
  }

  .tree-panel,
  .chip {
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--ink);
  }
}

/* Stagger helpers (classes instead of inline styles: the CSP forbids those). */
.i-0 { --i: 0; }
.i-1 { --i: 1; }
.i-2 { --i: 2; }
.i-3 { --i: 3; }
.delay-1 { --delay: 120ms; }

/* ==========================================================================
   Systemic motion: everything is connected, and moving one part moves others.
   Layers: section backgrounds → thread + halo (z 1) → content (z 2).
   ========================================================================== */

main {
  position: relative;
}

.section > .container,
.hero > .container,
.hero-stage {
  position: relative;
  z-index: 2;
}

/* ---------- Hero network: nodes linked by fine lines -------------------- */

.hero {
  position: relative;
}

.hero-network {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  width: 100%;
  height: var(--network-h, 100%);
  pointer-events: none;
}

/* ---------- Thread running through the page ----------------------------- */

.thread {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.thread path {
  fill: none;
  stroke: var(--clay);
  stroke-opacity: 0.5;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.thread circle {
  fill: var(--clay);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.thread.is-drawing circle {
  opacity: 0.9;
}

/* When the thread reaches the contact button, the button answers softly. */
.button[data-thread-end] {
  transition:
    transform 0.5s var(--ease),
    background-color 0.25s ease,
    box-shadow 1.2s var(--ease);
}

.button[data-thread-end].is-arrived {
  box-shadow:
    0 0 0 6px rgb(168 101 74 / 0.14),
    0 14px 32px -14px rgb(85 104 79 / 0.6);
}

/* ---------- Cursor presence --------------------------------------------- */

.halo {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  width: 420px;
  height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(143 161 132 / 0.2), rgb(143 161 132 / 0) 65%);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(var(--hx, -999px), var(--hy, -999px), 0);
  transition: opacity 0.8s ease;
}

.halo.is-active {
  opacity: 1;
}

@media (hover: none), (pointer: coarse) {
  .halo {
    display: none;
  }
}

/* ---------- Genogram ----------------------------------------------------- */

.tile-genogram {
  display: grid;
  align-content: space-between;
  gap: 28px;
  padding: clamp(24px, 4vw, 44px);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.genogram {
  width: 100%;
  height: auto;
  overflow: visible;
}

.geno-lines path {
  stroke: var(--ink-3);
  stroke-width: 1.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.geno-node {
  --near: 0;
  fill: var(--surface);
  stroke: color-mix(in srgb, var(--ink) calc(55% + var(--near) * 45%), var(--accent));
  stroke-width: calc(1.5px + var(--near) * 0.8px);
  transform-box: fill-box;
  transform-origin: center;
  transition:
    opacity 0.9s var(--ease),
    transform 1.1s var(--ease);
}

.geno-node.geno-you {
  fill: var(--clay);
  stroke: var(--clay);
}

.geno-labels text {
  fill: var(--ink-3);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: opacity 0.9s var(--ease);
}

.geno-labels .geno-you-label {
  fill: var(--clay);
}

/* The drawing scales down with the card; keep the labels readable on phones. */
@media (max-width: 600px) {
  .geno-labels text {
    font-size: 22px;
  }
}

/* Not yet reached by the drawing (only when the script runs). */
.js .genogram .is-pending {
  opacity: 0;
}

.js .genogram .geno-node.is-pending {
  transform: scale(0.6);
}

.tile-genogram figcaption {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.15;
  color: var(--accent-strong);
}

/* ---------- Tiles finding their place ----------------------------------- */

.js .benefit[data-settle] {
  --settle: 1;
  opacity: calc(0.25 + 0.75 * var(--settle));
  transform: translate(
      calc(var(--dx, 0px) * (1 - var(--settle))),
      calc(var(--dy, 0px) * (1 - var(--settle)))
    )
    rotate(calc(var(--rot, 0deg) * (1 - var(--settle))));
  transition: background-color 0.4s ease;
}

/* ---------- Breathing ---------------------------------------------------- */

.section-contact {
  position: relative;
  overflow: clip;
}

.breath {
  position: absolute;
  top: clamp(40px, 8vw, 96px);
  left: 50%;
  z-index: 0;
  width: min(720px, 120vw);
  aspect-ratio: 1;
  translate: -50% 0;
  pointer-events: none;
}

.breath span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), rgb(227 232 218 / 0) 62%);
  animation: breathe 5.5s var(--ease-in-out) infinite alternate paused;
}

.breath span + span {
  inset: 18%;
  background: radial-gradient(circle, var(--clay-soft), rgb(241 226 214 / 0) 60%);
  animation-delay: -2.75s;
}

/* Only breathes while on screen. */
.breath.is-breathing span {
  animation-play-state: running;
}

@keyframes breathe {
  from {
    opacity: 0.55;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .breath span {
    animation: none;
    opacity: 0.8;
  }

  .halo {
    display: none;
  }

  .js .benefit[data-settle] {
    --settle: 1;
  }
}
