/* rlcapstone.ai — site styles. No build step; this file is served as-is. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --text: #1a1d21;
  --text-soft: #5a6270;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --border: #e3e6ea;
  --warn-bg: #fef3c7;
  --warn-border: #f59e0b;
  --warn-text: #713f12;
  --radius: 12px;
  --maxw: 60rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101418;
    --bg-soft: #1a2028;
    --text: #e8eaed;
    --text-soft: #9aa4b2;
    --accent: #60a5fa;
    --accent-soft: #1e3a5f;
    --border: #2a323d;
    --warn-bg: #3a2e10;
    --warn-border: #b45309;
    --warn-text: #fcd34d;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1em 0.35em;
}

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 2.1rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.4rem; margin: 2.2rem 0 0.6rem; }
h3 { font-size: 1.1rem; margin: 1.6rem 0 0.4rem; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header / nav */
header.site {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.brand span { color: var(--accent); }
nav.site a {
  color: var(--text-soft);
  margin-left: 1.1rem;
  font-size: 0.95rem;
}
nav.site a[aria-current="page"] { color: var(--text); font-weight: 600; }

/* Hero */
.hero { padding: 3.5rem 0 2.5rem; }
p.lead {
  font-size: 1.2rem;
  color: var(--text-soft);
  max-width: 42rem;
  margin: 0.75rem 0 0;
}

/* Disclaimer banner */
.disclaimer {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  color: var(--warn-text);
  padding: 0.9rem 1.1rem;
  font-size: 0.95rem;
  margin: 1.5rem 0;
}
.disclaimer strong { font-weight: 700; }
.disclaimer a { color: inherit; text-decoration: underline; }

/* Project cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.1rem;
  margin: 1.5rem 0 3rem;
}
.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.1rem;
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
}
.card h3 { margin: 0 0 0.35rem; }
.card p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }
.card .tags { margin-top: 0.8rem; }
.tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 99px;
  padding: 0.15rem 0.6rem;
  margin: 0 0.3rem 0.3rem 0;
}
.card.coming {
  border-style: dashed;
  background: transparent;
}
.card.coming:hover { border-color: var(--border); transform: none; cursor: default; }

/* Article pages */
article { padding: 2.5rem 0 3rem; }
article p, article li { max-width: 46rem; }
article figure { margin: 1.5rem 0; }
article img { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
figcaption { font-size: 0.9rem; color: var(--text-soft); margin-top: 0.4rem; }

/* Fact table */
table.facts {
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
  width: 100%;
  max-width: 46rem;
  display: block;
  overflow-x: auto;
}
table.facts th, table.facts td {
  text-align: left;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
}
table.facts th { background: var(--bg-soft); white-space: nowrap; }

/* Demo (molecheck-demo.html) */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.4rem;
  cursor: pointer;
  margin-top: 0.9rem;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.gate-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-top: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.gate-row input { margin-top: 0.3rem; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-soft);
  cursor: pointer;
  margin: 1.5rem 0 0.5rem;
  max-width: 46rem;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); }
.dropzone img {
  max-width: 16rem;
  max-height: 16rem;
  border-radius: 8px;
  display: block;
  margin: 0 auto 0.8rem;
}
.demo-status { color: var(--text-soft); min-height: 1.5em; max-width: 46rem; }

.demo-result {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin: 1rem 0 2rem;
  max-width: 46rem;
}
.demo-result h2 { margin: 0 0 0.8rem; }
.demo-result.concerning { border-color: var(--warn-border); background: var(--warn-bg); color: var(--warn-text); }
.demo-result.concerning h2 { color: inherit; }
.result-bar {
  position: relative;
  height: 0.8rem;
  border-radius: 99px;
  background: rgba(127, 127, 127, 0.2);
  overflow: hidden;
  margin-bottom: 0.8rem;
}
.result-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.4s ease;
}
.demo-result.concerning .result-fill { background: var(--warn-border); }
.result-threshold {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 13.7%;
  width: 2px;
  background: var(--text-soft);
}
.result-reminder { font-size: 0.95rem; }

/* ECG demo (js/ecg-demo.js) */
#ecg-samples { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.sample-chip {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}
.sample-chip:hover { border-color: var(--accent); }
.sample-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ecg-screen {
  --grid: #e9edf2;
  --trace: var(--accent);
  width: 100%;
  max-width: 46rem;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  display: block;
}
@media (prefers-color-scheme: dark) { .ecg-screen { --grid: #232b35; } }
:root[data-theme="dark"] .ecg-screen { --grid: #232b35; }
:root[data-theme="light"] .ecg-screen { --grid: #e9edf2; }
.ecg-truth { font-size: 0.95rem; color: var(--text-soft); margin: 0 0 0.8rem; }
.prob-row { display: flex; align-items: center; gap: 0.6rem; margin: 0.3rem 0; max-width: 30rem; }
.prob-label { width: 1.4rem; font-weight: 700; font-family: ui-monospace, monospace; }
.prob-track { flex: 1; height: 0.7rem; background: rgba(127,127,127,0.2); border-radius: 99px; overflow: hidden; }
.prob-fill { height: 100%; background: var(--text-soft); border-radius: 99px; transition: width 0.3s ease; }
.prob-fill.top { background: var(--accent); }
.prob-val { width: 2.6rem; text-align: right; font-size: 0.85rem; color: var(--text-soft); }

/* Android app download card */
.download-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin: 1.2rem 0;
  max-width: 46rem;
  background: var(--bg-soft);
}
.download-meta {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 0.9rem;
}
.download-meta strong { color: var(--text); font-size: 1rem; }
.download-card .btn { margin: 0; }
.download-card details { margin-top: 1rem; }
.download-card details ol { margin: 0.6rem 0 0; padding-left: 1.3rem; }
.download-card details li { margin: 0.25rem 0; }
.download-note {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin: 1rem 0 0;
  line-height: 1.5;
}

/* Changelog (js/progress-chart.js) */
.changelog { margin: 1.5rem 0; max-width: 46rem; }
.changelog-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  background: var(--bg-soft);
}
.changelog-head { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.changelog-ver { font-weight: 700; font-size: 1.05rem; }
.changelog-date { color: var(--text-soft); font-size: 0.9rem; }
.changelog-status {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 99px;
  padding: 0.1rem 0.6rem;
}
.changelog-group { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.6rem; margin-top: 0.5rem; }
.changelog-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  height: fit-content;
  text-align: center;
}
.changelog-group.changed .changelog-tag { color: var(--text-soft); background: rgba(127,127,127,0.15); }
.changelog-group.improved .changelog-tag { color: #0a7d3c; background: #d7f3e1; }
.changelog-group.gap .changelog-tag { color: var(--warn-text); background: var(--warn-bg); }
@media (prefers-color-scheme: dark) {
  .changelog-group.improved .changelog-tag { color: #7ee2a8; background: #123522; }
}
:root[data-theme="dark"] .changelog-group.improved .changelog-tag { color: #7ee2a8; background: #123522; }
:root[data-theme="light"] .changelog-group.improved .changelog-tag { color: #0a7d3c; background: #d7f3e1; }
.changelog-group ul { margin: 0; padding-left: 1.1rem; }
.changelog-group li { margin: 0.15rem 0; }

/* Progress chart (js/progress-chart.js) */
.progress-note { color: var(--text-soft); font-size: 0.95rem; }
figure.chart {
  margin: 1.5rem 0;
  max-width: 46rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1rem 0.6rem;
  background: var(--bg-soft);
}
figure.chart figcaption {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.6rem;
}
.chart-stage { position: relative; }
.chart-stage svg { display: block; width: 100%; height: auto; }
.chart-stage .grid { stroke: var(--border); stroke-width: 1; }
.chart-stage .tick, .chart-stage .axis-label, .chart-stage .baseline-label {
  fill: var(--text-soft);
  font-size: 11px;
}
.chart-stage .axis-label { font-size: 12px; }
.chart-stage .baseline { stroke: var(--text-soft); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart-stage .series-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart-stage .series-dot { fill: var(--accent); stroke: var(--bg-soft); stroke-width: 2; }
.chart-stage .point-label { fill: var(--text); font-size: 11px; font-weight: 600; }
.chart-stage .crosshair { stroke: var(--text-soft); stroke-width: 1; stroke-dasharray: 2 3; }
.chart-tip {
  position: absolute;
  transform: translate(-50%, -140%);
  background: var(--text);
  color: var(--bg);
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
}
details summary { cursor: pointer; color: var(--text-soft); font-size: 0.9rem; }
details table.facts { margin-top: 0.6rem; }

/* Footer */
footer.site {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1.5rem 0 2.5rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 0.4rem 2rem; justify-content: space-between; }
