/* ============================================================================
   LoreWeaver — Mobile-first Redesign
   "Illuminated Manuscript meets Runtime"
   ----------------------------------------------------------------------------
   - Built phone-up: base styles target small screens; min-width queries enhance.
   - Scoped under `body.rd` so it coexists with the legacy stylesheet during the
     page-by-page migration. Remove the scoping (and legacy styles.css) once every
     page carries bodyClass: "rd".
   - Colour palette is unchanged from the legacy brand tokens (see :root in
     styles.css). This file only adds a mono accent face + motion/spacing tokens.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inria+Serif:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&family=Open+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    /* Brand tokens (ported from the retired legacy styles.css) */
    --primary-bg: #0d0d0c;
    --secondary-bg: #070706;
    --surface: #161614;
    --surface-alt: #1f201e;
    --text-primary: #eae6d5;
    --text-secondary: rgba(234, 230, 213, 0.85);
    --text-tertiary: rgba(234, 230, 213, 0.7);
    --text-muted: rgba(234, 230, 213, 0.55);
    --border-color: rgba(234, 230, 213, 0.1);
    --border-accent: rgba(234, 230, 213, 0.2);
    --navbar-bg: rgba(8, 8, 7, 0.97);
    --accent-gold: #ecc457;
    --accent-gold-dark: #c9a03a;
    --accent-blue: #3316e6;
    --accent-blue-dark: #2610b8;
    --accent-orange: #ecc457;
    --accent-orange-dark: #c9a03a;
    --font-primary: 'Open Sans', sans-serif;
    --font-heading: 'Inria Serif', Georgia, serif;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;

    /* New accent face — technical "runtime" voice for kickers, labels, tags */
    --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

    /* Fluid type scale (mobile-first; grows with viewport) */
    --step--1: clamp(0.83rem, 0.79rem + 0.18vw, 0.94rem);
    --step-0:  clamp(1rem, 0.95rem + 0.24vw, 1.13rem);
    --step-1:  clamp(1.2rem, 1.11rem + 0.45vw, 1.5rem);
    --step-2:  clamp(1.44rem, 1.28rem + 0.8vw, 2rem);
    --step-3:  clamp(1.73rem, 1.46rem + 1.36vw, 2.66rem);
    --step-4:  clamp(2.07rem, 1.62rem + 2.27vw, 3.55rem);
    --step-5:  clamp(2.49rem, 1.74rem + 3.74vw, 4.74rem);

    /* Layout */
    --rd-gutter: clamp(1.25rem, 0.9rem + 1.8vw, 2.5rem);
    --rd-max: 1240px;
    --rd-max-prose: 64ch;
    --rd-nav-h: 66px;
    --rd-banner-h: 36px;

    /* Motion */
    --rd-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --rd-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --rd-dur: 0.6s;

    /* Effects */
    --rd-glow-blue: rgba(51, 22, 230, 0.35);
    --rd-glow-gold: rgba(236, 196, 87, 0.16);
}

/* ----------------------------------------------------------------------------
   Global foundation (ported from the retired legacy styles.css)
   -------------------------------------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { background: var(--accent-gold); color: var(--primary-bg); }
::-moz-selection { background: var(--accent-gold); color: var(--primary-bg); }
:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }

/* Skip-to-content link (base.njk) */
.skip-link {
    position: absolute;
    top: -48px;
    left: 0;
    background: var(--accent-gold);
    color: var(--primary-bg);
    padding: 0.75rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 6px 0;
    transition: top 0.15s ease;
}
.skip-link:focus { top: 0; outline: 3px solid var(--accent-gold); outline-offset: 2px; }

/* Disambiguation banner */
#disambig-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
    background: var(--accent-gold);
    color: #0d0d0c;
    text-align: center;
    padding: 7px 18px;
    font-family: var(--font-mono);
    font-size: var(--step--1);
    font-weight: 500;
    line-height: 1.35;
}
#disambig-banner a { color: inherit; text-decoration: none; display: block; }
#disambig-banner a:hover { text-decoration: underline; }
.disambig-url { background: rgba(0, 0, 0, 0.15); padding: 1px 6px 1px 2px; border-radius: 3px; text-decoration: underline; }

/* Cookie consent banner (consent-banner.njk) */
.consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(13, 13, 12, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--border-accent);
    padding: 1rem 1.25rem;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}
.consent-banner[hidden] { display: none; }
.consent-banner-inner { max-width: var(--rd-max); margin: 0 auto; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.consent-banner-text { flex: 1 1 320px; margin: 0; color: var(--text-primary); font-size: 0.9rem; line-height: 1.5; }
.consent-banner-text a { color: var(--accent-gold); text-decoration: underline; }
.consent-banner-actions { display: flex; gap: 0.75rem; flex-shrink: 0; }
.consent-btn {
    padding: 0.625rem 1.5rem;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.consent-btn-reject { background: transparent; color: var(--text-primary); border-color: var(--border-accent); }
.consent-btn-reject:hover, .consent-btn-reject:focus-visible { border-color: var(--text-primary); outline: none; }
.consent-btn-accept { background: var(--accent-gold); color: var(--primary-bg); }
.consent-btn-accept:hover, .consent-btn-accept:focus-visible { background: #f5d557; outline: none; }
.consent-btn:focus-visible { box-shadow: 0 0 0 3px rgba(236, 196, 87, 0.5); }
@media (max-width: 600px) {
    .consent-banner-inner { flex-direction: column; align-items: stretch; }
    .consent-banner-actions { justify-content: flex-end; }
}

/* ----------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body.rd {
    font-family: var(--font-primary);
    font-size: var(--step-0);
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.65;
    padding-top: var(--rd-nav-h);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    position: relative;
}

/* Atmospheric backdrop: faint blue runtime glow + manuscript grain */
body.rd::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(70% 50% at 78% -5%, var(--rd-glow-blue) 0%, transparent 60%),
        radial-gradient(60% 40% at 5% 8%, var(--rd-glow-gold) 0%, transparent 55%);
    pointer-events: none;
}
body.rd::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.035;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body.rd.has-disambig-banner { padding-top: calc(var(--rd-nav-h) + var(--rd-banner-h)); }

.rd img { max-width: 100%; height: auto; display: block; }

/* ----------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */
.rd .wrap {
    width: 100%;
    max-width: var(--rd-max);
    margin-inline: auto;
    padding-inline: var(--rd-gutter);
}

.rd section { position: relative; }

.rd .section-pad { padding-block: clamp(3.5rem, 2.5rem + 5vw, 7rem); }

.rd .rule {
    height: 1px;
    border: 0;
    background: linear-gradient(90deg, transparent, var(--border-accent) 18%, var(--border-accent) 82%, transparent);
    margin: 0;
}

/* Editorial section header with folio number + mono kicker */
.rd .folio {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: var(--step--1);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin-bottom: 1.25rem;
}
.rd .folio::before {
    content: attr(data-folio);
    color: var(--text-muted);
}
.rd .folio .folio-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
    transform: translateY(-0.25em);
}

/* ----------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
.rd h1, .rd h2, .rd h3, .rd h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.015em;
    color: var(--text-primary);
}
.rd h1 { font-size: var(--step-5); }
.rd h2 { font-size: var(--step-4); }
.rd h3 { font-size: var(--step-2); }
.rd .display { font-size: var(--step-5); line-height: 1; }
.rd .lede {
    font-size: var(--step-1);
    color: var(--text-secondary);
    max-width: var(--rd-max-prose);
    font-weight: 300;
}
.rd .gold { color: var(--accent-gold); }
.rd em.gold, .rd .ink { font-style: italic; color: var(--accent-gold); }
.rd .kicker {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-gold);
}

/* ----------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.rd .btn {
    --bg: var(--accent-gold);
    --fg: var(--primary-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 48px;
    padding: 0.85rem 1.6rem;
    font-family: var(--font-mono);
    font-size: var(--step--1);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--bg);
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.25s var(--rd-ease), background 0.25s var(--rd-ease), color 0.25s var(--rd-ease), box-shadow 0.25s var(--rd-ease);
}
.rd .btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgba(236, 196, 87, 0.6); }
.rd .btn:active { transform: translateY(0); }
.rd .btn--ghost {
    --bg: transparent;
    --fg: var(--text-primary);
    border-color: var(--border-accent);
}
.rd .btn--ghost:hover { --fg: var(--accent-gold); border-color: var(--accent-gold); box-shadow: none; }
.rd .btn-row { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* Inline "learn more" link with animated arrow */
.rd .link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: var(--step--1);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-gold);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s var(--rd-ease);
}
.rd .link-arrow span { transition: transform 0.25s var(--rd-ease); }
.rd .link-arrow:hover { border-color: var(--accent-gold); }
.rd .link-arrow:hover span { transform: translateX(4px); }

/* ----------------------------------------------------------------------------
   Navigation (restyled; markup/classes unchanged so script.js still works)
   -------------------------------------------------------------------------- */
body.rd .navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--rd-nav-h);
    padding-inline: var(--rd-gutter);
    background: color-mix(in srgb, var(--primary-bg) 82%, transparent);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid var(--border-color);
}
body.rd.has-disambig-banner .navbar { top: var(--rd-banner-h); }
body.rd .navbar .logo { display: inline-flex; align-items: center; }
body.rd .navbar .logo-img { height: 30px; width: auto; }

body.rd .mobile-menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
}
body.rd .mobile-menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-primary);
    transition: transform 0.3s var(--rd-ease), opacity 0.2s;
}
body.rd .mobile-menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.rd .mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
body.rd .mobile-menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile: slide-down drawer */
body.rd .nav-links {
    position: fixed;
    top: var(--rd-nav-h);
    left: 0;
    width: 100%;
    max-height: calc(100dvh - var(--rd-nav-h));
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
    padding: 1rem var(--rd-gutter) 2rem;
    list-style: none;
    background: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s var(--rd-ease), opacity 0.3s var(--rd-ease), visibility 0.3s;
}
body.rd.has-disambig-banner .nav-links { top: calc(var(--rd-nav-h) + var(--rd-banner-h)); }
body.rd .nav-links.active { transform: translateY(0); opacity: 1; visibility: visible; }
body.rd .nav-links a {
    display: block;
    padding: 0.85rem 0.25rem;
    font-family: var(--font-mono);
    font-size: var(--step--1);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.2s var(--rd-ease);
}
body.rd .nav-links a:hover,
body.rd .nav-links a.active { color: var(--accent-gold); }
body.rd .nav-dropdown > a[aria-haspopup] { color: var(--text-muted); }
body.rd .dropdown-menu { display: flex; flex-direction: column; padding-left: 1rem; }
body.rd .nav-cta-item { margin-top: 1rem; border: 0; }
body.rd .nav-cta-item a { border: 0; }
body.rd .nav-cta-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    color: var(--primary-bg) !important;
    background: var(--accent-gold);
    border-radius: 2px;
    text-align: center;
}
body.rd .nav-cta-btn:hover { background: var(--accent-gold-dark); }

/* ----------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.rd .hero-section { padding-block: clamp(2.5rem, 1.5rem + 6vw, 5.5rem) clamp(2.5rem, 2rem + 4vw, 5rem); overflow: hidden; }
/* Neutralize legacy hero rules leaking from styles.css (absolute media, full-height, decorative ::before) */
.rd .hero-section { position: relative; min-height: 0; display: block; }
.rd .hero-section::before { content: none; }
.rd .hero-media { position: static; top: auto; left: auto; width: auto; height: auto; z-index: auto; }
.rd .hero-grid { display: grid; gap: clamp(2rem, 1rem + 6vw, 3.5rem); }
/* Hero spans a slightly wider container than the rest of the site so the
   product image reads larger. */
.rd .hero-section .wrap { max-width: 1360px; }
.rd .hero-eyebrow { margin-bottom: 1.5rem; }
.rd .hero-title { margin-bottom: 1.5rem; }
.rd .hero-title .line { display: block; }
.rd .hero-subtitle { margin-bottom: 2rem; }
.rd .hero-cta { margin-bottom: 1.5rem; }
.rd .hero-trust {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

/* Text-only hero (product pages: no media column) */
.rd .hero--text .hero-copy { max-width: 56rem; }

/* Framed "plate" for the product carousel */
.rd .plate {
    position: relative;
    border: 1px solid var(--border-accent);
    border-radius: 4px;
    background: var(--surface);
    padding: 0.5rem;
    box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
}
.rd .plate::before,
.rd .plate::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1px solid var(--accent-gold);
}
.rd .plate::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.rd .plate::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
/* Hero image sits against empty space (no text beside it once scrolled),
   so it carries no drop shadow; the border + corner ticks define it instead. */
.rd .hero-media .plate { box-shadow: none; }
.rd .hero-carousel { position: relative; aspect-ratio: 16 / 10; border-radius: 3px; overflow: hidden; }
.rd .hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.1s var(--rd-ease);
}
.rd .hero-slide.active { opacity: 1; }

/* ----------------------------------------------------------------------------
   Products overview
   -------------------------------------------------------------------------- */
.rd .products-grid { display: grid; gap: 1.25rem; margin-top: 2rem; }
.rd .product-card {
    position: relative;
    display: block;
    padding: 1.75rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.3s var(--rd-ease), border-color 0.3s var(--rd-ease);
}
.rd .product-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: var(--accent-gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--rd-ease);
}
.rd .product-card:hover { transform: translateY(-4px); border-color: var(--border-accent); }
.rd .product-card:hover::before { transform: scaleX(1); }
.rd .product-card .card-no { font-family: var(--font-mono); font-size: var(--step--1); color: var(--accent-gold); letter-spacing: 0.1em; }
.rd .product-card h3 { margin: 0.75rem 0 0.5rem; }
.rd .product-card p { color: var(--text-secondary); margin: 0; }
.rd .product-card .link-arrow { margin-top: 1.25rem; }

/* ----------------------------------------------------------------------------
   Manifesto / storytelling band
   -------------------------------------------------------------------------- */
.rd .manifesto { background: var(--surface); border-block: 1px solid var(--border-color); }
.rd .manifesto .manifesto-text {
    font-family: var(--font-heading);
    font-size: var(--step-3);
    line-height: 1.25;
    font-weight: 300;
    max-width: 22ch;
}
.rd .manifesto .lede { margin-top: 1.5rem; }

/* ----------------------------------------------------------------------------
   Testimonials
   -------------------------------------------------------------------------- */
.rd .testimonials-grid { display: grid; gap: 1.25rem; margin-top: 2rem; }
.rd .quote-card {
    padding: 1.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: linear-gradient(180deg, var(--surface), transparent);
}
.rd .quote-card blockquote {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: var(--step-1);
    line-height: 1.4;
    margin: 0 0 1rem;
}
.rd .quote-card blockquote::before { content: "\201C"; color: var(--accent-gold); margin-right: 0.1em; }
.rd .quote-card .author {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

/* ----------------------------------------------------------------------------
   Product detail blocks (alternating)
   -------------------------------------------------------------------------- */
.rd .detail { display: grid; gap: 1.75rem; align-items: center; }
.rd .detail .detail-media { order: -1; }
.rd .detail .plate { padding: 0.4rem; }
.rd .detail h2 { margin-bottom: 1.25rem; }
.rd .detail .product-name { color: var(--accent-gold); }
.rd .feature-list { list-style: none; margin: 0 0 1.75rem; padding: 0; display: grid; gap: 0.9rem; }
.rd .feature-list li {
    position: relative;
    padding-left: 1.9rem;
    color: var(--text-secondary);
}
.rd .feature-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 0.7rem;
    height: 0.7rem;
    border: 1px solid var(--accent-gold);
    transform: rotate(45deg);
}

/* ----------------------------------------------------------------------------
   Client logos marquee
   -------------------------------------------------------------------------- */
.rd .clients { text-align: center; }
.rd .clients .kicker { display: block; margin-bottom: 2rem; }
.rd .logo-track {
    display: flex;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    width: max-content;
    animation: rd-marquee 32s linear infinite;
}
.rd .marquee-mask {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.rd .logo-item img { height: 34px; width: auto; opacity: 0.6; filter: grayscale(1); transition: opacity 0.3s, filter 0.3s; }
.rd .logo-item img:hover { opacity: 1; filter: grayscale(0); }
@keyframes rd-marquee { to { transform: translateX(-50%); } }

/* ----------------------------------------------------------------------------
   CTA
   -------------------------------------------------------------------------- */
.rd .cta { text-align: center; }
.rd .cta-card {
    position: relative;
    padding: clamp(2.5rem, 1.5rem + 5vw, 5rem) var(--rd-gutter);
    border: 1px solid var(--border-accent);
    border-radius: 6px;
    background:
        radial-gradient(80% 120% at 50% 0%, rgba(51, 22, 230, 0.18), transparent 60%),
        var(--surface);
    overflow: hidden;
}
.rd .cta h2 { margin-bottom: 1rem; }
.rd .cta p { color: var(--text-secondary); margin: 0 auto 2rem; max-width: 46ch; }
.rd .cta .underline-gold { text-decoration: underline; text-decoration-color: var(--accent-gold); text-underline-offset: 6px; text-decoration-thickness: 2px; }

/* ----------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
body.rd .footer {
    border-top: 1px solid var(--border-color);
    padding: clamp(2.5rem, 2rem + 3vw, 4rem) var(--rd-gutter) 2rem;
    background: var(--secondary-bg);
}
body.rd .footer-content {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    max-width: var(--rd-max);
    margin-inline: auto;
}
body.rd .footer .logo-img { height: 30px; width: auto; }
body.rd .footer-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin: 0;
    padding: 0;
}
body.rd .footer-links a {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s var(--rd-ease);
}
body.rd .footer-links a:hover { color: var(--accent-gold); }
body.rd .footer > p {
    max-width: var(--rd-max);
    margin: 1.75rem auto 0;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: var(--step--1);
    color: var(--text-muted);
}

/* ----------------------------------------------------------------------------
   Motion: staggered reveal on scroll/load
   -------------------------------------------------------------------------- */
/* Hidden state is gated on html.rd-anim (set by an inline script in base.njk).
   If JS never runs, the class is absent and content stays fully visible. */
html.rd-anim .rd [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--rd-ease-out), transform 0.7s var(--rd-ease-out);
    transition-delay: calc(var(--i, 0) * 90ms);
}
html.rd-anim .rd [data-reveal].is-visible { opacity: 1; transform: none; }

/* ----------------------------------------------------------------------------
   Responsive enhancements (mobile-first → up)
   -------------------------------------------------------------------------- */
@media (min-width: 40em) {
    .rd .products-grid { grid-template-columns: repeat(2, 1fr); }
    .rd .testimonials-grid { grid-template-columns: repeat(3, 1fr); }
    .rd .btn-row { gap: 1rem; }
}

@media (min-width: 64em) {
    /* Desktop nav: inline, drop the drawer */
    body.rd .mobile-menu-toggle { display: none; }
    body.rd .nav-links {
        position: static;
        flex-direction: row;
        align-items: center;
        gap: 0.35rem;
        width: auto;
        max-height: none;
        overflow: visible;
        padding: 0;
        background: none;
        border: 0;
        transform: none;
        opacity: 1;
        visibility: visible;
    }
    body.rd .nav-links > li > a { border: 0; padding: 0.5rem 0.9rem; }
    body.rd .nav-dropdown { position: relative; }
    body.rd .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 180px;
        padding: 0.5rem;
        background: var(--secondary-bg);
        border: 1px solid var(--border-color);
        border-radius: 4px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: opacity 0.2s var(--rd-ease), transform 0.2s var(--rd-ease), visibility 0.2s;
    }
    body.rd .nav-dropdown:hover .dropdown-menu,
    body.rd .nav-dropdown:focus-within .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
    body.rd .dropdown-menu a { padding: 0.6rem 0.75rem; border: 0; }
    body.rd .nav-cta-item { margin: 0 0 0 0.5rem; }
    body.rd .nav-cta-btn { min-height: 40px; padding: 0.5rem 1.1rem; }

    /* Hero becomes a two-column editorial split; media column is larger so the
       product image reads ~35-40% bigger than the copy column. */
    .rd .hero-grid { grid-template-columns: 1fr 1.6fr; align-items: center; }

    /* Product detail: alternating columns; reset media order */
    .rd .detail { grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 4vw, 4.5rem); }
    .rd .detail .detail-media { order: 0; }
    .rd .detail.mirrored .detail-media { order: 1; }

    /* Manifesto two-column */
    .rd .manifesto .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
    .rd .manifesto .manifesto-text { max-width: none; }
    .rd .manifesto .lede { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .rd *,
    .rd *::before,
    .rd *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .rd [data-reveal] { opacity: 1 !important; transform: none !important; }
    .rd .logo-track { animation: none; }
}

/* ============================================================================
   Interior / product pages (Architect, Director, Pricing, etc.)
   ========================================================================== */

/* Sticky product sub-nav */
body.rd .psub {
    position: sticky;
    top: var(--rd-nav-h);
    z-index: 900;
    background: color-mix(in srgb, var(--secondary-bg) 92%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}
body.rd.has-disambig-banner .psub { top: calc(var(--rd-nav-h) + var(--rd-banner-h)); }
.rd .psub-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    max-width: var(--rd-max);
    margin-inline: auto;
    padding: 0.7rem var(--rd-gutter);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.rd .psub-inner::-webkit-scrollbar { display: none; }
.rd .psub-label { font-family: var(--font-heading); font-size: var(--step-0); color: var(--accent-gold); white-space: nowrap; }
.rd .psub-inner a {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s var(--rd-ease);
}
.rd .psub-inner a:hover { color: var(--accent-gold); }
.rd .psub-inner .psub-cta {
    margin-left: auto;
    color: var(--primary-bg);
    background: var(--accent-gold);
    padding: 0.45rem 0.9rem;
    border-radius: 2px;
}
.rd .psub-inner .psub-cta:hover { color: var(--primary-bg); background: var(--accent-gold-dark); }

/* Product hero copy descriptions */
.rd .detail p,
.rd .hero-copy .product-sub { color: var(--text-secondary); margin-bottom: 1.5rem; }
.rd .step-label {
    display: inline-block;
    margin-bottom: 0.9rem;
    font-family: var(--font-mono);
    font-size: var(--step--1);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-gold);
}
.rd .steps { display: grid; gap: clamp(3rem, 5vw, 5.5rem); }

/* SEO definition band */
.rd .definition { text-align: center; }
.rd .definition .wrap { max-width: 840px; }
.rd .definition p { font-size: var(--step-1); color: var(--text-secondary); font-weight: 300; }

/* Stat bar */
.rd .statbar { border-block: 1px solid var(--border-color); background: var(--surface); }
.rd .statbar .wrap { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.75rem 1rem; padding-block: clamp(2rem, 1.5rem + 2vw, 3rem); }
.rd .stat { text-align: center; }
.rd .stat .num { display: block; font-family: var(--font-heading); font-size: var(--step-4); color: var(--accent-gold); line-height: 1; }
.rd .stat .lbl { display: block; margin-top: 0.5rem; font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.04em; color: var(--text-tertiary); text-transform: uppercase; }

/* Before / after compare */
.rd .compare { display: grid; gap: 1.25rem; margin-top: 2rem; }
.rd .compare-col { padding: 1.75rem; border: 1px solid var(--border-color); border-radius: 4px; background: var(--surface); }
.rd .compare-col.is-after { border-color: var(--border-accent); background: linear-gradient(180deg, rgba(236, 196, 87, 0.06), transparent); }
.rd .compare-col h3 { font-size: var(--step-1); margin-bottom: 1rem; }
.rd .compare-col.is-after h3 { color: var(--accent-gold); }
.rd .compare-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.rd .compare-col li { position: relative; padding-left: 1.7rem; color: var(--text-secondary); font-size: var(--step--1); }
.rd .compare-col li::before { content: "\2715"; position: absolute; left: 0; top: 0; color: var(--text-muted); }
.rd .compare-col.is-after li::before { content: "\2713"; color: var(--accent-gold); }

/* Feature cards (3-up) */
.rd .feature-cards { display: grid; gap: 1.25rem; margin-top: 2rem; }
.rd .feature-card { padding: 1.75rem; border: 1px solid var(--border-color); border-radius: 4px; background: var(--surface); }
.rd .feature-card .ic { width: 2.4rem; height: 2.4rem; color: var(--accent-gold); margin-bottom: 1rem; }
.rd .feature-card .ic svg { width: 100%; height: 100%; }
.rd .feature-card h3 { font-size: var(--step-1); margin-bottom: 0.5rem; }
.rd .feature-card p { color: var(--text-secondary); margin: 0; }

/* Extended testimonial body */
.rd .quote-card .quote-detail { color: var(--text-secondary); font-size: var(--step--1); margin: 0 0 1rem; }
.rd .quote-card .author .role { display: block; color: var(--text-muted); }

/* Integration tools */
.rd .toolgrid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 2rem; }
.rd .tool { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; width: clamp(96px, 28vw, 130px); padding: 1.25rem 0.5rem; border: 1px solid var(--border-color); border-radius: 4px; background: var(--surface); text-align: center; }
.rd .tool img, .rd .tool svg { width: 38px; height: 38px; object-fit: contain; color: var(--accent-gold); }
.rd .tool span { font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-tertiary); }

/* Statement band */
.rd .statement { border-block: 1px solid var(--border-color); background: var(--surface); text-align: center; }
.rd .statement p { font-family: var(--font-heading); font-size: var(--step-2); font-weight: 300; line-height: 1.4; max-width: 42ch; margin-inline: auto; }
.rd .statement strong { color: var(--accent-gold); font-weight: 700; }

/* Pricing card */
.rd .price-card { max-width: 480px; margin-inline: auto; border: 1px solid var(--border-accent); border-radius: 6px; background: var(--surface); overflow: hidden; }
.rd .price-head { padding: 1.75rem; text-align: center; border-bottom: 1px solid var(--border-color); }
.rd .price-label { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-gold); }
.rd .price-amt { font-family: var(--font-heading); font-size: var(--step-4); margin-top: 0.4rem; }
.rd .price-body { padding: 1.75rem; }
.rd .price-body ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.rd .price-body li { padding-left: 1.7rem; position: relative; color: var(--text-secondary); }
.rd .price-body li::before { content: "\2713"; position: absolute; left: 0; color: var(--accent-gold); }
.rd .price-note { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border-color); }
.rd .price-note h3 { font-size: var(--step-0); color: var(--text-primary); }
.rd .price-note p { color: var(--text-muted); font-size: var(--step--1); margin: 0.25rem 0 0; }
.rd .price-foot { display: grid; gap: 0.75rem; padding: 0 1.75rem 1.75rem; }

/* FAQ accordion */
.rd .faq { max-width: 820px; margin-inline: auto; }
.rd .faq details { border-bottom: 1px solid var(--border-color); }
.rd .faq summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 0; cursor: pointer; list-style: none; font-family: var(--font-heading); font-size: var(--step-1); color: var(--text-primary); }
.rd .faq summary::-webkit-details-marker { display: none; }
.rd .faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent-gold); font-size: 1.4em; line-height: 1; transition: transform 0.25s var(--rd-ease); }
.rd .faq details[open] summary::after { transform: rotate(45deg); }
.rd .faq details > p { padding: 0 0 1.2rem; color: var(--text-secondary); max-width: 72ch; margin: 0; }

/* Media cards (image + body), e.g. "Proven across genres" */
.rd .media-cards { display: grid; gap: 1.25rem; margin-top: 2rem; }
.rd .media-card { border: 1px solid var(--border-color); border-radius: 4px; background: var(--surface); overflow: hidden; transition: transform 0.3s var(--rd-ease), border-color 0.3s var(--rd-ease); }
.rd .media-card:hover { transform: translateY(-4px); border-color: var(--border-accent); }
.rd .media-card img { width: 100%; height: 200px; object-fit: cover; display: block; }
.rd .media-card .media-body { padding: 1.5rem; }
.rd .media-card h3 { font-size: var(--step-1); margin-bottom: 0.5rem; }
.rd .media-card p { color: var(--text-secondary); margin: 0; }

@media (min-width: 40em) {
    .rd .statbar .wrap { grid-template-columns: repeat(4, 1fr); }
    .rd .compare { grid-template-columns: 1fr 1fr; }
    .rd .feature-cards { grid-template-columns: repeat(3, 1fr); }
    .rd .media-cards { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================================
   Node-graph diagrams (Director "How it works" steps)
   Inline SVG, themed via these classes. Evokes a node-editor canvas.
   ========================================================================== */
.rd .ng-canvas {
    position: relative;
    border: 1px solid var(--border-accent);
    border-radius: 4px;
    background-color: var(--secondary-bg);
    background-image: radial-gradient(circle, rgba(234, 230, 213, 0.06) 1px, transparent 1px);
    background-size: 22px 22px;
    background-position: -1px -1px;
    padding: clamp(0.85rem, 2.5vw, 1.5rem);
}
.rd .ng-canvas::before,
.rd .ng-canvas::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1px solid var(--accent-gold);
    pointer-events: none;
}
.rd .ng-canvas::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.rd .ng-canvas::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.rd .ng-canvas svg { width: 100%; height: auto; display: block; overflow: visible; }

.rd .ng-node { fill: var(--surface); stroke: var(--border-accent); stroke-width: 1; }
.rd .ng-node.is-hub { fill: color-mix(in srgb, var(--accent-gold) 14%, var(--surface)); stroke: var(--accent-gold); }
.rd .ng-node.is-blue { stroke: var(--accent-blue); }
.rd .ng-node.is-out { stroke: var(--accent-gold); }
.rd .ng-title { fill: var(--text-primary); font-family: var(--font-heading); font-size: 15px; }
.rd .ng-tag { fill: var(--accent-gold); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; }
.rd .ng-tag.is-muted { fill: var(--text-muted); }
.rd .ng-edge { fill: none; stroke: var(--border-accent); stroke-width: 1.75; }
.rd .ng-edge.is-gold { stroke: var(--accent-gold); }
.rd .ng-edge.is-dash { stroke: var(--text-muted); stroke-dasharray: 4 4; }
.rd .ng-flow { stroke-dasharray: 5 7; animation: ng-dash 1.1s linear infinite; }
.rd .ng-elabel { fill: var(--text-tertiary); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.06em; }
.rd .ng-arrow { fill: var(--border-accent); }
.rd .ng-arrow.is-gold { fill: var(--accent-gold); }
.rd .ng-arrow.is-muted { fill: var(--text-muted); }
@keyframes ng-dash { to { stroke-dashoffset: -24; } }

/* ============================================================================
   Wave 2: interior page heading, pricing grid, team, contact form
   ========================================================================== */

/* Centered interior page heading */
.rd .page-head { text-align: center; }
.rd .page-head .wrap { max-width: 760px; }
.rd .page-head .kicker { display: inline-block; margin-bottom: 1rem; }
.rd .page-head h1 { margin-bottom: 1.25rem; }
.rd .page-head .lede { margin-inline: auto; }

/* Pricing: two cards side by side */
.rd .price-grid { display: grid; gap: 1.5rem; max-width: 920px; margin-inline: auto; }
.rd .price-grid .price-card { max-width: none; margin: 0; display: flex; flex-direction: column; }
.rd .price-grid .price-card .price-body { flex: 1; }
@media (min-width: 48em) { .rd .price-grid { grid-template-columns: 1fr 1fr; } }

/* Team grid */
.rd .team-grid { display: grid; gap: 1.5rem; margin-top: 2.5rem; }
.rd .team-member {
    padding: 1.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--surface);
    text-align: center;
    transition: transform 0.3s var(--rd-ease), border-color 0.3s var(--rd-ease);
}
.rd .team-member:hover { transform: translateY(-4px); border-color: var(--border-accent); }
.rd .member-image {
    width: 112px; height: 112px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--border-accent);
}
.rd .member-image { display: block; }
.rd .member-image img { width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 0; }
.rd .team-member h3 { font-size: var(--step-1); line-height: 1.15; }
.rd .member-title {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin: 0.4rem 0 1rem;
}
.rd .member-skills { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin-bottom: 1rem; }
.rd .skill-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 0.25rem 0.55rem;
}
.rd .member-bio { color: var(--text-secondary); font-size: var(--step--1); margin: 0; }
@media (min-width: 40em) { .rd .team-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64em) { .rd .team-grid { grid-template-columns: repeat(3, 1fr); } }

/* Contact form */
.rd .contact-grid { display: grid; gap: 1.5rem; max-width: 980px; margin-inline: auto; }
@media (min-width: 48em) { .rd .contact-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.rd .contact-card {
    padding: clamp(1.5rem, 4vw, 2.25rem);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--surface);
}
.rd .contact-card h2 { font-size: var(--step-2); margin-bottom: 1.25rem; }
.rd .press-intro { color: var(--text-secondary); margin-bottom: 1.5rem; }
.rd .form-group { margin-bottom: 1.1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.rd .form-group label {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
}
.rd .contact-form input,
.rd .contact-form textarea {
    width: 100%;
    padding: 0.8rem 0.9rem;
    min-height: 48px;
    background: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-family: var(--font-primary);
    font-size: var(--step-0);
    transition: border-color 0.2s var(--rd-ease), box-shadow 0.2s var(--rd-ease);
}
.rd .contact-form textarea { min-height: 120px; resize: vertical; }
.rd .contact-form input::placeholder,
.rd .contact-form textarea::placeholder { color: var(--text-muted); }
.rd .contact-form input:focus,
.rd .contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(236, 196, 87, 0.12);
}
.rd .submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    margin-top: 0.5rem;
    font-family: var(--font-mono);
    font-size: var(--step--1);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-bg);
    background: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.25s var(--rd-ease), background 0.25s var(--rd-ease), box-shadow 0.25s var(--rd-ease);
}
.rd .submit-button:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgba(236, 196, 87, 0.6); }
.rd .form-note { margin-top: 1rem; font-size: var(--step--1); color: var(--text-muted); }
.rd .success-message {
    padding: 1rem 1.1rem;
    border: 1px solid var(--accent-gold);
    border-radius: 3px;
    background: rgba(236, 196, 87, 0.08);
    margin-bottom: 1.25rem;
}
.rd .success-message p { margin: 0; }
.rd .success-message p + p { margin-top: 0.35rem; color: var(--text-secondary); }

/* ============================================================================
   Wave 3: Insights listing, article layout, tag pages
   ========================================================================== */

/* Map legacy button classes (still used in templates) to the new system */
.rd .btn-primary, .rd .btn-primary-large, .rd .btn-secondary, .rd .btn-learn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 48px;
    padding: 0.85rem 1.6rem;
    font-family: var(--font-mono);
    font-size: var(--step--1);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.25s var(--rd-ease), background 0.25s var(--rd-ease), color 0.25s var(--rd-ease), box-shadow 0.25s var(--rd-ease);
}
.rd .btn-primary, .rd .btn-primary-large { color: var(--primary-bg); background: var(--accent-gold); border: 1px solid var(--accent-gold); }
.rd .btn-primary:hover, .rd .btn-primary-large:hover { transform: translateY(-2px); color: var(--primary-bg); box-shadow: 0 10px 30px -12px rgba(236, 196, 87, 0.6); }
.rd .btn-secondary, .rd .btn-learn { color: var(--text-primary); background: transparent; border: 1px solid var(--border-accent); }
.rd .btn-secondary:hover, .rd .btn-learn:hover { color: var(--accent-gold); border-color: var(--accent-gold); }

/* Listing + tag pages */
.rd .insights-section { padding-block: clamp(2.5rem, 2rem + 4vw, 5rem); }
.rd .insights-content { width: 100%; max-width: var(--rd-max); margin-inline: auto; padding-inline: var(--rd-gutter); }
.rd .insights-section .section-title { font-family: var(--font-heading); font-size: var(--step-5); margin-bottom: 0.75rem; }
.rd .insights-section .section-subtitle { color: var(--text-secondary); font-size: var(--step-1); font-weight: 300; max-width: var(--rd-max-prose); margin-bottom: 2rem; }

.rd .insights-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2.5rem; }
.rd .filter-btn {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 0.5rem 1rem;
    min-height: 40px;
    cursor: pointer;
    transition: color 0.2s var(--rd-ease), border-color 0.2s var(--rd-ease), background 0.2s var(--rd-ease);
}
.rd .filter-btn:hover { color: var(--accent-gold); border-color: var(--border-accent); }
.rd .filter-btn.active { color: var(--primary-bg); background: var(--accent-gold); border-color: var(--accent-gold); }

.rd .insights-grid { display: grid; gap: 1.5rem; }
.rd .insight-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s var(--rd-ease), border-color 0.3s var(--rd-ease);
}
.rd .insight-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: var(--accent-gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--rd-ease);
    z-index: 2;
}
.rd .insight-card:hover { transform: translateY(-4px); border-color: var(--border-accent); }
.rd .insight-card:hover::before { transform: scaleX(1); }
.rd .card-thumbnail { aspect-ratio: 16 / 9; overflow: hidden; background: var(--secondary-bg); }
.rd .card-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--rd-ease); }
.rd .insight-card:hover .card-thumbnail img { transform: scale(1.04); }
.rd .card-body { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.5rem; flex: 1; }
.rd .card-meta { display: flex; align-items: center; gap: 0.75rem; font-family: var(--font-mono); font-size: var(--step--1); }
.rd .card-meta time { color: var(--text-muted); }
.rd .card-category, .rd .article-category {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-gold);
}
.rd .category-news { color: var(--accent-gold); }
.rd .category-articles { color: var(--accent-blue); }
.rd .card-title { font-family: var(--font-heading); font-size: var(--step-2); line-height: 1.15; }
.rd .card-excerpt { color: var(--text-secondary); font-size: var(--step--1); margin: 0; }

.rd .pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1rem; margin-top: 3rem; }
.rd .pagination-info { font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-muted); }

/* Article page */
.rd .article-page { width: 100%; max-width: 760px; margin-inline: auto; padding: clamp(2.5rem, 2rem + 4vw, 5rem) var(--rd-gutter); }
.rd .article-header { margin-bottom: 2.5rem; }
.rd .article-author { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; margin-bottom: 1.25rem; }
.rd .author-photo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border-accent); }
.rd .author-name { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.04em; color: var(--text-secondary); }
.rd .article-meta { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1rem; font-family: var(--font-mono); font-size: var(--step--1); }
.rd .article-meta time { color: var(--text-muted); }
.rd .article-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.rd .article-tags .tag, .rd .tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 0.25rem 0.55rem;
    transition: color 0.2s var(--rd-ease), border-color 0.2s var(--rd-ease);
}
.rd .article-tags .tag:hover, .rd .tag:hover { color: var(--accent-gold); border-color: var(--accent-gold); }
.rd .article-header h1 { font-family: var(--font-heading); font-size: var(--step-4); line-height: 1.08; margin-bottom: 1.25rem; }
.rd .article-excerpt { font-size: var(--step-1); font-weight: 300; color: var(--text-secondary); }

/* Article prose */
.rd .article-content { font-size: var(--step-0); color: var(--text-secondary); }
.rd .article-content > * + * { margin-top: 1.25rem; }
.rd .article-content p { line-height: 1.8; }
.rd .article-content h2 { font-family: var(--font-heading); color: var(--text-primary); font-size: var(--step-3); line-height: 1.2; margin-top: 2.5rem; }
.rd .article-content h3 { font-family: var(--font-heading); color: var(--text-primary); font-size: var(--step-2); line-height: 1.2; margin-top: 2rem; }
.rd .article-content a { color: var(--accent-gold); text-decoration: underline; text-underline-offset: 3px; }
.rd .article-content a:hover { color: var(--text-primary); }
.rd .article-content strong { color: var(--text-primary); }
.rd .article-content ul, .rd .article-content ol { padding-left: 1.4rem; display: grid; gap: 0.5rem; }
.rd .article-content li { line-height: 1.7; }
.rd .article-content blockquote {
    border-left: 2px solid var(--accent-gold);
    padding-left: 1.25rem;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: var(--step-1);
    color: var(--text-primary);
}
.rd .article-content img { border-radius: 4px; border: 1px solid var(--border-color); }
.rd .article-content code { font-family: var(--font-mono); font-size: 0.9em; background: var(--surface); padding: 0.15em 0.4em; border-radius: 3px; }
.rd .article-content pre { background: var(--secondary-bg); border: 1px solid var(--border-color); border-radius: 4px; padding: 1rem; overflow: auto; }
.rd .article-content pre code { background: none; padding: 0; }
.rd .article-content table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.rd .article-content th, .rd .article-content td { border: 1px solid var(--border-color); padding: 0.6rem 0.8rem; text-align: left; }
.rd .article-content th { background: var(--surface); font-family: var(--font-mono); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.04em; color: var(--text-tertiary); }

/* Article share + back */
.rd .article-share { margin-top: 3rem; padding-top: 1.75rem; border-top: 1px solid var(--border-color); display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.rd .share-label { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.rd .share-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.rd .share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 40px;
    padding: 0.5rem 0.7rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: var(--step--1);
    transition: color 0.2s var(--rd-ease), border-color 0.2s var(--rd-ease);
}
.rd .share-btn:hover { color: var(--accent-gold); border-color: var(--accent-gold); }
.rd .article-back { margin-top: 2.5rem; }

@media (min-width: 40em) {
    .rd .insights-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 64em) {
    .rd .insights-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================================
   Wave 4: legal pages + 404
   ========================================================================== */
.rd .legal-page { max-width: 760px; margin-inline: auto; padding: clamp(2.5rem, 2rem + 4vw, 5rem) var(--rd-gutter); }
.rd .legal-page h1 { font-family: var(--font-heading); font-size: var(--step-4); line-height: 1.08; margin-bottom: 0.5rem; }
.rd .legal-meta { font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-muted); margin-bottom: 2rem; }
.rd .legal-review {
    padding: 1rem 1.1rem;
    border: 1px solid var(--accent-gold);
    border-radius: 3px;
    background: rgba(236, 196, 87, 0.08);
    color: var(--text-secondary);
    font-size: var(--step--1);
    margin-bottom: 2.5rem;
}
.rd .legal-review strong { color: var(--accent-gold); }
.rd .legal-page h2 { font-family: var(--font-heading); color: var(--text-primary); font-size: var(--step-2); line-height: 1.2; margin-top: 2.5rem; margin-bottom: 0.75rem; }
.rd .legal-page p { color: var(--text-secondary); line-height: 1.8; }
.rd .legal-page p + p { margin-top: 1rem; }
.rd .legal-page ul { color: var(--text-secondary); padding-left: 1.4rem; display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.rd .legal-page li { line-height: 1.7; }
.rd .legal-page a { color: var(--accent-gold); text-decoration: underline; text-underline-offset: 3px; }
.rd .legal-page a:hover { color: var(--text-primary); }

.rd .error-section { min-height: 68vh; display: grid; place-items: center; text-align: center; padding: clamp(3rem, 2rem + 5vw, 7rem) var(--rd-gutter); }
.rd .error-container { max-width: 520px; }
.rd .error-code { font-family: var(--font-heading); font-size: clamp(5rem, 12vw, 9rem); line-height: 1; color: var(--accent-gold); }
.rd .error-title { font-family: var(--font-heading); font-size: var(--step-3); margin: 0.5rem 0 1rem; }
.rd .error-message { color: var(--text-secondary); margin-bottom: 2rem; }
.rd .error-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; justify-content: center; }
