/* ============================================================
   Cōrta — Content Hub layout (getcorta.app/learn/)
   Builds on the "Aurora" design tokens in corta.css.
   Long-form reading surface: site nav, breadcrumbs, prose,
   article cards, callouts, FAQ, sources, footer.
   ============================================================ */

html {
  scroll-behavior: smooth;
  min-height: 100%;
  /* Wallpaper lives on the root element so it always covers the full page
     height (the root background is propagated to the canvas). Fixes dark-mode
     light-on-light: corta.css caps <body> at viewport height and its
     [data-theme="night"] html selector can't match the root, so lower content
     was landing on the light <html> background. */
  background:
    radial-gradient(120% 60% at 50% -8%, color-mix(in oklab, var(--calm) 16%, transparent), transparent 60%),
    var(--wallpaper);
}
body {
  min-height: 100%;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
}
/* corta.css paints a solid night color on <body>; override so the root
   wallpaper shows through consistently on every page in dark mode. */
[data-theme="night"] body { background: transparent; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.container { max-width: 760px; margin: 0 auto; padding: 0 22px; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--surface); color: var(--fg);
  padding: 10px 16px; border-radius: 0 0 12px 0; box-shadow: var(--shadow); }
.skip-link:focus { left: 0; }

/* ---------- site navigation ---------- */
.sitenav { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  background: color-mix(in oklab, var(--bg) 80%, transparent); border-bottom: 1px solid var(--hairline); }
.sitenav .inner { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 16px; }
.sitenav .wm { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -0.03em; color: var(--fg); }
.sitenav .wm:hover { text-decoration: none; }
.sitenav .links { display: flex; gap: 4px; align-items: center; }
.sitenav .links a { color: var(--muted); font-weight: 600; font-size: 14.5px; padding: 8px 12px; border-radius: 10px; transition: .15s; }
.sitenav .links a:hover { color: var(--fg); background: color-mix(in oklab, var(--fg) 6%, transparent); text-decoration: none; }
.sitenav .links a[aria-current="page"] { color: var(--accent-ink); }
.sitenav .right { display: flex; gap: 10px; align-items: center; }
.nav-cta { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 999px; font-weight: 700;
  font-size: 14px; background: var(--ink); color: var(--ink-on); border: none; transition: .16s; }
.nav-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.nav-toggle { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--fg); cursor: pointer; place-items: center; }

@media (max-width: 860px) {
  .sitenav .links { position: fixed; inset: 62px 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 18px 20px; background: var(--bg); border-bottom: 1px solid var(--hairline); box-shadow: var(--shadow-lift);
    transform: translateY(-140%); transition: transform .26s cubic-bezier(.2,.7,.2,1); }
  .sitenav.open .links { transform: translateY(0); }
  .sitenav .links a { padding: 13px 14px; font-size: 16px; }
  .nav-toggle { display: grid; }
  .nav-cta.hide-sm { display: none; }
}

/* ---------- page hero (hub + category + article header) ---------- */
main { display: block; padding-bottom: 40px; }
.pagehead { padding: 40px 0 8px; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-ink); font-weight: 600; }
.pagehead h1 { font-size: clamp(30px, 5.4vw, 46px); line-height: 1.04; margin: 12px 0 0; }
.pagehead .dek { color: var(--muted); font-size: 18px; max-width: 62ch; margin-top: 14px; line-height: 1.55; text-wrap: pretty; }

/* ---------- breadcrumbs ---------- */
.crumbs { font-family: var(--font-mono); font-size: 12px; color: var(--faint); padding: 22px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--accent-ink); }
.crumbs .sep { color: var(--faint); opacity: .6; }

/* ---------- article prose ---------- */
article.prose { padding: 4px 0 8px; }
.prose > * + * { margin-top: 20px; }
.prose h2 { font-size: clamp(23px, 3.6vw, 30px); line-height: 1.15; margin-top: 44px; scroll-margin-top: 84px; }
.prose h3 { font-size: 20px; line-height: 1.25; margin-top: 30px; scroll-margin-top: 84px; }
.prose p { color: var(--fg); }
.prose p, .prose li { font-size: 17.5px; }
.prose strong { font-weight: 700; }
.prose a { color: var(--accent-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: color-mix(in oklab, var(--accent) 40%, transparent); }
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 8px; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 26px; }
.prose ul > li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); }
.prose ol { padding-left: 1.4em; } .prose ol > li { padding-left: 4px; }
.prose blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 20px; margin-left: 0; color: var(--muted); font-style: italic; }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.prose img { max-width: 100%; height: auto; border-radius: var(--r-md); }
.prose hr { border: none; border-top: 1px solid var(--hairline); margin: 32px 0; }

/* lede / intro paragraph */
.prose .lede { font-size: 20px; line-height: 1.55; color: var(--fg); }

/* TL;DR / direct-answer box (AISO: AI extracts this for inline answers) */
.tldr { background: var(--card-grad); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--r-md); padding: 18px 20px; box-shadow: var(--shadow); margin-top: 8px; }
.tldr .k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); font-weight: 600; }
.tldr p { margin-top: 8px; font-size: 17px; color: var(--fg); }

/* data / stat tables */
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; display: block; overflow-x: auto; }
.prose table th, .prose table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--hairline); }
.prose table thead th { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); }
.prose table tbody tr:hover { background: color-mix(in oklab, var(--fg) 3%, transparent); }

/* ---------- callout: "Cōrta Can Help" (soft CTA) ---------- */
.callout { margin-top: 40px; border-radius: var(--r-xl); padding: 26px 28px; overflow: hidden; position: relative;
  color: #fff; box-shadow: var(--shadow-lift);
  background: radial-gradient(120% 130% at 12% 0%, oklch(78% 0.15 60), transparent 55%),
              linear-gradient(135deg, oklch(46% 0.13 42), oklch(30% 0.10 285)); }
[data-theme="night"] .callout { background: radial-gradient(140% 130% at 10% 0%, oklch(50% 0.12 50), transparent 52%),
              linear-gradient(150deg, oklch(28% 0.09 285), oklch(19% 0.06 270)); }
.callout .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .85; font-weight: 600; }
.callout h2 { color: #fff; font-size: 25px; margin: 8px 0 0; }
.callout p { color: rgba(255,255,255,.9); font-size: 16px; margin-top: 10px; max-width: 54ch; }
.callout .btnrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.callout .cbtn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-weight: 700;
  font-size: 14.5px; background: #fff; color: oklch(30% 0.10 285); transition: .16s; }
.callout .cbtn:hover { transform: translateY(-2px); text-decoration: none; box-shadow: 0 12px 30px -12px rgba(0,0,0,.5); }
.callout .cbtn.line { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.5); }

/* ---------- key takeaways ---------- */
.takeaways { margin-top: 40px; background: var(--card-grad); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 22px 24px; box-shadow: var(--shadow); }
.takeaways h2 { margin-top: 0; font-size: 20px; }
.takeaways ul { margin-top: 14px; }

/* ---------- FAQ (AISO: FAQPage schema pairs with this) ---------- */
.faq { margin-top: 20px; }
.faq details { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card-grad); box-shadow: var(--shadow); overflow: hidden; }
.faq details + details { margin-top: 10px; }
.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 700; font-size: 16.5px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); font-size: 22px; color: var(--accent); transition: .2s; line-height: 1; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .fa { padding: 0 20px 18px; color: var(--muted); font-size: 16px; }
.faq .fa > * + * { margin-top: 12px; }

/* ---------- sources ---------- */
.sources { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--hairline); }
.sources h2 { font-size: 18px; margin-top: 0; }
.sources ol { margin-top: 12px; padding-left: 1.3em; }
.sources li { font-size: 14.5px; color: var(--muted); }
.sources li + li { margin-top: 8px; }
.sources a { word-break: break-word; }

/* medical disclaimer */
.disclaimer { margin-top: 28px; font-size: 13px; color: var(--faint); font-style: italic; line-height: 1.5; }

/* byline / meta */
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 20px; font-family: var(--font-mono);
  font-size: 12px; color: var(--faint); }
.byline .rt::before { content: "·"; margin-right: 14px; color: var(--faint); }

/* ---------- related / cross-links ---------- */
.related { margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--hairline); }
.related h2 { font-size: 20px; }

/* ---------- article card grid (hubs + category pages + related) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 22px; }
a.acard { display: flex; flex-direction: column; background: var(--card-grad); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); transition: .18s; color: var(--fg); }
a.acard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); text-decoration: none; border-color: color-mix(in oklab, var(--accent) 30%, var(--border)); }
a.acard .tag { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); font-weight: 600; }
a.acard h3 { font-size: 18.5px; line-height: 1.25; margin-top: 10px; }
a.acard p { color: var(--muted); font-size: 14.5px; margin-top: 8px; line-height: 1.5; flex: 1; }
a.acard .more { margin-top: 14px; font-weight: 700; font-size: 13.5px; color: var(--accent-ink); display: inline-flex; align-items: center; gap: 6px; }
a.acard:hover .more { gap: 9px; }

/* category tiles (learn hub) */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 24px; }
a.cat { display: block; background: var(--card-grad); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 24px; box-shadow: var(--shadow); transition: .18s; color: var(--fg); }
a.cat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); text-decoration: none; }
a.cat .ci { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--calm-soft); color: var(--calm); margin-bottom: 14px; }
a.cat h2 { font-size: 21px; } a.cat p { color: var(--muted); font-size: 14.5px; margin-top: 8px; }
a.cat .count { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); margin-top: 14px; display: block; }

/* ---------- section titles ---------- */
.sec-head { margin-top: 48px; }
.sec-head h2 { font-size: 26px; }
.sec-head p { color: var(--muted); margin-top: 6px; }

/* ---------- footer ---------- */
.sitefoot { border-top: 1px solid var(--hairline); margin-top: 64px; padding: 44px 0 56px;
  background: color-mix(in oklab, var(--bg) 60%, transparent); }
.footgrid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 30px 24px; }
.footgrid .brand .wm { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -0.03em; }
.footgrid .brand p { color: var(--muted); font-size: 14px; margin-top: 10px; max-width: 30ch; }
.footcol h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.footcol ul { list-style: none; margin-top: 12px; }
.footcol li + li { margin-top: 9px; }
.footcol a { color: var(--muted); font-size: 14px; } .footcol a:hover { color: var(--accent-ink); }
.footbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--hairline); }
.footbar .meta { font-size: 12.5px; color: var(--faint); }
.footbar .chips-lite { display: flex; gap: 8px; flex-wrap: wrap; }
.footbar .chips-lite span { font-family: var(--font-mono); font-size: 10.5px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); }
@media (max-width: 780px) { .footgrid { grid-template-columns: 1fr 1fr; } .footgrid .brand { grid-column: 1 / -1; } }
@media (max-width: 460px) { .footgrid { grid-template-columns: 1fr; } }

/* ---------- app CTA buttons (store badges as text pills) ---------- */
.storebtns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.store { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 14px; background: var(--ink);
  color: var(--ink-on); font-weight: 700; transition: .16s; }
.store:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); text-decoration: none; }
.store small { display: block; font-size: 10px; font-weight: 600; opacity: .7; letter-spacing: .04em; }
.store b { font-size: 15px; }

/* Official App Store / Google Play badge lockups (per Apple + Google brand guidelines).
   Always-black badge with a light hairline so it reads on both day and night footers. */
.store.apple, .store.gplay {
  gap: 12px; height: 56px; padding: 0 20px; border-radius: 11px;
  background: #000; color: #fff; border: 1px solid rgba(255,255,255,.32); font-weight: 400;
}
[data-theme="night"] .store.apple, [data-theme="night"] .store.gplay { border-color: rgba(255,255,255,.42); }
.store.apple .storelogo { flex: none; width: 30px; height: 30px; }
.store.gplay .storelogo { flex: none; width: 28px; height: 28px; }
.store .lockup { display: flex; flex-direction: column; justify-content: center; line-height: 1.05; text-align: left; }
.store .s1 { font-size: 11px; font-weight: 500; letter-spacing: .01em;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.store .s2 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; margin-top: 1px;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.store.gplay .s1 { text-transform: uppercase; letter-spacing: .1em; font-size: 9.5px; }

/* theme toggle (reuse .toggle from corta.css) */
.toggle { width: 52px; height: 30px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); position: relative; cursor: pointer; flex: none; }
.toggle .kn { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; transition: .28s cubic-bezier(.3,.8,.3,1); color: var(--accent); }
[data-theme="night"] .toggle { background: color-mix(in oklab, var(--calm) 34%, var(--surface-2)); }
[data-theme="night"] .toggle .kn { transform: translateX(22px); color: var(--calm); }

/* 404 + generic centered page */
.centered { text-align: center; padding: 80px 0; }
.centered .big { font-family: var(--font-display); font-weight: 800; font-size: clamp(70px,16vw,140px); line-height: .9; letter-spacing: -0.05em;
  background: linear-gradient(120deg, var(--accent), var(--calm)); -webkit-background-clip: text; background-clip: text; color: transparent; }
