/* app.css — Ted application chrome, layered on the shared Keystone design
   system (tokens.css + base.css). Every value derives from a token; no new
   palette or scale is introduced. The one bold element is the operator
   readout (.readout); everything else stays quiet. */

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: var(--header-h) 1fr auto;
}

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 var(--space-8);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--fg);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}
.brand:hover { color: var(--fg); text-decoration: none; }
.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--kc-oxford);
  color: var(--kc-white);
  font-weight: 800;
  font-size: var(--fs-13);
}
.brand__name { font-size: var(--fs-16); }

.topbar__status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--fg-muted);
}

/* ── Status dot (shared by topbar pill and readout head) ─────────────── */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--fg-subtle);
}
.dot--checking { background: var(--kc-lion); animation: dot-pulse 1.2s ease-in-out infinite; }
.dot--ok       { background: #3f9a6a; } /* derived: a calm green at the palette's value level */
.dot--down     { background: var(--kc-brown); }

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .dot--checking { animation: none; }
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-20) var(--space-8);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--space-16);
  align-items: start;
}

.thesis__eyebrow {
  margin: 0 0 var(--space-4);
  font-size: var(--fs-13);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--accent);
}
.thesis__title {
  margin: 0 0 var(--space-6);
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
  color: var(--fg);
}
.thesis__lede {
  margin: 0 0 var(--space-10);
  font-size: var(--fs-20);
  line-height: var(--lh-snug);
  color: var(--fg-muted);
  max-width: 54ch;
}

/* Facets — the three things Ted manages. Not a sequence, so no numbering:
   a left rule binds them as peers. */
.facets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.facet {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: baseline;
  padding-left: var(--space-5);
  border-left: 2px solid var(--border);
}
.facet__key {
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
}
.facet__desc {
  font-size: var(--fs-15);
  line-height: var(--lh-base);
  color: var(--fg-muted);
}

/* ── Signature: the operator readout ─────────────────────────────────── */
.readout {
  background: var(--bg-inverse);
  color: var(--fg-on-inverse);
  border-radius: var(--radius-4);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}
.readout__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-on-inverse);
}
.readout__title {
  font-family: var(--font-mono);
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--fg-on-inverse);
}
.readout__rows {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.readout__row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: baseline;
}
.readout__row dt {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-on-inverse-muted);
}
.readout__row dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-14);
  color: var(--fg-on-inverse);
  word-break: break-word;
}
.readout__note {
  margin: var(--space-6) 0 0;
  font-size: var(--fs-13);
  line-height: var(--lh-base);
  color: var(--fg-on-inverse-muted);
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-8);
  border-top: 1px solid var(--border);
  font-size: var(--fs-13);
  color: var(--fg-muted);
}
.foot a { color: var(--fg-muted); font-family: var(--font-mono); font-size: var(--fs-12); }
.foot a:hover { color: var(--fg); text-decoration: none; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--space-10);
    padding: var(--space-12) var(--space-6);
  }
  .readout { order: -1; }
}
@media (max-width: 520px) {
  .topbar { padding: 0 var(--space-5); }
  .facet { grid-template-columns: 1fr; gap: var(--space-1); }
}
