/* Leads Rubix — home page, "the Lead Machine". Blueprint language: dot grids, hairlines, mono spec labels.
   Uses the site tokens from site.css; light default, .dark on <html>. */
.lr-home {
  --display: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --em-x: #0f9f73; --gold: #f5c04a; --night: #110e24;
  --dot: color-mix(in srgb, var(--ink) 13%, transparent);
  --muted: color-mix(in srgb, var(--ink) 42%, var(--bg));
}
.dark .lr-home { --em-x: #34d399; }
body[data-page="home"] .veil { display: none; }
body[data-page="home"] main.lr-home { z-index: auto; }
.lr-wrap { width: var(--wrap); margin-inline: auto; }
.mono { font-family: var(--mono); }
.sec-x { padding: clamp(90px, 11vw, 150px) 0; position: relative; }

/* labels, headings, buttons */
.mono-tag { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 20px; font: 600 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.mono-tag .idx { padding: 3px 8px; border-radius: 6px; background: var(--c, var(--ink)); color: #fff; letter-spacing: .02em; }
.mono-tag.light { color: rgba(255,255,255,.7); }
.led { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.18), 0 0 12px #10b981; animation: led 1.6s ease-in-out infinite; flex: none; }
.led.amber { background: #f5a524; box-shadow: 0 0 0 3px rgba(245,165,36,.2), 0 0 12px #f5a524; }
@keyframes led { 50% { opacity: .45; } }
.h2-x { margin: 0; font: 800 clamp(34px, 4.5vw, 62px)/1.03 var(--display); letter-spacing: -.035em; color: var(--ink); max-width: 18ch; }
.h2-x .dim { color: var(--muted); }
.h2-x.light { color: #fff; }
.lede-x { margin: 20px 0 0; max-width: 560px; font-size: 18px; color: var(--ink-2); }
.lede-x.light { color: rgba(255,255,255,.72); }
.link-x { font: 600 14px var(--mono); color: var(--violet); text-decoration: none; letter-spacing: .02em; }
.link-x:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn-x { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 54px; padding: 0 24px; border-radius: 10px; font: 650 16px var(--sans); text-decoration: none; transition: transform .2s, background .2s, border-color .2s; }
.btn-x:hover { transform: translateY(-2px); }
.btn-x .arr { font-family: var(--mono); }
.btn-x.primary { background: var(--primary); color: var(--primary-fg); box-shadow: 0 10px 0 -4px color-mix(in srgb, #10b981 60%, transparent); }
.btn-x.ghost { border: 1.5px solid var(--ink); color: var(--ink); background: transparent; }
.btn-x.light { background: #fff; color: #17142b; }
.btn-x.ghost-light { border: 1.5px solid rgba(255,255,255,.5); color: #fff; }
.btn-x.wide { width: 100%; }

/* motion: rise-in (only when JS + motion; a timer in <head> reveals everything if JS never starts) */
html.lr-motion:not(.lr-revealed) .rise { opacity: 0; transform: translateY(22px); }
.rise { transition: opacity .8s cubic-bezier(.2,.7,.2,1) var(--d, 0ms), transform .8s cubic-bezier(.2,.7,.2,1) var(--d, 0ms); }
html.lr-motion .rise.in { opacity: 1; transform: none; }

/* ---------------- the run: one sticky machine, the hero and six chapters scroll over it ---------------- */
.lr-run { position: relative; }
.run-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; z-index: 0; }
.stage-bg { position: absolute; inset: 0; background-image: radial-gradient(var(--dot) 1.2px, transparent 1.3px); background-size: 26px 26px; mask-image: radial-gradient(80% 90% at 70% 50%, #000 35%, transparent 85%); }
.stage-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(40% 50% at 72% 45%, rgba(108,92,231,.14), transparent 70%), radial-gradient(30% 35% at 70% 92%, rgba(245,192,74,.14), transparent 70%); }
#machineCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .8s; }
html.has-machine #machineCanvas { opacity: 1; }
.schematic { position: absolute; right: max(24px, calc((100vw - 1240px) / 2)); top: 50%; transform: translateY(-50%); height: min(78vh, 640px); width: auto; transition: opacity .6s; }
html.has-machine .schematic { opacity: 0; }
.stage-hud { position: absolute; right: max(24px, calc((100vw - 1240px) / 2)); bottom: 26px; display: flex; align-items: center; gap: 14px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.hud-bars { display: flex; gap: 4px; }
.hud-bars i { width: 18px; height: 4px; border-radius: 2px; background: var(--line-2); transition: background .3s; }
.hud-bars i.on { background: #10b981; }
.hud-bars i.cur { background: var(--ink); }
.run-steps { position: relative; z-index: 2; margin-top: -100vh; margin-top: -100svh; pointer-events: none; }
.run-step { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--head-h) + 20px) 0 40px; }
.run-step .lr-wrap > * { pointer-events: auto; max-width: 560px; }
.run-hero .hero-copy { max-width: 620px; }
.chapter-card { max-width: 530px; }
.run-step:not(.run-hero) { min-height: 110vh; }
.hero-title { margin: 0; font: 800 clamp(50px, 6.5vw, 100px)/.94 var(--display); letter-spacing: -.045em; color: var(--ink); }
.hero-title .ln { display: block; }
.hero-title .accent { color: var(--em-x); }
.hero-sub { margin: 22px 0 0; font-size: clamp(17px, 1.3vw, 19px); line-height: 1.62; color: var(--ink-2); }
.hero-proof { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 22px 0 0; font: 500 13px var(--mono); color: var(--ink-3); }
.hero-proof span::before { content: "✓ "; color: var(--em-x); }
.hero-proof b { color: var(--em-x); }
.try { display: flex; align-items: center; gap: 10px; margin: 30px 0 0; padding: 10px 14px; border: 1px dashed var(--line-2); border-radius: 10px; width: fit-content; font-size: 12.5px; color: var(--ink-2); }
html.no-webgl .try { display: none; }
.chapter-card { position: relative; padding: 30px 30px 26px; border-radius: 18px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(14px) saturate(140%); border: 1px solid var(--line); box-shadow: var(--shadow); opacity: .4; transform: translateY(10px); transition: opacity .5s, transform .5s; }
.chapter-card::before { content: ""; position: absolute; left: -1px; top: 22px; bottom: 22px; width: 4px; border-radius: 4px; background: var(--c); }
.run-step.is-active .chapter-card, html:not(.lr-motion) .chapter-card { opacity: 1; transform: none; }
.ch-title { margin: 0; font: 800 clamp(28px, 2.9vw, 42px)/1.06 var(--display); letter-spacing: -.03em; color: var(--ink); }
.ch-body { margin: 14px 0 0; color: var(--ink-2); font-size: 16.5px; }
.spec { margin: 22px 0 0; display: grid; }
.spec > div { display: grid; grid-template-columns: 112px 1fr; gap: 14px; padding: 10px 0; border-top: 1px dashed var(--line-2); font-size: 14.5px; }
.spec dt { font: 600 11.5px/1.7 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.spec dd { margin: 0; color: var(--ink); font-weight: 600; }

/* ---------------- activity log ---------------- */
.lr-log { position: relative; z-index: 3; background: var(--night); color: #fff; padding: 22px 0 26px; overflow: hidden; }
.log-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 16px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.log-head .mono { display: inline-flex; align-items: center; gap: 10px; }
.log-head .dim { color: rgba(255,255,255,.45); }
.log-viewport { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.log-track { list-style: none; margin: 0; padding: 0; display: flex; gap: 34px; width: max-content; animation: log 70s linear infinite; }
.lr-log:hover .log-track { animation-play-state: paused; }
@keyframes log { to { transform: translateX(-50%); } }
.log-track li { display: inline-flex; align-items: center; gap: 12px; font: 500 14px var(--mono); white-space: nowrap; }
.log-track .t { color: rgba(255,255,255,.38); }
.log-track .k { padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--night); background: var(--c); }
.log-track .m { color: rgba(255,255,255,.88); }
@media (prefers-reduced-motion: reduce) { .log-track { animation: none; flex-wrap: wrap; width: auto; } }

/* ---------------- leaks ---------------- */
.leak-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(30px, 6vw, 100px); align-items: start; }
.leak-head { position: sticky; top: calc(var(--head-h) + 40px); }
.leak-list { list-style: none; margin: 0; padding: 0; position: relative; }
.leak-list::before { content: ""; position: absolute; left: 27px; top: 10px; bottom: 10px; width: 3px; background: repeating-linear-gradient(var(--line-2) 0 10px, transparent 10px 18px); }
.leak-list li { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 22px; padding: 26px 0; }
.leak-id { position: relative; z-index: 1; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--card); border: 1.5px solid #e11d48; color: #e11d48; font-weight: 700; font-size: 14px; }
.leak-list h3 { margin: 4px 0 6px; font: 700 22px var(--display); letter-spacing: -.02em; color: var(--ink); }
.leak-list p { margin: 0; color: var(--ink-2); }
.drip { position: absolute; left: 25px; top: 86px; width: 7px; height: 7px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #e11d48; animation: drip 2.4s ease-in infinite; opacity: 0; }
.leak-list li:nth-child(2) .drip { animation-delay: .6s; } .leak-list li:nth-child(3) .drip { animation-delay: 1.2s; } .leak-list li:nth-child(4) .drip { animation-delay: 1.8s; }
@keyframes drip { 0% { opacity: 0; transform: translateY(0) rotate(-45deg); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(46px) rotate(-45deg); } }

/* ---------------- spec sheet ---------------- */
.lr-spec { background: color-mix(in srgb, var(--bg-2) 80%, transparent); border-block: 1px solid var(--line); }
.spec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 40px; margin-bottom: 50px; }
.spec-head .mono-tag { flex-basis: 100%; margin-bottom: 0; }
.spec-head .lede-x { margin: 0; max-width: 420px; }
.spec-sheet { margin: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 50px; }
.spec-sheet > div { display: grid; grid-template-columns: 170px 1fr; gap: 20px; padding: 20px 0; border-top: 1px solid var(--line-2); }
.spec-sheet dt { display: flex; gap: 12px; font: 700 18px var(--display); color: var(--ink); }
.spec-sheet dt .mono { font-size: 12px; color: var(--violet); padding-top: 5px; font-weight: 600; }
.spec-sheet dd { margin: 0; color: var(--ink-2); font-size: 15.5px; }

/* ---------------- presets ---------------- */
.preset-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.preset-grid a { display: flex; flex-direction: column; height: 100%; padding: 24px 22px 22px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: inherit; transition: border-color .3s, transform .3s, box-shadow .3s; }
.preset-grid a:hover { border-color: var(--c); transform: translateY(-4px); box-shadow: var(--shadow); }
.preset-no { margin: 0; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--c); font-weight: 700; }
.preset-grid h3 { margin: 10px 0 6px; font: 800 21px/1.15 var(--display); letter-spacing: -.02em; color: var(--ink); }
.preset-tag { margin: 0; font-size: 14px; color: var(--ink-2); }
.mini-line { list-style: none; margin: 18px 0 0; padding: 0 0 0 4px; position: relative; display: grid; gap: 7px; }
.mini-line::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: color-mix(in srgb, var(--c) 35%, transparent); }
.mini-line li { position: relative; display: flex; align-items: center; gap: 12px; font: 500 12.5px var(--mono); color: var(--ink-2); }
.mini-line i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--c); background: var(--card); flex: none; position: relative; }
.mini-line li:last-child i { background: var(--c); }
.mini-line li:last-child span { color: var(--ink); font-weight: 700; }
.preset-go { margin-top: auto; padding-top: 18px; font: 600 13px var(--mono); color: var(--c); }

/* ---------------- install ---------------- */
.install-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(30px, 6vw, 100px); align-items: start; }
.install-list { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.install-list li { display: grid; grid-template-columns: 64px 1fr; gap: 20px; padding: 24px 0; border-top: 1px solid var(--line-2); }
.install-list li:last-child { border-bottom: 1px solid var(--line-2); }
.step-no { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 700; }
.install-list h3 { margin: 2px 0 6px; font: 700 22px var(--display); letter-spacing: -.02em; color: var(--ink); }
.install-list p { margin: 0; color: var(--ink-2); }

/* ---------------- pricing ---------------- */
.plans-x { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan-x { position: relative; display: flex; flex-direction: column; padding: 30px 28px 28px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.plan-x.hot { background: linear-gradient(170deg, #2b2652, #17142b); color: #fff; border-color: transparent; }
.plan-flag { position: absolute; top: 20px; right: 20px; margin: 0; padding: 4px 9px; border-radius: 6px; background: #10b981; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.plan-x h3 { margin: 0; font: 800 22px var(--display); color: var(--ink); }
.plan-x.hot h3 { color: #fff; }
.price-x { margin: 16px 0 0; display: flex; align-items: baseline; gap: 6px; }
.price-x b { font: 800 46px/1 var(--display); letter-spacing: -.035em; color: var(--ink); }
.plan-x.hot .price-x b { color: #fff; }
.price-x span { font: 500 13px var(--mono); opacity: .6; }
.plan-d { margin: 12px 0 0; font-size: 15px; color: var(--ink-2); }
.plan-x.hot .plan-d { color: rgba(255,255,255,.72); }
.plan-x ul { list-style: none; margin: 22px 0 26px; padding: 20px 0 0; border-top: 1px dashed var(--line-2); display: grid; gap: 10px; font-size: 14.5px; }
.plan-x.hot ul { border-color: rgba(255,255,255,.2); }
.plan-x li { position: relative; padding-left: 24px; }
.plan-x li::before { content: "▸"; position: absolute; left: 4px; color: #10b981; }
.plan-x .btn-x { margin-top: auto; }
.foot-link { margin: 28px 0 0; }

/* ---------------- voices ---------------- */
.voices-x { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.voices-x figure { margin: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: 28px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.voices-x blockquote { margin: 0; font-size: 17px; line-height: 1.6; color: var(--ink); }
.voices-x blockquote::before { content: "“"; display: block; font: 800 46px/0.6 var(--display); color: var(--violet); margin-bottom: 14px; }
.voices-x figcaption { display: grid; gap: 2px; padding-top: 16px; border-top: 1px dashed var(--line-2); font: 500 12.5px var(--mono); color: var(--ink-3); }
.voices-x figcaption b { font: 700 15px var(--sans); color: var(--ink); }

/* ---------------- faq ---------------- */
.faq-x { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(30px, 6vw, 100px); align-items: start; }
.lr-faq .faq summary { font-family: var(--display); font-weight: 700; font-size: 19px; }

/* ---------------- switch on ---------------- */
.lr-switch { position: relative; z-index: 3; padding: clamp(90px, 11vw, 140px) 0; color: #fff; background: radial-gradient(50% 70% at 82% 50%, rgba(245,192,74,.22), transparent 70%), radial-gradient(50% 70% at 0% 0%, rgba(108,92,231,.35), transparent 70%), var(--night); overflow: hidden; }
.lr-switch::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1.2px, transparent 1.3px); background-size: 26px 26px; }
.switch-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 40px; align-items: center; }
.switch-coin { justify-self: center; width: min(240px, 50vw); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #ffe7a3, #f5c04a 45%, #b07d00 100%); box-shadow: inset 0 0 0 10px rgba(176,125,0,.35), 0 30px 80px -20px rgba(245,192,74,.6); animation: coin 6s ease-in-out infinite; }
.switch-coin span { font: 800 110px/1 var(--display); color: #8a6200; text-shadow: 0 2px 0 rgba(255,255,255,.35); }
@keyframes coin { 0%, 100% { transform: rotateY(0) translateY(0); } 50% { transform: rotateY(180deg) translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .switch-coin { animation: none; } .led { animation: none; } }

/* ---------------- responsive ---------------- */
@media (max-width: 1000px) {
  .schematic { right: 50%; transform: translate(50%, -50%); height: 70vh; opacity: .35; }
  .stage-hud { left: 24px; right: 24px; justify-content: space-between; bottom: 14px; }
  .run-step { align-items: flex-end; padding-bottom: 70px; }
  .run-hero { align-items: flex-start; padding-top: calc(var(--head-h) + 28px); }
  .run-hero .hero-copy { padding: 22px 20px 24px; margin: 0 -8px; border-radius: 18px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); }
  .chapter-card { padding: 22px 20px 18px; opacity: 1; transform: none; }
  .ch-body { font-size: 15.5px; }
  .spec > div { grid-template-columns: 92px 1fr; font-size: 13.5px; }
  .leak-grid, .install-grid, .faq-x, .switch-grid { grid-template-columns: 1fr; }
  .leak-head { position: static; }
  .spec-sheet { grid-template-columns: 1fr; }
  .preset-grid { grid-template-columns: 1fr 1fr; }
  .plans-x, .voices-x { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .preset-grid { grid-template-columns: 1fr; }
  .spec-sheet > div { grid-template-columns: 1fr; gap: 6px; }
  .actions .btn-x { flex: 1 1 100%; }
  .log-head .dim { display: none; }
}
@media (max-width: 600px) { .chapter-card .spec { display: none; } .chapter-card { padding: 18px 18px 16px; } .ch-title { font-size: 24px; } .ch-body { font-size: 14.5px; } }

/* ================= refinements: callouts on the machine, live feed, HUD counters ================= */
.callouts { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.co { position: absolute; left: 0; top: 0; display: none; will-change: transform; transition: opacity .3s; }
.co.on { display: block; animation: co-in .5s cubic-bezier(.2,.8,.2,1) both; }
html:not(.has-machine) .callouts, html:not(.has-machine) .feed { display: none; }
@keyframes co-in { from { opacity: 0; filter: blur(4px); } }
.co-dot { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bg) 70%, transparent); }
.co-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--ink); opacity: .4; animation: co-ping 2s ease-out infinite; }
@keyframes co-ping { from { transform: scale(.6); opacity: .6; } to { transform: scale(1.8); opacity: 0; } }
.co-card { position: absolute; white-space: nowrap; padding: 9px 13px; border-radius: 12px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(10px) saturate(150%); border: 1px solid var(--line); box-shadow: 0 12px 30px -14px rgba(23,20,43,.45); font-size: 13px; color: var(--ink); }
.co-card::before { content: ""; position: absolute; background: var(--ink); opacity: .35; }
.co[data-side="right"] .co-card { left: 26px; top: 0; transform: translateY(-50%); }
.co[data-side="right"] .co-card::before { right: 100%; top: 50%; width: 20px; height: 1.5px; }
.co[data-side="left"] .co-card { right: 26px; top: 0; transform: translateY(-50%); }
.co[data-side="left"] .co-card::before { left: 100%; top: 50%; width: 20px; height: 1.5px; }
.co[data-side="up-left"] .co-card { right: -14px; bottom: 26px; }
.co[data-side="up-right"] .co-card { left: -14px; bottom: 26px; }
.co[data-side="down"] .co-card { left: 0; top: 30px; transform: translateX(-50%); }
.co[data-side^="up"] .co-card::before, .co[data-side="down"] .co-card::before { width: 1.5px; height: 20px; }
.co[data-side="up-left"] .co-card::before { right: 14px; top: 100%; }
.co[data-side="up-right"] .co-card::before { left: 14px; top: 100%; }
.co[data-side="down"] .co-card::before { left: 50%; bottom: 100%; }
/* overview tags */
.co.tag .co-card { display: flex; align-items: center; gap: 9px; padding: 7px 12px 7px 8px; font: 600 12px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.co-tag { padding: 3px 7px; border-radius: 6px; background: var(--ink); color: var(--bg); font-size: 11px; }
/* live counts */
.co.count .co-card { display: grid; gap: 0; text-align: left; padding: 8px 12px; font-size: 12px; color: var(--ink-2); }
.co.count b { font: 800 22px/1.1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.co-k { font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.co.count.small .co-card { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.co.count.small b { font-size: 17px; }
.co-av { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: #252140; color: #fff; font: 700 11px var(--sans); }
.dark .co-av { background: #5b50b8; }
.co.accent .co-card { border-color: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.12), 0 12px 30px -14px rgba(23,20,43,.45); }
.co.accent b { color: #0f9f73; }
.dark .co.accent b { color: #34d399; }
/* product-moment cards */
.co.ui .co-card { width: 236px; white-space: normal; padding: 13px 15px 12px; border-top: 3px solid var(--k, var(--ink)); }
.co.call { --k: #10b981; } .co.amber { --k: #f5a524; } .co.sky { --k: #0ea5e9; } .co.rose { --k: #e11d48; } .co.gold { --k: #f5c04a; } .co.dashx { --k: #8d81d0; }
.co-title { display: flex; align-items: center; gap: 8px; margin: 0; font: 700 14px var(--sans); color: var(--ink); }
.co-title svg { width: 17px; height: 17px; color: var(--k); flex: none; }
.co-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.co-row b { font: 800 18px var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.co-row .mono { font-size: 13px; font-weight: 600; color: var(--ink); }
.co .ok { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #047857; background: #ecfdf5; }
.dark .co .ok { color: #a7f3d0; background: rgba(2,44,34,.6); }
.co .ok svg { width: 12px; height: 12px; }
.co-sub { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); }
.co-sub b { color: var(--ink); }
.co-amt { margin: 6px 0 0; font: 800 30px/1 var(--display); letter-spacing: -.02em; color: var(--ink); }
.rzp { padding: 2px 7px; border-radius: 5px; background: #0b72e7; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.dash { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 4px; }
.dash p { margin: 0; padding: 7px 8px; border-radius: 8px; background: color-mix(in srgb, var(--k) 10%, var(--card)); display: grid; }
.dash span { font-size: 10.5px; color: var(--ink-3); }
.dash b { font: 800 18px var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.sbars { display: grid; gap: 5px; margin-top: 6px; }
.sbars p { margin: 0; display: grid; grid-template-columns: 70px 1fr 26px; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-2); }
.sbars i { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.sbars s { display: block; height: 100%; background: linear-gradient(90deg, #6c5ce7, #10b981); transform-origin: left; transform: scaleX(0); transition: transform .6s; }
.sbars b { font: 700 12px var(--mono); text-align: right; color: var(--ink); }

/* live event feed (hero view) */
.live-box { margin-top: 22px; max-width: 470px; }
.live-box .try { margin: 0 0 8px; }
.feed { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; min-height: 0; }
.feed li { display: flex; gap: 10px; align-items: center; padding: 7px 11px; border-radius: 10px; background: color-mix(in srgb, var(--card) 90%, transparent); border: 1px solid var(--line); backdrop-filter: blur(8px); font: 500 12px var(--mono); color: var(--ink); animation: feed-in .45s cubic-bezier(.2,.8,.2,1); }
.feed li:nth-child(n+3) { opacity: .5; }
.feed li:nth-child(n+4) { display: none; }
.feed li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--f, #6c5ce7); }
.feed .t { color: var(--ink-3); }
.feed .f-rr { --f: #10b981; } .feed .f-call { --f: #f5a524; } .feed .f-cb { --f: #f5a524; } .feed .f-visit { --f: #0ea5e9; } .feed .f-lost { --f: #9a98ad; } .feed .f-book { --f: #f5c04a; }
@keyframes feed-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* HUD counters */
.stage-hud { gap: 18px; }
.hud-stats { display: flex; gap: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 80%, transparent); }
.hud-stats span:first-child { color: var(--ink-3); }
.hud-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
html:not(.has-machine) .hud-stats { display: none; }

/* leaky pipe */
.leak-pipe { display: block; width: 100%; max-width: 520px; margin-top: 40px; overflow: visible; }
.lp-k { font: 600 11px var(--mono); letter-spacing: .08em; fill: var(--ink-3); }
.lp-flow circle { fill: #fff; opacity: .85; animation: lp-flow 3s linear infinite; }
.lp-flow circle:nth-child(2) { animation-delay: -.6s; } .lp-flow circle:nth-child(3) { animation-delay: -1.2s; } .lp-flow circle:nth-child(4) { animation-delay: -1.8s; } .lp-flow circle:nth-child(5) { animation-delay: -2.4s; }
@keyframes lp-flow { from { transform: translateX(-30px); opacity: 0; } 10% { opacity: .9; } 90% { opacity: .9; } to { transform: translateX(470px); opacity: 0; } }
.lp-crack { fill: none; stroke: #e11d48; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.lp-drop { fill: #e11d48; animation: lp-drip 2.2s ease-in infinite; animation-delay: calc(var(--i) * .5s); }
@keyframes lp-drip { 0% { transform: translateY(-10px); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(70px); opacity: 0; } }
.lp-id { font: 700 13px var(--mono); fill: #e11d48; }
.lp-floor { stroke: var(--line-2); stroke-width: 2; stroke-dasharray: 4 6; }

/* install icons, preset hover run */
.install-list h3 { display: flex; align-items: center; gap: 10px; }
.st-ic { width: 22px; height: 22px; color: var(--violet); flex: none; }
.preset-grid a:hover .mini-line i { animation: mini-pass .35s ease both; animation-delay: calc(var(--n) * .12s); }
@keyframes mini-pass { 50% { background: var(--c); transform: scale(1.5); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); } }

.co.small .co-dot { display: none; }
.co[data-side="down"].ui .co-card { top: 46px; }
@media (max-width: 1000px) { .callouts { display: none !important; } .hud-stats span:first-child { display: none; } }
@media (prefers-reduced-motion: reduce) { .co-dot::after, .lp-flow circle, .lp-drop { animation: none; } }
@media (max-width: 600px) { #hudPart { display: none; } .hud-stats { white-space: nowrap; font-size: 11px; } .stage-hud { justify-content: flex-start; } }
.hud-stats, #hudPart { white-space: nowrap; }

/* ================= phones & tablets: machine stays the star, copy and live cards dock around it ================= */
@media (max-width: 1000px) {
  /* hero: copy on top, the running machine in the lower half */
  .run-hero { align-items: flex-start; padding-top: calc(var(--head-h) + 22px); }
  .run-hero .hero-copy { padding: 0; margin: 0; background: none; backdrop-filter: none; max-width: 640px; }
  .hero-title { font-size: clamp(44px, 11vw, 84px); }
  .hero-sub { font-size: 16.5px; margin-top: 16px; }
  .run-hero .actions { margin-top: 20px; flex-wrap: nowrap; }
  .run-hero .actions .btn-x { flex: 1 1 0; height: 50px; padding: 0 14px; font-size: 15px; white-space: nowrap; }
  .hero-proof { margin-top: 14px; font-size: 12px; }
  .live-box { max-width: none; }
  .stage-bg { mask-image: radial-gradient(90% 70% at 50% 60%, #000 30%, transparent 85%); }

  /* chapters: compact card at the bottom, machine above it */
  .run-step:not(.run-hero) { align-items: flex-end; padding-bottom: 64px; min-height: 100vh; min-height: 100svh; }
  .run-step .lr-wrap > .chapter-card { max-width: 560px; margin-inline: auto; }
  .chapter-card { padding: 18px 20px 16px; border-radius: 16px; }
  .chapter-card .mono-tag { margin-bottom: 10px; }
  .ch-title { font-size: clamp(22px, 5.4vw, 32px); }
  .ch-body { margin-top: 8px; font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

  /* live cards become chips docked under the header */
  html.has-machine .callouts { display: flex !important; }
  .callouts { flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 6px; inset: calc(var(--head-h) + 10px) 12px auto 12px; }
  .co { position: static; transform: none !important; opacity: 1 !important; }
  .co.tag, .co.m-hide { display: none !important; }
  .co-dot, .co-card::before { display: none; }
  .co-card, .co[data-side] .co-card { position: static; transform: none; top: auto; left: auto; right: auto; bottom: auto; }
  .co.ui .co-card { width: min(320px, calc(100vw - 24px)); }
  .co.count .co-card { padding: 6px 10px; }
  .co.count b { font-size: 18px; }
  .co.count.small .co-card { padding: 5px 9px; }

  .stage-hud { bottom: 18px; }
  .hud-stats { font-size: 11px; padding: 5px 10px; gap: 10px; }
}
@media (max-width: 600px) {
  .hero-sub .more, .live-box { display: none; }
  .run-step:not(.run-hero) { padding-bottom: 56px; }
  .co.ui .co-card { padding: 10px 12px; }
  .co-amt { font-size: 24px; }
  .dash b { font-size: 16px; }
}
/* tablets in landscape and small laptops: keep the side-by-side layout but give the copy room */
@media (min-width: 1001px) and (max-width: 1280px) {
  .hero-title { font-size: clamp(50px, 6vw, 80px); }
  .run-step .lr-wrap > * { max-width: 470px; }
  .chapter-card { max-width: 470px; }
  .co.ui .co-card { width: 220px; }
}
@media (max-width: 1000px) {
  /* each chapter card parks at the bottom while its chapter scrolls, so it never sweeps across the machine */
  .run-step:not(.run-hero) .lr-wrap { align-self: stretch; display: flex; align-items: flex-end; }
  .run-step:not(.run-hero) .chapter-card { position: sticky; bottom: 58px; width: 100%; }
  .run-step:not(.run-hero) { min-height: 120vh; min-height: 120svh; padding-top: 0; }
}
@media (max-width: 1000px) {
  /* only the active chapter card shows; the others fade instead of sliding over the machine */
  .run-step:not(.run-hero) .chapter-card { opacity: 0; transform: translateY(14px); transition: opacity .35s, transform .35s; }
  .run-step.is-active:not(.run-hero) .chapter-card { opacity: 1; transform: none; }
  html:not(.lr-motion) .run-step:not(.run-hero) .chapter-card { opacity: 1; transform: none; }
  /* hero copy sits on a soft fade so the machine below never runs under the text */
  .run-hero .hero-copy { position: relative; }
  .run-hero .hero-copy::before { content: ""; position: absolute; z-index: -1; inset: -40px -24px -36px; background: linear-gradient(to bottom, var(--bg) 78%, transparent); }
}
@media (max-width: 1000px) { .live-box { display: none; } }
.co[data-side="down"].ui .co-card { top: 74px; }
@media (max-height: 860px) and (min-width: 1001px) { .feed li:nth-child(n+3) { display: none; } .hero-sub .more { display: none; } }
