
/* Layout: one reading column; a "route" of stages across the top, then plain-language findings with small pictures, then live work, then the log. */
:root {
  --paper: #f3f5f4;
  --sheet: #ffffff;
  --ink: #15201d;
  --muted: #56645f;
  --line: #d6dedb;
  --accent: #0f6b5c;      /* deep sea green: the "deposit alive" colour */
  --accent-soft: #dcefe9;
  --ok: #1b7647;
  --run: #8d5100;
  --run-soft: #fbecd2;
  --bad: #b3261e;
  --bad-soft: #f8dcd9;
  --wait: #65726b;
  --f-display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --f-body: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-data: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0f1513; --sheet: #161e1b; --ink: #e6eeeb; --muted: #9aaba5; --line: #2a3632;
    --accent: #5cc4ae; --accent-soft: #173a33; --ok: #5ccb8c; --run: #f0a840; --run-soft: #3a2a10;
    --bad: #f07a70; --bad-soft: #3d1a17; --wait: #9aaba5;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f1513; --sheet: #161e1b; --ink: #e6eeeb; --muted: #9aaba5; --line: #2a3632;
  --accent: #5cc4ae; --accent-soft: #173a33; --ok: #5ccb8c; --run: #f0a840; --run-soft: #3a2a10;
  --bad: #f07a70; --bad-soft: #3d1a17; --wait: #9aaba5;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.6 var(--f-body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
main { max-width: 56rem; margin: 0 auto; padding-block: 2.5rem 4rem; display: grid; gap: 3.25rem; }
h1, h2 { font-family: var(--f-display); text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 4.2vw, 2.4rem); line-height: 1.2; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 500; }
h3 { font-size: 1.05rem; margin: 0; font-weight: 600; }
p { margin: 0; max-width: 65ch; }
.muted { color: var(--muted); }
.eyebrow { font: 600 .75rem/1 var(--f-data); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.num { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
section { display: grid; gap: 1.25rem; }

/* freshness strip */
.fresh { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; font-size: .9rem; color: var(--muted); }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--ok); display: inline-block; margin-right: .4rem; }
.fresh.stale .dot { background: var(--bad); }
.sample { background: var(--run-soft); color: var(--ink); padding: .2rem .6rem; border-radius: .3rem; font-size: .85rem; }

/* hero summary */
.hero { display: grid; gap: 1.1rem; }
.hero .lead { font-size: 1.15rem; }
.answer { background: var(--sheet); border: 1px solid var(--line); border-radius: .6rem; padding: 1.25rem 1.4rem; display: grid; gap: .6rem; }
.answer strong { color: var(--accent); }

/* route of stages */
.route { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--stage-count, 7), minmax(0, 1fr)); gap: 0; position: relative; }
.route li { display: grid; grid-template-rows: 1.8rem auto auto; align-content: start; gap: .45rem; justify-items: start; padding-right: .75rem; position: relative; }
.route li::before { content: ""; position: absolute; top: .9rem; left: 1.9rem; right: 0; height: 3px; background: var(--line); }
.route li:last-child::before { display: none; }
.route li.done::before { background: var(--ok); }
.marker { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; font: 600 .8rem var(--f-data); background: var(--sheet); border: 3px solid var(--wait); color: var(--wait); position: relative; z-index: 1; }
.done .marker { background: var(--ok); border-color: var(--ok); color: var(--sheet); }
.run .marker { border-color: var(--run); color: var(--run); animation: pulse 2s ease-in-out infinite; }
.fail .marker { background: var(--bad); border-color: var(--bad); color: var(--sheet); }
@keyframes pulse { 50% { box-shadow: 0 0 0 .4rem var(--run-soft); } }
@media (prefers-reduced-motion: reduce) { .run .marker { animation: none; } }
.route .t { font-weight: 600; font-size: .92rem; line-height: 1.3; }
.route .s { font-size: .82rem; color: var(--muted); line-height: 1.35; }
.chip { font: 600 .7rem/1 var(--f-data); letter-spacing: .04em; padding: .3rem .45rem; border-radius: .25rem; }
.chip.done { background: var(--accent-soft); color: var(--ok); }
.chip.run { background: var(--run-soft); color: var(--run); }
.chip.fail { background: var(--bad-soft); color: var(--bad); }
.chip.wait { background: transparent; color: var(--wait); border: 1px solid var(--line); }
@media (max-width: 760px) {
  .route { grid-template-columns: 1fr; gap: 1rem; }
  .route li { grid-template-columns: 1.8rem 1fr; column-gap: .9rem; align-items: start; padding: 0; }
  .route li > :not(.marker) { grid-column: 2; }
  .route li .marker { grid-row: 1 / span 2; }
  .route li::before { top: 1.8rem; bottom: -1rem; left: .78rem; right: auto; width: 3px; height: auto; }
}

/* findings */
.findings { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.finding { background: var(--sheet); border: 1px solid var(--line); border-radius: .6rem; padding: 1.2rem; display: grid; gap: .8rem; align-content: start; }
.finding p { font-size: .95rem; }
.accounts { display: grid; grid-template-columns: repeat(10, 1fr); gap: .3rem; }
.acc { aspect-ratio: 1; border-radius: .25rem; background: var(--ok); }
.acc.out { background: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: .15rem; margin-right: .35rem; vertical-align: -.05rem; }
.bars { display: grid; gap: .5rem; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(2.5rem, 1fr) 3.4rem; gap: .6rem; align-items: center; font-size: .85rem; }
.bar-track { height: .7rem; background: var(--paper); border-radius: .2rem; overflow: hidden; border: 1px solid var(--line); }
.bar-fill { height: 100%; background: var(--accent); }
.bar-fill.weak { background: var(--wait); }

/* live work */
.jobs { display: grid; gap: 1rem; }
.job { background: var(--sheet); border: 1px solid var(--line); border-radius: .6rem; padding: 1.1rem 1.2rem; display: grid; gap: .6rem; }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: baseline; }
.progress { height: .85rem; border-radius: .45rem; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: .45rem; }
.progress.run > div { background: repeating-linear-gradient(-45deg, var(--run), var(--run) 8px, color-mix(in srgb, var(--run) 75%, var(--sheet)) 8px, color-mix(in srgb, var(--run) 75%, var(--sheet)) 16px); }
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; }
.gauge { display: grid; gap: .35rem; }
.gauge .big { font: 600 1.6rem/1 var(--f-data); }

/* log */
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.log li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .85rem 0; border-top: 1px solid var(--line); }
.log time { font: .85rem var(--f-data); color: var(--muted); padding-top: .15rem; }
@media (max-width: 520px) { .log li { grid-template-columns: 1fr; gap: .2rem; }  }

/* site header */
.site { max-width: 56rem; margin: 0 auto; padding-block: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; border-bottom: 1px solid var(--line); }
.brand { font: 700 1rem/1 var(--f-display); color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: .5rem; }
.brand svg { color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; font-size: .95rem; margin-right: auto; }
.nav a { color: var(--muted); text-decoration: none; padding-block: .25rem; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.theme { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--sheet); border: 1px solid var(--line); }
.theme button { width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.theme button:hover { color: var(--ink); }
.theme button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.theme button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.theme svg { width: 1.05rem; height: 1.05rem; }

details { background: var(--sheet); border: 1px solid var(--line); border-radius: .6rem; padding: 1rem 1.2rem; }
summary { cursor: pointer; font-weight: 600; }
summary:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tech { overflow-x: auto; margin-top: .8rem; }
.tech table { border-collapse: collapse; font-size: .85rem; min-width: 30rem; }
.tech td { padding: .35rem .8rem .35rem 0; border-top: 1px solid var(--line); vertical-align: top; }
.tech td:first-child { color: var(--muted); }
a { color: var(--accent); }
footer { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 1rem; }

/* Shared page details and resilient data rendering. */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
[hidden] { display: none !important; }
main, section, details, .route li, .finding, .job, .gauge, .bar-row > *, .log li > *, .brand { min-width: 0; }
p, .route .t, .route .s, .bar-row > span, .brand { overflow-wrap: anywhere; }
.fresh.stale { color: var(--bad); background: var(--bad-soft); border: 1px solid var(--bad); border-radius: .4rem; padding: .65rem .85rem; }
.fresh .fresh-time { font-size: .8rem; }
.load-error { color: var(--bad); }
.log article { display: grid; gap: .35rem; }
.log time { display: block; }
.log .age { display: block; font: .8rem var(--f-body); margin-top: .2rem; }
.bar-row .num { text-align: right; font-size: .8rem; }
.bar-row > span:first-child { line-height: 1.3; }
.bar-track { min-width: 0; }
.progress.indeterminate > div { width: 100%; background-size: 2rem 2rem; animation: status-stripes 1.5s linear infinite; }
@keyframes status-stripes { to { background-position: 2rem 0; } }
@media (prefers-reduced-motion: reduce) { .progress.indeterminate > div { animation: none; } }
.job-meta { font-size: .85rem; }
.tech td:last-child { overflow-wrap: anywhere; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .85rem 1.25rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--sheet); color: var(--ink); text-decoration: none; font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--sheet); font-size: 1.15rem; }
:root[data-theme="dark"] .btn.primary { color: var(--paper); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: var(--paper); } }
.home-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.home-cards article { background: var(--sheet); border: 1px solid var(--line); border-radius: .6rem; padding: 1.2rem; display: grid; gap: .65rem; }
.home-cards h2 { font-size: 1.05rem; }
@media (max-width: 520px) { .brand { font-size: .88rem; } .nav { width: 100%; order: 3; gap: .25rem .9rem; font-size: .85rem; } .theme { margin-left: auto; } }

.finding-risk .bar-fill, .finding-risk .progress > div { background: var(--bad); }

.stage-results { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: 0; }
.stage-results li { display: grid; gap: .4rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.stage-results h3 { font-size: .95rem; }
.stage-results p { font-size: .95rem; }
.milestone-counts { font: .85rem/1.6 var(--f-data); color: var(--muted); }
@media (max-width: 760px) { .route li { grid-template-rows: auto auto; } }

/* Account observations have their own clock, independent of research ticks. */
.account-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.account-metric { padding: 16px; background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.account-metric > span, .account-metric > strong { display: block; overflow-wrap: anywhere; }
.account-metric > span { font-size: 14px; }
.account-metric > strong { margin-top: 8px; font-size: 20px; }
.account-stale { color: var(--bad); }
.account-chart { padding: 16px; background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; }
.account-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.account-chart svg text { fill: var(--muted); font: 12px var(--f-data); }
.account-grid { stroke: var(--line); stroke-width: 1; }
.account-series { stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.account-dot { fill: var(--accent); }
.account-legend { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 16px; font-size: 14px; }
.account-line { display: inline-block; width: 24px; margin-right: 8px; border-top: 3px solid var(--accent); vertical-align: middle; }
.demo-line { border-top: 3px dashed var(--muted); }
@media(max-width: 650px) { .account-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .account-chart { padding: 8px; } }
@media(max-width: 360px) { .account-metrics { grid-template-columns: 1fr; } }

.account-metric > strong.account-unknown { font: 500 16px/1.5 var(--f-body); overflow-wrap: normal; }
.account-period { font-size: 14px; }
@media(max-width: 650px) { .account-chart svg text { display: none; } }
