/* Motion and finish layer. Loaded last; every effect has a static state and respects reduced motion. */
:root { --ease-out: cubic-bezier(.19, 1, .22, 1); --ease-mask: cubic-bezier(.77, 0, .18, 1); interpolate-size: allow-keywords; }

/* ---------- Typography: balanced headings and captions, no orphaned words in copy ---------- */
h1, h2, h3, figcaption, .professional-name, .faq-list summary, .contact-list p { text-wrap: balance; }
p, li { text-wrap: pretty; }
/* Small labels stay readable on phones (nothing under 10 px). */
@media (max-width: 700px) {
  .section-kicker, .eyebrow, .service-topline, .journey-art-label { font-size: 10px; }
  .hero-note, .footer-bottom { font-size: 11px; }
}
@media (max-width: 480px) {
  .hero-visual-photographic .visual-index { font-size: 9px; }
}

/* ---------- Header: reading progress, compact state, steps aside while reading ---------- */
.site-header { transition: transform .5s var(--ease-out), background-color .3s ease, border-color .3s ease, box-shadow .3s ease; }
.site-header.is-scrolled { box-shadow: 0 10px 30px -22px rgba(27, 49, 63, .45); }
.site-header.is-hidden:not(:focus-within) { transform: translateY(-100%); }
.header-inner { transition: min-height .45s var(--ease-out); }
.site-header.is-scrolled .header-inner { min-height: 78px; }
.scroll-progress {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--vitalle-teal), #6fc2b6);
  pointer-events: none;
}

/* ---------- Early hide for the opening only (no flash before the script runs) ---------- */
.motion-ready:not(.motion-started) .hero .eyebrow,
.motion-ready:not(.motion-started) .hero h1,
.motion-ready:not(.motion-started) .hero-description,
.motion-ready:not(.motion-started) .hero-actions,
.motion-ready:not(.motion-started) .hero-note,
.motion-ready:not(.motion-started) .hero-visual { opacity: 0; }

/* ---------- Reveals ---------- */
.reveal {
  opacity: 0;
  transition: opacity .9s ease var(--d, 0ms), transform 1.1s var(--ease-out) var(--d, 0ms);
}
.reveal-up { transform: translateY(30px); }
.reveal-rise { transform: translateY(46px) scale(.97); }
.reveal-panel { transform: translateY(54px); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal.is-settled { transition: opacity .3s ease, transform .3s ease; }

.reveal-fade .kicker-line, .reveal-fade .eyebrow-rule { transform: scaleX(0); transform-origin: left; transition: transform 1.1s var(--ease-out) calc(var(--d, 0ms) + 150ms); }
.reveal-fade.is-in .kicker-line, .reveal-fade.is-in .eyebrow-rule { transform: none; }

.reveal-lines .line { display: block; overflow: hidden; padding: 0 .12em .16em; margin: 0 -.12em -.16em; }
.reveal-lines .line-inner {
  display: inline-block;
  transform: translateY(112%);
  transition: transform 1.25s var(--ease-out) calc(var(--d, 0ms) + var(--line, 0) * 95ms);
}
.reveal-lines.is-in .line-inner { transform: none; }

.reveal-media { opacity: 1; transform: none; }
.reveal-media img { clip-path: inset(100% 0 0 0); transform: scale(1.12); transition: clip-path 1.35s var(--ease-mask) var(--d, 0ms), transform 1.8s var(--ease-out) var(--d, 0ms); }
.reveal-media figcaption { opacity: 0; transition: opacity .8s ease calc(var(--d, 0ms) + 650ms); }
.reveal-media.is-in img { clip-path: inset(0 0 0 0); transform: none; }
.reveal-media.is-in figcaption { opacity: 1; }
.reveal-media.is-settled img { clip-path: none; transition: transform .65s var(--vitalle-ease), box-shadow .65s var(--vitalle-ease); }

/* Manifesto: words light up while it is read (opacity set from the script). */
.scrub .word { transition: opacity .25s linear; }

/* ---------- Word band between the opening and the manifesto ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--vitalle-border);
  padding: 22px 0;
  background: var(--vitalle-ivory);
  color: var(--vitalle-ink);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: vitalle-marquee 46s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span {
  display: inline-flex;
  align-items: center;
  gap: 38px;
  padding-right: 38px;
  font: 400 clamp(26px, 3.2vw, 44px)/1 var(--serif);
  letter-spacing: -.01em;
  white-space: nowrap;
}
.marquee span:nth-child(even) { color: var(--vitalle-teal); font-style: italic; }
.marquee span::after { width: 7px; height: 7px; border: 1px solid var(--vitalle-teal); border-radius: 50%; content: ""; }
@keyframes vitalle-marquee { to { transform: translateX(-50%); } }

/* ---------- Opening: an orbit from the brand mark behind the portrait ---------- */
.hero-photo-stack { isolation: isolate; }
.hero-orbit {
  position: absolute;
  z-index: -1;
  top: 22%;
  right: -26px;
  width: clamp(220px, 21vw, 300px);
  aspect-ratio: 1;
  border: 1px solid rgba(20, 117, 112, .28);
  border-radius: 50%;
  pointer-events: none;
}
.hero-orbit::before { position: absolute; inset: 14%; border: 1px solid rgba(20, 117, 112, .14); border-radius: 50%; content: ""; }
.hero-orbit::after {
  position: absolute;
  top: -5px;
  left: calc(50% - 5px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--vitalle-teal);
  box-shadow: 0 0 0 6px rgba(20, 117, 112, .12);
  content: "";
  transform-origin: 5px calc(5px + clamp(110px, 10.5vw, 150px));
  animation: vitalle-orbit 18s linear infinite;
}
@keyframes vitalle-orbit { to { transform: rotate(360deg); } }

/* ---------- Buttons: soft magnetic pull and a light sweep ---------- */
.button, .header-cta { position: relative; overflow: hidden; isolation: isolate; }
.button, .header-cta, .whatsapp-float { transition: translate .45s var(--ease-out), transform .3s var(--vitalle-ease), background-color .3s ease, color .3s ease, border-color .3s ease; }
.button::before, .header-cta::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  transform: translateX(-102%);
  background: linear-gradient(100deg, transparent 10%, rgba(255, 255, 255, .22) 50%, transparent 90%);
  content: "";
  transition: transform .9s var(--ease-out);
}
.button:hover::before, .header-cta:hover::before { transform: translateX(102%); }
.button span[aria-hidden="true"], .header-cta .arrow, .service-link span, .text-link span, .contact-cta span { display: inline-block; transition: transform .45s var(--ease-out); }
.button:hover span[aria-hidden="true"], .header-cta:hover .arrow, .service-link:hover span, .contact-cta:hover span { transform: translate(3px, -3px); }

/* ---------- Underlined links: the line hugs the text, the 44 px target grows upwards ---------- */
.service-link, .contact-cta { align-items: flex-end; padding-top: 14px; padding-bottom: 6px; }

/* ---------- Professional: portrait on the left, label + title + note as one column ---------- */
@media (min-width: 701px) {
  .professional {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "photo intro" "photo note";
    column-gap: 8%;
    row-gap: 0;
    align-items: start;
  }
  .professional-profile { display: contents; }
  .professional-photo { grid-area: photo; }
  .professional-intro { grid-area: intro; display: block; padding-top: 8px; }
  .professional-intro .section-kicker { max-width: none; margin: 0 0 24px; }
  .professional-profile .professional-note { grid-area: note; align-self: start; margin-top: 40px; }
}

/* ---------- Phones: compact WhatsApp button after the opening, out of the way at the end ---------- */
@media (max-width: 700px) {
  .whatsapp-float {
    display: flex;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    min-height: 52px;
    gap: 14px;
    padding: 8px 16px 8px 20px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(140%);
    transition: transform .5s var(--ease-out), opacity .3s ease, visibility 0s linear .5s;
  }
  .whatsapp-float.is-shown { visibility: visible; opacity: 1; transform: none; transition: transform .5s var(--ease-out), opacity .3s ease, visibility 0s; }
  .whatsapp-float-copy small { display: none; }
  .whatsapp-float-copy strong { font-size: 13px; }
}

/* ---------- Service panels: a soft light follows the pointer ---------- */
.service-panel { position: relative; overflow: hidden; }
.service-panel::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 40%), rgba(255, 255, 255, .55), transparent 62%);
  opacity: 0;
  content: "";
  transition: opacity .5s ease;
  pointer-events: none;
}
.service-panel:hover::after { opacity: 1; }
.service-panel > * { position: relative; z-index: 2; }

/* ---------- Film grain on the deep sections ---------- */
.journey, .final-cta, .site-footer { position: relative; }
.journey::before, .final-cta::before, .site-footer::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .07;
  mix-blend-mode: soft-light;
  content: "";
  pointer-events: none;
}
.journey > *, .final-cta > *, .site-footer > * { position: relative; z-index: 1; }
.final-cta .final-ornament { animation: vitalle-breathe 9s ease-in-out infinite; }
@keyframes vitalle-breathe { 50% { scale: 1.035; opacity: .78; } }

/* ---------- Footer signature ---------- */
.footer-bottom { align-items: center; }
@media (max-width: 700px) { .footer-bottom { align-items: flex-start; } }
.footer-wordmark {
  margin: 8px 0 18px;
  overflow: hidden;
  color: rgba(242, 246, 244, .07);
  font: 500 clamp(96px, 21vw, 330px)/.78 var(--serif);
  letter-spacing: -.045em;
  text-align: center;
  user-select: none;
}

/* ---------- FAQ opens smoothly where the browser supports it ---------- */
.faq-list details::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size .5s var(--ease-out), content-visibility .5s allow-discrete;
}
.faq-list details[open]::details-content { block-size: auto; }
.faq-list summary::after { transition: transform .4s var(--ease-out), background .3s ease; }
.faq-list details[open] summary::after { transform: translateY(-50%) rotate(180deg); }
.faq-list summary:hover { color: var(--vitalle-teal); }

/* ---------- Zoomable photographs + lightbox ---------- */
.is-zoomable { position: relative; }
.zoom-trigger {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 14px;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.zoom-chip {
  display: inline-flex;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(247, 246, 241, .92);
  color: var(--vitalle-ink);
  font: 600 11px/1.2 var(--sans);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .35s ease, transform .45s var(--ease-out);
}
.zoom-chip span { color: var(--vitalle-teal); }
.zoom-trigger:hover .zoom-chip, .zoom-trigger:focus-visible .zoom-chip { opacity: 1; transform: none; }
.zoom-trigger:focus-visible { outline-offset: -3px; }
@media (hover: none) { .zoom-chip { opacity: 1; transform: none; } }

.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: clamp(18px, 4vw, 48px);
  border: 0;
  background: rgba(13, 30, 35, .96);
  color: #eef4f1;
}
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; place-items: center; animation: vitalle-fade .35s ease; }
.lightbox::backdrop { background: rgba(13, 30, 35, .6); }
.lightbox-figure { grid-row: 2; display: flex; max-height: 100%; min-height: 0; flex-direction: column; align-items: center; margin: 0; }
.lightbox-figure img { display: block; max-width: min(92vw, 1200px); max-height: calc(100dvh - 190px); width: auto; height: auto; object-fit: contain; }
.lightbox-figure figcaption { padding-top: 14px; color: #c9dcd5; font-size: 13px; }
.lightbox-count { grid-row: 1; justify-self: start; margin: 0; color: #a4ddd3; font: 700 11px/1 var(--sans); letter-spacing: .14em; }
.lightbox-close {
  position: absolute;
  top: clamp(14px, 3vw, 34px);
  right: clamp(14px, 3vw, 34px);
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(238, 244, 241, .3);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: 600 12px/1 var(--sans);
  cursor: pointer;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(238, 244, 241, .3);
  border-radius: 50%;
  background: rgba(13, 30, 35, .5);
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  translate: 0 -50%;
}
.lightbox-prev { left: clamp(8px, 2vw, 28px); }
.lightbox-next { right: clamp(8px, 2vw, 28px); }
.lightbox-close:hover, .lightbox-nav:hover { border-color: #a4ddd3; color: #a4ddd3; }
@keyframes vitalle-fade { from { opacity: 0; } }

@media (max-width: 960px) {
  .hero-orbit { display: none; }
}
@media (max-width: 700px) {
  .marquee { padding: 16px 0; }
  .marquee span { gap: 26px; padding-right: 26px; }
  .lightbox-nav { top: auto; bottom: 18px; translate: none; }
  .lightbox-figure img { max-height: calc(100dvh - 210px); }
}

/* ---------- Reduced motion: everything visible, nothing travels ---------- */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-lines .line-inner, .reveal-media img, .reveal-media figcaption { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important; }
  .marquee-track, .hero-orbit::after, .final-cta .final-ornament { animation: none; }
  .site-header.is-hidden { transform: none; }
  .button, .header-cta, .whatsapp-float { translate: none !important; }
  .faq-list details::details-content { transition: none; }
  .lightbox[open] { animation: none; }
}
