/*
  Premium layer for the Langston Plumbing concept — loaded after styles.css.
  Loader, floating glass nav, Ken Burns hero, glass credential chips, scroll
  reveals, review carousel, story band.

  v2: reveals are shorter and staggered by position rather than all-at-once,
  the nav gains a scroll-progress hairline, and every motion here is disabled
  under prefers-reduced-motion (the base sheet also clamps durations globally).
*/

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 200;
  background: radial-gradient(ellipse 900px 620px at 50% 42%, #16251b, #080d0a);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s-6); transition: opacity .6s ease, visibility .6s ease;
}
#loader.done { opacity: 0; visibility: hidden; }
#loader .ring-wrap { position: relative; width: 212px; height: 212px; display: flex; align-items: center; justify-content: center; }
#loader .puck {
  background: #fff; border-radius: 50%; width: 170px; height: 170px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
  animation: puck-in .9s cubic-bezier(.2,.9,.3,1.2) both;
}
#loader .puck img { width: 122px; height: auto; }
#loader svg.ring { position: absolute; width: 212px; height: 212px; transform: rotate(-90deg); }
#loader svg.ring circle {
  fill: none; stroke: #2fa855; stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 650; stroke-dashoffset: 650;
  animation: ring-draw 1.5s .2s cubic-bezier(.4,0,.2,1) forwards;
}
#loader .motto {
  color: #a9cdb5; font-size: var(--fs-sm); letter-spacing: .42em; text-transform: uppercase;
  font-weight: 700; opacity: 0; animation: motto-in 1s .7s ease forwards; text-indent: .42em;
}
@keyframes ring-draw { to { stroke-dashoffset: 0; } }
@keyframes motto-in { to { opacity: 1; } }
@keyframes puck-in { from { transform: scale(.86); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #loader { display: none; } }

/* ---------- floating glass nav ---------- */
.nav { padding: var(--s-3) var(--s-4) 0; }
.nav-inner {
  background: linear-gradient(rgba(255,255,255,.82), rgba(255,255,255,.66));
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid rgba(255,255,255,.7);
  outline: 1px solid rgba(16,20,26,.06);
  border-radius: var(--r-xl);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 10px 34px rgba(16,20,26,.10);
  padding: var(--s-2) var(--s-5);
  transition: box-shadow .3s var(--ease), background-color .3s var(--ease);
  position: relative;
}
.nav.scrolled .nav-inner {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 16px 46px rgba(16,20,26,.18);
  background: linear-gradient(rgba(255,255,255,.92), rgba(255,255,255,.8));
}
/* reading-progress hairline — orientation without another widget */
.nav-inner::after {
  content: ""; position: absolute; left: var(--s-5); right: var(--s-5); bottom: 0; height: 2px;
  border-radius: 2px; background: var(--blue); transform-origin: left center;
  transform: scaleX(var(--progress, 0)); opacity: .85;
  transition: transform .1s linear;
}
@media (max-width: 1240px) {
  .nav-links {
    border-radius: 0 0 var(--r-lg) var(--r-lg); overflow: hidden; left: 0; right: 0;
    background: rgba(255,255,255,.97);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  }
}

/* ---------- hero ---------- */
.hero .bg { animation: kenburns 22s ease-out both; transform-origin: 55% 45%; }
@keyframes kenburns { from { transform: scale(1.13); } to { transform: scale(1); } }

.hero-mark img { animation: mark-in 1.1s cubic-bezier(.2,.85,.3,1) both; }
.hero-copy > * { animation: copy-in .9s cubic-bezier(.2,.85,.3,1) both; }
.hero-copy > *:nth-child(1) { animation-delay: .16s; }
.hero-copy > *:nth-child(2) { animation-delay: .24s; }
.hero-copy > *:nth-child(3) { animation-delay: .32s; }
.hero-copy > *:nth-child(4) { animation-delay: .40s; }
.hero-copy > *:nth-child(5) { animation-delay: .48s; }
.chip-row { animation: copy-in .9s .56s cubic-bezier(.2,.85,.3,1) both; }
@keyframes mark-in { from { opacity: 0; transform: scale(.94) translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes copy-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* scroll cue — tells first-time visitors there is more below the fold */
.scroll-cue {
  position: absolute; left: 50%; bottom: var(--s-5); transform: translateX(-50%);
  z-index: 3; display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  color: var(--on-dark-3); font-size: var(--fs-xs); letter-spacing: .18em;
  text-transform: uppercase; font-weight: 700; text-decoration: none;
  padding: var(--s-2) var(--s-4); border-radius: var(--r-pill);
  transition: color var(--dur) var(--ease);
}
.scroll-cue:hover { color: #fff; }
.scroll-cue svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; animation: nudge 2.2s var(--ease) infinite; }
@keyframes nudge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@media (max-width: 1240px) { .scroll-cue { display: none; } }

/* glass credential chips over the hero photo */
.chip-row { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-8); }
.chip {
  display: flex; flex-direction: column; gap: 3px; padding: var(--s-3) var(--s-5);
  border-radius: var(--r-md);
  background: linear-gradient(rgba(255,255,255,.15), rgba(255,255,255,.06));
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  backdrop-filter: blur(16px) saturate(1.6);
  border: 1px solid rgba(255,255,255,.26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.33);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.chip:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.42); }
.chip .n {
  font-size: var(--fs-xl); font-weight: 800; color: #a8e6bd; letter-spacing: -.02em;
  line-height: 1.2; display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums;
}
.chip .n svg { width: 17px; height: 17px; fill: #c99450; }
.chip .l { font-size: var(--fs-xs); letter-spacing: .13em; text-transform: uppercase; color: #dce6ef; font-weight: 600; }

/* ---------- scroll reveals ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
/* stagger siblings so a grid arrives as a wave, not a block */
.reveal.d1 { transition-delay: .06s; }
.reveal.d2 { transition-delay: .12s; }
.reveal.d3 { transition-delay: .18s; }
.reveal.d4 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- story band ---------- */
.story { position: relative; color: #fff; background: var(--ink); overflow: hidden; }
.story .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .22; }
.story .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,13,18,.84), rgba(9,13,18,.95)); }
.story .wrap-narrow { position: relative; z-index: 2; text-align: center; }
.story .eyebrow { font-size: var(--fs-xs); letter-spacing: .2em; text-transform: uppercase; font-weight: 700; color: var(--focus-dark); margin-bottom: var(--s-4); }
.story h2 { font-size: var(--fs-3xl); color: #fff; margin-bottom: var(--s-5); }
.story p { color: var(--on-dark-2); font-size: var(--fs-lg); margin-bottom: var(--s-4); max-width: 62ch; margin-inline: auto; }
.story .sig { margin-top: var(--s-6); font-size: var(--fs-base); color: var(--on-dark-3); letter-spacing: .04em; }
.story .sig b { color: #fff; display: block; font-size: var(--fs-md); letter-spacing: 0; margin-bottom: 2px; }

/* ---------- review carousel ---------- */
.carousel { position: relative; max-width: 800px; margin-inline: auto; min-height: 230px; }
.carousel .slide {
  opacity: 0; visibility: hidden; position: absolute; inset: 0;
  transition: opacity .5s var(--ease), visibility .5s var(--ease); text-align: center;
}
.carousel .slide.on { opacity: 1; visibility: visible; position: relative; }
.carousel .slide .stars { justify-content: center; margin-bottom: var(--s-5); }
.carousel .slide p { font-size: var(--fs-2xl); line-height: 1.42; color: var(--ink); font-weight: 500; margin-bottom: var(--s-5); text-wrap: balance; }
.carousel .slide .who { font-size: var(--fs-md); color: var(--muted); font-weight: 600; }
.carousel .slide .who b { color: var(--ink); }
.dots { display: flex; gap: var(--s-1); justify-content: center; margin-top: var(--s-6); }
/* 40px hit area around a 9px dot — the dot itself was far too small to tap */
.dots button {
  width: 40px; height: 40px; border: 0; padding: 0; cursor: pointer; background: none;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
}
.dots button::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--paper-3);
  border: 1px solid var(--line);
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.dots button:hover::before { background: #c3d0dc; }
.dots button.on::before { background: var(--blue); border-color: var(--blue); transform: scale(1.3); }
