/* =============================================================================
   READING PAGES — The Manual · Terms & Disclaimer
   ---------------------------------------------------------------------------
   Standalone pages (not part of the SPA router), styled for long-form
   reading rather than dashboard density. Same cosmic navy/gold identity as
   the rest of Aion (cockpit.css tokens), but generous serif typography —
   the reading comfort of Kagami-Mirai's story page, in Aion's own palette.
   ============================================================================= */

:root {
    --rd-void:      #060912;
    --rd-deep:      #0B1020;
    --rd-panel:     #0E1428;
    --rd-gold:      #D4AF37;
    --rd-gold-br:   #FFD86B;
    --rd-text:      #E8E3D0;
    --rd-text-soft: #C9C4B1;
    --rd-text-dim:  #8C8674;
    --rd-serif: 'Cormorant Garamond', Georgia, serif;
    --rd-sans:  'Inter', 'Segoe UI', -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html {
    /* Disable WebKit/mobile-browser auto text-size-adjust. Without this,
       Safari/Chrome on phones silently re-scale paragraph font-size based
       on surrounding layout (worse after a <ul> interrupts the flow of
       <p> tags), so text drifts smaller further down the page even though
       every .rd-body p shares the exact same declared font-size. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
html, body {
    margin: 0; padding: 0;
    background: var(--rd-void);
    color: var(--rd-text-soft);
    font-family: var(--rd-serif);
}

body {
    background:
        radial-gradient(60% 40% at 50% 0%, rgba(212,175,55,0.13), transparent 60%),
        radial-gradient(120% 80% at 50% 100%, rgba(91,60,20,0.10), transparent 70%),
        linear-gradient(180deg, var(--rd-void) 0%, var(--rd-deep) 100%);
    min-height: 100vh;
    /* Chromium-Edge and Chrome share Blink, but font-smoothing hints can
       still diverge and make text read dimmer/thinner in Edge. Force
       consistent anti-aliasing so weight/contrast match across both. */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ── Quiet starfield — a handful of static points, not animated confetti ── */
.rd-stars {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        radial-gradient(1px 1px at 8% 12%, rgba(255,255,255,0.35), transparent),
        radial-gradient(1px 1px at 22% 38%, rgba(255,255,255,0.22), transparent),
        radial-gradient(1.5px 1.5px at 41% 8%, rgba(255,255,255,0.30), transparent),
        radial-gradient(1px 1px at 63% 22%, rgba(255,255,255,0.20), transparent),
        radial-gradient(1px 1px at 78% 45%, rgba(255,255,255,0.28), transparent),
        radial-gradient(1.5px 1.5px at 91% 15%, rgba(255,255,255,0.22), transparent),
        radial-gradient(1px 1px at 15% 70%, rgba(255,255,255,0.18), transparent),
        radial-gradient(1px 1px at 55% 85%, rgba(255,255,255,0.20), transparent),
        radial-gradient(1px 1px at 85% 78%, rgba(255,255,255,0.16), transparent);
    background-repeat: no-repeat;
}

/* ── Back link, top corner ── */
.rd-back {
    position: fixed; top: 22px; left: 24px; z-index: 10;
    font-family: var(--rd-sans);
    font-size: 12px; letter-spacing: 0.05em;
    color: var(--rd-text-dim);
    text-decoration: none;
    opacity: 0.85;
    transition: color 0.2s, opacity 0.2s;
}
.rd-back:hover { color: var(--rd-gold-br); opacity: 1; }

.rd-sibling {
    position: fixed; top: 22px; right: 24px; z-index: 10;
    font-family: var(--rd-sans);
    font-size: 12px; letter-spacing: 0.05em;
    color: var(--rd-text-dim);
    text-decoration: none;
    opacity: 0.85;
    transition: color 0.2s, opacity 0.2s;
}
.rd-sibling:hover { color: var(--rd-gold-br); opacity: 1; }

/* ── Wrap ──
   No load/scroll-triggered animation gating visibility here on purpose —
   content must always be visible with zero JS and zero animation-completion
   dependency. Reading comfort > entrance effects. */
.rd-wrap {
    position: relative; z-index: 1;
    max-width: 820px;
    margin: 0 auto;
    padding: 120px 26px 80px;
}

.rd-page-icon {
    width: 64px; height: 64px;
    object-fit: contain;
    border-radius: 16px;
    margin-bottom: 22px;
    filter: drop-shadow(0 6px 20px rgba(0,0,0,0.4));
}

.rd-kicker {
    font-family: var(--rd-sans);
    font-size: 11px; letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--rd-gold);
    opacity: 0.75;
    margin-bottom: 14px;
}

.rd-title {
    font-size: clamp(34px, 6.5vw, 52px);
    font-weight: 700;
    line-height: 1.22;
    color: var(--rd-gold-br);
    text-shadow: 0 0 30px rgba(255,216,107,0.18);
    margin: 0 0 10px;
    letter-spacing: 0.01em;
}
.rd-subtitle {
    font-family: var(--rd-sans);
    font-size: 15px;
    color: var(--rd-text-dim);
    letter-spacing: 0.04em;
    margin-bottom: 56px;
}

/* ── Chapters ──
   Visible by default, no JS required to read the page. The .rd-wrap-level
   fade-in below is a pure-CSS, load-triggered enhancement (not scroll/
   IntersectionObserver-based) so it can never leave content stuck invisible
   if some environment doesn't fire intersection callbacks. */
.rd-chapter {
    margin: 64px 0 0;
}

.rd-chap-kicker {
    font-family: var(--rd-sans);
    font-size: 11px; letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--rd-text-dim);
    margin-bottom: 8px;
}
.rd-chap-kicker .rd-glyph { color: var(--rd-gold); margin-right: 6px; }

.rd-h2 {
    font-size: clamp(27px, 4.4vw, 36px);
    font-weight: 700;
    color: var(--rd-gold-br);
    margin: 0 0 22px;
    letter-spacing: 0.01em;
}

.rd-body p {
    font-size: 20px;
    line-height: 1.9;
    color: var(--rd-text-soft);
    margin: 0 0 24px;
    letter-spacing: 0.01em;
}
.rd-body em { color: var(--rd-gold-br); font-style: italic; }
.rd-body strong { color: var(--rd-text); font-weight: 600; }

.rd-pullquote {
    font-style: italic;
    font-size: 22px;
    line-height: 1.7;
    color: var(--rd-gold-br);
    border-left: 2px solid rgba(212,175,55,0.4);
    padding: 4px 0 4px 22px;
    margin: 32px 0;
    opacity: 0.92;
}

/* ── Grouped lists (used in the Lab / Living Layers chapters) ── */
.rd-group-title {
    font-family: var(--rd-sans);
    font-size: 12px; letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rd-gold);
    margin: 30px 0 12px;
    opacity: 0.85;
}
.rd-list { list-style: none; margin: 0 0 8px; padding: 0; }
.rd-list li {
    font-family: var(--rd-sans);
    font-size: 16.5px;
    line-height: 1.75;
    color: var(--rd-text-soft);
    padding: 8px 0;
    border-bottom: 1px solid rgba(212,175,55,0.08);
}
.rd-list li b { color: var(--rd-gold-br); font-weight: 600; }

/* ── Divider between major chapters ── */
.rd-divider {
    display: flex; align-items: center; gap: 14px;
    margin: 70px 0 0;
    color: var(--rd-gold);
    opacity: 0.5;
}
.rd-divider::before, .rd-divider::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.35), transparent);
}
.rd-divider span { font-size: 13px; letter-spacing: 0.3em; }

/* ── Signed-by footer ── */
.rd-signed {
    display: flex; align-items: center; gap: 16px;
    margin: 72px 0 8px;
    padding-top: 34px;
    border-top: 1px solid rgba(212,175,55,0.14);
}
.rd-signed-hanko { width: 46px; height: 46px; object-fit: contain; }
.rd-signed-text {
    font-style: italic; font-size: 16px;
    color: var(--rd-text-soft);
    letter-spacing: 0.03em;
}
.rd-signed-text strong { color: var(--rd-gold-br); font-style: normal; }

.rd-footer-note {
    font-family: var(--rd-sans);
    font-size: 12px; color: var(--rd-text-dim);
    margin-top: 26px; line-height: 1.7;
}

/* ── Terms page: plainer, no mystical voice ── */
.rd-terms .rd-body p { font-family: var(--rd-sans); font-size: 17px; line-height: 1.8; }
.rd-terms .rd-h2 { font-size: 25px; }
.rd-terms .rd-chapter { margin-top: 44px; }

@media (max-width: 560px) {
    .rd-wrap { padding: 90px 20px 60px; }
    .rd-back, .rd-sibling { font-size: 11px; }
}
