/* Shared Afterglow styles for LORE's secondary pages (legal, support, sign-in). The landing page inlines its own. */
@font-face { font-family: "LORE Poster"; src: url("/assets/fonts/BricolageGrotesque-Poster.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "LORE Title"; src: url("/assets/fonts/BricolageGrotesque-Title.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "LORE Heading"; src: url("/assets/fonts/BricolageGrotesque-Heading.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --ink: #0C0A12;
  --surface: #17131F;
  --raised: #231D2D;
  --line: #342B40;
  --chalk: #FAF7FF;
  --fog: #A89FB8;
  --dim: #6F6682;
  --drop-quote: #FFD43B;
  --signal-flame: #FF8A1F;
  --signal-energy: #3EE8A5;
  --signal-danger: #FF3B30;
  --gradient-spectrum: linear-gradient(90deg, #4D7BFF 0%, #45DDF2 20%, #3EE8A5 40%, #FFD43B 60%, #FF5277 80%, #A974FF 100%);
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-press: cubic-bezier(.2, .8, .2, 1);
  --gutter: 24px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ink); scroll-behavior: smooth; }
body { min-height: 100dvh; display: flex; flex-direction: column; margin: 0; background: var(--ink); color: var(--chalk); font: 16px/24px var(--text); text-wrap: pretty; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: var(--fog); }
:focus-visible { outline: 2px solid var(--chalk); outline-offset: 2px; }
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: fixed; z-index: 100; top: 8px; left: 16px; padding: 12px 16px; border-radius: 12px; color: var(--ink); background: var(--chalk); font-weight: 600; transform: translateY(-80px); }
.skip:focus { transform: none; }
.wrap { width: min(1200px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.label { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.muted { color: var(--fog); }

/* Buttons */
.btn, .button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; border: 0; border-radius: 12px; color: var(--chalk); background: var(--raised); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 0 0 1px var(--line); font-size: 16px; font-weight: 600; white-space: nowrap; text-decoration: none; transition: transform 120ms var(--ease-press), opacity 120ms var(--ease-press), background-color 200ms var(--ease); }
.btn-primary, .button { color: var(--ink); background: var(--chalk); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn:hover { color: var(--chalk); background: #2C2538; }
.btn-primary:hover, .button:hover { color: var(--ink); background: #FFFFFF; }
.btn:active, .button:active { transform: scale(.98); opacity: .88; }

/* Top bar */
.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { position: relative; display: inline-block; font: 800 30px/1 "LORE Poster", sans-serif; letter-spacing: -.5px; text-decoration: none; }
.wordmark::after { content: ""; position: absolute; right: 0; bottom: -6px; left: 0; height: 3px; border-radius: 999px; background: var(--gradient-spectrum); }
.wordmark:hover { color: var(--chalk); }
.topbar .btn { min-height: 44px; padding-inline: 16px; font-size: 14px; }

/* Document pages */
main { flex: 1; }
.doc-head { padding-block: 64px 48px; }
.doc-head h1 { max-width: 880px; margin: 12px 0 0; font: 800 60px/1 "LORE Title", sans-serif; letter-spacing: -.015em; text-transform: uppercase; text-wrap: balance; }
.doc-head .lede { max-width: 680px; margin: 16px 0 0; color: var(--fog); font-size: 18px; line-height: 28px; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 24px 0 0; color: var(--fog); font-size: 14px; line-height: 20px; }
.notice { max-width: 760px; margin: 24px 0 0; padding: 12px 16px; border-radius: 12px; color: var(--signal-flame); background: color-mix(in srgb, var(--signal-flame) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--signal-flame) 40%, transparent); font-size: 14px; line-height: 20px; }
.todo { padding: 0 4px; border-radius: 4px; color: var(--ink); background: var(--drop-quote); font-weight: 600; }

.doc-grid { display: grid; grid-template-columns: 240px minmax(0, 760px); gap: 64px; padding-bottom: 96px; }
.toc { position: sticky; top: 24px; align-self: start; max-height: calc(100dvh - 48px); overflow-y: auto; }
.toc ol { display: grid; gap: 2px; margin: 12px 0 0; padding: 0; list-style: none; counter-reset: toc; }
.toc a { display: flex; gap: 8px; padding: 6px 0; color: var(--fog); font-size: 14px; line-height: 20px; text-decoration: none; }
.toc a::before { counter-increment: toc; content: counter(toc); min-width: 20px; color: var(--dim); font-variant-numeric: tabular-nums; }
.toc a:hover, .toc a[aria-current="true"] { color: var(--chalk); }

.prose { min-width: 0; counter-reset: section; }
.prose > section { padding-top: 16px; scroll-margin-top: 24px; }
.prose > section + section { margin-top: 40px; }
.prose h2 { display: flex; gap: 12px; margin: 0 0 16px; font: 700 30px/36px "LORE Heading", sans-serif; letter-spacing: -.01em; text-wrap: balance; }
.prose.numbered > section > h2::before { counter-increment: section; content: counter(section); color: var(--dim); font-variant-numeric: tabular-nums; }
.prose h3 { margin: 24px 0 8px; font: 700 20px/28px "LORE Heading", sans-serif; }
.prose p, .prose li { color: #D9D3E4; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { display: grid; gap: 8px; margin: 0 0 16px; padding-left: 24px; }
.prose li::marker { color: var(--dim); }
.prose strong { color: var(--chalk); }
.prose a { color: var(--chalk); }

.summary { margin: 0 0 48px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.summary h2 { margin: 0 0 12px; font: 700 20px/28px "LORE Heading", sans-serif; }
.summary ul { display: grid; gap: 8px; margin: 0; padding-left: 20px; }
.summary li { color: #D9D3E4; }
.summary p { margin: 16px 0 0; color: var(--fog); font-size: 14px; line-height: 20px; }

.conspicuous { margin: 0 0 16px; padding: 20px 24px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--chalk); }
.conspicuous p, .conspicuous li { color: var(--chalk); font-weight: 600; }
.conspicuous p:last-child, .conspicuous ul:last-child { margin-bottom: 0; }
.summary.conspicuous p { margin: 0; font-size: 16px; line-height: 24px; }

.table-scroll { margin: 0 0 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; line-height: 20px; }
th, td { padding: 12px 16px; text-align: left; vertical-align: top; }
th { color: var(--fog); background: var(--surface); font-weight: 600; }
td { color: #D9D3E4; }
tr + tr td { border-top: 1px solid var(--line); }
td:first-child { color: var(--chalk); font-weight: 600; }

/* Cards for support-style pages */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-bottom: 64px; }
.card { display: flex; flex-direction: column; gap: 12px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.card .icon { color: var(--fog); }
.card h2 { margin: 0; font: 700 24px/32px "LORE Heading", sans-serif; }
.card p { margin: 0; color: var(--fog); }
.card ol, .card ul { display: grid; gap: 6px; margin: 0; padding-left: 20px; color: #D9D3E4; }
.card .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.card .links .btn { min-height: 44px; font-size: 14px; }
.card.alert { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--signal-danger) 55%, transparent); }
.card.alert .icon { color: var(--signal-danger); }

/* Centered single-message pages (sign-in handoff) */
.center { min-height: 100dvh; display: grid; place-items: center; padding: 24px; text-align: center; }
.center > div { max-width: 420px; display: grid; justify-items: center; gap: 16px; }
.center h1 { margin: 16px 0 0; font: 800 36px/40px "LORE Title", sans-serif; letter-spacing: -.015em; text-transform: uppercase; text-wrap: balance; }
.center p { margin: 0; color: var(--fog); }
.center img { width: 200px; }

/* Footer */
.footer { padding-block: 48px; border-top: 1px solid var(--line); }
.footer-top, .footer-bottom { display: flex; justify-content: space-between; gap: 24px; }
.footer-top p { margin: 16px 0 0; color: var(--fog); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 24px; }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; }
.footer-links a[aria-current="page"] { color: var(--fog); text-decoration: none; }
.footer-bottom { margin-top: 32px; color: var(--fog); font-size: 14px; }

@media (max-width: 1023px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .toc { position: static; max-height: none; padding: 20px 24px; border: 1px solid var(--line); border-radius: 20px; }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
}

@media (max-width: 767px) {
  :root { --gutter: 16px; }
  .topbar-inner { height: 64px; }
  .doc-head { padding-block: 40px 32px; }
  .doc-head h1 { font-size: 36px; line-height: 40px; }
  .doc-head .lede { font-size: 16px; line-height: 24px; }
  .doc-grid { padding-bottom: 64px; }
  .toc ol { grid-template-columns: minmax(0, 1fr); }
  .prose h2 { font-size: 24px; line-height: 32px; }
  .summary, .conspicuous { padding: 20px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .footer-top, .footer-bottom { flex-direction: column; }
  .footer-links { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .button { transition: opacity 150ms; }
  .btn:active, .button:active { transform: none; }
}
