/* Homepage hero: "The work begins beneath the surface."
   A lake cross-section. The headline's first line sits above the waterline, the second line below it.
   Layout geometry lives in custom properties so the waterline lines up with the headline even
   before JavaScript runs; assets/js/home-hero.js then measures the real line and refines --wl. */

.home-hero.hh {
  --pad-top: clamp(150px, 15vw, 220px);
  --h1s: clamp(46px, 5.4vw, 84px);
  --eyebrow-block: 36px;            /* 16px line + 20px margin */
  --wl: calc(var(--pad-top) + var(--eyebrow-block) + var(--h1s) * 1.04 + 16px);
  --artw: min(64vw, 980px, calc(var(--wl) * 2.45));   /* the scene is 900x360: keep it inside the sky */
  --sun-x: calc(100% - var(--artw) * .3333);   /* sun sits at x=600 of the 900-wide scene */
  --px: 0;                          /* pointer parallax, -1..1, set by JS */
  --py: 0;
  --sky-1: #f3f3ed;
  --sky-2: #efe6d2;
  --sky-3: #e9d3a8;
  --surface: #3b6d62;
  --deep-1: #2c5c52;
  --deep-2: #1d443b;
  --deep-3: #0f2924;
  --light: #f2d49b;

  position: relative;
  display: block;
  max-width: none;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--deep-3);
  color: var(--ink);
}

/* ---------- Above the water ---------- */
.hh-defs { position: absolute; }

.hh-sky {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--wl);
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-1) 35%, var(--sky-2) 78%, var(--sky-3) 100%);
  z-index: 0;
}
.hh-range {
  position: absolute;
  right: 0;
  bottom: -1px;
  width: var(--artw);
  height: auto;
  display: block;
  overflow: visible;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 30%);
          mask-image: linear-gradient(90deg, transparent 0, #000 30%);
  transform: translate3d(calc(var(--px) * -10px), 0, 0);
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.hh-sun__glow {
  transform-box: fill-box;
  transform-origin: center;
}

/* ---------- The waterline ---------- */
.hh-surface {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--wl) - 11px);
  height: 22px;
  z-index: 2;
  pointer-events: none;
}
.hh-surface span {
  position: absolute;
  inset: 0;
  background-repeat: repeat-x;
  background-size: 240px 22px;
}
.hh-surface span:first-child {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='22'%3E%3Cpath d='M0 11q30-7 60 0t60 0 60 0 60 0V22H0Z' fill='%233b6d62'/%3E%3Cpath d='M0 11q30-7 60 0t60 0 60 0 60 0' fill='none' stroke='%23f6efdc' stroke-opacity='.75' stroke-width='1.4'/%3E%3C/svg%3E");
}
.hh-surface span:last-child {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='22'%3E%3Cpath d='M0 12q40 6 80 0t80 0 80 0' fill='none' stroke='%23f2d49b' stroke-opacity='.45' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 320px 22px;
}

/* ---------- Below the water ---------- */
.hh-deep {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--wl);
  bottom: 0;
  z-index: 1;
  overflow: hidden;
  background:
    radial-gradient(ellipse 38% 46% at var(--sun-x) 0, rgba(242, 212, 155, .22), transparent 70%),
    linear-gradient(180deg, var(--deep-1) 0%, var(--deep-2) 38%, var(--deep-3) 100%);
}
.hh-reflection {
  position: absolute;
  right: 0;
  top: 0;
  width: var(--artw);
  height: auto;
  display: block;
  transform: scaleY(-1) translate3d(calc(var(--px) * -10px), 0, 0);
  transform-origin: top;
  opacity: .16;
  filter: blur(1.5px);
  -webkit-mask-image: linear-gradient(0deg, #000 0, transparent 65%);
          mask-image: linear-gradient(0deg, #000 0, transparent 65%);
}
.hh-rays {
  position: absolute;
  top: 0;
  left: var(--sun-x);
  width: 0;
  height: 100%;
  transform: translate3d(calc(var(--px) * 14px), 0, 0);
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
.hh-rays i {
  position: absolute;
  top: -4%;
  left: 0;
  width: 70px;
  height: 115%;
  margin-left: -35px;
  transform-origin: 50% 0;
  background: linear-gradient(180deg, rgba(242, 212, 155, .30), rgba(242, 212, 155, .08) 45%, transparent 85%);
  filter: blur(6px);
  mix-blend-mode: screen;
}
.hh-rays i:nth-child(1) { transform: rotate(16deg); width: 46px; }
.hh-rays i:nth-child(2) { transform: rotate(7deg); width: 92px; opacity: .8; }
.hh-rays i:nth-child(3) { transform: rotate(-2deg); width: 60px; }
.hh-rays i:nth-child(4) { transform: rotate(-11deg); width: 110px; opacity: .6; }
.hh-rays i:nth-child(5) { transform: rotate(-21deg); width: 40px; opacity: .8; }

.hh-roots {
  position: absolute;
  right: 0;
  top: -1px;
  width: var(--artw);
  height: auto;
  display: block;
  transform: translate3d(calc(var(--px) * -6px), 0, 0);
  transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}
.hh-roots__base { stroke: #5f8c7e; opacity: .75; }
.hh-roots__pulse { stroke: var(--light); stroke-width: 2.5; stroke-dasharray: 7 100; stroke-dashoffset: 7; opacity: 0; filter: drop-shadow(0 0 4px rgba(242, 212, 155, .9)); }

.hh-motes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Copy ---------- */
.home-hero.hh .hh-copy {
  position: relative;
  z-index: 3;
  max-width: 1264px;
  margin: 0 auto;
  padding: var(--pad-top) 48px 120px;
  align-self: auto;
}
@media (min-width: 1440px) {
  .home-hero.hh .hh-copy { padding-left: 48px; }
}
.home-hero.hh .eyebrow {
  line-height: 16px;
  margin: 0 0 20px;
  color: #557265;
}
.home-hero.hh h1 {
  /* Segoe UI on Windows; the phone's own system font on iPhone/Mac/Android
     (otherwise iOS falls back to Verdana, which is too wide for this line) */
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--h1s);
  line-height: 1.04;
  letter-spacing: -.055em;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}
.hh-l1, .hh-l2 { display: block; font-family: inherit; }
.hh-l1 { white-space: nowrap; }
.hh-l2 {
  padding-top: 34px;
  color: #f6f1e4;
  text-shadow: 0 1px 24px rgba(10, 35, 30, .35);
}
.hh-below { max-width: 470px; margin-top: 26px; }
.home-hero.hh .hh-below p {
  font-size: 18px;
  line-height: 1.7;
  color: #cfdcd4;
  margin: 0 0 32px;
}
.home-hero.hh .button-primary {
  background: #f6f1e4;
  color: #173f36;
}
.home-hero.hh .button-primary:hover { background: var(--light); }
.home-hero.hh .home-hero__secondary { color: #e7efe9; }
.home-hero.hh a:focus-visible {
  outline: 2px solid var(--light);
  outline-offset: 4px;
}

/* ---------- The one orchestrated moment: dawn, the surface, then what's beneath ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hh-anim .hh-sun { animation: hh-sunrise 2.6s cubic-bezier(.2, .7, .2, 1) both; }
  .hh-anim .hh-sun__glow { animation: hh-breathe 7s ease-in-out 2.6s infinite; }
  .hh-anim .hh-range use { animation: hh-fade 1.6s ease-out both; }
  .hh-anim .hh-surface { animation: hh-draw 1.4s cubic-bezier(.6, 0, .2, 1) .5s both; }
  .hh-anim .hh-surface span:first-child { animation: hh-drift 22s linear infinite; }
  .hh-anim .hh-surface span:last-child { animation: hh-drift-back 31s linear infinite; }
  .hh-anim .hh-deep { animation: hh-fade 1.2s ease-out .7s both; }
  .hh-anim .hh-rays i { animation: hh-sway 11s ease-in-out infinite alternate, hh-shimmer 6s ease-in-out infinite alternate; }
  .hh-anim .hh-rays i:nth-child(2) { animation-duration: 14s, 7.5s; animation-delay: -3s, -2s; }
  .hh-anim .hh-rays i:nth-child(3) { animation-duration: 9s, 5s; animation-delay: -5s, -1s; }
  .hh-anim .hh-rays i:nth-child(4) { animation-duration: 16s, 8s; animation-delay: -7s, -4s; }
  .hh-anim .hh-rays i:nth-child(5) { animation-duration: 12s, 6.5s; animation-delay: -2s, -3s; }
  .hh-anim .hh-roots__base path { stroke-dasharray: 100; animation: hh-grow 2.4s cubic-bezier(.3, .6, .2, 1) 1.4s both; }
  .hh-anim .hh-roots__pulse path { animation: hh-pulse 6s cubic-bezier(.45, 0, .55, 1) 3.6s infinite; }
  .hh-anim .hh-roots__pulse path:nth-child(2) { animation-delay: 5.6s; animation-duration: 7s; }
  .hh-anim .hh-roots__pulse path:nth-child(3) { animation-delay: 4.5s; animation-duration: 8s; }
  .hh-anim .eyebrow, .hh-anim .hh-l1 { animation: hh-rise .9s cubic-bezier(.2, .7, .2, 1) .15s both; }
  .hh-anim .hh-l2 { animation: hh-sink 1.1s cubic-bezier(.2, .7, .2, 1) 1.05s both; }
  .hh-anim .hh-below { animation: hh-sink 1.1s cubic-bezier(.2, .7, .2, 1) 1.35s both; }
  .hh-anim .hh-reflection { animation: hh-ripple 9s ease-in-out infinite alternate; }
}
@keyframes hh-sunrise { from { transform: translateY(120px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hh-breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: .7; } }
@keyframes hh-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hh-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes hh-drift { to { background-position-x: -240px; } }
@keyframes hh-drift-back { to { background-position-x: 320px; } }
@keyframes hh-sway { from { rotate: -4deg; } to { rotate: 4deg; } }
@keyframes hh-shimmer { from { opacity: .45; } to { opacity: 1; } }
@keyframes hh-grow { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes hh-pulse { 0% { stroke-dashoffset: 7; opacity: 0; } 8% { opacity: 1; } 70% { opacity: .9; } 100% { stroke-dashoffset: -100; opacity: 0; } }
@keyframes hh-rise { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hh-sink { from { transform: translateY(-22px); opacity: 0; filter: blur(6px); } to { transform: none; opacity: 1; filter: blur(0); } }
@keyframes hh-ripple { from { transform: scaleY(-1) skewX(-.6deg) translate3d(calc(var(--px) * -10px), 0, 0); } to { transform: scaleY(-1.02) skewX(.6deg) translate3d(calc(var(--px) * -10px), 0, 0); } }

/* ---------- Smaller screens ---------- */
@media (max-width: 1000px) {
  .home-hero.hh { --pad-top: 140px; --h1s: clamp(44px, 6.2vw, 62px); --artw: min(74vw, calc(var(--wl) * 2.45)); }
  .home-hero.hh .hh-copy { padding: var(--pad-top) 30px 100px; }
}
@media (max-width: 768px) {
  /* Mountains sit above the words, fading into mist; the words cross the waterline below them */
  .home-hero.hh {
    --artw: 128vw;
    --pad-top: calc(128vw * .4 - 10px);
    --h1s: clamp(36px, 11.5vw, 58px);
    --sun-x: 52%;
  }
  .hh-range {
    bottom: auto;
    top: 0;
    -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
            mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  }
  .hh-reflection { opacity: .1; }
  .hh-roots { opacity: .45; top: auto; bottom: -40px; }
  .home-hero.hh .hh-copy { padding: var(--pad-top) 24px 96px; }
  .home-hero.hh .hh-below p { font-size: 16px; }
  .hh-l2 { padding-top: 30px; }
}
@media (max-width: 480px) {
  .home-hero.hh .button-primary { width: 100%; }
}
