/* The www.epimodel.org home page (index.qmd). Tokens and shared components
   (header band, live model, chips, cards, charts) come from brand/brand.css. */

/* ---- header band ----------------------------------------------------------------- */
.install { display: flex; align-items: center; gap: .6rem; max-width: 26rem; margin: 1.3rem 0 0;
  background: rgba(8, 20, 34, .35); border: 1px solid rgba(255, 255, 255, .25); border-radius: 8px; padding: .45rem .5rem .45rem .9rem; }
.install code { flex: 1; color: #fff; background: transparent; font-size: .95rem; padding: 0; }
.install .copy { font: 600 .8rem var(--head-font); color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 6px; padding: .2rem .6rem; cursor: pointer; }
.install .copy:hover { background: rgba(255, 255, 255, .22); }
.install .copy:focus-visible { outline: 3px solid #ffd666; outline-offset: 2px; }
.hero .badges { margin: 1.1rem 0 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.hero .badges img { display: block; }

/* ---- resources ------------------------------------------------------------------- */
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1.05rem; }
.res-grid .lcard-art { padding: 14px 10px 10px; }
.lcard-extra { display: flex; flex-direction: column; gap: .15rem; font-size: .84rem; color: var(--ink-2); border-top: 1px solid var(--grid); padding-top: .5rem; margin-top: auto; }
.lcard-sub { font-weight: 700; color: var(--ink); }
.art-docs .pill { fill: var(--surface); stroke: var(--steel); stroke-width: 1.5; }
.art-docs .pill.main { fill: var(--steel-soft); }
.art-docs .fn { font: 600 13px "SFMono-Regular", Menlo, Consolas, monospace; fill: var(--ink); }
.art-docs .verb { font: 600 11px var(--head-font); fill: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.art-docs .arr { fill: none; stroke: var(--edge-strong); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.art-training .axis { stroke: var(--edge); }
.art-training .grid { stroke: var(--grid); stroke-dasharray: 3 3; }
.art-training .run { fill: none; stroke: var(--st-i); stroke-width: 1.2; opacity: .28; }
.art-training .mean { fill: none; stroke: var(--st-i); stroke-width: 2.4; }

/* ---- playground --------------------------------------------------------------------- */
.pg { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.pg-code { grid-column: 1 / -1; }
@media (max-width: 860px) { .pg { grid-template-columns: minmax(0, 1fr); } .pg-right { order: -1; } }
.pg-group { border: 0; padding: 0; margin: 0 0 .9rem; min-width: 0; }
.pg-group legend { float: none; width: auto; font: 700 .74rem var(--head-font); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .35rem; padding: 0; }
.pg-ctl { padding: .4rem 0 .45rem; border-bottom: 1px solid var(--grid); }
.pg-ctl:last-child { border-bottom: 0; }
.pg-ctl.off { opacity: .45; }
.pg-lab { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .88rem; color: var(--ink); }
.pg-lab label, .pg-lab span { font-weight: 600; }
.pg-val { font: 700 .86rem var(--head-font); color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-ctl input[type="range"] { width: 100%; accent-color: var(--accent); margin: .2rem 0 0; }
.pg-ctl .seg { margin-top: .3rem; }
.pg-arg { font-size: .74rem; color: var(--muted); }
.pg-arg code { color: var(--steel); background: transparent; padding: 0; font-size: 1em; }
.pg-foot { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; margin-top: .2rem; }
.pg-check { font-size: .88rem; color: var(--ink); display: flex; gap: .4rem; align-items: center; cursor: pointer; }
.pg-check input { accent-color: var(--accent); width: 16px; height: 16px; }
.pg-reset { font: 600 .8rem var(--head-font); border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); border-radius: 6px; padding: .25rem .6rem; cursor: pointer; }
.pg-reset:hover { background: var(--surface-2); }
.pg-viz .live-head { margin-bottom: .5rem; }
.pg-viz .live-ctl { align-items: center; flex-wrap: wrap; }
.pg-step { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; margin-right: .2rem; }
.pg-speed button { padding: .22rem .55rem; font-size: .78rem; }
.pg-net { display: block; border-radius: 8px; background: var(--surface-2); }
.pg-netstat { font-size: .8rem; color: var(--ink-2); margin: .35rem 0 .5rem; font-variant-numeric: tabular-nums; }
.pg-chart-title { font: 700 .8rem var(--head-font); color: var(--ink); margin: .2rem 0 .1rem; }
.pg-chart { touch-action: pan-y; }
.pg-svg .cur { fill: none; stroke: var(--st-i); stroke-width: 2.2; stroke-linejoin: round; }
.pg-svg .old { fill: none; stroke: var(--st-i); stroke-width: 1.2; opacity: .25; }
.pg-svg .ref { fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-dasharray: 5 4; }
.pg-svg .cross { stroke: var(--edge-strong); stroke-width: 1; }
.pg-svg .tip line { stroke-width: 2.4; }
.pg-svg .tip line.old { opacity: .5; stroke-width: 2; }
.pg-chart-legend { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; font-size: .8rem; color: var(--ink-2); margin-top: .2rem; }
.pg-chart-legend .sw { display: inline-block; width: 20px; height: 0; border-top: 2.4px solid var(--st-i); vertical-align: middle; margin-right: .4rem; }
.pg-chart-legend .sw.old { opacity: .35; border-top-width: 1.6px; }
.pg-chart-legend .sw.ref { border-top: 2px dashed var(--ink-2); }
.pg-code { background: #13263a; color: #e6edf3; border-radius: 12px; padding: .7rem 1rem .8rem; box-shadow: var(--shadow); }
.pg-code-head { display: flex; justify-content: space-between; align-items: center; font: 700 .78rem var(--head-font); text-transform: uppercase; letter-spacing: .07em; color: #a9bccf; margin-bottom: .4rem; }
.pg-copy { font: 600 .78rem var(--head-font); text-transform: none; letter-spacing: 0; color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .3); border-radius: 6px; padding: .18rem .6rem; cursor: pointer; }
.pg-copy:hover { background: rgba(255, 255, 255, .2); }
.pg-copy:focus-visible { outline: 3px solid #ffd666; outline-offset: 2px; }
.pg-pre { background: transparent; border: 0; margin: 0; padding: 0; color: inherit; font-size: .84rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.pg-pre code { color: inherit; background: transparent; padding: 0; font-size: inherit; white-space: inherit; }
.pg-pre .c { color: #8aa2b8; }
.pg-pre .v { color: #ffd98a; font-weight: 700; border-radius: 3px; }
.pg-pre .v.flash { animation: pg-flash 1.2s ease-out; }
@keyframes pg-flash { from { background: rgba(255, 214, 102, .45); } to { background: transparent; } }
.pg-note { font-size: .8rem; color: #a9bccf; margin: .6rem 0 0; line-height: 1.5; }
.pg-note a { color: #cfe3f5; }
.pg-code .pg-note code { color: #e6edf3; background: transparent; padding: 0; }

/* ---- learning path ------------------------------------------------------------------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; counter-reset: none; }
@media (max-width: 860px) { .steps { grid-template-columns: minmax(0, 1fr); } }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: .9rem 1.1rem 1rem; position: relative; }
.step-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.step-n { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 700 .95rem var(--head-font); color: #fff; background: var(--accent); }
.step:nth-child(2) .step-n { background: var(--steel); }
.step:nth-child(3) .step-n { background: var(--navy); }
.step-name { font: 700 1.02rem var(--head-font); color: var(--ink); }
.step ul { list-style: none; padding: 0; margin: 0; }
.step li { font-size: .92rem; color: var(--ink-2); padding: .4rem 0; border-top: 1px solid var(--grid); line-height: 1.45; }
.step li code { font-size: .86em; color: var(--accent); background: var(--surface-2); border-radius: 3px; padding: 0 .25rem; }
@media (min-width: 861px) {
  .step:not(:last-child)::after { content: ""; position: absolute; right: -1rem; top: 1.85rem; width: 1rem; border-top: 2px solid var(--edge); }
}

/* ---- ecosystem ---------------------------------------------------------------------------- */
.eco { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.2rem; }
@media (max-width: 900px) { .eco { grid-template-columns: minmax(0, 1fr); } }
.eco-board { position: relative; }
.eco-lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.eco-lines .link { fill: none; stroke-width: 2; opacity: .85; }
.eco-lines .link.up { stroke: var(--accent); }
.eco-lines .link.down { stroke: var(--steel); }
.eco-stack { position: relative; display: flex; flex-direction: column; gap: 2.1rem; padding-top: .9rem; }
.eco-layer { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: .8rem; align-items: center; }
@media (max-width: 560px) { .eco-layer { grid-template-columns: minmax(0, 1fr); gap: .35rem; } .eco-lines { display: none; } }
.eco-lab strong { display: block; font: 700 .86rem var(--head-font); color: var(--ink); }
.eco-lab span { display: block; font-size: .74rem; color: var(--muted); line-height: 1.3; }
.eco-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.eco-node { position: relative; z-index: 1; font: inherit; background: var(--surface); border: 1.3px solid var(--border); border-radius: 8px; padding: .32rem .62rem; cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s; }
.eco-node code { color: var(--ink); background: transparent; padding: 0; font-size: .86rem; font-weight: 600; }
.eco-node.core { padding: .45rem 1.2rem; border-width: 2px; }
.eco-node.core code { font-size: 1rem; }
.eco-node:hover { border-color: var(--ink-2); }
.eco-node.focus { border-color: var(--ink); border-width: 2.2px; box-shadow: var(--shadow); }
.eco-node.up { border-color: var(--accent); background: var(--accent-soft); }
.eco-node.down { border-color: var(--steel); background: var(--steel-soft); }
.eco-node.off { border-color: var(--grid); }
.eco-node.off code { color: #a3adb6; }
.eco-node:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.eco-detail { border-left: 1px solid var(--grid); padding-left: 1.2rem; font-size: .92rem; min-height: 14rem; }
@media (max-width: 900px) { .eco-detail { border-left: 0; padding-left: 0; border-top: 1px solid var(--grid); padding-top: .8rem; min-height: 0; } }
.eco-d-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .3rem .8rem; margin-bottom: .35rem; }
.eco-d-name { font-size: 1.1rem; font-weight: 700; color: var(--ink); background: transparent; padding: 0; }
.eco-d-links { display: flex; gap: .8rem; font-size: .86rem; }
.eco-d-desc { color: var(--ink); margin: 0 0 .5rem; }
.eco-detail .pd-rel { margin: 0 0 .3rem; font-size: .88rem; }
.eco-detail .pd-rel code { font-size: .86em; color: var(--ink); background: var(--surface-2); padding: 0 .2rem; border-radius: 3px; }
.eco-install { background: var(--surface-2); border: 1px solid var(--grid); border-radius: 8px; padding: .45rem .7rem; margin: .6rem 0 0; font-size: .84rem; }
.eco-install code { color: var(--ink); background: transparent; padding: 0; }
.eco-d-note { font-size: .84rem; color: var(--muted); margin: .5rem 0 0; }

/* ---- literature ---------------------------------------------------------------------------- */
.lit-top { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center; margin-bottom: .8rem; }
.lit-top .searchbox { flex: 1 1 280px; min-width: 0; }
.lit-chart { margin: .2rem 0 0; }
.lit-svg .ghost { fill: var(--grid); }
.lit-svg .fill { fill: var(--accent); }
.lit-svg .hitbox { fill: transparent; }
.lit-svg .yr { cursor: pointer; outline: none; }
.lit-svg .yr:hover .ghost { fill: #d6dee5; }
.lit-svg .yr.off .fill { opacity: .35; }
.lit-svg .yr.on .tick { font-weight: 700; fill: var(--ink); }
.lit-svg .yr:focus-visible .hitbox { fill: var(--accent-soft); }
.lit-hint { font-size: .78rem; margin: .1rem 0 .6rem; }
.lit-count { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: baseline; font-size: .92rem; color: var(--ink-2); margin: 0 0 .4rem; }
.lit-count strong { color: var(--ink); }
.lit-list { list-style: none; padding: 0; margin: 0; }
.lit-list li { padding: .55rem 0; border-top: 1px solid var(--grid); }
.lit-title { font-weight: 600; color: var(--ink); text-decoration: none; }
a.lit-title:hover { color: var(--accent); text-decoration: underline; }
.lit-meta { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; font-size: .82rem; color: var(--muted); margin-top: .15rem; }
.lit-more { font: 600 .86rem var(--head-font); border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); border-radius: 8px; padding: .35rem .8rem; margin-top: .5rem; cursor: pointer; }
.lit-more:hover { background: var(--surface-2); }

@media (prefers-reduced-motion: reduce) {
  .pg-pre .v.flash { animation: none; }
  .eco-node { transition: none; }
}
