/* Motion layer: smooth scroll, sticky header, stacked panels, reveals, tide text, coast-path process, floating CTA. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* Header: stays at the top, slides away while scrolling down */
.site-head { position: sticky; top: 0; z-index: 40; transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s; }
.site-head.is-hidden { transform: translateY(-100%); }
.site-head.is-scrolled { box-shadow: 0 10px 30px -18px rgba(5, 18, 20, 0.6); }

/* Stacked panels: each one rises over the last with a rounded edge */
.panel { position: relative; border-radius: clamp(24px, 3.5vw, 48px) clamp(24px, 3.5vw, 48px) 0 0; margin-top: calc(clamp(24px, 3.5vw, 48px) * -1); }
.section.panel, .section.panel + .section, .panel + .section { border-top: 0; }
.cta.panel { margin-top: 0; }

/* Reveal on scroll (only once JS has marked the element, so nothing hides without it) */
[data-r] { opacity: 0; transform: translateY(32px); transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--d, 0ms); }
[data-r].in { opacity: 1; transform: none; }

/* Tide text */
.tide { overflow: hidden; padding-block: clamp(40px, 7vw, 96px) clamp(72px, 10vw, 140px); display: grid; gap: 4px; }
.tide-row { display: flex; width: max-content; white-space: nowrap; will-change: transform; font: 800 clamp(3rem, 9vw, 8.5rem)/1 var(--display); letter-spacing: -0.03em; }
.tide-row span { padding-right: 0.3em; color: transparent; -webkit-text-stroke: 1.5px var(--sea); }
.tide-row b { color: var(--gorse); -webkit-text-stroke: 0; font-weight: 800; }
.tide-row.solid { font-size: clamp(1.6rem, 4vw, 3.4rem); margin-left: -20vw; }
.tide-row.solid span { color: var(--sea); -webkit-text-stroke: 0; }

/* Coast-path process */
.voyage { background: var(--paper); }
.voyage-pin { padding-block: 88px; }
.voyage-head { display: grid; gap: 14px; margin-bottom: 40px; }
.voyage-track { position: relative; }
.voyage-path { display: none; }
.voyage-steps { list-style: none; margin: 0; padding: 0 max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px)); display: grid; gap: 40px; max-width: var(--max); margin-inline: auto; }
.voyage-steps li { display: grid; gap: 10px; position: relative; }
.voyage-steps .num { font: 800 clamp(4.5rem, 9vw, 9rem)/0.85 var(--display); letter-spacing: -0.04em; color: transparent; -webkit-text-stroke: 1.5px var(--sea); transition: color 0.5s, -webkit-text-stroke-color 0.5s; }
.voyage-steps li.reached .num { color: var(--gorse); -webkit-text-stroke-color: var(--gorse); }
.voyage-steps .when { font: 500 0.78rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.voyage-steps h3 { font-size: 1.6rem; }
.voyage-steps p { color: var(--muted); max-width: 34ch; }

@media (min-width: 900px) {
  html.has-motion .voyage-pin { position: sticky; top: 0; height: 100vh; padding-block: 0; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
  html.has-motion .voyage-track { width: max-content; will-change: transform; padding-top: 40px; }
  html.has-motion .voyage-path { display: block; position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 150px; overflow: visible; }
  .voyage-path path { fill: none; }
  .voyage-path .base { stroke: var(--line); stroke-width: 2px; stroke-dasharray: 0.004 0.006; }
  .voyage-path .trail { stroke: var(--gorse); stroke-width: 3px; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--vp, 0)); }
  html.has-motion .voyage-steps { display: flex; gap: clamp(48px, 6vw, 110px); max-width: none; margin: 0; padding-left: max(20px, calc((100vw - var(--max)) / 2 + 20px)); padding-right: 30vw; padding-top: 70px; }
  html.has-motion .voyage-steps li { width: clamp(300px, 30vw, 430px); flex: none; }
}

/* Floating call to action */
.float-cta { position: fixed; z-index: 45; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 20px; border-radius: 999px; background: var(--gorse); color: #1B1600; font: 600 0.95rem/1 var(--body); text-decoration: none;
  box-shadow: 0 14px 34px -14px rgba(10, 30, 34, 0.55); transform: translateY(140%); opacity: 0; transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.3s; }
.float-cta.show { transform: none; opacity: 1; }
.float-cta:hover { background: #F2C64A; }
.float-cta span { transition: transform 0.25s; }
.float-cta:hover span { transform: translateX(3px); }

@media (prefers-reduced-motion: reduce) {
  [data-r] { opacity: 1; transform: none; transition: none; }
  .site-head, .float-cta { transition: none; }
}