/* Libra entry page. Loads tokens.css first, like every page; nothing token-like is redefined here.
   Self-hosted assets only, so a page load never discloses a visitor to a third party and the strict
   CSP stays intact.

   The look is deliberately plain: black paper, a book face for reading, hairline rules, one real
   figure. No glow, no gradient wash, no animated decoration, no letter-spaced capitals shouting a
   slogan. A lab's own page, not a template. */
body {
  display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden;
  font-size: 15px;
}
a { color: var(--accent-soft); text-decoration: underline; text-decoration-color: rgba(103, 232, 249, .35); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

/* ---- top bar ---- */
/* The word mark sits 24px down and 20px in: exactly where the workbench rail puts it, so it does not
   jump between pages. The row is top-aligned so the buttons on the right cannot push it off that line. */
/* 2026-10-19: the same bar as the workbench (54px, 20px in, centred), so the mark does not move between pages. */
.topbar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 54px; box-sizing: border-box; padding: 0 clamp(16px, 4vw, 44px) 0 20px; border-bottom: 1px solid var(--line-soft, var(--line)); }
.topbar .account-chip { padding-block: 0; }
.topbar .brand { text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.auth-actions { display: flex; gap: 8px; }
.topbar .primary-button, .topbar .ghost-button { padding: 6px 13px; font-size: 13px; }
.status-pill { font-size: 12px; }
.account-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px;
  border: 1px solid var(--line-soft); border-radius: var(--radius-pill); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--text-soft); color: #05080d; font-weight: 700; font-size: 13px; text-transform: uppercase; }
.account-meta { display: flex; flex-direction: column; line-height: 1.25; }
.account-meta strong { font-size: 13px; color: var(--text-strong); }
.account-meta small { font-size: 11px; color: var(--faint); }

/* ---- page frame ---- */
main { position: relative; z-index: 1; flex: 1; width: 100%; max-width: 1120px; margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 44px); }

/* ---- cover: text on the left, a figure on the right ---- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(28px, 5vw, 64px);
  align-items: center; padding: clamp(32px, 7vh, 88px) 0 clamp(40px, 8vh, 96px); }
.kicker { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 4.6vw, 52px); line-height: 1.08;
  letter-spacing: -0.01em; color: var(--text-strong); margin: 0; text-wrap: balance; }
.lede { font-family: var(--serif); font-size: 19px; line-height: 1.55; color: var(--text-soft); margin: 20px 0 0; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.primary-button.large, .ghost-button.large { padding: 11px 18px; font-size: 15px; }
.note { margin: 16px 0 0; font-size: 13px; color: var(--faint); max-width: 36em; }

.hero-figure { margin: 0; }
.fig-spectrum { display: block; width: 100%; height: auto; }
.fig-axis { stroke: var(--line); stroke-width: 1; }
.fig-tick { fill: var(--faint); font-size: 11px; text-anchor: middle; font-family: var(--body); }
.fig-label { fill: var(--muted); font-size: 12px; text-anchor: middle; font-family: var(--body); }
.fig-trace { fill: none; stroke: var(--text-soft); stroke-width: 1.3; stroke-linejoin: round; }
.fig-tick-host, .fig-tick-inc, .fig-tick-odd { stroke-width: 1.2; }
.fig-tick-host { stroke: var(--muted); }
.fig-tick-inc { stroke: var(--accent); }
.fig-tick-odd { stroke: var(--unexplained); }
.fig-peak { font-size: 11px; text-anchor: middle; font-family: var(--body); font-weight: 600; }
.fig-peak-host { fill: var(--muted); }
.fig-peak-inc { fill: var(--accent-soft); }
.fig-peak-odd { fill: var(--unexplained); }
figcaption { margin-top: 10px; font-family: var(--serif); font-size: 14px; line-height: 1.55; color: var(--muted); }
.fig-no { font-family: var(--body); font-weight: 700; color: var(--text); margin-right: 4px; }
.key::before { content: ''; display: inline-block; width: 12px; height: 2px; margin: 0 5px 3px 0; vertical-align: middle; }
.key-host::before { background: var(--muted); }
.key-inc::before { background: var(--accent); }
.key-odd::before { background: var(--unexplained); }

/* ---- the reading part below the cover: a label on the left, prose on the right ---- */
.about { border-top: 1px solid var(--line); padding-bottom: 48px; }
.row { display: grid; grid-template-columns: minmax(160px, 240px) minmax(0, 1fr); gap: 16px clamp(24px, 5vw, 64px);
  padding: 34px 0; border-bottom: 1px solid var(--line-soft); }
.row h2 { font-family: var(--serif); font-weight: 600; font-size: 21px; line-height: 1.3; color: var(--text-strong); margin: 0; }
.row p, .row li, .row dd { font-family: var(--serif); font-size: 17px; line-height: 1.6; color: var(--text); max-width: 40em; }
.row p { margin: 0; }
.row .primary-button { margin-top: 18px; }
.module-list { margin: 0; }
.module-list > div { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 4px 24px; padding: 12px 0;
  border-top: 1px solid var(--line-soft); }
.module-list > div:first-child { border-top: 0; padding-top: 0; }
.module-list dt { font-weight: 650; color: var(--text-strong); font-size: 15px; padding-top: 3px; }
.module-list dd { margin: 0; }
.plain-list { margin: 0; padding-left: 1.1em; }
.plain-list li { margin: 0 0 8px; padding-left: 4px; }
.plain-list li::marker { color: var(--faint); }
.aside { margin-top: 14px !important; font-family: var(--body) !important; font-size: 14px !important; color: var(--muted) !important; }

/* ---- modules, for someone already signed in ---- */
.modules { padding: clamp(28px, 6vh, 64px) 0 48px; }
.modules-head { margin-bottom: 22px; }
.modules-head h2 { font-family: var(--serif); font-weight: 600; font-size: 30px; color: var(--text-strong); margin: 0; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.module-card { display: flex; flex-direction: column; text-decoration: none; color: inherit;
  padding: 20px 22px 18px 0; border-bottom: 1px solid var(--line-soft); }
.module-grid .module-card + .module-card { padding-left: 22px; border-left: 1px solid var(--line-soft); }
a.module-card:hover h3 { color: var(--accent-soft); }
.module-tag { font-size: 12px; font-weight: 600; color: var(--muted); }
.module-card h3 { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--text-strong); margin: 6px 0 8px; }
.module-card p { margin: 0 0 8px; font-size: 14px; color: var(--text-soft); }
.module-card .detail { font-size: 13px; color: var(--muted); }
.module-foot { margin-top: auto; padding-top: 12px; font-size: 13px; color: var(--faint); }
.module-open { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-soft); font-weight: 600; }
.module-card.soon { opacity: .7; }
.module-state { display: inline-flex; align-items: center; gap: 6px; }
#modules-count:empty { display: none; }

/* ---- log in / sign up: one dialog, centred on the page ---- */
.auth-dialog { width: min(440px, calc(100vw - 32px)); padding: 22px 24px 18px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--panel-solid); color: var(--text); z-index: 20; }
.auth-dialog::backdrop { background: rgba(0, 0, 0, .66); }
.auth-head { display: flex; align-items: center; justify-content: space-between; }
.auth-head h2 { font-family: var(--serif); font-weight: 600; font-size: 24px; color: var(--text-strong); margin: 0; }
.ghost-button.close { border: 0; font-size: 22px; line-height: 1; padding: 4px 8px; color: var(--muted); }
.auth-tabs { display: flex; gap: 22px; margin: 14px 0 0; border-bottom: 1px solid var(--line-soft); }
.auth-tabs button { border: 0; background: none; padding: 8px 0; margin-bottom: -1px; color: var(--muted);
  font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; }
.auth-tabs button[aria-selected='true'] { color: var(--text-strong); border-bottom-color: var(--accent); }
.auth-intro { margin: 14px 0 16px; font-size: 14px; color: var(--text-soft); }
.auth-intro:empty { display: none; }
.auth-panel .field { margin-bottom: 12px; }
.google-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 10px 16px; border: 1px solid #dadce0; border-radius: var(--radius-xs);
  background: #fff; color: #1f2937; font-weight: 600; font-size: 14px; }
.google-button .icon { width: 18px; height: 18px; }
.google-button:hover:not(:disabled) { background: #f1f5f9; }
.divider { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: var(--faint); font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.fine-print { font-size: 12px; line-height: 1.6; color: var(--faint); margin: 10px 0 0; }
.form-error:empty { min-height: 0; }
.ghost-button.wide { width: 100%; margin-top: 4px; padding: 10px 16px; }

/* ---- footer ---- */
.site-footer { position: relative; z-index: 1; padding: 20px clamp(16px, 4vw, 44px) 28px; border-top: 1px solid var(--line-soft); }
.site-footer nav { max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { color: var(--muted); font-size: 13px; text-decoration: none; }
.site-footer a:hover { color: var(--text-strong); }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .row, .module-list > div { grid-template-columns: minmax(0, 1fr); }
  .module-grid .module-card + .module-card { padding-left: 0; border-left: 0; }
}
@media (max-width: 520px) {
  .topbar { flex-wrap: wrap; }
  .status-pill { display: none; }
  .lede { font-size: 17px; }
  .hero-actions > * { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Signed in (marked by the server on <body>): the module list from the first paint, never the cover. */
body.signed-in #hero, body.signed-in #about, body.signed-in #auth-actions { display: none !important; }
body.signed-in #modules { display: block !important; }
