/* earnings-desk static site -- the one and only stylesheet.
   Hand-written, no framework. Light palette on :root, dark palette under
   prefers-color-scheme: dark. */

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1a1c1e;
  --muted: #63686e;
  --border: #dcdedf;
  --accent: #1a56db;
  --beat: #157347;
  --beat-bg: rgba(21, 115, 71, 0.10);
  --miss: #b02a37;
  --miss-bg: rgba(176, 42, 55, 0.10);
  --inline: #63686e;
  --warn-bg: #fff3cd;
  --warn-text: #664d03;
  --badge-legacy-bg: #eee6d8;
  --badge-legacy-text: #6b5a2e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181a;
    --surface: #1f2225;
    --text: #e6e8ea;
    --muted: #9aa1a8;
    --border: #33383d;
    --accent: #7aa2f7;
    --beat: #4cc38a;
    --beat-bg: rgba(76, 195, 138, 0.12);
    --miss: #f47174;
    --miss-bg: rgba(244, 113, 116, 0.12);
    --inline: #9aa1a8;
    --warn-bg: #3a3421;
    --warn-text: #e8d48b;
    --badge-legacy-bg: #383225;
    --badge-legacy-text: #cdb877;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

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

header.site {
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1rem;
}
header.site .inner {
  max-width: 60rem;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
header.site h1 { font-size: 1.05rem; margin: 0; }
header.site h1 a { color: var(--text); }
header.site .sub { color: var(--muted); font-size: 0.85rem; }

/* status strip */
.status-strip {
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  margin: 1rem 0 1.25rem;
}
.status-strip.warn {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: transparent;
}

/* index controls */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
}
.controls input[type="search"] {
  flex: 1 1 14rem;
  padding: 0.45rem 0.65rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.controls button {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.controls button.active {
  border-color: var(--accent);
  color: var(--accent);
}
.count-line { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.75rem; }

/* report list */
.report-list { list-style: none; margin: 0; padding: 0; }
.report-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.55rem;
}
.report-list .row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}
.report-list .date {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.report-list .one-liner {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chip {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
}
.badge.stage-preliminary { background: var(--beat-bg); color: var(--beat); }
.badge.stage-post_call { background: var(--miss-bg); color: var(--accent); }
.badge.legacy { background: var(--badge-legacy-bg); color: var(--badge-legacy-text); }

/* report page */
.report-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.9rem;
  margin-bottom: 1.25rem;
}
.report-header h1 { margin: 0.2rem 0 0.4rem; font-size: 1.4rem; }
.report-header .meta { color: var(--muted); font-size: 0.9rem; }

article.report h1, article.legacy-report h1 { font-size: 1.25rem; }
article.report h2, article.legacy-report h2 {
  font-size: 1.05rem;
  margin-top: 1.6rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.75rem 0;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
th, td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }

/* verdict coloring: rows carry .beat / .miss / .in-line / .unavailable */
tr.beat td { color: var(--beat); background: var(--beat-bg); }
tr.miss td { color: var(--miss); background: var(--miss-bg); }
tr.in-line td { color: var(--inline); }
tr.unavailable td { color: var(--muted); }

article footer {
  margin-top: 2rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}
article footer p { margin: 0.15rem 0; }

.back-link { display: inline-block; margin-bottom: 0.75rem; font-size: 0.9rem; }
