/* Home: the seed scene. Under html.anim the hero is pinned for 640vh while the seeds tell the story (motion.js);
   without it (reduced motion, no GSAP, failsafe) the first screen is still, the mark formed at the right, and the closing sits in flow beneath. */

.hero { position: relative; overflow: clip; }
.hero canvas { position: absolute; inset: 0 0 auto; width: 100%; height: 100vh; }
/* the fruit: one apple of seeds hanging from the crown once the tree has bloomed, swaying a little under a warm glow (decorative, like the light) */
.hero .fruit { position: absolute; inset: 0 0 auto; z-index: 2; width: 100%; height: 100vh; overflow: visible; pointer-events: none; opacity: 0; }
/* pivots in viewBox units, set by motion.js (the viewBox is the screen): a fill-box pivot resolves late in Firefox and the breathe scales the halo off its apple */
.hero .fruit .halo { transform-box: view-box; animation: fruit-breathe 3.6s ease-in-out infinite; }
.hero .fruit .swing { transform-box: view-box; animation: fruit-sway 4s ease-in-out infinite; }
@keyframes fruit-breathe { 0%, 100% { opacity: .5; transform: scale(1); } 50% { opacity: .95; transform: scale(1.15); } }
@keyframes fruit-sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
html:not(.anim) .fruit { display: none; }
/* the pick (desktop only): once the tree stands (motion.js adds .fruit-on) a button sits on the apple with "Click me" beside it; picked (.lit on the hero),
   the glow comes on and breathes, the tag goes and the affirmation beneath the apple rises into place. On phones the apple just glows, as before */
.pick-apple, .apple-words { display: none; }
@media (min-width: 981px) {
  .hero:not(.lit) .fruit .halo { opacity: 0; animation: none; }
  .pick-apple { display: block; position: absolute; z-index: 3; border-radius: 50%; cursor: pointer; visibility: hidden; }
  .hero.fruit-on .pick-apple { visibility: visible; }
  .pick-apple:focus-visible { outline: 2px solid var(--leaf-deep); outline-offset: 6px; }
  .pick-tag { position: absolute; left: calc(100% + 10px); top: 50%; translate: 0 -50%; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--hair); border-radius: 999px; background: var(--bg); font: 600 .8125rem/1 var(--sans); color: var(--ink); white-space: nowrap; transition: opacity .3s; }
  .pick-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--seed); animation: beat 2.4s ease-in-out infinite; }
  .hero.lit .pick-tag { opacity: 0; }
  .apple-words { display: block; position: absolute; z-index: 3; width: 260px; margin: 0; text-align: center; visibility: hidden; }
  .hero.lit.fruit-on .apple-words { visibility: visible; }
  .apple-words span { display: block; font: 500 clamp(1.125rem, 1.5vw, 1.375rem)/1.35 var(--display); font-variation-settings: 'SOFT' 100; color: var(--ink); text-wrap: pretty; translate: 0 14px; transition: translate .6s var(--ease); }
  .apple-words i { font-style: italic; color: var(--leaf-deep); }
  .hero.lit .apple-words span { translate: 0 0; }
  @keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }
}
.hero .wrap { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; min-height: 100vh; padding-top: var(--nav-h); pointer-events: none; }
.hero .copy { pointer-events: auto; }
.hero h1 .line { display: block; padding-bottom: .12em; margin-bottom: -.12em; }
.hero h1 .line > span { display: block; }
.hero .lead { max-width: 40ch; margin-top: 28px; }
.hero .scroll { display: flex; align-items: center; gap: 14px; margin-top: 40px; font: 600 .8125rem/1.5 var(--sans); color: var(--muted); }
.hero .scroll i { width: 1px; height: 36px; background: var(--muted); transform-origin: top; }
/* keyboard only: hidden (site.css .visually-hidden) until it has focus */
.hero .skip-scene:focus { position: static; display: inline-block; width: auto; height: auto; margin: 24px 0 0; overflow: visible; clip: auto; clip-path: none; font: 600 .8125rem/1.5 var(--sans); color: var(--ink); text-decoration: underline; text-decoration-color: var(--seed); text-underline-offset: 4px; }
/* no JavaScript: the mark, drawn where the seeds would form it */
.mark-still { position: absolute; z-index: 1; left: 72%; top: 50vh; width: min(34vw, 74vh); height: auto; transform: translate(-50%, -50%); }
.hero .state { position: absolute; left: 0; bottom: 40px; font: 600 .8125rem/1.5 var(--sans); color: var(--muted); }
.hero .state span { position: absolute; left: 0; bottom: 0; white-space: nowrap; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .3s var(--ease), transform .6s var(--ease), visibility 0s linear .3s; }
.hero .state span.on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

/* the eight service labels, centred under their seeds (beside them on phones); the name links to its service, the caption opens on hover and focus */
.svc { position: absolute; z-index: 3; width: 106px; margin-left: -53px; text-align: center; opacity: 0; transition: opacity .3s; }
.svc i { display: block; margin-bottom: 2px; font: 700 .75rem/1 var(--sans); font-style: normal; letter-spacing: .1em; color: var(--seed-ink); }
.svc a { display: block; padding-block: 4px; font: 700 .8125rem/1.2 var(--sans); color: var(--ink); text-decoration: none; transition: color .3s; }
.svc a:hover, .svc.on a { color: var(--leaf-deep); }
.svc small { display: block; font: 500 .75rem/1.4 var(--sans); color: var(--muted); }
.svc .cap { display: block; max-height: 0; overflow: hidden; opacity: 0; font: 400 .875rem/1.45 var(--sans); color: var(--text); transition: max-height .6s var(--ease), opacity .3s, margin-top .3s; }
.svc:is(:hover, :focus-within) .cap { max-height: 12em; opacity: 1; margin-top: 6px; }

/* the guide seed, and the words for the service it is on */
.guide { position: absolute; z-index: 3; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--seed); opacity: 0; box-shadow: 0 0 0 6px color-mix(in srgb, var(--seed) 18%, transparent), 0 8px 16px -6px color-mix(in srgb, var(--seed-deep) 70%, transparent); }
.stages { position: absolute; z-index: 3; left: 0; right: 0; top: 58%; text-align: center; pointer-events: none; transition: opacity .3s var(--ease); }
/* an open caption runs down into the stage words: they step aside while a label is hovered or focused (phones show no captions) */
@media (min-width: 981px) { .hero:has(.svc:hover, .svc:focus-within) .stages { opacity: 0; } }
.stage { position: absolute; left: var(--gutter); right: var(--gutter); top: 0; opacity: 0; visibility: hidden; }
.stage .num { font: 500 .9375rem/1 var(--display); font-variation-settings: 'SOFT' 100; letter-spacing: .14em; color: var(--seed-ink); }
.stage h2 { margin-top: 10px; font-size: clamp(1.75rem, 3.2vw, 2.75rem); line-height: 1.05; }
.stage p { max-width: 50ch; margin: 12px auto 0; text-wrap: pretty; }

/* the closing words: in flow beneath the still first screen, or beside (under, on phones) the tree of seeds at the end of the scene */
.end { position: relative; z-index: 3; padding: 64px var(--gutter) 96px; text-align: center; }
.end h2 i { font-style: italic; font-weight: 400; color: var(--leaf); }
.end p { max-width: 46ch; margin: 18px auto 0; text-wrap: pretty; }
.end .proof { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 0; max-width: none; margin-top: 18px; font: 600 .8125rem/1.5 var(--sans); color: var(--leaf-deep); }
.end .proof span { display: inline-flex; align-items: center; }
.end .proof span + span::before { content: ""; width: 5px; height: 5px; margin: 0 14px; border-radius: 50%; background: var(--seed); }
.end .next-step { padding: 0; margin-top: 26px; }
.end .verse { display: block; margin-top: 24px; font: 500 .8125rem/1.5 var(--sans); color: var(--muted); }

/* still page: the walk's labels and words have no stage to play on */
html:not(.anim) :is(.svc, .guide, .stages, .gather) { display: none; }
/* the gather and the bloom: while the eight come together as one seed and the mark returns, two lines sit where the copy sat */
.gather { position: absolute; z-index: 3; left: max(var(--gutter), (100% - var(--container)) / 2); top: 50%; translate: 0 -50%; width: calc(min(var(--container), 100% - 2 * var(--gutter)) * .4); pointer-events: none; }
.gather p { position: absolute; left: 0; top: 50%; margin: 0; width: 100%; font: 500 clamp(2rem, 3.4vw, 3rem)/1.08 var(--display); font-variation-settings: 'SOFT' 100; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; opacity: 0; visibility: hidden; translate: 0 calc(-50% + var(--rise, 16px)); }
.gather p i { font-style: italic; font-weight: 400; color: var(--leaf); }

/* ---------- the pinned scene ---------- */
html.anim .hero-wrap { height: 640vh; }
html.anim .hero { position: sticky; top: 0; z-index: 1; height: 100vh; }
html.anim .hero canvas { height: 100%; }
html.anim .hero .wrap { height: 100%; min-height: 0; }
/* not visibility:hidden, so keyboards and screen readers reach the closing; Tab into it plays the scene to its end (motion.js) */
html.anim .end { position: absolute; left: 0; right: 0; bottom: 40px; padding: 0 var(--gutter); opacity: 0; pointer-events: none; }
html.anim .end.is-shown > * { pointer-events: auto; }
html.anim .hero h1 .line { overflow: hidden; }

/* entrance: the header fades in, the h1 lines rise, then the lead, cue and status; `backwards` fill hands the values back to the scroll-driven inline styles */
@keyframes home-rise { from { transform: translateY(110%); } }
@keyframes home-fade { from { opacity: 0; } }
@keyframes home-drop { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }
html.anim .site-head .nav { animation: home-fade .6s var(--ease) backwards; }
html.anim .hero h1 .line > span { animation: home-rise .9s var(--ease) .15s backwards; }
html.anim .hero h1 .line + .line > span { animation-delay: .25s; }
html.anim .hero .lead { animation: home-fade .6s var(--ease) .5s backwards; }
html.anim .hero .scroll { animation: home-fade .6s var(--ease) .8s backwards; }
html.anim .hero .state { animation: home-fade .6s var(--ease) .9s backwards; }
html.anim .hero .scroll i { animation: home-drop 1.8s var(--ease) infinite; }

/* ---------- tablets and phones: the copy stacks, the row becomes a column ---------- */
@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; align-content: start; padding-top: 110px; }
  .hero h1 { font-size: clamp(2.5rem, 10vw, 3.5rem); }
  .hero .lead { margin-top: 18px; font-size: 1rem; }
  .hero .scroll { margin-top: 24px; }
  .svc { width: 190px; margin: -16px 0 0 34px; text-align: left; }
  .svc .cap { display: none; }
  .mark-still { left: 50%; top: 72vh; width: min(62vw, 43vh); }
  .stages { top: 77%; }
  .gather { left: var(--gutter); right: var(--gutter); width: auto; top: 16%; translate: none; text-align: center; }
  .gather p { font-size: 1.5rem; top: 0; translate: 0 var(--rise, 16px); }
  .stage h2 { font-size: 1.375rem; }
  .stage p { max-width: 34ch; font-size: .8125rem; }
}
@media (max-width: 760px) {
  .end { padding-bottom: 64px; }
  html.anim .end { bottom: 24px; }
  .end h2 { font-size: 1.5rem; }
  .end p { font-size: .9375rem; }
  .end .proof { display: none; }
}
/* desktop scene: the closing is a left column like the opening copy, vertically centred, while the tree grows on the right half (motion.js) */
@media (min-width: 981px) {
  html.anim .end { left: max(var(--gutter), (100% - var(--container)) / 2); right: auto; top: 50%; bottom: auto; width: calc(min(var(--container), 100% - 2 * var(--gutter)) * .46); padding: 0; text-align: left; translate: 0 -50%; }
  html.anim .end h2 { font-size: clamp(2rem, 3.4vw, 3rem); }
  html.anim .end p { margin-inline: 0; }
  html.anim .end .proof { flex-direction: column; align-items: flex-start; }
  html.anim .end .proof span::before { content: ""; width: 5px; height: 5px; margin: 0 12px 0 0; border-radius: 50%; background: var(--seed); }
  html.anim .end .next-step { align-items: flex-start; }
}
/* short screens (landscape phones, small laptops): the closing keeps only its words and the Next button, so it fits */
@media (max-height: 700px) and (max-width: 980px) { html.anim .end { bottom: 16px; } }
@media (max-height: 700px) {
  html.anim .end h2 { font-size: clamp(1.375rem, 3vw, 2rem); }
  html.anim .end p { margin-top: 10px; font-size: .9375rem; }
  html.anim .end .next-step { margin-top: 14px; gap: 6px; }
  html.anim .end :is(.proof, .verse) { display: none; }
}
