/* landing-fx.css — motion & polish layer (loads after landing-c.css) */

html { scroll-behavior: smooth; overflow-x: hidden; }

/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* scroll progress: a pencil line being drawn across the top */
.scroll-pencil {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  z-index: 200;
  pointer-events: none;
}
.scroll-pencil-bar {
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--ink) 0 14px, transparent 14px 22px);
  clip-path: inset(0 100% 0 0);
}

/* full-viewport sections: each fills the viewport minus the sticky nav and the
   scroll-progress bar. --nav-h is measured live in landing-fx.js; --pencil-h is
   the fixed scroll-progress bar height. (CTA is part of the footer zone, so it's
   intentionally excluded.) */
:root { --nav-h: 78px; --pencil-h: 5px; }
/* anchor jumps land below the sticky nav instead of behind it */
html { scroll-padding-top: calc(var(--nav-h) + var(--pencil-h) + 24px); }
.hero,
.section {
  min-height: calc(100svh - var(--nav-h) - var(--pencil-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* hero is shorter than full viewport so the stats band sits closer below it */
.hero { min-height: 70vh; }

/* subsections size to their own content — only top-level sections fill the viewport */
.section.problem-sub {
  min-height: 0;
}

/* agents is the top subsection of the problem block — size to content, not the full viewport */
#agents.section {
  min-height: 0;
}

/* subsections of the solution block (compliance → value) also size to content */
#compliance.section,
#why.section,
#method.section,
#expect.section,
#value.section {
  min-height: 0;
}

/* cases sizes to content too, so the callout above it has matching whitespace
   above and below (it no longer centers its title in a tall, empty section) */
#cases.section {
  min-height: 0;
}

/* As flex items, centered max-width containers (margin-inline:auto) would
   collapse to their content width — width:100% lets them fill up to their
   max-width again, just like in normal block flow. */
.hero > .sub,
.section > .faq-list,
.section > .timeline,
.section > .plans,
.section > .value-explorer,
.section > .comp-wrap,
.section > .lanes-intro,
.section > .founder-grid {
  width: 100%;
}

/* sticky nav — full-bleed background so it spans edge to edge */
/* (full-bleed overflow guard lives on html above — hidden, not clip, so the viewport stays scrollable) */
.nav {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--paper);
  transition: box-shadow 0.25s ease;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: calc(50vw - 50%);
  padding-right: calc(50vw - 50%);
}
.nav.stuck { box-shadow: 0 4px 0 rgba(30, 30, 30, 0.1); }

/* wall of patterns fits the viewport (set by landing-fx.js): no pinned
   hscroll — center the cards and scroll straight past the section */
.no-hscroll .pattern-carousel { overflow-x: visible; cursor: default; }
.no-hscroll .stickies { padding: 0 28px; margin: 0 auto; }
.no-hscroll .carousel-bleed::before,
.no-hscroll .carousel-bleed::after { display: none; }
.no-hscroll .carousel-hint { display: none !important; }

/* magnetic buttons (translate is independent of transform, so hover still works) */
.btn {
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    translate 0.3s cubic-bezier(0.2, 0.8, 0.3, 1.4);
}

/* hero scribbles */
.hero-scribble {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  opacity: 0.85;
}
.hero-scribble.s1 { left: 4%; top: 16%; width: 110px; }
.hero-scribble.s2 { right: 5%; bottom: 16%; width: 92px; }

/* keyboard / touch access to ring popovers (mirrors :hover) */
.ring-item:focus {
  outline: none;
  z-index: 30;
  transform: translateX(var(--tx, 0px)) rotate(var(--rot, 0deg)) scale(1.12);
  box-shadow: 3.5px 4.5px 0 rgba(30, 30, 30, 0.28);
  background: var(--c-cream);
}
.ring-item:focus .ring-tip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
  transform: translateX(-50%) rotate(-1deg) scale(1);
}
.ring-item:focus::before { opacity: 1; }

/* layout safety for grids */
.eco-grid > *, .agents-grid > * { min-width: 0; }

/* ---------- mobile pass ---------- */
@media (max-width: 760px) {
  .hero { padding: 44px 8px 44px; }
  .hero h1 { font-size: 34px; }
  .hero .sub { font-size: 17px; }
  .hero .doodle-note { display: none; }
  .hero-scribble { display: none; }

  .section { padding: 40px 0 46px; }
  .section-title { font-size: 34px; }

  .nav { gap: 12px; flex-wrap: wrap; }
  .nav-links { gap: 12px; flex-wrap: wrap; justify-content: flex-start; }

  /* ring diagram: scale down without clipping the legend */
  .stack-wrap { height: auto; overflow: hidden; align-items: center; width: 100%; }
  .stack-diagram { transform: scale(0.6); transform-origin: top center; margin-bottom: -210px; }

  .agent-mosaic { grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(56px, auto); }
  .agent-cell.a-tools { grid-column: span 2; }
  .agent-cell.a-llm { grid-column: span 2; grid-row: auto; }
  .a-llm > .agent-face { font-size: 22px; }
  .agent-box-hint { display: none; }
  .llm-bento { grid-template-columns: 1fr 1fr; }
  .evo-horizontal { flex-direction: column; }
  .evo-horizontal .evo-arrow { transform: rotate(90deg); padding: 4px 0; }

  .method-phases { grid-template-columns: 1fr; }
  .method-phase + .method-phase {
    border-left: none;
    border-top: 2.5px dashed rgba(30, 30, 30, 0.45);
    padding-top: 18px;
    margin-top: 18px;
  }
  .cadence { grid-template-columns: 1fr 1fr; gap: 14px; }

  .tl-row { grid-template-columns: 86px 1fr 76px; }
  .tl-label { font-size: 12.5px; }
  .tl-val { font-size: 16px; }

  .case { padding: 22px 16px; }
  .plans { gap: 30px; }
  .plan.featured { transform: none; }

  .footer-legal { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-pencil { display: none; }
}
