/* Design tokens extracted from design/Application.dc.html */
:root {
  --bg: #f6f7f9;            /* page background, light-on-dark text */
  --ink: #0d1420;           /* header + diagram background */
  --text: #1a2230;          /* headings / primary text */
  --text-body: #2b3648;     /* body copy */
  --text-muted: #6b7688;    /* secondary text, table dates/weights */
  --text-faint: #8a93a3;    /* footer */
  --steel: #8aa0c0;         /* kaomoji, diagram captions */
  --border: #c9d0da;        /* outer box, table header rules */
  --border-light: #e1e5ec;  /* row separators */
  --accent: #f5a623;        /* CTA button */
  --accent-hover: #d98413;  /* link hover */
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --content-max: 1120px;
  --col-label: 340px;       /* left column of each section row */
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
}

.link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.link:hover { color: var(--accent-hover); }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ink);
  color: var(--bg);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { font-size: 15px; letter-spacing: -0.5px; color: var(--steel); font-weight: 500; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -0.5px; }

.site-nav { display: flex; align-items: center; gap: 36px; }
.site-nav a { text-decoration: none; font-size: 15px; color: var(--bg); }
.site-nav a:not(.cta):hover { color: var(--accent-hover); }
.site-nav a.cta {
  font-weight: 500;
  color: var(--ink);
  background: var(--accent);
  padding: 9px 18px;
  border-radius: 3px;
}

/* ---------- page frame ---------- */

main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 56px 32px 96px;
}

.frame {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 44px 48px 12px;
}

.frame-label {
  position: absolute;
  top: -11px;
  left: 24px;
  background: var(--bg);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--text);
}

/* ---------- section rows ---------- */

.row {
  display: grid;
  grid-template-columns: var(--col-label) 1fr;
  gap: 32px;
  padding: 32px 0 40px;
  border-bottom: 1px solid var(--border-light);
  scroll-margin-top: 80px; /* keep anchor targets clear of the sticky header */
}
.row:last-child { border-bottom: 0; padding-bottom: 36px; }

.row-label { font-size: 15px; font-weight: 700; }
.row-note { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

.row-body {
  font-size: 15px;
  line-height: 1.75;
  max-width: 640px;
  color: var(--text-body);
}
.row-body p { margin: 0 0 16px; }
.row-body p:last-child { margin-bottom: 0; }

.row-body ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.row-body .list-heading { margin: 24px 0 8px; font-weight: 700; }
.row-body .group-heading { margin: 0 0 8px; font-weight: 700; }

.stack { display: flex; flex-direction: column; gap: 24px; }
.stack p { margin: 0; }

.stack-sm { display: flex; flex-direction: column; gap: 14px; }
.stack-sm p { margin: 0; }

/* ---------- tables ---------- */

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-body);
}
.spec-table th {
  text-align: left;
  font-weight: 700;
  padding: 0 16px 10px 0;
  border-bottom: 1px solid var(--border);
}
.spec-table td {
  padding: 10px 16px 10px 0;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
.spec-table th:last-child,
.spec-table td:last-child { padding-right: 0; }
.spec-table tr:last-child td { border-bottom: 0; }

.calendar th:first-child { white-space: nowrap; }
.calendar td:first-child { white-space: nowrap; color: var(--text-muted); }
.calendar td:last-child { white-space: nowrap; font-weight: 500; }

.scorecard th:first-child { white-space: nowrap; }
.scorecard td:first-child { white-space: nowrap; font-weight: 500; }
.scorecard th:last-child { text-align: right; }
.scorecard td:last-child { text-align: right; color: var(--text-muted); }

/* ---------- workflow diagram ---------- */

.diagram {
  grid-column: 1 / -1;
  margin-top: 28px;
  background: var(--ink);
  border-radius: 2px;
  padding: 44px 32px 40px;
  overflow-x: auto;
}

.diagram-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 860px;
  color: var(--bg);
}

.dgroup {
  position: relative;
  border: 2px solid var(--bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dgroup--capture { width: 330px; padding: 30px 0 24px 24px; }
.dgroup--math { width: 320px; padding: 30px 24px 24px 0; }

.dgroup-label {
  position: absolute;
  top: -10px;
  left: 16px;
  background: var(--ink);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
}

.dnode-row { display: flex; align-items: center; }
.dnode-row .dnode { flex: 1; }

.dnode { border: 2px solid var(--bg); padding: 10px 14px; }
.dnode--dashed { border-style: dashed; }
.dnode--recap {
  flex-shrink: 0;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  line-height: 1.6;
}

.dnode-title { font-size: 14px; font-weight: 700; }
.dnode-sub { font-size: 12.5px; color: var(--steel); margin-top: 2px; line-height: 1.5; }

.stub { display: block; width: 18px; height: 2px; background: var(--bg); flex-shrink: 0; }
.stub--in { width: 12px; }

.arrow { display: flex; align-items: center; flex-shrink: 0; }
.arrow-line { display: block; width: 44px; height: 2px; background: var(--bg); }
.arrow-head {
  display: block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--bg);
  flex-shrink: 0;
}

/* ---------- footer ---------- */

.footer {
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
}

/* ---------- mobile ---------- */

@media (max-width: 760px) {
  main { padding: 36px 16px 64px; }
  .frame { padding: 32px 20px 8px; }
  .row { grid-template-columns: 1fr; gap: 10px; }

  .spec-table { font-size: 12.5px; }
  .spec-table th, .spec-table td { padding-right: 10px; }
  .spec-table th:last-child, .spec-table td:last-child { padding-right: 0; }

  .site-header { padding: 0 16px; }
  .brand-mark { display: none; }
  .brand-name { font-size: 16px; }
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 13px; }
  .site-nav a.cta { padding: 7px 12px; }
}
