/* Approved Folen waterline composition. Keep these rules local to Home. */
#folen.home-folen-waterline {
  --ink: #e5f0f5;
  --quiet: #a9bfca;
  --logo-mask: url("assets/folen-waterline-leaf.svg?v=1");
  --activity: 0;
  --sway: 0deg;
  --grow: 1;
  --light-x: 0px;
  --light-y: 0px;
  --background-scale: 1;
  --folen-unit: min(.0520833333cqw, .0925925926cqh);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  container-type: inline-size;
  padding: 0;
  background: #031721;
  color: var(--ink);
  font-family: var(--font-body);
  text-align: left;
}

#folen .waterline-scene {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

/* The entire desktop composition fits between the navbar and the lower edge.
   Scale the artwork and typography together, without stretching the emblem. */
@media (min-width: 701px) {
  #folen.home-folen-waterline {
    container-type: size;
    height: min(50.625vw, calc((100svh - var(--nav-h) - 32px) * .9));
  }
  #folen .waterline-scene { height: 100%; aspect-ratio: auto; }
}

#folen .waterline-background {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  object-fit: fill;
  transform: scale(var(--background-scale));
  transform-origin: var(--waterline-anchor-x, 18%) 79%;
  filter: hue-rotate(-7deg) saturate(.78) brightness(.94);
  user-select: none;
  pointer-events: none;
}

#folen .waterline-light {
  position: absolute;
  width: 74%;
  height: 130%;
  left: -17%;
  top: -40%;
  background: radial-gradient(ellipse at 48% 42%, rgb(172 221 238 / .45), rgb(98 158 182 / .12) 39%, transparent 68%);
  transform: translate(var(--light-x), var(--light-y));
  opacity: calc(var(--activity) * .7);
  pointer-events: none;
}

#folen .waterline-water {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#folen .waterline-logo {
  position: absolute;
  left: calc(31.359375% - 265 * var(--folen-unit));
  top: calc(79% - 590 * var(--folen-unit));
  width: calc(530 * var(--folen-unit));
  aspect-ratio: 1060 / 1200;
  transform-origin: 1.6037736% 98.3333333%;
  transform: rotate(var(--sway)) scale(var(--grow));
  pointer-events: none;
}

#folen .waterline-logo img {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 10px rgb(185 226 242 / .08));
  user-select: none;
}

#folen .waterline-sheen {
  position: absolute;
  inset: 0;
  mask-image: var(--logo-mask);
  -webkit-mask-image: var(--logo-mask);
  mask-size: 100% 100%;
  -webkit-mask-size: 100% 100%;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  overflow: hidden;
  opacity: var(--activity);
}

#folen .waterline-sheen::after {
  content: "";
  position: absolute;
  inset: -90% -150%;
  background: linear-gradient(112deg, transparent 38%, rgb(235 251 255 / .12) 44%, rgb(245 253 255 / .8) 49%, rgb(230 248 255 / .24) 54%, transparent 61%);
  transform: translateX(-44%);
  animation: folen-waterline-sheen 5s cubic-bezier(.22, .45, .42, 1) infinite;
  animation-play-state: paused;
}

#folen.is-active .waterline-sheen::after { animation-play-state: running; }

@keyframes folen-waterline-sheen {
  0% { transform: translateX(-44%); }
  65%, 100% { transform: translateX(44%); }
}

#folen .waterline-motion-surface {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

#folen .waterline-motion-surface:focus-visible {
  outline: 2px solid #c5e6ef;
  outline-offset: -5px;
}

#folen .waterline-copy {
  position: absolute;
  z-index: 3;
  left: 61.45%;
  top: 16.6%;
  width: 34.5%;
  padding: 0;
  transform: translateZ(0);
}

#folen .waterline-eyebrow {
  font-family: var(--font-mono);
  font-size: clamp(11px, calc(24.384 * var(--folen-unit)), 25px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: .22em;
  margin: 0 0 calc(48 * var(--folen-unit));
  text-transform: uppercase;
}

#folen h2 {
  font-family: var(--font-display);
  font-size: clamp(29px, calc(78.336 * var(--folen-unit)), 80px);
  font-weight: 300;
  letter-spacing: -.035em;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
  text-shadow: none;
  color: var(--ink);
}

#folen h2 span { display: block; }

#folen .waterline-description {
  font-size: clamp(14px, calc(36.672 * var(--folen-unit)), 37px);
  font-weight: 400;
  line-height: 1.27;
  letter-spacing: -.015em;
  color: var(--quiet);
  margin: calc(38.4 * var(--folen-unit)) 0 calc(64.32 * var(--folen-unit));
  max-width: 99%;
}

#folen .waterline-explore {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(32.64 * var(--folen-unit));
  padding: calc(16.32 * var(--folen-unit)) calc(30.72 * var(--folen-unit));
  min-height: 44px;
  min-width: calc(355.2 * var(--folen-unit));
  border: 1px solid #b4d0dc;
  border-radius: 0;
  color: #e4f1f8;
  font: inherit;
  font-size: clamp(14px, calc(34.176 * var(--folen-unit)), 35px);
  font-weight: 400;
  line-height: 1.3;
  text-decoration: none;
  background: linear-gradient(116deg, rgb(159 199 214 / .3), rgb(79 120 142 / .12));
  box-shadow: inset 0 0 12px rgb(201 237 249 / .12);
  cursor: pointer;
  transition: background-color .3s, box-shadow .3s;
}

#folen .waterline-explore:hover {
  background-color: rgb(153 193 208 / .12);
  box-shadow: inset 0 0 18px rgb(201 237 249 / .2);
}

#folen .waterline-explore:focus-visible {
  outline: 2px solid #d1eff6;
  outline-offset: 4px;
}

#folen .waterline-principle {
  font-size: clamp(11px, calc(25.92 * var(--folen-unit)), 26px);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: .035em;
  margin: calc(43.2 * var(--folen-unit)) 0 0;
  color: #c7d8df;
}

#folen .waterline-a11y {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  #folen.home-folen-waterline { --folen-unit: .1041666667cqw; }
  #folen .waterline-scene { aspect-ratio: 8 / 9; }
  #folen .waterline-scene::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 8%;
    background: linear-gradient(transparent, #031721);
    pointer-events: none;
  }
  #folen .waterline-background { width: 200%; max-width: none; }
  #folen .waterline-light { width: 148%; left: -34%; }
  #folen .waterline-logo { left: calc((100% - 55.2083334%) / 2); top: 24.3703704%; width: 55.2083334%; }
  #folen .waterline-copy { position: relative; left: auto; top: auto; width: 100%; padding: 4px 7% 11%; }
  #folen .waterline-eyebrow { font-size: 11px; margin-bottom: 21px; letter-spacing: .2em; }
  #folen h2 { font-size: clamp(34px, 8.3cqw, 51px); line-height: 1.1; letter-spacing: -.035em; }
  #folen h2 span { display: inline; }
  #folen .waterline-description { font-size: 17px; line-height: 1.45; margin: 22px 0 28px; max-width: 340px; }
  #folen .waterline-explore { font-size: 17px; min-width: 190px; padding: 12px 18px; gap: 25px; }
  #folen .waterline-principle { font-size: 12px; letter-spacing: .025em; margin-top: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  #folen .waterline-sheen::after { animation: none; }
  #folen .waterline-light, #folen .waterline-sheen { display: none; }
  #folen .waterline-logo, #folen .waterline-background { transform: none; }
  #folen .waterline-explore { transition: none; }
}
