/* RugRadar Scan: story hero + new home sections (home pages only). Local CSS, no external resources. */
:root { --hdr: 4.25rem; --tg-bg: #0b1019; --tg-bubble: #182131; --tg-me: #1f6fd0; }

/* ---------- hero / story ---------- */
.story { position: relative; padding: 0; }
.story-intro { position: relative; z-index: 3; padding: 1.8rem 0 0.6rem; }
.story-intro-inner { max-width: 38rem; }
.story-intro h1 { margin: 0 0 0.55rem; font-size: clamp(2.05rem, 5.2vw, 3.55rem); line-height: 1.05; font-weight: 800; letter-spacing: -0.025em; text-wrap: balance; }
.story-sub { margin: 0 0 0.7rem; font-size: clamp(1.12rem, 2.3vw, 1.45rem); font-weight: 700; color: var(--ok); letter-spacing: -0.01em; }
.story-intro .tagline { margin: 0 0 1.15rem; font-size: clamp(0.98rem, 1.6vw, 1.08rem); max-width: 34rem; }
.story-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1.1rem; }
.btn-lg { padding: 0.95rem 1.55rem; font-size: 1.04rem; min-height: 3.1rem; }
.btn-cta { background: linear-gradient(90deg, #35c2f3 0%, #3DDEC8 48%, #5CF28F 100%); color: var(--accent-text); box-shadow: 0 10px 34px rgba(61, 222, 200, 0.28); }
.btn-cta:hover { background: linear-gradient(90deg, #5ad0f7 0%, #62ead7 48%, #7ff6a8 100%); color: var(--accent-text); }
.story-hint { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; }
.story-note { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.86rem; }
.story-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 0.5rem; margin: 1.1rem 0 0; padding: 0; }
.story-chips li { border: 1px solid var(--line); background: rgba(15, 20, 30, 0.7); color: var(--muted); border-radius: 999px; padding: 0.28rem 0.7rem; font-size: 0.78rem; font-weight: 600; }

.story-track { position: relative; }
.story-pin { position: relative; }
.story-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(55% 55% at 82% 18%, rgba(61, 222, 200, 0.17), transparent 70%),
    radial-gradient(48% 60% at 8% 72%, rgba(53, 130, 243, 0.15), transparent 72%),
    radial-gradient(40% 40% at 60% 105%, rgba(92, 242, 143, 0.09), transparent 70%); }
.story-grid { position: relative; z-index: 1; }
.story-chapters, .story-skip { display: none; }
.story-device { display: flex; justify-content: center; padding: 1rem 0 2.2rem; }

/* phone */
.phone { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 21.5rem; background: var(--tg-bg);
  border: 2px solid #28344c; border-radius: 2.1rem; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 7px rgba(15, 20, 30, 0.85), 0 0 90px rgba(61, 222, 200, 0.09); }
.tg-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.95rem 1rem 0.7rem; background: #0F141E; border-bottom: 1px solid var(--line-soft); }
.tg-avatar { width: 2.4rem; height: 2.4rem; flex: 0 0 2.4rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--accent-text); background: linear-gradient(135deg, #3DDEC8, #5CF28F); }
.tg-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tg-who b { font-size: 0.95rem; }
.tg-who small { color: var(--muted); font-size: 0.78rem; }
.tg-label { margin: 0.55rem auto 0.1rem; width: max-content; max-width: 92%; text-align: center; font-family: var(--mono); font-size: 0.66rem; line-height: 1.35; color: var(--warn);
  border: 1px solid rgba(232, 184, 74, 0.55); border-radius: 999px; padding: 0.18rem 0.65rem; }
.tg-chat { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 0.4rem 0.7rem 0.7rem; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%); mask-image: linear-gradient(to bottom, transparent 0, #000 14%); }
.tg-chat > * { margin-top: 0.5rem; flex: 0 0 auto; }
.msg { max-width: 90%; padding: 0.55rem 0.78rem; border-radius: 15px; font-size: 0.875rem; line-height: 1.38; overflow-wrap: anywhere; }
.msg small { display: block; color: var(--muted); font-size: 0.8rem; }
.msg b { font-weight: 700; }
.msg.bot { align-self: flex-start; background: var(--tg-bubble); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--tg-me); color: #fff; border-bottom-right-radius: 4px; font-family: var(--mono); font-size: 0.82rem; }
.msg.report { max-width: 100%; width: 100%; padding: 0.4rem 0.75rem; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); gap: 0.55rem; padding: 0.32rem 0; align-items: start; }
.row + .row { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.row .gl { width: 1.2rem; height: 1.2rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.7rem; font-weight: 800; line-height: 1; margin-top: 0.1rem; }
.row .rt b { display: block; font-size: 0.86rem; line-height: 1.3; }
.row .rt small { font-size: 0.78rem; line-height: 1.3; }
.row-ok .gl { background: var(--ok-bg); color: var(--ok); } .row-ok small { color: var(--ok); }
.row-warn .gl { background: var(--warn-bg); color: var(--warn); } .row-warn small { color: var(--warn); }
.row-risk .gl { background: var(--risk-bg); color: var(--risk); } .row-risk small { color: var(--risk); }
.verdict { border: 1px solid rgba(255, 93, 108, 0.5); background: rgba(255, 93, 108, 0.09); border-radius: 15px; padding: 0.7rem 0.85rem 0.8rem; transition: box-shadow 0.5s ease, border-color 0.5s ease; }
.verdict.is-glow { border-color: rgba(255, 93, 108, 0.85); box-shadow: 0 0 0 1px rgba(255, 93, 108, 0.35), 0 0 42px rgba(255, 93, 108, 0.32); }
.v-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.v-count { font-size: 2.35rem; line-height: 1; font-weight: 800; color: var(--risk); font-variant-numeric: tabular-nums; }
.v-of { color: var(--muted); font-size: 0.95rem; font-family: var(--mono); }
.v-label { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--risk); text-align: right; }
.v-bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 0.55rem 0 0.5rem; }
.seg { display: block; height: 6px; border-radius: 3px; }
.seg-ok { background: var(--ok); } .seg-warn { background: var(--warn); } .seg-risk { background: var(--risk); }
.v-text { margin: 0; font-size: 0.82rem; font-weight: 600; }
.tg-cta { display: block; text-align: center; text-decoration: none; border-radius: 13px; padding: 0.7rem 0.8rem; font-weight: 800; font-size: 0.92rem;
  background: linear-gradient(90deg, #35c2f3, #3DDEC8 50%, #5CF28F); color: var(--accent-text); }
.tg-cta:hover { color: var(--accent-text); }
.msg.typing { display: none; padding: 0.7rem 0.85rem; gap: 5px; }
.msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: block; animation: tgdot 1.1s infinite ease-in-out; }
.msg.typing i:nth-child(2) { animation-delay: 0.15s; } .msg.typing i:nth-child(3) { animation-delay: 0.3s; }
.msg.typing.is-in { display: inline-flex; }
@keyframes tgdot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.tg-input { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.8rem 0.8rem; background: #0F141E; border-top: 1px solid var(--line-soft); }
.tg-input span { flex: 1; border-radius: 999px; background: #182131; color: var(--muted); font-size: 0.84rem; padding: 0.5rem 0.9rem; }
.tg-input i { width: 2rem; height: 2rem; border-radius: 50%; background: #2b8be8; }

/* animated mode only: chat items appear by scroll progress */
.story-anim [data-at] { display: none; }
.story-anim [data-at].is-in { display: block; animation: tgpop 0.34s ease both; }
.story-anim .msg[data-at].is-in { display: block; }
.story-anim li.row[data-at].is-in { display: grid; animation: tgpop 0.3s ease both; }
@keyframes tgpop { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }

/* static fallback (no JS or reduced motion): the full end state is visible, no pinning */
@media (min-width: 900px) {
  html:not(.story-anim) .story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 25rem); gap: 2rem 3.5rem; align-items: center;
    width: min(100% - 2rem, var(--max)); margin-inline: auto; padding: 2rem 0 1rem; }
  html:not(.story-anim) .story-intro { padding: 0; }
  html:not(.story-anim) .story-intro .wrap, html:not(.story-anim) .story-grid.wrap { width: auto; margin: 0; }
}

/* animated, pinned mode */
.story-anim .story { --h: calc(100vh - var(--hdr)); --h: calc(100svh - var(--hdr)); --run: 330vh; --run: 330svh; }
.story-anim .story-track { height: calc(var(--h) + var(--run)); }
.story-anim .story-pin { position: sticky; top: var(--hdr); height: var(--h); overflow: hidden; }
.story-anim .story-grid { height: 100%; display: flex; flex-direction: column; padding: 0.5rem 0 1.5rem; }
.story-anim .story-chapters { display: grid; flex: 0 0 auto; min-height: 5.6rem; margin-bottom: 0.45rem; }
.story-anim .chapter { grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s; align-self: start; }
.story-anim .chapter.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.story-anim .story-device { flex: 1 1 auto; min-height: 0; padding: 0; align-items: stretch; }
.story-anim .phone { height: 100%; max-height: 41rem; }
.story-anim .story-skip { display: block; position: absolute; left: 0; right: 0; bottom: 0.2rem; z-index: 2; text-align: center; font-size: 0.8rem; color: var(--muted); padding: 0.25rem; }
.story-anim .story-skip:hover { color: var(--text); }
.ch-num { margin: 0; font-weight: 800; font-size: 1.05rem; line-height: 1.1; font-family: var(--mono); letter-spacing: 0.02em; }
.ch-title { margin: 0.1rem 0 0.2rem; font-size: 1.45rem; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
.ch-text { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.45; max-width: 30rem; }
.ch-1 .ch-num { color: #5db7ff; } .ch-2 .ch-num { color: var(--warn); } .ch-3 .ch-num { color: var(--ok); } .ch-4 .ch-num { color: var(--accent); }
.chapter .btn { margin-top: 0.8rem; }
@media (max-width: 899px) {
  .chapter .btn { display: none; }
  .ch-num { display: inline; margin-right: 0.45rem; }
  .ch-title { display: inline; font-size: 1.25rem; }
  .ch-text { margin-top: 0.15rem; }
}
@media (max-height: 700px) { .tg-input { display: none; } .tg-head { padding: 0.7rem 0.9rem 0.55rem; } }
@media (max-height: 640px) { .story[data-stage="4"] .msg.report { display: none; } }
@media (max-width: 899px) and (max-height: 640px) { .ch-text { font-size: 0.86rem; } .story-anim .story-chapters { min-height: 5.1rem; } }
@media (min-width: 900px) {
  .story-anim .story-intro { position: sticky; top: var(--hdr); height: var(--h); margin-bottom: calc(var(--h) * -1); padding: 0; display: flex; align-items: center; pointer-events: none; }
  .story-anim .story-intro-inner { pointer-events: auto; width: min(50%, 36rem); transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0s; }
  .story-anim .story[data-stage]:not([data-stage="0"]) .story-intro-inner { opacity: 0; visibility: hidden; transform: translateY(-14px); transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s; }
  .story-anim .story-grid { display: grid; grid-template-columns: minmax(0, 1fr) 23.5rem; gap: 3.5rem; align-items: center; padding: 1.4rem 0 2.4rem; }
  .story-anim .story-chapters { min-height: 14rem; margin: 0; align-self: center; }
  .story-anim .chapter { align-self: center; }
  .ch-num { font-size: clamp(3.2rem, 6.5vw, 5.2rem); letter-spacing: -0.02em; }
  .ch-title { font-size: clamp(1.9rem, 3.4vw, 2.7rem); margin: 0.2rem 0 0.5rem; }
  .ch-text { font-size: 1.12rem; }
  .story-anim .story-device { height: 100%; align-items: center; }
  .story-anim .story-skip { text-align: left; left: max(1rem, calc((100vw - var(--max)) / 2)); right: auto; }
}
@media (min-width: 900px) and (max-height: 700px) {
  .story-intro h1 { font-size: clamp(2rem, 4.2vw, 2.8rem); }
  .story-intro .tagline { font-size: 0.95rem; margin-bottom: 0.8rem; }
  .story-chips { margin-top: 0.7rem; }
}

/* ---------- sections below the story ---------- */
#checks, #waitlist, #story { scroll-margin-top: 5.5rem; }
.section-head .kicker { margin-bottom: 0.5rem; }
.checks-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: ck; }
.checks-grid li { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 0.9rem; padding: 1.1rem 0; border-top: 1px solid var(--line-soft); align-items: start; }
.checks-grid li:last-child { border-bottom: 1px solid var(--line-soft); }
.ck-num { font-family: var(--mono); font-weight: 800; font-size: 1.5rem; line-height: 1.2; }
.checks-grid li:nth-child(1) .ck-num, .checks-grid li:nth-child(5) .ck-num { color: #5db7ff; }
.checks-grid li:nth-child(2) .ck-num, .checks-grid li:nth-child(7) .ck-num { color: var(--ok); }
.checks-grid li:nth-child(3) .ck-num, .checks-grid li:nth-child(6) .ck-num { color: var(--warn); }
.checks-grid li:nth-child(4) .ck-num { color: var(--risk); }
.checks-grid h3 { margin: 0 0 0.25rem; font-size: 1.12rem; letter-spacing: -0.01em; }
.checks-grid p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.checks-note { margin-top: 1.4rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-card); max-width: 46rem; }
.checks-note h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.checks-note p { margin: 0; color: var(--muted); font-size: 0.95rem; }
@media (min-width: 760px) {
  .checks-grid { grid-template-columns: 1fr 1fr; column-gap: 3rem; }
  .checks-grid li:nth-last-child(2) { border-bottom: 1px solid var(--line-soft); }
}
.duo { display: grid; gap: 2rem; align-items: start; }
.duo .buddy-figure { max-width: 36rem; }
.duo-report { padding: 0; }
.duo-report h3 { margin: 0 0 0.4rem; font-size: 1.25rem; }
.duo-report > p { color: var(--muted); margin: 0 0 0.9rem; max-width: 36rem; }
.duo-report .report-label { font-family: var(--mono); font-size: 0.74rem; color: var(--warn); margin: 0 0 0.5rem; }
.duo-report .report-frame { max-width: 32.5rem; }
@media (min-width: 900px) { .duo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; } }
.final-cta { padding: 1.5rem 0 3.4rem; }
.final-box { text-align: center; max-width: 44rem; margin-inline: auto; padding: 2.4rem 1.2rem 2.2rem; border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
  background: radial-gradient(70% 90% at 50% 0%, rgba(61, 222, 200, 0.13), transparent 70%), var(--bg-card); }
.cta-display { margin: 0 0 0.5rem; font-size: clamp(2.2rem, 7vw, 3.6rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; color: var(--text); }
.final-box h2 { margin: 0 0 0.5rem; font-size: clamp(1.1rem, 2.4vw, 1.4rem); color: var(--ok); }
.final-intro { margin: 0 auto 1.3rem; color: var(--muted); max-width: 32rem; }
.final-form { max-width: 32rem; margin-inline: auto; text-align: left; }
.final-form .waitlist-compact .waitlist-row { max-width: none; }
.final-form .hero-note { text-align: center; }
#waitlist-links { text-align: center; }
#waitlist-links .btn + .btn { margin-inline-start: 0.5rem; }
.final-form:target { outline: 2px solid var(--accent); outline-offset: 10px; border-radius: 8px; }
#updates { padding-top: 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  .msg.typing i, .story-anim [data-at].is-in { animation: none; }
  .chapter, .story-intro-inner, .verdict { transition: none !important; }
}

/* static fallback: no scroll hint, no top fade, no glow rectangle */
html:not(.story-anim) .story-hint, html:not(.story-anim) .story-bg { display: none; }
html:not(.story-anim) .tg-chat { -webkit-mask-image: none; mask-image: none; }
