/* ============================================================
   premium.css — the "make it not look homemade" design layer.
   Loaded LAST. Typography (Inter / Fraunces / JetBrains Mono),
   layered depth, refined surfaces, motion, focus. Overrides only
   look & feel — never layout structure. (2026-08-23)
   ============================================================ */

:root {
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Fraunces', 'Roboto Slab', Georgia, serif;
  --font-data: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --ring: color-mix(in srgb, var(--gold) 30%, transparent);
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body { font-family: var(--font-body); letter-spacing: -.005em; }

/* editorial display headings */
h1.page { letter-spacing: -.021em; font-weight: 600; font-optical-sizing: auto; line-height: 1.12; }
h2.sect { letter-spacing: -.015em; }
.brand { font-family: var(--font-display); font-size: 1.06rem; letter-spacing: -.01em; }
.brand small { opacity: .58; font-weight: 400; letter-spacing: .02em; }
/* tabular figures for all the dates/counts */
.src, .tc-date, .jc-last, .age, .stamp, .kpi b, .d, table td { font-variant-numeric: tabular-nums; }
.tc-date, .d { font-family: var(--font-data); }

/* ---------- surfaces: hairline + layered soft depth ---------- */
.card {
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 10px 30px -14px rgba(0,0,0,.30);
}
:root[data-theme="light"] .card,
:root:not([data-theme="dark"]) .card {
  box-shadow: 0 1px 2px rgba(24,34,48,.05), 0 12px 30px -16px rgba(24,34,48,.14);
}
.card > h3 { letter-spacing: .14em; }

/* ---------- sticky, refined header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 60;
  padding: 12px 22px;
  box-shadow: 0 1px 0 var(--line), 0 6px 18px -12px rgba(0,0,0,.4);
}

/* ---------- nav ---------- */
.nav a { border-radius: 8px; font-weight: 500; transition: background .13s ease, color .13s ease; }
.nav a.on { font-weight: 600; }

/* ---------- buttons: subtle depth + lift, never flat blocks ---------- */
button, .btn {
  border-radius: 9px; font-weight: 600; letter-spacing: -.008em;
  box-shadow: 0 1px 2px rgba(0,0,0,.20);
  transition: transform .1s ease, box-shadow .13s ease, filter .13s ease;
}
button:hover, .btn:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 3px 10px -2px rgba(0,0,0,.30); }
button:active, .btn:active { transform: translateY(0); filter: brightness(.98); }
.btn.quiet { background: var(--panel2); color: var(--tx); border: 1px solid var(--line); box-shadow: none; }
.btn.quiet:hover { border-color: var(--gold-ink); filter: none; }

/* ---------- omni search ---------- */
#omniIn, .omni input {
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel2);
  padding: 9px 14px; transition: border-color .13s ease, box-shadow .13s ease;
}
#omniIn:focus, .omni input:focus { outline: none; border-color: var(--gold-ink); box-shadow: 0 0 0 3px var(--ring); }

/* ---------- project chips ---------- */
.pchip { border-radius: 20px; transition: transform .1s ease, border-color .13s ease, background .13s ease; }
.pchip:hover { transform: translateY(-1px); }

/* ---------- wikilinks: crisp underline that lights on hover ---------- */
a.wl { border-bottom: 1px solid var(--link-under); text-decoration: none; transition: color .1s ease, border-color .1s ease; }
a.wl:hover { color: var(--link); border-bottom-color: var(--link); }

/* ---------- focus-visible everywhere (a11y + polish) ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, .pchip:focus-visible, .nav a:focus-visible, .jobcard:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 7px;
}

/* ---------- tables: airier ---------- */
table td, table th { padding: 7px 10px; }
th { font-weight: 600; color: var(--mut); letter-spacing: -.004em; }

/* ---------- misc ---------- */
main { padding-bottom: 72px; }
::selection { background: color-mix(in srgb, var(--gold) 30%, transparent); }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 8px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--mut); }
*::-webkit-scrollbar-track { background: transparent; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* --- spacing & rhythm pass (2026-08-23): consistent breathing room ---
   Card padding a touch more generous against the 14px radius; uniform
   stacking gap between dossier flow-column cards (fixes cards that touch
   because they lacked an inline margin); stronger section breaks. Scoped
   to NOT disturb .dt-doc's own reading rhythm or the home KPI grid. */
.card:not(.dt-doc){ padding:16px 18px; }
.card > h3{ margin-bottom:12px; }
.grid2 > div > .card + .card{ margin-top:var(--gap-3); }
.grid2{ gap:var(--gap-4); }
h2.sect{ margin-top:28px; }
.timeline li,.chase li{ padding-top:8px; padding-bottom:8px; }

/* --- mobile pass (2026-08-23): the header nav wasn't wrapping, forcing the
   page wider than a phone viewport and clipping everything on the right. Wrap
   the nav + search onto their own rows, collapse the boards to one column,
   and let long text break. --- */
@media (max-width: 600px) {
  .hdr { flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .omni { order: 3; flex-basis: 100%; max-width: none; }
  .nav { order: 4; flex-basis: 100%; flex-wrap: wrap; gap: 3px; }
  .nav a { padding: 6px 10px; font-size: var(--fs-0); }
  .hdr-right { margin-left: auto; }
  main { padding-left: 14px; padding-right: 14px; }
  .grid, .grid2 { grid-template-columns: 1fr; }
  .jobsboard { grid-template-columns: minmax(0, 1fr); }
  .jobsboard .jobcard { min-width: 0; overflow-wrap: anywhere; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  h1.page { font-size: 1.55rem; line-height: 1.15; }
  .dossier-hd { gap: 8px; }
  .card { overflow-wrap: break-word; }
  .toc-fab { left: 14px; bottom: 14px; }
  .toc-panel { left: 14px; right: 14px; width: auto; }
}

/* ---- source-document links must LOOK alive (Nick 2026-08-30: "looks like a dead
   link until you click it"). Blueprint-blue + underline, consistent with a.wl, plus
   a doc marker so "this opens the actual PDF" is legible at a glance. ---- */
a.doc-open { color: var(--link); text-decoration: none; font-weight: 500;
  border-bottom: 1px solid var(--link-under); transition: color .1s ease, border-color .1s ease; }
/* 2026-09-27: the page-emoji ::before drew as an empty box without an emoji font; an
   inline SVG document mark (data URI, allowed by img-src data:) draws everywhere */
a.doc-open::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-right: .3em;
  vertical-align: -0.15em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h7l4 4v14H7z'/%3E%3Cpath d='M14 3v4h4M9.5 12h5M9.5 15.5h5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h7l4 4v14H7z'/%3E%3Cpath d='M14 3v4h4M9.5 12h5M9.5 15.5h5'/%3E%3C/svg%3E") center / contain no-repeat; }
a.doc-open:hover { border-bottom-color: var(--link); }
