/* apex.css -- layout for the front door at jdoner.me.
 *
 * Every colour, radius, width and font family here is a token from
 * assets/tokens-b.css, which is a byte copy of site/_shared/tokens-b.css in the
 * cs repo. No literal colour appears below, so a token change reaches this page
 * with no edit here.
 *
 * Light is the default because :root in the token file is the light theme and
 * nothing here sets data-theme. Setting data-theme="warm-dark" or
 * data-theme="cool-dark" on <html> switches the whole page, because every rule
 * below reads a token and never a fixed colour.
 *
 * No @font-face and no font host. The token font stacks name Newsreader, Inter
 * Tight and IBM Plex Mono first and fall back to system faces, so the page makes
 * zero network requests of any kind.
 *
 * Badges always carry a label beside a value. There is no bar anywhere on this
 * page, labeled or otherwise, and nothing counts down.
 */

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

code { font-family: var(--font-mono); }

h1, h2, h3, .eyebrow, .badge, .label, .status-word {
  font-family: var(--font-display);
}

h1 { font-size: 2.1rem; line-height: 1.15; margin: 0 0 0.75rem; letter-spacing: -0.015em; }
h2 { font-size: 0.82rem; letter-spacing: 0.07em; text-transform: uppercase; margin: 0 0 0.35rem; }
h3 { font-size: 1.1rem; margin: 0 0 0.4rem; letter-spacing: -0.005em; }

p { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.4rem; }
li { margin: 0 0 0.35rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.page {
  max-width: 52rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 5rem;
}

/* ---- head ---------------------------------------------------------------- */

.page-head { margin-bottom: 3rem; }

.lede {
  color: var(--muted);
  font-size: 1.12rem;
  margin-bottom: 1.5rem;
}

ul.page-notes {
  list-style: none;
  padding: 0.85rem 1.1rem;
  margin: 0;
  border: 1px solid var(--warning-line);
  border-radius: var(--radius);
  background: var(--warning-soft);
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text);
}
ul.page-notes li { margin: 0 0 0.35rem; }
ul.page-notes li:last-child { margin-bottom: 0; }

/* ---- section ------------------------------------------------------------- */

.section { margin-bottom: 3.25rem; }

.section h2 {
  color: var(--faint);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

/* The audience sentence always opens with "This is for you if", enforced by the
   generator, so it needs no separate label. */
.audience {
  color: var(--muted);
  font-size: 0.97rem;
  margin: 0.9rem 0 0.9rem;
}

.blurb { color: var(--muted); font-size: 0.97rem; }

.label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---- entries ------------------------------------------------------------- */

ul.entries { list-style: none; padding-left: 0; margin: 0; }

li.entry {
  padding: 1.35rem 1.5rem;
  margin-bottom: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-1);
}

/* A pending entry is visibly a different kind of thing: dashed, unfilled, and
   carrying no link at all. The generator cannot emit an anchor for one. */
li.entry.pending {
  background: none;
  border-style: dashed;
}
li.entry.pending h3 { color: var(--muted); }

.entry-title a { text-decoration: none; }
.entry-title a:hover { text-decoration: underline; }

.summary { margin: 0 0 0.75rem; }

.note, .awaiting {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.awaiting {
  padding: 0.5rem 0.8rem;
  border-left: 3px solid var(--neutral-line);
  background: var(--neutral-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.evidence { margin: 0 0 0.75rem; color: var(--faint); font-size: 0.86rem; }

/* ---- badges. Always a label next to a value, never a bare bar. ----------- */

.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }

.badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-1);
  font-size: 0.8rem;
  line-height: 1.4;
}
.badge-label { color: var(--muted); }
.badge-value { color: var(--text); font-weight: 600; }

.badge.open { border-color: var(--accent-line); background: var(--accent-soft); }
.badge.open .badge-value { color: var(--accent); }
.badge.waiting { border-style: dashed; }
.badge.waiting .badge-value { color: var(--muted); }
.badge.where .badge-value { font-family: var(--font-mono); font-weight: 400; font-size: 0.94em; }

/* ---- foot ---------------------------------------------------------------- */

.page-foot {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  color: var(--faint);
  font-family: var(--font-display);
  font-size: 0.85rem;
}
.page-foot p { margin: 0 0 0.35rem; }

@media (max-width: 34rem) {
  .page { padding: 2rem 1rem 4rem; }
  h1 { font-size: 1.65rem; }
  li.entry { padding: 1.1rem 1.1rem; }
}

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