/* Rivet Cloud landing (index.html only). Everything is scoped under main.cl so
   the auth pages and dashboard keep rivet.css untouched. */
.cl {
  --sky: #8cc8ea;
  --sky-wash: #8cc8ea1f;
  --accent-wash: #34d3991f;
  --deep: #0b0f0d;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 48px);
  --spine-x: 22px;
  --rail: clamp(34px, 5vw, 64px);
  font-size: 17px;
  overflow-x: clip;
}
.cl p { color: var(--muted); }
.cl h1, .cl h2, .cl h3 { color: var(--text); text-wrap: balance; margin: 0; }
.cl h1 em, .cl h2 em { font-style: normal; color: var(--accent); }
.cl .eyebrow { margin: 0; font-size: 12px; letter-spacing: .1em; }
.cl-wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.cl code, .cl pre { background: none; }

/* Hero */
.cl-hero {
  padding-block: clamp(48px, 7vw, 96px) clamp(56px, 7vw, 88px);
  border-bottom: 1px solid var(--hairline);
  background-image: linear-gradient(#ffffff07 1px, transparent 1px), linear-gradient(90deg, #ffffff07 1px, transparent 1px);
  background-size: 40px 40px;
}
.cl-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.cl-kicker { display: flex; align-items: center; gap: 10px; }
.cl-live { width: 8px; height: 8px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 4px var(--sky-wash); animation: cl-pulse 2.4s ease-in-out infinite; }
@keyframes cl-pulse { 50% { box-shadow: 0 0 0 8px transparent; } }
.cl-hero h1 { margin-top: 20px; font-size: clamp(38px, 5.2vw, 68px); line-height: 1.02; letter-spacing: -.04em; font-weight: 700; }
.cl-hero .tagline { margin: 22px 0 0; max-width: 54ch; font-size: clamp(17px, 1.5vw, 19px); }
.cl-hero .actions { margin: 30px 0 0; }
.cl-hero .chips { justify-content: flex-start; margin-top: 30px; }
.cl-viz { margin: 0; }
.cl-viz canvas {
  display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 600 / 560;
  border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  background: radial-gradient(circle at 72% 50%, #8cc8ea12, transparent 55%), var(--surface);
}
.cl-viz figcaption { margin-top: 12px; font-size: 13px; color: var(--muted); max-width: 60ch; }

/* Who runs what */
.cl-split { padding-block: clamp(64px, 9vw, 112px); border-bottom: 1px solid var(--hairline); }
.cl-split h2 { margin-top: 14px; font-size: clamp(30px, 4vw, 48px); line-height: 1.08; letter-spacing: -.035em; max-width: 20ch; }
.cl-split-grid { margin-top: clamp(32px, 5vw, 56px); display: grid; grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr); align-items: stretch; }
.cl-side { padding: 26px; border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--surface); }
.cl-side-cloud { border-color: #8cc8ea55; background: linear-gradient(160deg, var(--sky-wash), var(--surface) 60%); }
.cl-side-label { margin: 0 0 14px; font: 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.cl-side .cl-side-label { color: var(--accent); }
.cl-side-cloud .cl-side-label { color: var(--sky); }
.cl-list { margin: 0; padding: 0; display: grid; gap: 10px; }
.cl-list li { list-style: none; margin: 0; padding-left: 20px; position: relative; color: var(--text); }
.cl-list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--accent); }
.cl-side-cloud .cl-list li::before { border-color: var(--sky); }
.cl-bridge { position: relative; }
.cl-bridge span {
  position: absolute; top: 50%; left: 6px; right: 6px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 14px);
  background-size: 28px 2px; animation: cl-march 1.4s linear infinite;
}
.cl-bridge span::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left-color: var(--sky); }
@keyframes cl-march { to { background-position: 28px 0; } }

/* Story spine */
.cl-story { position: relative; }
.cl-spine {
  position: absolute; top: 0; bottom: 0; width: 2px; background: var(--hairline);
  left: max(calc((100% - var(--wrap)) / 2 + var(--gutter) + var(--spine-x)), calc(var(--gutter) + var(--spine-x)));
}
.cl-spine i {
  position: absolute; inset: 0; background: linear-gradient(var(--accent), var(--sky));
  transform-origin: top; transform: scaleY(var(--fill, 0));
}
.cl-chapter { padding-block: clamp(72px, 10vw, 128px) 0; }
.cl-chapter > .cl-wrap { padding-left: calc(var(--gutter) + var(--spine-x) + var(--rail)); }
.cl-chapter-head { position: relative; max-width: 760px; }
.cl-stud {
  position: absolute; top: 0; left: calc(-1 * var(--rail) - 8px);
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--hairline);
  transition: background .4s, border-color .4s, box-shadow .4s;
}
.cl-chapter.is-lit .cl-stud { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px var(--accent-wash); }
.cl-chapter-leave.is-lit .cl-stud, .cl-pricing.is-lit .cl-stud { background: var(--sky); border-color: var(--sky); box-shadow: 0 0 0 6px var(--sky-wash); }
.cl-chapter-head h2 { margin-top: 12px; font-size: clamp(30px, 4.4vw, 54px); line-height: 1.04; letter-spacing: -.035em; }
.cl-lede { margin: 18px 0 0; max-width: 60ch; font-size: clamp(17px, 1.4vw, 19px); }

/* How it works: sticky stage */
.cl-scrolly { margin-top: clamp(36px, 5vw, 64px); display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(28px, 5vw, 64px); }
.cl .steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; padding: 0; }
.cl .steps li { padding-block: clamp(24px, 9vh, 96px); border-top: 1px solid var(--hairline); }
.cl .steps li:first-child { border-top: 0; padding-top: 6px; }
.cl .steps article { background: none; border: 0; padding: 0; margin: 0; height: auto; }
.cl .steps h3 { margin-top: 10px; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.025em; }
.cl .steps article p:last-child { margin: 12px 0 0; max-width: 46ch; }
.cl.has-js .steps li { opacity: .42; transition: opacity .35s; }
.cl.has-js .steps li.is-active { opacity: 1; }
.cl-stage { position: sticky; top: 96px; align-self: start; }
.cl-stage-frame {
  position: relative; min-height: 390px; border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  background: var(--deep); overflow: hidden;
}
.cl-panel { padding: 22px 24px 26px; }
.cl.has-js .cl-panel { position: absolute; inset: 0; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .45s, transform .6s, visibility 0s .45s; }
.cl.has-js .cl-panel.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.cl-panel + .cl-panel { border-top: 1px solid var(--hairline); }
.cl.has-js .cl-panel + .cl-panel { border-top: 0; }
.cl-panel-bar { margin: 0 0 18px; font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cl-panel-bar::before { content: "● ● ●"; letter-spacing: 3px; margin-right: 12px; opacity: .35; }
.cl-mock-plan { padding: 18px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface); max-width: 280px; }
.cl .cl-mock-name { margin: 0; color: var(--text); font-weight: 700; }
.cl .cl-mock-price { margin: 6px 0 10px; font: 700 32px var(--mono); color: var(--text); }
.cl-mock-price small { font: 13px var(--pico-font-family); color: var(--muted); }
.cl .cl-mock-line { margin: 4px 0 0; font-size: 14px; }
.cl .cl-mock-field { margin: 22px 0 8px; font-size: 13px; }
.cl .cl-mock-bar { margin: 0; height: 36px; max-width: 280px; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface); }
.cl .cl-mock-status { margin: 14px 0 0; font: 12px var(--mono); color: var(--accent); }
.cl .cl-mock-title { margin: 0; color: var(--text); font-weight: 700; font-size: 20px; }
.cl-mock-cmd {
  margin-top: 18px; display: flex; align-items: center; gap: 12px; padding: 14px;
  border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface); font: 13px var(--mono);
}
.cl-mock-ps { color: var(--accent); }
.cl-redact {
  flex: 1; height: 12px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, #a2b09f40 0 38px, transparent 38px 46px, #a2b09f40 46px 120px, transparent 120px 128px);
  filter: blur(2px);
}
.cl-mock-copy { color: var(--text); border: 1px solid var(--hairline); border-radius: 6px; padding: 3px 8px; font-size: 12px; }
.cl .cl-mock-note { margin: 14px 0 0; font-size: 13px; }
.cl-panel-term pre { margin: 0; padding: 0; white-space: pre-wrap; font: 13.5px/1.7 var(--mono); color: var(--text); }
.cl-panel-term code { padding: 0; background: none; color: inherit; font: inherit; }
.cl-t-you { color: var(--accent); }
.cl-t-tool { color: var(--sky); }
.cl-t-dim { color: var(--muted); }
.cl-t-ok { color: var(--accent); }
.cl .cl-stage-note { margin: 10px 0 0; font-size: 12px; }
.cl .cl-guidance { margin: clamp(32px, 5vw, 56px) 0 0; padding-top: 22px; border-top: 1px solid var(--hairline); max-width: 70ch; }

/* What we run */
.cl-runs { margin: clamp(36px, 5vw, 56px) 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--hairline); }
.cl-runs > div { padding: 22px 24px 26px 0; border-bottom: 1px solid var(--hairline); }
.cl-runs dt { font-family: var(--pico-font-family); color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.cl-runs dd { margin: 8px 0 0; font-family: var(--pico-font-family); color: var(--muted); font-size: 15px; }

/* Leave any time */
.cl-route { margin-top: clamp(36px, 5vw, 56px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, .8fr) minmax(0, 1fr); align-items: center; }
.cl-route-end { padding: 24px; border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--surface); }
.cl-route-cloud { border-color: #8cc8ea55; }
.cl .cl-route-end p { margin: 0; font-size: 15px; }
.cl .cl-route-end .cl-route-where { margin-bottom: 6px; color: var(--text); font-weight: 700; font-size: 18px; }
.cl-route-wire { position: relative; height: 40px; }
.cl-route-wire::before, .cl-route-wire::after {
  content: ""; position: absolute; left: 10px; right: 10px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--sky) 0 8px, transparent 8px 14px); background-size: 28px 2px;
  animation: cl-march 1.4s linear infinite;
}
.cl-route-wire::before { top: 8px; }
.cl-route-wire::after { bottom: 8px; animation-direction: reverse; background-image: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 14px); }
.cl-route-archive {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap;
  font: 11px var(--mono); letter-spacing: .06em; color: var(--text);
  background: var(--bg); border: 1px solid var(--hairline); border-radius: 999px; padding: 3px 10px;
}

/* Pricing (structure kept for pricing.js + copy-check) */
.cl-pricing .section-intro h2 { margin-top: 12px; }
.cl-pricing .section-intro > p:last-child { margin: 14px 0 0; }
.cl-pricing .billing-toggle { margin: 32px 0 24px; }
.cl-pricing .pricing-grid { gap: 18px; }
.cl-pricing .price-card { padding: 26px; }
.cl-pricing .price-card h3 { margin: 6px 0 12px; font-size: 20px; }
.cl-pricing .featured { border-color: var(--sky); background: linear-gradient(170deg, var(--sky-wash), var(--surface) 55%); }
.cl-pricing .price { font-size: 44px; letter-spacing: -.03em; }
.cl-pricing .price:not([data-monthly]) { font: 700 30px var(--pico-font-family); letter-spacing: -.02em; }
.cl-pricing .price-card ul { padding: 16px 0 0; margin: 16px 0 24px; border-top: 1px solid var(--hairline); }
.cl-pricing .price-card li { list-style: none; margin: 0 0 6px; font-size: 15px; color: var(--muted); }
.cl-pricing .price-card li::before { content: "+ "; color: var(--accent); font-family: var(--mono); }
.cl-pricing .featured li::before { color: var(--sky); }

/* FAQ + final */
.cl-faq { margin-top: clamp(80px, 11vw, 140px); padding-block: clamp(56px, 8vw, 96px); border-top: 1px solid var(--hairline); }
.cl-faq-grid { display: grid; grid-template-columns: minmax(0, .6fr) minmax(0, 1.4fr); gap: clamp(24px, 5vw, 64px); }
.cl-faq h2 { font-size: clamp(28px, 3.4vw, 42px); letter-spacing: -.03em; }
.cl-faq-list details { margin: 0; padding: 0; border-top: 1px solid var(--hairline); border-bottom: 0; }
.cl-faq-list details:last-child { border-bottom: 1px solid var(--hairline); }
.cl-faq-list summary { padding: 18px 0; font-size: 18px; font-weight: 500; color: var(--text); }
.cl-faq-list details p { margin: 0 0 20px; max-width: 64ch; }
.cl-final { padding-block: clamp(64px, 9vw, 120px); border-top: 1px solid var(--hairline); background: radial-gradient(ellipse at 20% 0%, #8cc8ea14, transparent 60%); }
.cl-final h2 { font-size: clamp(38px, 6vw, 76px); line-height: 1; letter-spacing: -.045em; }
.cl-final h2 em { display: block; color: var(--sky); }
.cl-final .actions { margin: 32px 0 0; }

@media (max-width: 960px) {
  .cl-hero-grid, .cl-scrolly, .cl-faq-grid { grid-template-columns: minmax(0, 1fr); }
  .cl-stage { display: none; }
  .cl.has-js .steps li { opacity: 1; padding-block: 22px; }
  .cl-runs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .cl { --spine-x: 0px; --rail: 0px; }
  .cl-spine, .cl-stud { display: none; }
  .cl-chapter > .cl-wrap { padding-left: var(--gutter); }
  .cl-split-grid, .cl-route { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cl-bridge { height: 36px; }
  .cl-bridge span { top: 6px; bottom: 6px; left: 50%; right: auto; width: 2px; height: auto; background: repeating-linear-gradient(180deg, var(--accent) 0 8px, transparent 8px 14px); animation: none; }
  .cl-bridge span::after { display: none; }
  .cl-route-wire { height: 56px; }
  .cl-route-wire::before, .cl-route-wire::after { display: none; }
  .cl-runs { grid-template-columns: minmax(0, 1fr); }
  .cl-runs > div { padding-right: 0; }
  .cl-stage-frame { min-height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .cl *, .cl *::before, .cl *::after { animation: none !important; transition: none !important; }
}
