/* ============================================================
   RF Academy — long-form styling, H2 Aesthetics design system
   Loads after the DS token CSS (colors / fonts / typography).
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--soft-white); color: var(--text-body);
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--text-link); text-decoration: none; }

/* tokens local */
:root {
  --acad-gutter: clamp(20px, 5vw, 80px);
  --acad-measure: 70ch;
  --ease: cubic-bezier(0.22,0.61,0.36,1);
}

/* ---------------- top bar ---------------- */
.acad-top {
  position: sticky; top: 0; z-index: 50;
  background: var(--purple-900);
  border-bottom: 1px solid var(--purple-800);
}
.acad-top__in {
  max-width: 1180px; margin: 0 auto; padding: 14px var(--acad-gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.acad-top__brand { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.acad-top__mark {
  font-size: 18px; font-weight: 300; letter-spacing: .14em; color: var(--soft-white);
  text-transform: none;
}
.acad-top__mark em { font-style: normal; color: var(--gold-400); font-weight: 400; }
.acad-top__sub {
  font-size: 9.5px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase;
  color: var(--text-on-dark-muted); padding-left: .26em;
}
.acad-top__nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); }
.acad-top__nav > a {
  font-size: 13px; font-weight: 500; letter-spacing: .02em; color: var(--text-on-dark-muted);
  white-space: nowrap; transition: color .2s var(--ease);
}
.acad-top__nav > a:hover { color: var(--soft-white); }
.acad-top__cta { color: var(--gold-400) !important; }
.acad-top__langs { display: flex; gap: 2px; }
.acad-lang {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--text-on-dark-muted);
  padding: 5px 7px; border-radius: 5px; transition: color .2s var(--ease), background .2s var(--ease);
}
.acad-lang:hover { color: var(--soft-white); background: rgba(255,255,255,.08); }
.acad-lang.is-active { color: var(--purple-900); background: var(--gold-400); }

/* ---------------- shared bits ---------------- */
.acad-eyebrow {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold-700); margin-bottom: 14px;
}
.acad-eyebrow::after {
  content: ""; display: block; width: 46px; height: 2px; background: var(--gold-500);
  margin-top: 12px;
}
.acad-eyebrow--light { color: var(--gold-400); }
.acad-eyebrow--light::after { background: var(--gold-500); }

/* ---------------- article ---------------- */
.acad-art { max-width: 1180px; margin: 0 auto; padding: 0 var(--acad-gutter); }
.acad-crumbs { padding: 22px 0 6px; }
.acad-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.acad-crumbs li { font-size: 12.5px; color: var(--text-subtle); display: flex; gap: 8px; align-items: center; }
.acad-crumbs li + li::before { content: "›"; color: var(--stone-400); }
.acad-crumbs a { color: var(--text-muted); }
.acad-crumbs a:hover { color: var(--purple-600); }
.acad-crumbs li[aria-current] { color: var(--text-strong); }

.acad-art__head { padding: 18px 0 30px; border-bottom: 1px solid var(--border-subtle); max-width: 860px; }
.acad-art__head h1 {
  font-size: clamp(30px, 4.6vw, 50px); font-weight: 300; line-height: 1.08;
  letter-spacing: -0.01em; color: var(--text-strong); margin: 0 0 18px; text-wrap: balance;
}
.acad-dek {
  font-size: clamp(17px, 2vw, 20px); line-height: 1.55; color: var(--text-muted);
  font-weight: 300; margin: 0 0 26px; max-width: 64ch;
}
.acad-byline { display: flex; align-items: center; gap: 13px; }
.acad-byline__av {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--purple-900); color: var(--gold-400);
  display: grid; place-items: center; font-size: 13px; font-weight: 600; letter-spacing: .04em;
}
.acad-byline__meta { display: flex; flex-direction: column; gap: 2px; }
.acad-byline__by { font-size: 13.5px; font-weight: 500; color: var(--text-strong); }
.acad-byline__sub { font-size: 12px; color: var(--text-subtle); }

/* layout: TOC aside + main column */
.acad-art__body { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); padding: 38px 0 10px; }
.acad-art__main { min-width: 0; max-width: var(--acad-measure); }
.acad-art__aside { position: relative; }
.acad-toc { position: sticky; top: 92px; }
.acad-toc__h {
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-subtle); margin: 0 0 12px;
}
.acad-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border-subtle); }
.acad-toc li { margin: 0; }
.acad-toc a {
  display: block; padding: 6px 0 6px 16px; margin-left: -1px; font-size: 13px; line-height: 1.4;
  color: var(--text-muted); border-left: 2px solid transparent; transition: color .2s var(--ease), border-color .2s var(--ease);
}
.acad-toc a:hover { color: var(--purple-700); border-left-color: var(--gold-400); }

/* prose */
.acad-sec { margin: 0 0 4px; }
.acad-sec h2 {
  font-size: clamp(22px, 2.6vw, 30px); font-weight: 300; line-height: 1.18; color: var(--text-strong);
  letter-spacing: -0.01em; margin: 46px 0 16px; scroll-margin-top: 92px; text-wrap: balance;
}
.acad-sec h3 {
  font-size: clamp(17px, 1.8vw, 20px); font-weight: 600; color: var(--text-strong);
  margin: 30px 0 10px; scroll-margin-top: 92px;
}
.acad-art__main p { font-size: 17px; line-height: 1.72; color: var(--text-body); margin: 0 0 18px; }
.acad-art__main ul, .acad-art__main ol { margin: 0 0 20px; padding-left: 22px; }
.acad-art__main li { font-size: 17px; line-height: 1.68; color: var(--text-body); margin: 0 0 9px; }
.acad-art__main strong { color: var(--text-strong); font-weight: 600; }
.acad-art__main a:not(.acad-cta__btn) { color: var(--text-link); text-decoration: underline; text-decoration-color: var(--purple-200); text-underline-offset: 2px; }
.acad-art__main a:hover { color: var(--text-link-hover); }
sup { font-size: .68em; line-height: 0; }
sup a { text-decoration: none !important; font-weight: 600; }

/* key-takeaways card */
.acad-tldr {
  background: var(--white); border: 1px solid var(--border-subtle); border-top: 3px solid var(--gold-500);
  border-radius: 8px; padding: 22px 26px; margin: 4px 0 34px;
  box-shadow: 0 1px 2px rgba(33,16,47,.04), 0 8px 24px -16px rgba(33,16,47,.18);
}
.acad-tldr__h {
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-700); margin: 0 0 12px;
}
.acad-tldr ul { margin: 0; padding-left: 20px; }
.acad-tldr li { font-size: 15.5px; line-height: 1.55; margin-bottom: 8px; color: var(--text-body); }
.acad-tldr li::marker { color: var(--gold-500); }

/* callout / definition box */
.acad-note {
  background: var(--purple-50); border: 1px solid var(--purple-100); border-left: 3px solid var(--purple-500);
  border-radius: 8px; padding: 18px 22px; margin: 24px 0;
}
.acad-note p { margin: 0; font-size: 15.5px; color: var(--purple-900); }
.acad-note p + p { margin-top: 10px; }
.acad-note strong { color: var(--purple-900); }

/* tables */
.acad-tablewrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--border-subtle); border-radius: 8px; }
table.acad-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 460px; }
.acad-table th, .acad-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.acad-table thead th {
  background: var(--purple-900); color: var(--soft-white); font-weight: 500; letter-spacing: .02em;
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em;
}
.acad-table tbody tr:nth-child(even) { background: var(--stone-50); }
.acad-table tbody tr:last-child td { border-bottom: 0; }
.acad-table td:first-child { font-weight: 500; color: var(--text-strong); }

/* figure */
.acad-fig { margin: 26px 0; }
.acad-fig svg { display: block; width: 100%; height: auto; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--white); }
.acad-fig figcaption { font-size: 13px; color: var(--text-subtle); margin-top: 10px; text-align: center; }

/* FAQ */
.acad-faq h2 { margin-bottom: 6px; }
.acad-q { border-bottom: 1px solid var(--border-subtle); padding: 4px 0; }
.acad-q summary {
  cursor: pointer; list-style: none; padding: 16px 36px 16px 0; position: relative;
  font-size: 16.5px; font-weight: 500; color: var(--text-strong); line-height: 1.4;
}
.acad-q summary::-webkit-details-marker { display: none; }
.acad-q summary::after {
  content: "+"; position: absolute; right: 4px; top: 14px; font-size: 22px; font-weight: 300;
  color: var(--purple-500); transition: transform .2s var(--ease);
}
.acad-q[open] summary::after { content: "−"; }
.acad-q__a { padding: 0 0 18px; }
.acad-q__a p { font-size: 15.5px; line-height: 1.65; color: var(--text-body); margin: 0 0 12px; }
.acad-q__a p:last-child { margin-bottom: 0; }

/* inline CTA */
.acad-cta { margin: 44px 0 10px; }
.acad-cta__in {
  background: var(--purple-900); border-radius: 12px; padding: 30px 32px; position: relative; overflow: hidden;
}
.acad-cta__in::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--purple-500), var(--gold-500));
}
.acad-cta__h { font-size: 19px; font-weight: 300; color: var(--soft-white); margin: 0 0 8px; }
.acad-cta__t { font-size: 14.5px; color: var(--text-on-dark-muted); margin: 0 0 18px; max-width: 52ch; }
.acad-cta__btn {
  display: inline-block; background: var(--gold-500); color: var(--purple-950); font-weight: 600;
  font-size: 14px; padding: 11px 22px; border-radius: 7px; transition: background .2s var(--ease), transform .2s var(--ease);
}
.acad-cta__btn:hover { background: var(--gold-400); transform: translateY(-1px); }

/* references */
.acad-refs { max-width: var(--acad-measure); margin: 40px 0 0; padding-top: 30px; border-top: 1px solid var(--border-subtle); }
.acad-refs h2 { font-size: 15px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 16px; }
.acad-refs ol { padding-left: 22px; margin: 0; }
.acad-refs li { font-size: 13.5px; line-height: 1.5; color: var(--text-muted); margin-bottom: 10px; }
.acad-refs a { color: var(--text-link); text-decoration: underline; }

/* related */
.acad-related { max-width: 1180px; margin: 0 auto; padding: 56px 0 0; }
.acad-related > h2 {
  font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 20px;
}
.acad-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.acad-card {
  display: flex; flex-direction: column; gap: 8px; background: var(--white);
  border: 1px solid var(--border-subtle); border-radius: 10px; padding: 22px 22px 46px; position: relative;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.acad-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -20px rgba(33,16,47,.4); border-color: var(--border-default); }
.acad-card__cat { font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-700); }
.acad-card__t { font-size: 17px; font-weight: 500; line-height: 1.3; color: var(--text-strong); }
.acad-card__d { font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.acad-card__go { position: absolute; right: 20px; bottom: 16px; font-size: 22px; color: var(--purple-400); transition: transform .2s var(--ease), color .2s var(--ease); }
.acad-card:hover .acad-card__go { transform: translateX(3px); color: var(--gold-600); }

/* ---------------- hub ---------------- */
.acad-hubhero { background: var(--purple-900); color: var(--soft-white); position: relative; overflow: hidden; }
.acad-hubhero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 85% 10%, rgba(190,177,78,.14), transparent 55%);
}
.acad-hubhero__in { max-width: 1180px; margin: 0 auto; padding: clamp(48px, 8vw, 96px) var(--acad-gutter); position: relative; z-index: 1; max-width: 1180px; }
.acad-hubhero h1 {
  font-size: clamp(32px, 5vw, 58px); font-weight: 300; line-height: 1.06; letter-spacing: -0.015em;
  margin: 0 0 20px; max-width: 18ch; text-wrap: balance;
}
.acad-hubhero__dek { font-size: clamp(16px, 2vw, 20px); font-weight: 300; line-height: 1.55; color: var(--text-on-dark-muted); max-width: 60ch; margin: 0; }
.acad-hub__body { max-width: 1180px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) var(--acad-gutter) 20px; }
.acad-hubgrp { margin-bottom: 52px; }
.acad-hubgrp__h {
  font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-700);
  margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border-subtle);
}

/* ---------------- footer ---------------- */
.acad-foot { background: var(--purple-950); color: var(--text-on-dark-muted); margin-top: 72px; }
.acad-foot__in { max-width: 1180px; margin: 0 auto; padding: 40px var(--acad-gutter); display: flex; flex-direction: column; gap: 16px; }
.acad-foot__disc { font-size: 12.5px; line-height: 1.55; color: var(--text-on-dark-muted); margin: 0; max-width: 70ch; opacity: .8; }
.acad-foot__links { display: flex; gap: 22px; }
.acad-foot__links a { font-size: 13px; color: var(--soft-white); }
.acad-foot__links a:hover { color: var(--gold-400); }
.acad-foot__copy { font-size: 11.5px; color: var(--text-on-dark-muted); opacity: .65; margin: 0; letter-spacing: .02em; }

/* ---------------- responsive ---------------- */
@media (max-width: 920px) {
  .acad-art__body { grid-template-columns: 1fr; gap: 0; }
  .acad-art__aside { display: none; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .acad-top__in { flex-wrap: wrap; gap: 10px 16px; padding: 12px var(--acad-gutter); }
  .acad-top__nav { gap: 14px; width: 100%; justify-content: space-between; }
  .acad-art__main p, .acad-art__main li { font-size: 16px; }
  .acad-cta__in { padding: 24px; }
}
