/* ════════════════════════════════════════════════════════════════
   Research Base — base.css
   Design tokens, reset, typography, buttons, shared primitives.
   Palette: "alpine dawn" — deep slate sky, cool fog, warm facility light.
   ════════════════════════════════════════════════════════════════ */

:root {
    /* surfaces */
    --rb-bg:        #0b1420;
    --rb-bg-1:      #0e1a28;
    --rb-bg-2:      #122336;
    --rb-panel:     rgba(18, 33, 52, 0.66);
    --rb-panel-2:   rgba(23, 41, 63, 0.78);
    --rb-line:      rgba(150, 185, 215, 0.14);
    --rb-line-2:    rgba(150, 185, 215, 0.28);

    /* ink */
    --rb-ink:       #eaf2f9;
    --rb-ink-dim:   #b3c4d4;
    --rb-muted:     #7c8fa2;

    /* instrument accents (muted, not neon) */
    --rb-teal:      #58d2c1;
    --rb-amber:     #f2b266;
    --rb-violet:    #9c8cf2;

    /* active accent — overridden per .rb-tone--* */
    --rb-accent:        var(--rb-teal);
    --rb-accent-soft:   rgba(88, 210, 193, 0.14);
    --rb-accent-line:   rgba(88, 210, 193, 0.42);

    /* type */
    --rb-display: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --rb-body:    'Inter', 'Segoe UI', system-ui, -apple-system, 'Noto Sans', sans-serif;

    /* geometry */
    --rb-radius:    16px;
    --rb-radius-sm: 11px;
    --rb-shell:     1200px;
    --rb-gap:       clamp(1rem, 2.4vw, 1.6rem);

    --rb-shadow:    0 24px 60px -28px rgba(0, 0, 0, 0.7);
    --rb-ring:      0 0 0 1px var(--rb-line);
}

/* tone modifiers — set the active accent for a subtree */
.rb-tone--teal   { --rb-accent: var(--rb-teal);   --rb-accent-soft: rgba(88,210,193,0.14); --rb-accent-line: rgba(88,210,193,0.45); }
.rb-tone--amber  { --rb-accent: var(--rb-amber);  --rb-accent-soft: rgba(242,178,102,0.14); --rb-accent-line: rgba(242,178,102,0.45); }
.rb-tone--violet { --rb-accent: var(--rb-violet); --rb-accent-soft: rgba(156,140,242,0.16); --rb-accent-line: rgba(156,140,242,0.48); }

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.rb {
    margin: 0;
    background: var(--rb-bg);
    color: var(--rb-ink);
    font-family: var(--rb-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* deep ambient backdrop behind everything below the hero */
body.rb::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(1200px 700px at 80% -10%, rgba(156,140,242,0.10), transparent 60%),
        radial-gradient(1100px 800px at 10% 0%, rgba(88,210,193,0.08), transparent 55%),
        linear-gradient(180deg, var(--rb-bg-1), var(--rb-bg));
}

h1, h2, h3 { font-family: var(--rb-display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }

:focus-visible {
    outline: 2px solid var(--rb-accent);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ── shared primitives ─────────────────────────────────────────── */
.rb-shell {
    width: min(100% - 2.5rem, var(--rb-shell));
    margin-inline: auto;
}

.rb-section {
    position: relative;
    padding-block: clamp(3.5rem, 7vw, 6rem);
}

.rb-muted { color: var(--rb-muted); }

/* glyphs */
.rb-glyph        { width: 22px; height: 22px; display: inline-block; vertical-align: middle; flex: none; }
.rb-glyph--sm    { width: 16px; height: 16px; }
.rb-glyph--lg    { width: 30px; height: 30px; }

/* section heads */
.rb-sectionhead { max-width: 60ch; margin-bottom: clamp(1.8rem, 4vw, 2.8rem); }
.rb-sectionhead--center { margin-inline: auto; text-align: center; }
.rb-sectionhead__kicker {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-family: var(--rb-display); font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.22em; color: var(--rb-accent);
    margin-bottom: 0.9rem;
}
.rb-sectionhead__kicker .rb-glyph { color: var(--rb-accent); }
.rb-sectionhead__title { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
.rb-sectionhead__lede { margin-top: 0.85rem; color: var(--rb-ink-dim); font-size: 1.02rem; }

/* ── buttons ───────────────────────────────────────────────────── */
.rb-btn {
    --_pad: 0.62rem 1.1rem;
    display: inline-flex; align-items: center; gap: 0.55rem;
    padding: var(--_pad);
    border-radius: 999px;
    font-family: var(--rb-display); font-weight: 600; font-size: 0.92rem;
    border: 1px solid transparent;
    transition: transform .18s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
    white-space: nowrap;
}
.rb-btn--lg { --_pad: 0.85rem 1.5rem; font-size: 1rem; }

.rb-btn--solid {
    background: var(--rb-accent); /* fallback for browsers without color-mix() */
    background: linear-gradient(180deg, var(--rb-accent), color-mix(in srgb, var(--rb-accent) 78%, #000));
    color: #08131d;
    box-shadow: 0 12px 30px -14px var(--rb-accent-line);
}
.rb-btn--solid:hover { transform: translateY(-2px); box-shadow: 0 18px 38px -14px var(--rb-accent-line); }

.rb-btn--ghost {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--rb-line-2);
    color: var(--rb-ink);
}
.rb-btn--ghost:hover { border-color: var(--rb-accent-line); background: var(--rb-accent-soft); transform: translateY(-2px); }

.rb-btn:disabled, .rb-btn[aria-disabled="true"] {
    opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none;
    background: rgba(255,255,255,0.04); color: var(--rb-ink-dim); border-color: var(--rb-line);
}

/* ── chips / tags / pills ──────────────────────────────────────── */
.rb-chip {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-family: var(--rb-display); font-size: 0.62rem; font-weight: 600;
    letter-spacing: 0.14em; padding: 0.28rem 0.6rem; border-radius: 999px;
    border: 1px solid var(--rb-line-2); color: var(--rb-ink-dim);
}
.rb-chip__pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rb-chip--incoming { color: var(--rb-teal);   border-color: rgba(88,210,193,0.4); }
.rb-chip--active   { color: var(--rb-amber);   border-color: rgba(242,178,102,0.4); }
.rb-chip--closing  { color: #f08a8a;           border-color: rgba(240,138,138,0.45); }
.rb-chip--closing .rb-chip__pulse,
.rb-chip--incoming .rb-chip__pulse { animation: rb-blink 1.8s ease-in-out infinite; }

.rb-tag {
    font-family: var(--rb-display); font-size: 0.6rem; font-weight: 600;
    letter-spacing: 0.14em; padding: 0.22rem 0.5rem; border-radius: 6px;
    border: 1px solid var(--rb-line-2); color: var(--rb-muted);
}
.rb-tag--updated { color: var(--rb-teal);   border-color: rgba(88,210,193,0.4); }
.rb-tag--new     { color: var(--rb-amber);   border-color: rgba(242,178,102,0.4); }

.rb-pill {
    font-family: var(--rb-display); font-size: 0.68rem; font-weight: 600;
    letter-spacing: 0.08em; color: var(--rb-muted);
    border: 1px solid var(--rb-line); border-radius: 999px; padding: 0.24rem 0.7rem;
    display: inline-flex; align-items: center; gap: 0.45rem;
}
.rb-pill--live { color: var(--rb-teal); border-color: rgba(88,210,193,0.4); }
.rb-pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rb-teal); animation: rb-blink 1.6s ease-in-out infinite; }

@keyframes rb-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ── scroll reveal (JS adds .is-in) ────────────────────────────── */
.rb-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.rb-reveal.is-in { opacity: 1; transform: none; }
/* stagger cards inside a grid a touch */
.rb-action.rb-reveal { transition-delay: .04s; }
.rb-action.rb-reveal:nth-child(2) { transition-delay: .12s; }
.rb-action.rb-reveal:nth-child(3) { transition-delay: .2s; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
