/* V5 motion layer: scroll progress, hero line masks, sourcing band, pinned process story.
   Everything is visible without JS; motion.js only animates from these resting states. */

/* scroll progress, pinned under the sticky nav */
.progress { position: sticky; top: 0; z-index: 11; height: 0; }
.progress i {
  position: absolute; left: 0; top: 0; height: 2px; width: 100%;
  background: linear-gradient(90deg, #006c85, #0a8fb3, #2a5fb8);
  transform: scaleX(0); transform-origin: 0 50%;
}

/* hero headline: each line in its own mask */
.h-lines .ln { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.h-lines .ln > span { display: inline-block; }
.hero { position: relative; }
.hero-copy, .instrument { will-change: transform; }

/* sourcing band */
.band { overflow: hidden; border-bottom: 1px solid var(--rule); background: var(--paper-2); padding: 18px 0; }
.band-track { display: flex; width: max-content; }
.band-row { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; }
.band-row li {
  display: flex; align-items: center; white-space: nowrap;
  font-size: clamp(18px, 2vw, 26px); font-weight: 500; letter-spacing: -0.02em; color: var(--ink-2);
}
.band-row li::after { content: ""; width: 7px; height: 7px; margin: 0 28px; border: 1px solid var(--accent); transform: rotate(45deg); }

/* pinned process story */
.story-in { display: grid; grid-template-columns: 1fr 0.95fr; gap: 64px; align-items: center; }
.story-left { position: relative; }
.story-steps { list-style: none; margin: 0; padding: 0 0 0 28px; display: grid; gap: 22px; }
.story-steps li { position: relative; }
.story-steps li::before {
  content: ""; position: absolute; left: -33px; top: 3px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--rule-2); transition: background-color .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.story-steps li.on::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0,127,153,0.15); }
.story-steps h3 { margin-top: 6px; }
.story h2 { text-wrap: balance; }
.story-steps p { color: var(--ink-2); font-size: 15px; margin: 6px 0 0; max-width: 460px; }
.story-rail { position: absolute; left: 0; bottom: 0; width: 1px; background: var(--rule); }
.story-rail i { position: absolute; inset: 0; background: var(--accent); transform: scaleY(1); transform-origin: 50% 0; }

.quote-card {
  position: relative; background: #fbf9f4; border: 1px solid var(--rule); border-radius: 18px; padding: 26px 26px 28px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset, 0 30px 60px -30px rgba(20,30,40,0.35);
}
.qc-head { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: .16em; color: var(--ink-3); padding-bottom: 16px; border-bottom: 1px dashed var(--rule-2); }
.qc-status { color: var(--accent); }
.qc-part { display: grid; gap: 4px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.qc-part .k { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.qc-part .v { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.qc-part .sub { font-size: 11px; color: var(--ink-3); }
.qc-lines { list-style: none; margin: 0; padding: 8px 0; }
.qc-lines li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.qc-lines b { font: 500 12px var(--mono); color: var(--accent); align-self: center; }
.qc-total { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px 16px; padding-top: 16px; font-weight: 600; }
.qc-bar { height: 8px; border-radius: 99px; background: var(--paper-3); overflow: hidden; }
.qc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #006c85, #0a8fb3, #2a5fb8); transform-origin: 0 50%; }
.qc-total .note { grid-column: 1 / -1; font-size: 11px; font-weight: 400; color: var(--ink-3); }

@media (max-width: 1020px) {
  .story-in { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 720px) {
  .band { padding: 14px 0; }
  .band-row li::after { margin: 0 18px; }
  .quote-card { padding: 20px 18px 22px; }
  .qc-lines li { font-size: 14px; }
}

/* corner brackets sit clear of the panel's rounded corners */
.instrument .br.tl { top: 14px; left: 14px; }
.instrument .br.tr { top: 14px; right: 14px; }
.instrument .br.bl { bottom: 14px; left: 14px; }
.instrument .br.br- { bottom: 14px; right: 14px; }
.instrument { padding: 22px; }

/* motion toggle */
.motion-toggle {
  position: fixed; left: 16px; bottom: 16px; z-index: 40;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px 9px 10px;
  border: 1px solid var(--rule-2); border-radius: 999px; background: rgba(251,249,244,0.92);
  backdrop-filter: blur(8px); box-shadow: 0 8px 24px -10px rgba(0,0,0,0.35);
  font: 500 12px/1 var(--sans); color: var(--ink-2); cursor: pointer;
  transition: background-color .2s ease, color .2s ease, transform .15s ease;
}
.motion-toggle:hover { color: var(--ink); background: #fff; }
.motion-toggle:active { transform: scale(0.97); }
.motion-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mt-icon { position: relative; width: 26px; height: 15px; border-radius: 99px; background: var(--accent); transition: background-color .2s ease; }
.mt-icon::after { content: ""; position: absolute; top: 2px; left: 13px; width: 11px; height: 11px; border-radius: 50%; background: #fff; transition: left .2s ease; }
.motion-toggle[aria-pressed="true"] .mt-icon { background: var(--ink-3); }
.motion-toggle[aria-pressed="true"] .mt-icon::after { left: 2px; }

/* calm: stop every CSS-driven loop too */
html.calm { scroll-behavior: auto; }
html.calm *, html.calm *::before, html.calm *::after { animation: none !important; }
html.calm .reveal-in { opacity: 1; transform: none; }

@media (max-width: 720px) {
  .motion-toggle { left: 10px; bottom: 10px; padding: 8px 12px 8px 8px; }
}

/* loading screen */
.loader {
  position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: var(--paper); transition: opacity .55s ease, visibility .55s;
}
.loader img { width: 132px; height: 132px; }
.loader span { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--ink-3); }
.loader.out { opacity: 0; visibility: hidden; }
html.loading { overflow: hidden; }
