/* DNEG AI Roadmap: site.css
   1. Base and ambient background          (from the Gate LLM presentation, minus the full-viewport scene engine)
   2. Components ported from the presentation, class names unchanged:
      .eyebrow .title .lede .frag .grid .card .chip .btn .pill .stats .stat .hosts .bars .bar .steps .step .tl
      .legend .four kbd code .mono .num
   3. Site layout: .topbar .lens-nav .search .filterbar .layout .rail .main .footer
   4. Site components: .sechead .hero .section .tag .owners .tiles .lens-grid .rlist .rrow .panel .empty ...
   5. Responsive, print, reduced motion
   Colours come from tokens.css only. Per-lens extras live in css/views/<lens>.css. */

/* ------------------------- 1. base ------------------------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); scroll-padding-top: calc(var(--topbar-h) + 12px); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  padding-top: var(--topbar-h);
  background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: clamp(15px, 1.15vw, 19px); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent2); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -56px; z-index: 60; padding: 8px 14px; border: 0; border-radius: 8px; background: var(--accent); color: var(--on-accent); cursor: pointer; transition: top .15s var(--ease); }
.skip:focus { top: 8px; }

#bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#bg::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(1200px 600px at 50% 110%, var(--glow1), transparent 60%),
              radial-gradient(900px 500px at 50% -10%, var(--glow2), transparent 60%); }

/* ------------------------- 2. ported components ------------------------- */
.eyebrow { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent2); margin-bottom: .6rem; }
.title { font-size: clamp(1.6rem, 3.1vw, 2.7rem); line-height: 1.12; margin-bottom: 1.2rem; }
.lede { color: var(--muted); max-width: min(62ch, 100%); font-size: 1.05em; }
.frag { opacity: 0; transform: translateY(10px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.frag.on { opacity: 1; transform: none; }

.grid { display: grid; gap: 14px; }
.card { position: relative; background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.card h3 { font-size: 1.05em; margin-bottom: .35rem; }
.card p { color: var(--muted); font-size: .92em; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 2px 9px; border: 1px solid var(--line); color: var(--muted); vertical-align: middle; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.chip.warn { color: var(--human); border-color: color-mix(in srgb, var(--human) 50%, transparent); }
.chip.off { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.chip.info { color: var(--accent2); border-color: color-mix(in srgb, var(--accent2) 50%, transparent); }
.chip.muted { color: var(--muted); border-color: var(--line); }

kbd { font-family: var(--mono); font-size: .8em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--panel); color: var(--fg); }

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 14px; cursor: pointer; color: var(--fg); text-decoration: none; display: inline-block; line-height: 1.4; }
.btn:hover { border-color: var(--accent); }
.btn.live { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.small { padding: 3px 11px; font-size: .8rem; border-radius: 999px; }

.pill { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; background: var(--glass); cursor: pointer; text-transform: none; letter-spacing: 0; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.pill:hover { border-color: var(--accent); color: var(--fg); }
.pill.on { border-color: var(--accent); color: var(--accent2); }
.pill.static { cursor: default; }
.pill.static:hover { border-color: var(--line); color: var(--muted); }

/* Stat tiles (presentation scene 8). Used as <div class="grid stats"> of .card.stat */
.stats { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.stat .v { font-size: clamp(1.7rem, 2.8vw, 2.5rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: .45em; color: var(--muted); font-weight: 400; margin-left: .2em; }
.stat .l { color: var(--muted); font-size: .85em; margin-top: .3rem; }
.stat.date .v { font-size: clamp(1.25rem, 1.9vw, 1.75rem); line-height: 1.5; white-space: nowrap; }
.stats.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1000px) { .stats.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stats.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Bars (presentation scene 9) */
.bars { display: grid; gap: 10px; margin-top: .6rem; }
.bar { display: grid; grid-template-columns: 220px 1fr 110px; align-items: center; gap: 12px; }
.bar .n { font-size: .9em; }
.bar .n small { display: block; color: var(--muted); font-size: .8em; }
.bar .t { height: 14px; background: var(--panel2); border-radius: 4px; overflow: hidden; position: relative; }
.bar .t i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); border-radius: 0 4px 4px 0; transition: width 1s var(--ease); }
.bar .v { font-family: var(--mono); font-size: .9em; text-align: right; color: var(--fg); }
@media (max-width: 700px) { .bar { grid-template-columns: 1fr; gap: 4px; } .bar .v { text-align: left; } }
/* Stacked maturity mix (R.ui.maturityBar): segments sized by flex-grow, coloured by the maturity chip class */
.bars.compact { gap: 6px; margin-top: auto; padding-top: .7rem; }
.bars.compact .bar { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.bars.compact .bar .n { display: none; }
.bars.compact .bar .v { font-size: .74rem; color: var(--muted); }
.bar .t.mix { display: flex; gap: 2px; background: var(--panel2); }
.bar .t.mix i { position: static; flex: 1 1 0; width: auto; border-radius: 2px; transition: none; }
.bar .t.mix i.ok, .mixkey i.ok { background: var(--ok); }
.bar .t.mix i.info, .mixkey i.info { background: var(--accent2); }
.bar .t.mix i.warn, .mixkey i.warn { background: var(--human); }
.bar .t.mix i.muted, .mixkey i.muted { background: color-mix(in srgb, var(--muted) 60%, transparent); }
.bar .t.mix i.off, .mixkey i.off { background: var(--bad); }
.mixkey { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .74rem; color: var(--muted); }
.mixkey span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.mixkey i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }

/* Hosts (presentation scene 10): tiles with a title row and a status chip */
.hosts { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.hosts .card { display: flex; flex-direction: column; gap: .35rem; }
.hosts .card .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Four problems (presentation scene 2) */
.four { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.four .card { min-height: 190px; display: flex; flex-direction: column; gap: .5rem; }
.four .ico { width: 34px; height: 34px; color: var(--accent2); }
.four .n { font-family: var(--mono); color: var(--muted); font-size: .75rem; letter-spacing: .1em; }
.four .q { color: var(--fg); font-weight: 300; font-size: .98em; margin-top: auto; }

/* Steps (presentation scene 5). --n sets the column count (13 in the presentation, 16 pipeline steps here) */
.steps { display: grid; grid-template-columns: repeat(var(--n, 13), 1fr); gap: 4px; margin: 1.2rem 0 1rem; position: relative; }
.steps::before { content: ""; position: absolute; left: 4%; right: 4%; top: 15px; height: 2px; background: var(--line); }
.steps .fill { position: absolute; left: 4%; top: 15px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent2)); width: 0; transition: width .5s var(--ease); }
.step { text-align: center; position: relative; cursor: pointer; }
.step .dot { width: 32px; height: 32px; border-radius: 50%; margin: 0 auto; background: var(--bg2); border: 2px solid var(--line); display: grid; place-items: center; font-family: var(--mono); font-size: .72rem; color: var(--muted); transition: all .3s; }
.step .lbl { font-size: .72rem; color: var(--muted); margin-top: .5rem; line-height: 1.2; }
.step.done .dot { border-color: var(--accent); color: var(--fg); background: var(--panel); }
.step.now .dot { border-color: var(--accent2); background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent), 0 0 18px color-mix(in srgb, var(--accent) 50%, transparent); }
.step.human .dot { border-color: var(--human); }
.step.now .lbl { color: var(--fg); }
@media (max-width: 820px) { .steps { grid-template-columns: repeat(7, 1fr); row-gap: 18px; } .steps::before, .steps .fill { display: none; } }

/* Timeline (presentation scene 13) */
.tl { position: relative; margin: 2.2rem 0 1rem; padding: 0 24px; }
.tl .track { height: 2px; background: var(--line); position: relative; }
.tl .track .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .3s; }
.tl .dots { position: relative; height: 0; }
.tl .d { position: absolute; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg2); border: 2px solid var(--line); transform: translateX(-50%); transition: all .25s; cursor: pointer; }
.tl .d.on { border-color: var(--accent2); background: var(--accent); }
.tl .d.now { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); }
.tl .d .m { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: .68rem; color: var(--muted); white-space: nowrap; }
.tl input[type=range] { width: 100%; margin-top: 2.6rem; accent-color: var(--accent); }

/* Legend (presentation scene 11) */
.legend { display: flex; gap: 16px; justify-content: center; font-size: .82em; color: var(--muted); margin-top: .4rem; flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.legend.left { justify-content: flex-start; }

/* ------------------------- 3. site layout ------------------------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: env(safe-area-inset-top, 0px) 20px 0;
  font-size: .78rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase;
  background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 600; color: var(--fg); text-decoration: none; white-space: nowrap; flex: 0 0 auto; }
.topbar .brand:hover { color: var(--accent2); }

.lens-nav { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; letter-spacing: 0; text-transform: none; }
.lens-nav::-webkit-scrollbar { display: none; }
.lens-link { flex: 0 0 auto; padding: 3px 9px; border: 1px solid transparent; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .8rem; white-space: nowrap; transition: color .2s, border-color .2s, background .2s; }
.lens-link:hover { color: var(--fg); border-color: var(--line); }
.lens-link[aria-current="page"] { color: var(--fg); border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 14%, transparent); }

.search { flex: 0 0 auto; margin: 0; }
.search input {
  width: 14rem; max-width: 100%; padding: 5px 12px 5px 32px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--glass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d9ab2' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 11px 50% / 14px;
  color: var(--fg); font: inherit; font-size: .8rem; letter-spacing: 0; text-transform: none;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

.filterbar { position: sticky; top: var(--topbar-h); z-index: 20; background: var(--glass-strong); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.fb { max-width: var(--maxw-layout); margin: 0 auto; padding: 8px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: .84rem; }
.fb-label { color: var(--muted); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.fb-select { background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font: inherit; font-size: .84rem; max-width: 13rem; }
.fb-select:hover, .fb-select:focus { border-color: var(--accent); }
.fb-chips { display: contents; }
.chip.filter { text-transform: none; letter-spacing: 0; font-size: .8rem; color: var(--accent2); border-color: color-mix(in srgb, var(--accent2) 50%, transparent); padding-right: 4px; }
.chip.filter::before { display: none; }
.chip.filter .fk { color: var(--muted); }
.chip.filter .x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.1em; line-height: 1; padding: 0 6px; border-radius: 999px; }
.chip.filter .x:hover { color: var(--fg); background: var(--panel2); }

.layout { position: relative; z-index: 1; flex: 1 0 auto; width: 100%; max-width: var(--maxw-layout); margin: 0 auto; padding: 26px 24px 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
.layout.has-rail { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
.main { min-width: 0; width: 100%; max-width: var(--maxw); margin: 0 auto; }
.layout.has-rail .main { max-width: none; margin: 0; }
.main:focus { outline: none; }

.rail { position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow: auto; padding-right: 6px; scrollbar-width: thin; }
.railbox > summary { list-style: none; cursor: pointer; margin: 0 0 .6rem; }
.railbox > summary::-webkit-details-marker { display: none; }
.railbox > summary .eyebrow { margin: 0; }
@media (min-width: 901px) { .railbox > summary { pointer-events: none; cursor: default; } }
@media (max-width: 900px) {
  .railbox { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 10px 14px; }
  .railbox > summary { margin: 0; display: flex; justify-content: space-between; align-items: center; }
  .railbox > summary::after { content: "\25BE"; color: var(--muted); }
  .railbox[open] > summary { margin-bottom: .6rem; }
  .railbox[open] > summary::after { content: "\25B4"; }
}
.rgroup { margin: 1rem 0 .3rem; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ritem { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 10px; border-radius: 8px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: .92em; }
.ritem:hover { background: var(--panel); color: var(--fg); }
.ritem.on { background: var(--panel2); color: var(--fg); border-left-color: var(--accent2); }
.ritem .rl small { display: block; color: var(--muted); font-size: .8em; }
.ritem .rn { font-family: var(--mono); font-size: .8em; color: var(--muted); }

.footer { position: relative; z-index: 1; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg2) 75%, transparent); color: var(--muted); font-size: .82rem; }
.footer .inner { max-width: var(--maxw-layout); margin: 0 auto; padding: 18px 24px; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 28px; }
.footer .fcol { min-width: 0; }
.footer .fcol strong { color: var(--fg); font-weight: 600; }
.footer .fmeta { margin-top: 4px; font-size: .78rem; }
.footer .flinks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer a { color: var(--accent2); }

/* ------------------------- 4. site components ------------------------- */
.sechead { margin-bottom: 1.2rem; }
.sechead .title { font-size: clamp(1.35rem, 2.3vw, 2.1rem); margin-bottom: .5rem; }
.section { margin-top: clamp(2.4rem, 5vw, 3.8rem); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.4rem; }
.note { color: var(--muted); font-size: .82rem; margin-top: .7rem; }
.more { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* Hero (presentation title scene: gradient title, light-weight lede) */
.hero { padding-top: clamp(.6rem, 3vw, 2.2rem); }
.hero .sechead { margin-bottom: 0; }
.hero .title { font-size: clamp(2.4rem, 6vw, 4.9rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.04; margin-bottom: 1.1rem; max-width: 16em;
  background: linear-gradient(180deg, var(--title-from) 20%, var(--accent2) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { color: var(--fg); font-weight: 300; font-size: clamp(1rem, 1.5vw, 1.32rem); max-width: 60ch; }

/* Cards that are links: the title link stretches over the whole card, inner links stay clickable */
.stretch { color: inherit; text-decoration: none; }
.stretch::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.card a:not(.stretch), .card button { position: relative; z-index: 1; }
.card.linked { transition: border-color .2s var(--ease), transform .2s var(--ease); }
.card.linked:hover { border-color: var(--accent); transform: translateY(-1px); }
.card.linked:focus-within { border-color: var(--accent2); }
.frag.card.linked { transition: opacity .4s var(--ease), transform .4s var(--ease), border-color .2s var(--ease); }
.card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card .top h3 { margin-bottom: .2rem; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: .35rem; }
.card .foot { font-size: .8rem; }
.repo-card, .capability-card { display: flex; flex-direction: column; gap: .35rem; }

.tag { display: inline-flex; align-items: center; font-size: .72rem; line-height: 1.5; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; text-decoration: none; white-space: nowrap; }
a.tag:hover { border-color: var(--accent); color: var(--fg); }
.tag.late { color: var(--human); border-color: color-mix(in srgb, var(--human) 45%, transparent); }

.owners { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.owner { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.owner i { font-style: normal; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line); font-family: var(--mono); font-size: .6rem; color: var(--accent2); }

/* Platform tiles ("what is in the box") */
.tiles { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: .4rem; }
.tile .mods { font-size: .78rem; color: var(--muted); opacity: .85; }
.tile .rm { font-size: .78rem; color: var(--muted); }
.tile.empty-platform .mods, .tile.empty-platform p { opacity: .75; }

/* Lens cards */
.lens-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.lens { display: flex; flex-direction: column; gap: .45rem; min-height: 158px; }
.lens .ico { width: 34px; height: 34px; color: var(--accent2); }
.lens .ico svg { width: 100%; height: 100%; display: block; }
.lens .top { align-items: center; }
.lens h3 { margin-bottom: 0; }
.lens.soon { border-style: dashed; }
.lens.soon .ico, .lens.soon h3, .lens.soon p { opacity: .62; }

/* Roadmap rows */
.rlist { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--panel), var(--bg2)); overflow: hidden; }
.rrow { display: grid; grid-template-columns: 8.4rem minmax(0, 1fr) auto auto; align-items: start; gap: 6px 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rrow:last-child { border-bottom: 0; }
.rrow:hover { background: color-mix(in srgb, var(--panel2) 55%, transparent); }
.chip.key { font-family: var(--mono); text-transform: none; letter-spacing: 0; text-decoration: none; justify-self: start; }
.chip.key::before { display: none; }
.chip.key:hover { border-color: var(--accent); color: var(--fg); }
.rtitle { color: var(--fg); font-weight: 500; text-decoration: none; }
.rtitle:hover { color: var(--accent2); text-decoration: underline; }
.rsub { color: var(--muted); font-size: .9em; margin-top: 2px; }
.rmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 5px; }
.rdates { color: var(--accent2); font-size: .78rem; }
.rdates.dim { color: var(--muted); }
.rjira { font-size: .8rem; text-decoration: none; white-space: nowrap; padding-top: 2px; }
.rjira:hover { text-decoration: underline; }

/* Panels: errors, warnings, not-built-yet */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--panel), var(--bg2)); padding: 22px 24px; margin-bottom: 18px; }
.panel.warn { border-color: color-mix(in srgb, var(--human) 55%, transparent); padding: 12px 18px; }
.panel.error { border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.panel .title { font-size: clamp(1.3rem, 2.2vw, 1.9rem); margin-bottom: .6rem; }
.panel .lens-grid { margin-top: 1.2rem; }
.errtxt { margin: 1rem 0 0; padding: 12px 14px; max-height: 16rem; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: .78rem; white-space: pre-wrap; color: var(--muted); }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px 24px; color: var(--muted); text-align: center; }

.notes { margin-top: 1.4rem; }
.notes h3 { font-size: 1.05em; margin-bottom: .5rem; }
.notes p { color: var(--muted); max-width: 72ch; margin-bottom: .8em; }
.closing-band { border-top: 1px solid var(--line); padding-top: 2rem; }
.closing { margin-bottom: .8rem; font-size: clamp(1.3rem, 2.6vw, 2.1rem); font-weight: 300; }
.closing b { font-weight: 600; color: var(--accent2); }

/* Help overlay (presentation #help) */
#help { position: fixed; inset: 0; z-index: 50; background: var(--scrim); overflow: auto; padding: 70px 30px 30px; }
#help .box { max-width: 560px; margin: 0 auto; }
#help dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
#help dt { text-align: right; }
#help dd { margin: 0; color: var(--muted); }
#help .help-note { color: var(--muted); font-size: .85em; margin-top: .9rem; }

/* The executive brief (R.lensKit: K.brief, K.fact): the answer, then up to five facts. Every lens uses it, so it lives here. */
.lk-brief { margin: .4rem 0 1.6rem; }
.lk-answer { font-size: clamp(1.12rem, 1.7vw, 1.38rem); line-height: 1.45; color: var(--fg); max-width: 60rem; margin: 0 0 1rem; font-weight: 500; }
.lk-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.lk-fact { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-width: 0; }
.lk-fact > a, .lk-fact:not(.linked) { display: block; padding: 12px 14px; color: inherit; text-decoration: none; height: 100%; box-sizing: border-box; }
.lk-fact.linked:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.lk-fv { display: block; font-size: clamp(1.35rem, 2.1vw, 1.85rem); line-height: 1.1; color: var(--fg); font-weight: 600; }
.lk-fl { display: block; margin-top: 4px; color: var(--fg); font-size: .9rem; line-height: 1.35; }
.lk-fs { display: block; margin-top: 2px; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.lk-fact.linked .lk-fl { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent2) 45%, transparent); text-underline-offset: 3px; }
/* Supporting detail (K.more): folded sections that open on request. */
.lk-fold { border-top: 1px solid var(--line); padding: .9rem 0; }
.lk-fold:last-of-type { border-bottom: 1px solid var(--line); }
.lk-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 1.08rem; font-weight: 600; color: var(--fg); }
.lk-fold > summary::-webkit-details-marker { display: none; }
.lk-fold > summary::before { content: '\25B8'; color: var(--accent2); display: inline-block; width: 1em; transition: transform .15s ease; }
.lk-fold[open] > summary::before { transform: rotate(90deg); }
.lk-fold > summary:hover .lk-mt { color: var(--accent2); }
.lk-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.lk-mc { color: var(--muted); font-weight: 500; }
.lk-mh { color: var(--muted); font-weight: 400; font-size: .85rem; }
.lk-mbody { padding-top: .8rem; }
.lk-mbody > .lk-sec:first-child { margin-top: 0; padding-top: 0; }
.lk-mbody > .lk-sec > .sechead .eyebrow { display: none; }
@media (prefers-reduced-motion: reduce) { .lk-fold > summary::before { transition: none; } }
/* Five facts would leave one card alone on a row at tablet widths: balance them by the brief's own width. */
.lk-brief { container-type: inline-size; }
@container (max-width: 864px) { .lk-facts.n5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 689px) { .lk-facts.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 519px) {
  .lk-facts.n5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lk-facts > .lk-fact:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* no fact alone in half a row on a phone */
}
/* One or two facts keep a card's width instead of stretching across the page. */
.lk-facts.n1, .lk-facts.n2 { grid-template-columns: repeat(auto-fit, minmax(165px, 22rem)); }
/* The brief as a map (K.brief with a hub): the hub, the facts around it, each fact's leaves (the names behind its
   number) next to it. The lines are borders of pseudo-elements, so they follow the layout at every width, in Present
   mode and in print. Narrow: cards, each with its leaves as a line of names under it. From 760px: the facts hang in a
   row from a bar under the hub, their leaves in a small tree under each. From 1100px: the hub sits in the middle, the
   facts on both sides of it and their leaves outside them. */
.lk-map { --lk-c: color-mix(in srgb, var(--accent) 50%, var(--line)); --lk-w: 1.5px; --lk-arm: 14px; --lk-twig: 14px; --lk-r: 9px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.lk-side { display: contents; }
.lk-hub { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.lk-hv { font-size: clamp(1.5rem, 2.3vw, 2.1rem); line-height: 1.05; font-weight: 600; color: var(--fg); }
.lk-hl { color: var(--muted); font-size: .9rem; line-height: 1.3; }
.lk-branch { list-style: none; position: relative; display: flex; flex-direction: column; min-width: 0; }
.lk-leaves { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 7px 4px 0; padding: 0; min-width: 0; }
.lk-leaf { position: relative; min-width: 0; }
.lk-leaf > a, .lk-leaf > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 7px; min-width: 0; color: var(--fg); font-size: .84rem; line-height: 1.35; text-decoration: none; }
.lk-ln { min-width: 0; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.lk-lv { flex: 0 0 auto; color: var(--muted); font-size: .9em; }
.lk-leaf > a:hover .lk-ln, .lk-leaf > a:focus-visible .lk-ln { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent2) 60%, transparent); text-underline-offset: 3px; }
.lk-lmore > a, .lk-lmore > span { color: var(--muted); font-size: .8rem; }
.lk-lmore > a:hover { color: var(--accent2); }
@container (min-width: 500px) and (max-width: 759.98px) {
  .lk-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lk-map.n3 .lk-last, .lk-map.n5 .lk-last { grid-column: 1 / -1; }   /* no fact alone in half a row */
}
@container (min-width: 760px) {
  .lk-map { gap: 0; }
  .lk-hub { position: relative; z-index: 1; justify-self: center; flex-direction: column; align-items: center; gap: 2px; text-align: center;
    padding: 10px 28px; border: var(--lk-w) solid color-mix(in srgb, var(--accent) 60%, var(--line)); border-radius: 999px;
    background: radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--accent) 20%, var(--panel)), var(--panel));
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 9%, transparent), 0 0 28px color-mix(in srgb, var(--accent) 22%, transparent); }
  .lk-leaves { display: block; }
}
/* A row of facts hanging from one bar under the hub; the cards of the row share a height (subgrid), and each fact's
   leaves hang in a small tree from the card's lower edge. */
@container (min-width: 760px) and (max-width: 1099.98px) {
  .lk-map { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
  .lk-hub { margin-bottom: var(--lk-arm); }
  .lk-hub::after { content: ''; position: absolute; left: 50%; top: 100%; height: var(--lk-arm); border-left: var(--lk-w) solid var(--lk-c); }
  .lk-branch { grid-row: 2 / span 2; display: grid; grid-template-rows: subgrid; align-content: start; padding: var(--lk-arm) 5px 0; }
  .lk-branch::before { content: ''; position: absolute; top: 0; left: 0; right: 0; border-top: var(--lk-w) solid var(--lk-c); }
  .lk-branch::after { content: ''; position: absolute; top: 0; left: 50%; height: var(--lk-arm); border-left: var(--lk-w) solid var(--lk-c); }
  .lk-branch.lk-first::before { left: 50%; height: var(--lk-arm); border-left: var(--lk-w) solid var(--lk-c); border-top-left-radius: var(--lk-r); }
  .lk-branch.lk-last::before { right: 50%; height: var(--lk-arm); border-right: var(--lk-w) solid var(--lk-c); border-top-right-radius: var(--lk-r); }
  .lk-branch.lk-first::after, .lk-branch.lk-last::after { content: none; }
  .lk-leaves { margin: 0 0 0 18px; }
  .lk-leaf { padding: 3px 0 3px 16px; }
  .lk-leaf::before { content: ''; position: absolute; left: 0; top: 0; width: 11px; height: calc(.7em + 3px);
    border: 0 solid var(--lk-c); border-width: 0 0 var(--lk-w) var(--lk-w); border-bottom-left-radius: var(--lk-r); }
  .lk-leaf:not(:last-child)::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; border-left: var(--lk-w) solid var(--lk-c); }
}
/* The mind map: the hub in the middle, the first facts to its left, the rest to its right, leaves on the outside.
   Each item draws its own piece of line: an elbow at the first and last of a list, a stub and a spine between. */
@container (min-width: 1100px) {
  .lk-map { --lk-arm: 26px; --lk-twig: 16px; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
  .lk-side { display: flex; flex-direction: column; justify-content: center; margin: 0; padding: 0; min-width: 0; }
  .lk-l { grid-column: 1; grid-row: 1; }
  .lk-r { grid-column: 3; grid-row: 1; }
  .lk-hub { grid-column: 2; grid-row: 1; justify-content: center; box-sizing: border-box; width: 10.5rem; aspect-ratio: 1; padding: 14px;
    margin: 0 var(--lk-arm); border-radius: 50%; }
  .lk-hub::before, .lk-hub::after { content: ''; position: absolute; top: 50%; width: var(--lk-arm); border-top: var(--lk-w) solid var(--lk-c); }
  .lk-hub::before { right: 100%; }
  .lk-hub::after { left: 100%; }
  .lk-branch { flex-direction: row; align-items: center; padding: 7px 0 7px var(--lk-arm); }
  .lk-l > .lk-branch { flex-direction: row-reverse; padding: 7px var(--lk-arm) 7px 0; }
  .lk-node { flex: 0 0 14rem; width: 14rem; box-sizing: border-box; position: relative; }
  .lk-leaves { flex: 1 1 auto; margin: 0 0 0 var(--lk-twig); }
  .lk-l .lk-leaves { margin: 0 var(--lk-twig) 0 0; }
  .lk-leaf { padding: 2px 0 2px var(--lk-twig); }
  .lk-l .lk-leaf { padding: 2px var(--lk-twig) 2px 0; }
  .lk-l .lk-leaf > a, .lk-l .lk-leaf > span { justify-content: flex-end; text-align: right; }
  /* a fact to its leaves */
  .lk-branch > .lk-node:not(:last-child)::after { content: ''; position: absolute; top: 50%; width: var(--lk-twig); border-top: var(--lk-w) solid var(--lk-c); }
  .lk-r .lk-node::after { left: 100%; }
  .lk-l .lk-node::after { right: 100%; }
  /* the pieces of line: a stub to each item, a spine between the first and the last, elbows at both ends */
  .lk-r > .lk-branch::before, .lk-r .lk-leaf::before, .lk-l > .lk-branch::before, .lk-l .lk-leaf::before {
    content: ''; position: absolute; top: 50%; bottom: auto; height: 0; border: 0 solid var(--lk-c); border-top-width: var(--lk-w); border-radius: 0; }
  .lk-r > .lk-branch::after, .lk-r .lk-leaf::after, .lk-l > .lk-branch::after, .lk-l .lk-leaf::after {
    content: ''; position: absolute; top: 0; bottom: 0; border: 0 solid var(--lk-c); }
  .lk-r > .lk-branch::before, .lk-r > .lk-branch::after { left: 0; width: var(--lk-arm); }
  .lk-r .lk-leaf::before, .lk-r .lk-leaf::after { left: 0; width: var(--lk-twig); }
  .lk-l > .lk-branch::before, .lk-l > .lk-branch::after { right: 0; width: var(--lk-arm); }
  .lk-l .lk-leaf::before, .lk-l .lk-leaf::after { right: 0; width: var(--lk-twig); }
  .lk-r > .lk-branch::after, .lk-r .lk-leaf::after { border-left-width: var(--lk-w); }
  .lk-l > .lk-branch::after, .lk-l .lk-leaf::after { border-right-width: var(--lk-w); }
  :is(.lk-r > .lk-branch, .lk-r .lk-leaf):first-child::before { bottom: 0; height: auto; border-left-width: var(--lk-w); border-top-left-radius: var(--lk-r); }
  :is(.lk-r > .lk-branch, .lk-r .lk-leaf):last-child::before { top: 0; bottom: 50%; height: auto; border-top-width: 0; border-bottom-width: var(--lk-w); border-left-width: var(--lk-w); border-bottom-left-radius: var(--lk-r); }
  :is(.lk-l > .lk-branch, .lk-l .lk-leaf):first-child::before { bottom: 0; height: auto; border-right-width: var(--lk-w); border-top-right-radius: var(--lk-r); }
  :is(.lk-l > .lk-branch, .lk-l .lk-leaf):last-child::before { top: 0; bottom: 50%; height: auto; border-top-width: 0; border-bottom-width: var(--lk-w); border-right-width: var(--lk-w); border-bottom-right-radius: var(--lk-r); }
  :is(.lk-r > .lk-branch, .lk-r .lk-leaf, .lk-l > .lk-branch, .lk-l .lk-leaf):is(:first-child, :last-child)::after { content: none; }
  :is(.lk-r > .lk-branch, .lk-r .lk-leaf, .lk-l > .lk-branch, .lk-l .lk-leaf):only-child::before { top: 50%; bottom: auto; height: 0; border-width: var(--lk-w) 0 0; border-radius: 0; }
}
/* A note just above a folded block keeps clear of its border. */
:is(.lk-note, .note) + .lk-fold { margin-top: 1.2rem; }
/* A fact whose value is a name rather than a number (K.brief marks it). */
.lk-fv .lk-fname { display: inline-block; font-size: .76em; line-height: 1.2; }
/* The buttons beside a page title: Filter this page, Show everything, a lens's own. */
.lk-headtools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media print {
  .lk-fold > .lk-mbody { display: block; }
  details.lk-fold::details-content { content-visibility: visible; display: block; height: auto; }   /* closed folds print too */
  .lk-expandall, .lk-headtools { display: none; }
}

/* ------------------------- 5. responsive, print, motion ------------------------- */
/* Twelve lens links fit beside the search, the filters and the date pill from 1600 px; below that they take a row of
   their own (measured with a filter on). */
@media (max-width: 1599px) {
  :root { --topbar-h: 92px; }
  .topbar { flex-wrap: wrap; align-content: center; row-gap: 6px; padding-top: 6px; padding-bottom: 6px; }
  .lens-nav { order: 5; flex: 1 0 100%; }
  .topbar .brand { margin-right: auto; }
}
@media (max-width: 959px) {
  .lens-nav { gap: 2px; }
  .lens-link { padding: 3px 8px; }
}
@media (max-width: 900px) {
  .layout.has-rail { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; max-height: none; padding-right: 0; }
}
@media (max-width: 760px) {
  .rrow { grid-template-columns: minmax(0, 1fr) auto; }
  .rrow .rtext { grid-column: 1 / -1; order: 3; }
  .rrow .rjira { justify-self: end; }
}
@media (max-width: 640px) {
  .topbar { padding-left: 14px; padding-right: 14px; gap: 8px; }
  .topbar .brand { font-size: .72rem; }
  .search input { width: 9rem; }
  #genDate, #helpBtn { display: none; }
  .layout { padding: 18px 14px 40px; }
  .fb { padding: 8px 14px; }
  .hero .title { max-width: none; }
  #help { padding: 56px 16px 24px; }
  #help dl { grid-template-columns: 1fr; gap: 2px; }
  #help dt { text-align: left; margin-top: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  /* the site's own pages; the keynote (html.splash-on) keeps its motion and has its own switch, the M key */
  html:not(.splash-on) *, html:not(.splash-on) *::before, html:not(.splash-on) *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  html:not(.splash-on) .frag { opacity: 1; transform: none; }
}

@media print {
  :root, :root[data-theme] {
    --bg: #fff; --bg2: #f6f8fc; --panel: #fff; --panel2: #f1f4fa; --line: #cdd5e3; --fg: #111827; --muted: #475269;
    --accent: #1f56ad; --accent2: #1f56ad; --human: #8a5a00; --ok: #12703f; --bad: #b42323; --title-from: #0b1220;
    --glass: #fff; --glass-strong: #fff;
  }
  html, body { background: #fff; }
  body { padding-top: 0; font-size: 11pt; }
  #bg, .topbar, .filterbar, #help, .skip, .rail, .cta, .more, .footer .flinks, #live { display: none !important; }
  .layout { display: block; max-width: none; padding: 0; }
  .main { max-width: none; }
  .frag { opacity: 1 !important; transform: none !important; }
  .card, .rrow { break-inside: avoid; }
  .card { background: #fff; }
  .hero .title { background: none; -webkit-text-fill-color: initial; color: #0b1220; }
  .rrow[hidden] { display: grid !important; }
  a { color: inherit; text-decoration: none; }
  .footer { background: none; border-top: 1px solid #ccc; }
}
