/* ==========================================================================
   Crown — /learn article styling.

   Self-contained (does not import legal.css) but shares its tokens verbatim so
   the three surfaces — lander, legal, learn — read as one site.

   Follows DESIGN.md: hairline rules instead of cards, tick marks as structural
   ornament, tabular figures wherever a number appears, one continuous gold as
   the only chromatic event, near-black ground. No translucent blurred card
   stacks, no glow shadows, no gradient-filled text.
   ========================================================================== */

:root {
  --bg: #0A0A0C;
  --bg-raised: #111014;
  --gold: #F5C242;
  --gold-deep: #C08A2A;
  --ink: rgba(255, 255, 255, 0.88);
  /* Quiet-text floor. White at 45% alpha tops out at 4.41:1 on pure black and
     can never reach AA for normal-size text, so 60% is the lowest we use for
     text. Anything quieter is non-text decoration only. */
  --ink-60: rgba(255, 255, 255, 0.6);
  --rule: rgba(255, 255, 255, 0.1);
  --rule-strong: rgba(255, 255, 255, 0.2);
  --tick: rgba(245, 194, 66, 0.55);
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 50% -5%, rgba(245, 194, 66, 0.06), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 3.5rem) clamp(1.25rem, 5vw, 2rem) 5rem;
}

/* ---------- Masthead ---------- */

.brand {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  text-transform: lowercase;
}
.brand::after {
  content: '';
  display: block;
  width: 32px;
  height: 3px;
  margin-top: 6px;
  background: var(--gold);
  border-radius: 3px;
}

/* Breadcrumb. Mirrored in BreadcrumbList JSON-LD on every article page. */
.crumbs {
  margin: 1.5rem 0 2rem;
  font-size: 0.82rem;
  color: var(--ink-60);
}
.crumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.crumbs li { margin: 0; }
.crumbs li + li::before {
  content: '/';
  margin-right: 0.5rem;
  color: rgba(255, 255, 255, 0.28);
}
.crumbs a { color: var(--ink-60); }
.crumbs [aria-current='page'] { color: var(--ink); }

/* ---------- Type ---------- */

.kicker {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
/* A real tick, not a bullet: 1.5px so a major mark is legible on its own. */
.kicker::before {
  content: '';
  flex: none;
  width: 14px;
  height: 1.5px;
  background: var(--gold);
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 5.5vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.meta {
  color: var(--ink-60);
  font-size: 0.85rem;
  margin: 0 0 2rem;
}

.lede {
  font-size: 1.12rem;
  color: var(--ink);
  font-weight: 500;
  padding: 1.1rem 1.25rem;
  border-left: 3px solid var(--gold);
  background: rgba(245, 194, 66, 0.05);
  border-radius: 0 12px 12px 0;
  margin: 0 0 2.5rem;
}

h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 3.6vw, 1.35rem);
  line-height: 1.25;
  color: #fff;
  /* More space above a heading than below it. */
  margin: 3rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  text-wrap: balance;
}

h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: #fff;
  margin: 2rem 0 0.5rem;
  text-wrap: balance;
}

p { margin: 0 0 1rem; }
strong { color: #fff; font-weight: 600; }

ul, ol { padding-left: 1.25rem; margin: 0 0 1.25rem; }
li { margin-bottom: 0.6rem; }
li::marker { color: var(--gold); }

a { color: var(--gold); text-decoration: none; }
/* WCAG SC 1.4.1: gold on body ink measures ~1.3:1, far under the 3:1 that
   would let colour alone carry the distinction, so links inside prose carry a
   persistent underline. Standalone wordmarks and nav rows are exempt. */
p a, li a, td a, th a, dd a, footer a, .callout a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------- Registers (rules, never cards) ---------- */

/* A bounded register: 1px rule, no fill, no blur, no glow. Used where content
   genuinely needs a boundary — the limits box, the "what this is not" box. */
.callout {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold-deep);
  padding: 1.1rem 1.25rem 0.35rem;
  margin: 2rem 0;
  background: rgba(255, 255, 255, 0.02);
}
.callout > :first-child { margin-top: 0; }
.callout h3 {
  margin-top: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Ruled register: the standard way to lay out label/value or step/detail rows.
   Hairlines and space do the grouping. */
.reg {
  margin: 1.5rem 0 2rem;
  border-top: 1px solid var(--rule);
}
.reg-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.25rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.reg-key {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  /* Every number that can change is tabular. */
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}
.reg-val { margin: 0; }
.reg-val p { margin: 0 0 0.4rem; }
.reg-val > :last-child { margin-bottom: 0; }

@media (max-width: 30rem) {
  .reg-row { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* Numeric bands / scale tables. */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 2rem;
  font-size: 0.94rem;
}
th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-60);
  padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--rule-strong);
  vertical-align: bottom;
}
td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th:last-child, td:last-child { padding-right: 0; }
/* Any column of figures reads tabular so the digits line up like an instrument. */
td.num, th.num, .num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  white-space: nowrap;
  color: #fff;
  font-weight: 600;
}

/* Tables are the one thing wide enough to overflow a 320px viewport. */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0 2rem;
}
.scroll-x table { margin: 0; }

/* ---------- Step list (capture guides) ---------- */

.steps { list-style: none; padding: 0; margin: 1.5rem 0 2rem; counter-reset: step; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.1rem 2.6rem;
  margin: 0 0 1.1rem;
  border-bottom: 1px solid var(--rule);
}
.steps > li:last-child { border-bottom: 0; margin-bottom: 0; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  border-bottom: 1.5px solid var(--tick);
  padding-bottom: 2px;
}
.steps h3 { margin: 0 0 0.35rem; }
.steps p { margin: 0 0 0.5rem; }
.steps > li > :last-child { margin-bottom: 0; }

/* ---------- FAQ (mirrored verbatim in FAQPage JSON-LD) ---------- */

.faq { margin: 1.5rem 0 2rem; border-top: 1px solid var(--rule); }
.faq > div { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.faq h3 { margin: 0 0 0.4rem; font-size: 0.98rem; }
.faq p { margin: 0; color: var(--ink); }

/* ---------- Index / related links ---------- */

.index-list { list-style: none; padding: 0; margin: 1.5rem 0 2rem; border-top: 1px solid var(--rule); }
.index-list > li { margin: 0; border-bottom: 1px solid var(--rule); }
.index-list a {
  display: block;
  padding: 1rem 0;
  text-decoration: none;
  color: var(--ink);
}
.index-list a:hover .index-title,
.index-list a:focus-visible .index-title { color: var(--gold); }
.index-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: #fff;
  margin-bottom: 0.2rem;
}
.index-desc { display: block; font-size: 0.92rem; color: var(--ink-60); line-height: 1.5; }

/* ---------- Call to action ---------- */

.cta-row {
  margin: 2.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.cta {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  border-radius: 22px;
  background: var(--gold);
  color: #0A0A0C;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}
.cta:hover { background: #ffd166; text-decoration: none; }
.cta-note { margin: 0.75rem 0 0; font-size: 0.85rem; color: var(--ink-60); }

/* ---------- Footer ---------- */

.disclaimer {
  margin: 2.5rem 0 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--rule);
  color: var(--ink-60);
  font-size: 0.88rem;
}
.disclaimer p { margin: 0; }

footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-60);
  font-size: 0.8rem;
}
footer a { color: var(--ink-60); }
footer nav { margin-bottom: 0.5rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
