/* The scene's SVG viewport uses CSS pixels. Tree geometry never stretches;
   only grass adapts to the width; trunk bases follow broad rolling hills. */
[data-inline-forest-before], [data-inline-forest-after] { position: relative; }
[data-inline-forest-before]::before,
[data-inline-forest-after]::after { background: none !important; }
.pine-forest-scene { position: relative; left: 0; right: 0; display: block; width: 100%; pointer-events: none; }
.pine-forest-scene-before { bottom: auto; height: 165px; }
.pine-forest-scene-after { bottom: auto; height: 165px; }
#main:has(.account-grid) .page-palette-grove > .pine-forest-scene-before { height: 165px; }
[data-inline-forest-before] > .container,
[data-inline-forest-after] > .container { position: relative; z-index: 1; }
.pine-forest-scene > svg,
.forest-footer-layer[data-inline-scene] > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pine-forest-scene > .pine-forest-mobile,
.forest-footer-layer[data-inline-scene] > .pine-forest-mobile { display: none; }
.forest-footer-layer[data-inline-scene][data-forest-layer] { background-image: none; }
/* A scene owns its strip in the document flow; it never sits over text.
   Its front ground and the following surface use the same palette token. */
.pine-forest-scene[data-inline-scene='transition'] { background: var(--pine-daylight, #f8faf6); --forest-floor: var(--pine-grove, #e6eee1); }
.pine-forest-scene[data-inline-scene='section-exit'] { background: var(--pine-grove, #e6eee1); --forest-floor: var(--pine-dusk, #cbdcc6); }
.pine-forest-scene[data-inline-scene='faq-transition'] { background: var(--pine-dusk, #cbdcc6); --forest-floor: var(--pine-fern, #9eb89f); }
.pine-forest-scene [data-elastic-grass='front'] > path,
.pine-forest-scene [data-tree][data-layer='front'],
.pine-forest-scene [data-stem-bridge][data-layer='front'] { fill: var(--forest-floor); }
/* Match the page-specific section selectors: inherited section padding must
   never paint a floor-coloured strip before the scene's previous-surface sky. */
#main :is(.page-palette-band, .forest-section, .home-faq-section, .faq-page-section, .faq-support-band)[data-inline-forest-before] { padding-top: 0; }
/* Keep the account's existing breathing room after the ground, not above trees. */
#main:has(.account-grid) .page-palette-grove[data-inline-forest-before] > .container { padding-top: 18px; }
.home-experience .forest-section { margin-top: 0; padding-block: 0; background: var(--home-story, #e6eee1); }
.home-experience .forest-section > .container { padding-top: 28px; padding-bottom: 48px; }
.home-experience .home-trial-section { padding-bottom: 40px; background: var(--home-trial, #cbdcc6); }
.home-experience .home-faq-section { padding-top: 0; padding-bottom: 48px; background: var(--home-faq, #9eb89f); }
.home-experience .home-faq-section > .container { padding-top: 24px; }
.page-palette-grove:has(+ .page-palette-dusk) { padding-bottom: 40px; }
.page-palette-daylight:has(+ [data-inline-forest-before]) { padding-bottom: 24px; }
#main:has(.account-grid) .page-palette-daylight { padding-bottom: 24px; }
@media (max-width: 1023px) {
  .pine-forest-scene-before, .pine-forest-scene-after,
  #main:has(.account-grid) .page-palette-grove > .pine-forest-scene-before { height: 110px; }
  .pine-forest-scene > .pine-forest-desktop,
  .forest-footer-layer[data-inline-scene] > .pine-forest-desktop { display: none; }
  .pine-forest-scene > .pine-forest-mobile,
  .forest-footer-layer[data-inline-scene] > .pine-forest-mobile { display: block; }
  .home-experience .forest-section > .container { padding-top: 24px; padding-bottom: 32px; }
  .home-experience .home-trial-section { padding-bottom: 28px; }
  .page-palette-daylight:has(+ [data-inline-forest-before]) { padding-bottom: 20px; }
  #main:has(.account-grid) .page-palette-daylight { padding-bottom: 20px; }
}
.forest-section::before,
.forest-footer-edge {
  left: 0;
  right: 0;
  width: 100%;
  background-size: 100% 100%;
  background-position: center bottom;
  background-repeat: no-repeat;
}
.forest-section::before {
  height: 165px;
  background-image: url('/assets/illustrations/pine-transition.svg?v=20261128-palette-v22');
}
.forest-footer-edge {
  /* One shared footer scene; site-palette.css supplies the preceding surface. */
  height: 180px;
  --forest-scene-height: 180px;
  background-image: url('/assets/illustrations/pine-footer-transition.svg?v=20261128-palette-v22');
}
/* Keep the complete static scene until all three independent layers are mounted. */
.forest-footer-edge[data-layered] {
  top: calc(2px - var(--forest-scene-height));
  bottom: 0;
  height: auto;
  background-image: none;
  overflow: hidden;
  isolation: isolate;
  z-index: 0;
}
/* Each tree layer includes its own deep ground. The entire scene moves as one
   piece; its canvas edge stays beyond the footer and is clipped at its bottom. */
/* The page colour stops at the tree line. Keep the text on solid forest
   even while SVG layers load, and on browsers that delay background painting. */
.forest-footer-edge[data-layered] { background-color: transparent; }
.forest-footer-edge[data-layered]::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: var(--forest-scene-height);
  background: var(--footer-previous-surface, var(--paper));
  z-index: -1;
}
.forest-footer-edge[data-layered] + .container {
  position: relative;
  z-index: 1;
}
.forest-footer-layer {
  position: absolute;
  inset: 0 0 -32px;
  pointer-events: none;
  background-position: center top;
  background-size: 100% calc(var(--forest-scene-height) + 1024px);
  background-repeat: no-repeat;
}
.forest-footer-layer[data-forest-layer='back'] {
  z-index: 0;
  --forest-dip: 12px;
  --forest-delay: 0ms;
  background-image: url('/assets/illustrations/pine-footer-transition-back.svg?v=20261130-deep-ground-v120');
}
.forest-footer-layer[data-forest-layer='middle'] {
  z-index: 1;
  --forest-dip: 17px;
  --forest-delay: 70ms;
  background-image: url('/assets/illustrations/pine-footer-transition-middle.svg?v=20261130-deep-ground-v120');
}
.forest-footer-layer[data-forest-layer='front'] {
  z-index: 2;
  --forest-dip: 22px;
  --forest-delay: 140ms;
  background-image: url('/assets/illustrations/pine-footer-transition-front.svg?v=20261130-deep-ground-v120');
}
.forest-footer-edge[data-layered][data-forest-moving] .forest-footer-layer {
  animation: pine-footer-settle 1050ms cubic-bezier(.4, 0, .2, 1) var(--forest-delay) 1 both;
  will-change: transform;
}
@keyframes pine-footer-settle {
  0%, 100% { transform: translate3d(0, 0, 0); }
  30% { transform: translate3d(0, var(--forest-dip), 0); }
  75% { transform: translate3d(0, -2px, 0); }
}
@media (max-width: 1023px) {
  .forest-section::before {
    height: 110px;
    background-image: url('/assets/illustrations/pine-transition-mobile.svg?v=20261128-palette-v22');
  }
  .forest-footer-edge {
    height: 120px;
    --forest-scene-height: 120px;
    background-image: url('/assets/illustrations/pine-footer-transition-mobile.svg?v=20261128-palette-v22');
  }
  .forest-footer-layer[data-forest-layer='back'] {
    background-image: url('/assets/illustrations/pine-footer-transition-back-mobile.svg?v=20261130-deep-ground-v120');
  }
  .forest-footer-layer[data-forest-layer='middle'] {
    background-image: url('/assets/illustrations/pine-footer-transition-middle-mobile.svg?v=20261130-deep-ground-v120');
  }
  .forest-footer-layer[data-forest-layer='front'] {
    background-image: url('/assets/illustrations/pine-footer-transition-front-mobile.svg?v=20261130-deep-ground-v120');
  }
}
@media (prefers-reduced-motion: reduce) {
  .forest-footer-edge[data-layered][data-forest-moving] .forest-footer-layer {
    animation: none;
    transform: none;
    will-change: auto;
  }
}
