/* ================================================================
   Carcin rich-landing layer (spec homepage/008).
   Generic, portable pieces ported from the homepage so inner pages
   can read homepage-grade: backdrop, headline system, reveal motion,
   cards, bars, timeline, accordion. NO page-specific selectors here.
   Load AFTER brand.css + static-page.css. Pair with /rich-landing.js.
   Class prefix: rl-. Body gets .rl-page.
   ================================================================ */

/* ---- Page chrome: wider canvas, content above the backdrop ---- */
.rl-page .page-wrap { max-width: 920px; position: relative; z-index: 1; }
.rl-narrow { max-width: 680px; margin-left: auto; margin-right: auto; }
.rl-section { margin: 72px 0 0; }
@media (max-width: 600px) { .rl-section { margin-top: 56px; } }

/* ---- Backdrop: CSS-only starfield (homepage twinkle, no canvas) ----
   Three layers of box-shadow star dots positioned in vw/vh, each layer
   on its own twinkle phase (homepage @keyframes twk port). */
.rl-stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.rl-stars i { position: absolute; top: 0; left: 0; width: 2px; height: 2px; border-radius: 50%; background: transparent; }
.rl-stars .rl-st1 {
  box-shadow:
    6vw 14vh 0 0 #fff, 21vw 6vh 0 -0.5px #ffd98a, 38vw 22vh 0 0 #fff,
    57vw 9vh 0 -0.5px #fff, 74vw 18vh 0 0 #ffd98a, 90vw 7vh 0 -0.5px #fff,
    12vw 64vh 0 0 #fff, 84vw 58vh 0 -0.5px #ffd98a;
  animation: rl-twk 4.2s ease-in-out infinite;
}
.rl-stars .rl-st2 {
  box-shadow:
    11vw 34vh 0 -0.5px #ffd98a, 29vw 48vh 0 0 #fff, 46vw 31vh 0 -0.5px #fff,
    66vw 42vh 0 0.5px #fff, 81vw 33vh 0 -0.5px #ffd98a, 94vw 49vh 0 0 #fff,
    4vw 88vh 0 -0.5px #fff, 52vw 72vh 0 0 #ffd98a;
  animation: rl-twk 5.6s ease-in-out infinite 0.7s;
}
.rl-stars .rl-st3 {
  box-shadow:
    17vw 79vh 0 0 #fff, 33vw 91vh 0 -0.5px #ffd98a, 49vw 84vh 0 0 #fff,
    63vw 93vh 0 -0.5px #fff, 77vw 76vh 0 0.5px #ffd98a, 92vw 87vh 0 -0.5px #fff,
    26vw 16vh 0 -0.5px #fff, 70vw 62vh 0 0 #fff;
  animation: rl-twk 3.8s ease-in-out infinite 1.4s;
}
@keyframes rl-twk { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---- Constellation accent (faint, behind a hero) ---- */
.rl-constellation {
  position: absolute; top: -40px; left: 50%;
  transform: translateX(-50%);
  width: 460px; max-width: 120%; height: 540px;
  z-index: -1; opacity: 0.4; pointer-events: none;
}
@media (max-width: 500px) { .rl-constellation { width: 340px; height: 440px; top: -20px; opacity: 0.3; } }
.rl-constellation .cline { stroke: var(--accent); stroke-width: 1; opacity: 0.22; }
.rl-constellation .cstar { fill: var(--star-glow); }
.rl-constellation .cstar-core { fill: #fff; }
.rl-constellation .cglow { fill: var(--accent); opacity: 0.18; filter: blur(3px); }
.rl-twinkle-1 { animation: rl-twk 4.2s ease-in-out infinite; }
.rl-twinkle-2 { animation: rl-twk 5.6s ease-in-out infinite 0.7s; }
.rl-twinkle-3 { animation: rl-twk 3.8s ease-in-out infinite 1.4s; }
.rl-twinkle-4 { animation: rl-twk 6.1s ease-in-out infinite 0.3s; }

/* ---- Headline system ---- */
.rl-eyebrow {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--star-glow); margin-bottom: 18px;
}
.rl-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 12px rgba(245,166,35,0.7);
  animation: rl-pulse 2s ease-in-out infinite;
}
@keyframes rl-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

.rl-display {
  font-family: 'Inter', sans-serif; font-weight: 900;
  font-size: clamp(36px, 7vw, 56px); line-height: 1.04; letter-spacing: -0.03em;
  margin: 0 0 18px;
  background: var(--grad-headline);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rl-display span {
  background: var(--grad-accent-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.rl-h2 {
  font-family: 'Inter', sans-serif; font-weight: 800;
  font-size: clamp(24px, 4vw, 30px); line-height: 1.15; letter-spacing: -0.02em;
  color: var(--text); margin: 0 0 16px;
}
.rl-h2 span {
  background: var(--grad-accent-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.rl-sub { color: var(--text-dim); font-size: 17px; line-height: 1.65; }

/* ---- Hero head (shared inner-page hero block) ---- */
.rl-hero { position: relative; text-align: center; padding-top: 48px; }
.rl-hero .rl-sub { max-width: 56ch; margin-left: auto; margin-right: auto; }

/* ---- Pills (tag/channel chips) ---- */
.rl-pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rl-pill {
  display: inline-block; font-size: 12.5px; line-height: 1;
  color: var(--text-dim); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 12px; white-space: nowrap;
}

/* ---- Chip (mono uppercase label chip) ---- */
.rl-chip {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--star-glow); background: rgba(245,166,35,0.08);
  border: 1px solid var(--hairline); border-radius: 100px;
  padding: 6px 12px;
}

/* ---- Pull quote ---- */
.rl-quote { border-left: 3px solid var(--accent); padding: 6px 0 6px 20px; }
.rl-quote p { font-size: 18px; line-height: 1.65; color: var(--text); margin: 0; }

/* ---- Card system (homepage feature-card treatment) ---- */
.rl-card {
  background: var(--surface-gradient, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.rl-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245,166,35,0.4);
  box-shadow: var(--shadow-card), var(--glow-soft);
}
.rl-card-glow {
  border-color: rgba(245,166,35,0.35);
  box-shadow: var(--shadow-card), var(--glow-soft);
}
.rl-ico {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1c1408 0%, #0a0704 100%);
  border: 1px solid rgba(245,166,35,0.28);
  color: var(--star-glow); margin-bottom: 14px;
  box-shadow: var(--glow-soft);
}
.rl-ico svg { width: 18px; height: 18px; }

.rl-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 24px 0; }
@media (max-width: 880px) { .rl-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .rl-grid-3 { grid-template-columns: 1fr; } }
.rl-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 24px 0; }
@media (max-width: 880px) { .rl-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .rl-grid-4 { grid-template-columns: 1fr; } }
.rl-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 24px 0; }
@media (max-width: 720px) { .rl-grid-2 { grid-template-columns: 1fr; } }

/* ---- Big numerals (anchor cards, metric moments) ---- */
.rl-numeral {
  font-family: 'Inter', sans-serif; font-weight: 900;
  font-size: clamp(24px, 3.2vw, 34px); letter-spacing: -0.03em; line-height: 1.05;
  background: var(--grad-headline);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(245,166,35,0.25));
}
.rl-numeral-dim {
  background: none; -webkit-background-clip: border-box; background-clip: border-box;
  color: var(--text-dim); filter: none; opacity: 0.75;
}

/* ---- Bars (homepage pain-bar port) ---- */
.rl-bar-label {
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 16px;
  color: var(--text); margin-bottom: 10px; letter-spacing: -0.01em;
}
.rl-bar {
  height: 12px; border-radius: 999px;
  background: rgba(245,166,35,0.10);
  overflow: hidden; position: relative;
}
.rl-bar-fill {
  height: 100%; width: calc(var(--fill, 0) * 1%);
  background: linear-gradient(90deg, var(--accent), var(--star-glow));
  border-radius: inherit;
  box-shadow: 0 0 14px rgba(245,166,35,0.55);
  transition: width 1100ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.rl-reveal .rl-bar-fill { width: 0; }
.rl-reveal.in .rl-bar-fill { width: calc(var(--fill, 0) * 1%); }
.rl-bar-axis {
  margin-top: 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim);
  text-align: center;
}

/* ---- Timeline stepper: horizontal desktop, vertical mobile ---- */
.rl-timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin: 28px 0 8px; }
.rl-step { position: relative; padding-top: 28px; }
.rl-step::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 14px rgba(245,166,35,0.6);
}
.rl-step::after {
  content: ''; position: absolute; top: 5px; left: 20px; right: -8px;
  height: 2px; background: linear-gradient(90deg, rgba(245,166,35,0.35), rgba(245,166,35,0.08));
}
.rl-step:last-child::after { display: none; }
.rl-step-label {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--star-glow);
  margin-bottom: 8px;
}
.rl-step p { font-size: 14px; line-height: 1.55; color: var(--text-dim); margin: 0; }
@media (max-width: 760px) {
  .rl-timeline { grid-template-columns: 1fr; gap: 22px; }
  .rl-step { padding-top: 0; padding-left: 28px; }
  .rl-step::before { top: 4px; }
  .rl-step::after { top: 24px; left: 5px; right: auto; bottom: -22px; width: 2px; height: auto;
    background: linear-gradient(180deg, rgba(245,166,35,0.35), rgba(245,166,35,0.08)); }
}

/* ---- Accordion (native details/summary, branded) ---- */
.rl-accordion details {
  background: var(--surface-gradient, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: border-color 0.25s;
}
.rl-accordion details[open] { border-color: rgba(245,166,35,0.35); }
.rl-accordion summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; min-height: 44px; box-sizing: border-box;
  cursor: pointer; list-style: none;
  font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.4;
}
.rl-accordion summary::-webkit-details-marker { display: none; }
.rl-accordion summary::after {
  content: ''; flex-shrink: 0;
  width: 9px; height: 9px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.25s;
  margin-top: -4px;
}
.rl-accordion details[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.rl-acc-body { padding: 0 18px 16px; }
.rl-acc-body p { font-size: 15px; line-height: 1.7; color: var(--text-dim); margin: 0; }
.rl-accordion details[open] .rl-acc-body { animation: rl-acc-open 0.28s ease; }
@keyframes rl-acc-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---- Scroll reveal (homepage .reveal / [data-stagger] semantics).
   JS adds .rl-reveal (so no-JS stays fully visible), then .in. ---- */
.rl-reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.rl-reveal.in { opacity: 1; transform: none; }
.rl-reveal [data-rl-stagger] { opacity: 0; transform: translateY(18px); transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1); transition-delay: calc(var(--i, 0) * 70ms); }
.rl-reveal.in [data-rl-stagger] { opacity: 1; transform: none; }
@media (max-width: 600px) { .rl-reveal [data-rl-stagger] { transition-delay: calc(var(--i, 0) * 45ms); } }

/* ---- Final CTA radial glow (homepage module-final-cta port) ---- */
.rl-final-cta { position: relative; }
.rl-final-cta::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(245,166,35,0.12), transparent 70%);
}

/* ---- Reduced motion: everything visible, nothing moves ---- */
@media (prefers-reduced-motion: reduce) {
  .rl-stars { display: none; }
  .rl-twinkle-1, .rl-twinkle-2, .rl-twinkle-3, .rl-twinkle-4, .rl-eyebrow .dot { animation: none; }
  .rl-reveal, .rl-reveal [data-rl-stagger] { opacity: 1; transform: none; transition: none; }
  .rl-bar-fill, .rl-reveal .rl-bar-fill, .rl-reveal.in .rl-bar-fill { width: calc(var(--fill, 0) * 1%); transition: none; }
  .rl-accordion details[open] .rl-acc-body { animation: none; }
  .rl-card, .rl-card:hover { transform: none; }
}
