/* =========================================================================
   Sheaf — product site
   A sticky full-screen canvas is scrubbed by a tall spacer below it; captions
   fade in over frame ranges. Theme-aware, reduced-motion aware, self-contained.
   ========================================================================= */

/* Light theme, matched to the frame background (#e8edf7) so the fixed canvas
   and the document flow blend into one continuous surface. */
:root {
  --bg: #e8edf7;
  --bg-2: #ffffff;
  --fg: #101423;
  --muted: #5b6478;
  --line: rgba(16, 20, 35, 0.12);
  --accent: #0070f3;
  --card: rgba(255, 255, 255, 0.82);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
a {
  color: inherit;
}

/* ---- loader ---------------------------------------------------------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader__mark {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #4c8dff, #7c3aed 45%, #16a34a 75%, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.loader__bar {
  width: 220px;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.loader__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.2s ease;
}
.loader__pct {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.loader__hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

/* ---- sticky canvas stage -------------------------------------------- */
.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
}
.stage__canvas {
  width: 100vw;
  height: 100vh;
  display: block;
}

/* ---- floating captions (revealed by frame range) -------------------- */
.features {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.feature {
  position: absolute;
  top: 50%;
  transform: translateY(-46%);
  max-width: 380px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(16, 20, 35, 0.16);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.feature--left {
  left: 6vw;
  transform: translate(-16px, -46%);
}
.feature--right {
  right: 6vw;
  transform: translate(16px, -46%);
}
.feature.is-active {
  opacity: 1;
  transform: translate(0, -50%);
}
.feature__eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.feature__title {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.feature__copy {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

/* ---- scroll hint ----------------------------------------------------- */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 0.4s ease;
}
.scroll-hint.is-hidden {
  opacity: 0;
}
.scroll-hint__chev {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob {
  0%,
  100% {
    transform: rotate(45deg) translate(0, 0);
    opacity: 0.5;
  }
  50% {
    transform: rotate(45deg) translate(3px, 3px);
    opacity: 1;
  }
}

/* ---- document flow (drives the scroll height) ----------------------- */
#main {
  position: relative;
  z-index: 2;
}
.section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}
.section--hero {
  min-height: 100vh;
}
/* The tall spacer: its height IS the scroll distance of the animation.
   Transparent — the fixed canvas shows through. */
.section--scrub {
  height: 560vh;
}
.section--cta {
  min-height: 100vh;
  background: linear-gradient(180deg, transparent, var(--bg) 22%);
}

/* Kinetic grid backdrop: fills its section, never intercepts input. The
   section's real content is lifted above it. */
.fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.section--hero > :not(.fx),
.section--cta > :not(.fx) {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.hero__title {
  margin: 0;
  font-size: clamp(64px, 13vw, 168px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  background: linear-gradient(90deg, #4c8dff, #7c3aed 42%, #16a34a 72%, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__sub {
  margin: 18px 0 0;
  font-size: clamp(16px, 2.4vw, 22px);
  color: var(--muted);
  max-width: 620px;
}
.hero__tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 26px;
}
.hero__chip {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.65);
}
.hero__chip b {
  color: var(--accent);
}

.cta__title {
  margin: 0;
  font-size: clamp(34px, 6vw, 68px);
  letter-spacing: -0.03em;
  max-width: 14ch;
}
.cta__sub {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 2.2vw, 19px);
  max-width: 560px;
}
.cta__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 30px;
}
.btn {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: #005fce;
}
.btn--ghost {
  border: 1px solid var(--line);
  color: var(--fg);
}
.btn--ghost:hover {
  background: rgba(16, 20, 35, 0.05);
}

/* ---- feature grid (static, below the fold) -------------------------- */
.grid-section {
  position: relative;
  z-index: 2;
  background: var(--bg);
  padding: 96px 24px;
}
.grid-inner {
  max-width: 1040px;
  margin: 0 auto;
}
.grid-title {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  text-align: center;
}
.grid-sub {
  color: var(--muted);
  text-align: center;
  margin: 0 0 48px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.tile {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
}
.tile__badge {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
}
.tile h3 {
  margin: 0 0 6px;
  font-size: 18px;
}
.tile p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ---- footer ---------------------------------------------------------- */
.footer {
  position: relative;
  z-index: 2;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  padding: 56px 24px 32px;
}
.footer__grid {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}
.footer__brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.footer__tag {
  color: var(--muted);
  font-size: 14px;
  margin: 6px 0 0;
  max-width: 32ch;
}
.footer nav h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 12px;
}
.footer nav a {
  display: block;
  color: var(--fg);
  text-decoration: none;
  font-size: 14px;
  padding: 4px 0;
  opacity: 0.85;
}
.footer nav a:hover {
  opacity: 1;
}
.footer__legal {
  max-width: 1040px;
  margin: 40px auto 0;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

@media (max-width: 720px) {
  .feature {
    max-width: min(84vw, 380px);
  }
  .feature--left,
  .feature--right {
    left: 50%;
    right: auto;
    transform: translate(-50%, 8%);
  }
  .feature.is-active {
    transform: translate(-50%, 0);
  }
  .footer__grid {
    grid-template-columns: 1fr;
  }
}

/* Motion is decoration. If it's unwelcome, keep the page fully usable. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .scroll-hint__chev {
    animation: none;
  }
  .feature {
    transition: opacity 0.2s ease;
  }
}
