/**
 * Raddoppio — HUD layer ("Jarvis-like") on top of landing-theme.css + landing-fx.css.
 * Mobile-first: base rules target small screens, @media (min-width) adds desktop.
 * Every animation is disabled under prefers-reduced-motion.
 */
:root {
  --rd-red: #d4183d;
  --rd-cyan: var(--primary, #7de0e6);
  --rd-hud-line: rgba(125, 224, 230, 0.35);
  --rd-hud-dim: rgba(125, 224, 230, 0.12);
}

/* ── Header ─────────────────────────────────────────── */
.rd-nav { display: flex; gap: 1rem; align-items: center; }
.rd-nav a { color: var(--text-on-dark-muted); text-decoration: none; font-size: .9rem; }
.rd-nav a:hover { color: var(--link-on-dark-hover); }
.rd-nav .rd-nav-link { display: none; }
.rd-nav .btn-cta { color: var(--text-on-accent); padding: .55rem .95rem; font-size: .85rem; }
@media (min-width: 900px) { .rd-nav .rd-nav-link { display: inline; } .rd-nav { gap: 1.4rem; } }

/* ── Boot overlay ───────────────────────────────────── */
.rd-boot {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 45%, #0f1426 0%, #05050c 70%);
  font-family: var(--font-mono); color: var(--rd-cyan);
  transition: clip-path .7s var(--fx-ease-out), opacity .5s ease;
  clip-path: circle(150% at 50% 50%);
}
.rd-boot.is-done { clip-path: circle(0% at 50% 50%); opacity: 0; pointer-events: none; }
.rd-boot-inner { width: min(88vw, 420px); }
.rd-boot-ring { width: 84px; height: 84px; margin: 0 auto 1.4rem; display: block; animation: rd-spin 1.6s linear infinite; }
.rd-boot-lines { font-size: .78rem; line-height: 1.9; min-height: 7.6em; }
.rd-boot-lines div { opacity: 0; transform: translateX(-6px); animation: rd-line-in .25s forwards; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-boot-lines .ok { color: #a8f5b5; }
.rd-boot-skip { margin-top: 1rem; font-size: .7rem; color: var(--text-on-dark-subtle); letter-spacing: .12em; text-transform: uppercase; }
@keyframes rd-line-in { to { opacity: 1; transform: none; } }
@keyframes rd-spin { to { transform: rotate(360deg); } }

/* ── Hero ───────────────────────────────────────────── */
.rd-hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 6.5rem 0 7.5rem;
  background:
    radial-gradient(ellipse at 18% 62%, rgba(122, 90, 168, .23), transparent 52%),
    radial-gradient(ellipse at 76% 30%, rgba(125, 224, 230, .12), transparent 48%),
    var(--background);
}
.rd-hero::before { /* HUD grid */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--fx-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--fx-grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%);
}
.rd-hero::after { /* scanline sweep */
  content: ""; position: absolute; left: 0; right: 0; top: -20%; height: 18%; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(125, 224, 230, .07), transparent);
  animation: rd-sweep 7s linear infinite;
}
@keyframes rd-sweep { to { transform: translateY(700%); } }
.rd-hero .signal-wave { position: absolute; width: 140%; left: -20%; bottom: 20px; height: 220px; object-fit: fill; pointer-events: none; opacity: .75; z-index: -1; }
.rd-hero .signal-field { position: absolute; bottom: 10px; left: 0; width: 100%; height: 260px; pointer-events: none; opacity: 0; z-index: -1; }
.rd-hero.signal-live .signal-field { opacity: 1; }
.rd-hero.signal-live .signal-wave { opacity: 0; }
.rd-hero .signal-signature { position: absolute; bottom: 14px; width: 100%; text-align: center; font-family: var(--font-mono); font-size: .58rem; letter-spacing: .3em; color: var(--muted-foreground); }
.rd-hero .signal-signature span { color: var(--highlight-soft); padding: 0 12px; }

.rd-hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.rd-hero-copy { position: relative; z-index: 2; }
.rd-hero .eyebrow { margin-bottom: 1rem; }
.rd-hero h1 { font-size: clamp(2rem, 8.4vw, 3.6rem); line-height: 1.06; letter-spacing: -.03em; font-weight: 750; margin: .6rem 0 1rem; }
.rd-hero h1 .rd-accent {
  background: linear-gradient(92deg, var(--rd-cyan), #a8f5b5 45%, #b89cf0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rd-hero .sub { color: var(--text-on-dark-muted); font-size: 1.02rem; max-width: 38rem; }
.rd-hero .hero-terminal { margin: 0 0 .4rem; font-size: .78rem; }
.rd-actions { display: flex; flex-direction: column; gap: .7rem; margin-top: 1.6rem; }
.rd-actions .btn { justify-content: center; text-align: center; }
@media (min-width: 560px) { .rd-actions { flex-direction: row; flex-wrap: wrap; } }

/* HUD reactor */
.rd-hud { position: relative; width: min(78vw, 300px); aspect-ratio: 1; margin: 0 auto; }
.rd-hud svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rd-hud .r1 { animation: rd-spin 26s linear infinite; transform-origin: 50% 50%; }
.rd-hud .r2 { animation: rd-spin 14s linear infinite reverse; transform-origin: 50% 50%; }
.rd-hud .r3 { animation: rd-spin 40s linear infinite; transform-origin: 50% 50%; }
.rd-hud .pulse { animation: rd-pulse 2.6s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes rd-pulse { 50% { opacity: .35; transform: scale(.94); } }
.rd-hud-core { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.rd-hud-core b { display: block; font-size: clamp(2.6rem, 13vw, 3.8rem); font-weight: 800; letter-spacing: -.04em; color: #fff; text-shadow: 0 0 28px rgba(125, 224, 230, .55); line-height: 1; }
.rd-hud-core small { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .22em; color: var(--rd-cyan); text-transform: uppercase; }
.rd-hud-tag { position: absolute; font-family: var(--font-mono); font-size: .6rem; letter-spacing: .14em; color: var(--text-on-dark-muted); background: rgba(10, 10, 20, .72); border: 1px solid var(--rd-hud-line); border-radius: 999px; padding: .2rem .5rem; white-space: nowrap; }
.rd-hud-tag::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--rd-cyan); margin-right: .4rem; vertical-align: middle; box-shadow: 0 0 8px var(--rd-cyan); }
.rd-hud-tag.t1 { top: 2%; left: 50%; transform: translateX(-50%); }
.rd-hud-tag.t2 { top: 34%; right: -6%; }
.rd-hud-tag.t3 { bottom: 10%; right: 2%; }
.rd-hud-tag.t4 { bottom: 10%; left: 2%; }
.rd-hud-tag.t5 { top: 34%; left: -6%; }
.rd-hud-tag.t1::before { background: var(--rd-red); box-shadow: 0 0 8px var(--rd-red); }

@media (min-width: 960px) {
  .rd-hero { padding: 8.5rem 0 9rem; }
  .rd-hero-grid { grid-template-columns: 1.25fr .9fr; gap: 3rem; }
  .rd-hud { width: 360px; }
  .rd-hero .signal-wave { width: 112%; left: -6%; height: 300px; }
}

/* ── Telemetry ticker ───────────────────────────────── */
.rd-ticker { border-block: 1px solid var(--border); background: rgba(19, 19, 35, .6); overflow: hidden; }
.rd-ticker-track { display: flex; gap: 2.5rem; width: max-content; padding: .7rem 0; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; color: var(--text-on-dark-subtle); text-transform: uppercase; animation: rd-marquee 38s linear infinite; }
.rd-ticker-track span b { color: var(--rd-cyan); font-weight: 500; margin-right: .5rem; }
@keyframes rd-marquee { to { transform: translateX(-50%); } }

/* ── Section titles: HUD scan-in ────────────────────── */
.rd-scan-pending { opacity: 0; } /* not clip-path: a fully clipped target never intersects */
.rd-scan-in { animation: rd-wipe .9s var(--fx-ease-out) both, rd-flash 1.2s ease-out both; }
@keyframes rd-wipe { from { clip-path: inset(0 100% 0 0); opacity: 1; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes rd-flash { 0%, 40% { text-shadow: 0 0 18px rgba(125, 224, 230, .9); color: #dffcff; } 100% { text-shadow: none; } }

/* ── HUD frames on cards ────────────────────────────── */
.rd-hudframe { position: relative; }
.rd-hudframe::before, .rd-hudframe::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--rd-cyan); border-style: solid; opacity: 0; transition: opacity .5s ease .25s, transform .5s var(--fx-ease-out) .25s;
}
.rd-hudframe::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; border-top-left-radius: 10px; transform: translate(6px, 6px); }
.rd-hudframe::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; border-bottom-right-radius: 10px; transform: translate(-6px, -6px); }
.rd-hudframe.fx-visible::before, .rd-hudframe.fx-visible::after { opacity: .9; transform: none; }
.rd-hudframe .rd-scan { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.rd-hudframe .rd-scan::after { content: ""; position: absolute; left: 0; right: 0; height: 40%; top: -40%; background: linear-gradient(180deg, transparent, rgba(125, 224, 230, .10), transparent); }
.rd-hudframe.fx-visible .rd-scan::after { animation: rd-scan 1.1s var(--fx-ease-out) .15s 1 forwards; }
@keyframes rd-scan { to { top: 110%; } }

/* ── Levers ─────────────────────────────────────────── */
.rd-levers { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 640px) { .rd-levers { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .rd-levers { grid-template-columns: repeat(6, 1fr); } .rd-levers > :nth-child(-n+3) { grid-column: span 2; } .rd-levers > :nth-child(n+4) { grid-column: span 3; } }
.rd-levers .cluster-card ul { margin: .6rem 0 0 1.1rem; color: var(--text-on-dark-muted); font-size: .93rem; }
.rd-levers .cluster-card li { margin-bottom: .3rem; }
.rd-kpi { font-family: var(--font-mono); font-size: .72rem; color: var(--rd-cyan); margin-top: .9rem; display: flex; align-items: center; gap: .45rem; }
.rd-kpi::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #a8f5b5; box-shadow: 0 0 10px #a8f5b5; animation: rd-pulse 2s ease-in-out infinite; flex: none; }
.rd-ico { width: 34px; height: 34px; color: var(--rd-cyan); margin-bottom: .6rem; }

/* ── Thread timeline (draws on scroll) ──────────────── */
.rd-thread { position: relative; padding-left: 1.9rem; margin-top: 2rem; --rd-progress: 0; }
.rd-thread::before { content: ""; position: absolute; left: .5rem; top: .4rem; bottom: .4rem; width: 2px; background: var(--rd-hud-dim); border-radius: 2px; }
.rd-thread::after { content: ""; position: absolute; left: .5rem; top: .4rem; width: 2px; height: calc((100% - .8rem) * var(--rd-progress)); background: linear-gradient(180deg, var(--rd-red), var(--rd-cyan)); border-radius: 2px; box-shadow: 0 0 12px rgba(125, 224, 230, .5); }
.rd-thread-item { position: relative; margin-bottom: 1.8rem; opacity: .45; transition: opacity .5s ease; }
.rd-thread-item.is-lit { opacity: 1; }
.rd-thread-item::before { content: ""; position: absolute; left: -1.75rem; top: .4rem; width: .8rem; height: .8rem; border-radius: 50%; background: var(--background); border: 2px solid var(--rd-hud-line); transition: border-color .4s, box-shadow .4s; }
.rd-thread-item.is-lit::before { border-color: var(--rd-red); box-shadow: 0 0 0 4px rgba(212, 24, 61, .15), 0 0 14px rgba(212, 24, 61, .6); }
.rd-thread-item h3 { font-size: 1.05rem; margin: .15rem 0 .3rem; }
.rd-thread-item .when { font-family: var(--font-mono); font-size: .72rem; color: var(--rd-cyan); letter-spacing: .06em; text-transform: uppercase; }
.rd-thread-item p { color: var(--text-on-dark-muted); }

/* ── Comparison (mobile = stacked cards, desktop = table) ── */
.rd-compare { margin-top: 1.5rem; display: grid; gap: .8rem; }
.rd-compare-row { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 1rem; }
.rd-compare-row h3 { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--rd-cyan); margin-bottom: .5rem; }
.rd-compare-row .old { color: var(--text-on-dark-subtle); text-decoration: line-through; text-decoration-color: rgba(212, 24, 61, .6); font-size: .9rem; }
.rd-compare-row .new { color: #fff; margin-top: .25rem; }
@media (min-width: 760px) {
  .rd-compare-row { display: grid; grid-template-columns: 9rem 1fr 1fr; gap: 1rem; align-items: center; }
  .rd-compare-row h3 { margin: 0; }
  .rd-compare-row .new { margin: 0; }
}

/* ── Terminal (line-by-line) ────────────────────────── */
.rd-term-lines .agent-line { opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s; }
.rd-term-lines .agent-line.on { opacity: 1; transform: none; }

/* ── Misc ───────────────────────────────────────────── */
.rd-note { font-size: .8rem; color: var(--text-on-dark-subtle); margin-top: 1rem; }
.rd-two { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 760px) { .rd-two { grid-template-columns: 1fr 1fr; } }
.rd-fit li { margin: 0 0 .45rem 1.1rem; color: var(--text-on-dark-muted); }
.rd-disclaimer { font-size: .78rem; color: var(--text-on-dark-subtle); border-left: 2px solid var(--border-strong); padding-left: .9rem; margin-top: 1.5rem; }
.cluster-cards { grid-template-columns: 1fr; }
@media (min-width: 760px) { .cluster-cards { grid-template-columns: repeat(3, 1fr); } }
.rd-sticky-cta { position: fixed; left: 1rem; right: 1rem; bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 60; display: flex; justify-content: center; transform: translateY(160%); transition: transform .45s var(--fx-ease-out); }
.rd-sticky-cta.is-on { transform: none; }
.rd-sticky-cta .btn { width: 100%; max-width: 420px; justify-content: center; box-shadow: 0 10px 40px rgba(0, 0, 0, .55), var(--glow-accent-soft); }
@media (min-width: 900px) { .rd-sticky-cta { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .rd-boot { display: none; }
  .rd-hero::after, .rd-hud .r1, .rd-hud .r2, .rd-hud .r3, .rd-hud .pulse, .rd-ticker-track, .rd-kpi::before, .rd-boot-ring { animation: none !important; }
  .rd-thread-item { opacity: 1; }
  .rd-thread::after { height: calc(100% - .8rem); }
  .rd-term-lines .agent-line { opacity: 1; transform: none; }
  .rd-hudframe::before, .rd-hudframe::after { opacity: .9; transform: none; transition: none; }
}

/* ── Reveal (shared with landing-effects.js, which only toggles classes) ── */
.fx-reveal-when-visible { opacity: 0; transform: translateY(18px); filter: blur(4px); transition: opacity .7s var(--fx-ease-out), transform .7s var(--fx-ease-out), filter .7s var(--fx-ease-out); transition-delay: var(--rd-delay, 0s); }
.fx-reveal-when-visible.fx-visible { opacity: 1; transform: none; filter: none; }
@media (prefers-reduced-motion: reduce) { .fx-reveal-when-visible { opacity: 1; transform: none; filter: none; transition: none; } }
.rd-hero .eyebrow { display: inline-block; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--rd-cyan); border: 1px solid var(--rd-hud-line); background: rgba(125, 224, 230, .06); border-radius: 999px; padding: .3rem .75rem; }
.rd-hero .hero-terminal { display: flex; margin-top: .9rem; }

/* ── Language switcher (always visible, also on mobile) ── */
.rd-lang { display: inline-flex; gap: .35rem; align-items: center; font-family: var(--font-mono); font-size: .75rem; color: var(--text-on-dark-subtle); }
.rd-lang a { color: var(--text-on-dark-subtle); text-decoration: none; padding: .2rem .15rem; }
.rd-lang a[aria-current="page"] { color: var(--rd-cyan); }
