/* ==========================================================================
   RUDI · Workplace AI Enablement Playbook — document stylesheet
   Shares its design tokens with worksheet-system.css (the toolkit sheets).
   Bold black hierarchy · fine ink rules · multicolor dot language.
   ========================================================================== */

:root {
  --ink: #101820;
  --muted: #5f6871;
  --line: #26313b;
  --soft-line: #cfd3d5;
  --paper: #ffffff;
  --field: #f6f6f4;
  --field-strong: #ececea;
  --example: #fffaf1;
  --desk: #e9e6df;
  --pink: #e5004f;
  --red: #ff3b30;
  --orange: #ff8a00;
  --yellow: #f6b600;
  --green: #2eb84f;
  --teal: #00a89d;
  --blue: #0878f9;
  --purple: #6720c6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  color: var(--ink);
  background: var(--desk);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

body { padding: 40px 16px 72px; }

/* ------------------------------------------------------------------ paper */

.doc {
  max-width: 900px;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 22px 60px rgb(16 24 32 / 16%);
}

.page-body { padding: 56px 72px 64px; }

@media (max-width: 760px) {
  body { padding: 12px 0 40px; }
  .page-body { padding: 32px 22px 40px; }
}

/* ------------------------------------------------------------------- dots */

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot-color, var(--pink));
  flex: none;
}

.dot.pink   { --dot-color: var(--pink); }
.dot.red    { --dot-color: var(--red); }
.dot.orange { --dot-color: var(--orange); }
.dot.yellow { --dot-color: var(--yellow); }
.dot.green  { --dot-color: var(--green); }
.dot.teal   { --dot-color: var(--teal); }
.dot.blue   { --dot-color: var(--blue); }
.dot.purple { --dot-color: var(--purple); }

.dot-rail {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.dot-rail .dot { width: 5px; height: 5px; }

/* Full-spectrum separator */
.dotline {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin: 40px 0;
}

.dotline::before,
.dotline::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--soft-line);
}

/* ----------------------------------------------------------------- kicker */

.kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kicker .divider { width: 24px; height: 1px; background: var(--ink); }

/* ------------------------------------------------------------------ cover */

.cover {
  position: relative;
  border-bottom: 2px solid var(--ink);
}

.cover img {
  display: block;
  width: 100%;
  height: auto;
}

/* ------------------------------------------------------------ title block */

.title-block { padding: 46px 72px 8px; }

@media (max-width: 760px) { .title-block { padding: 30px 22px 0; } }

.wordmark {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}

.wordmark-sub {
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.doc-title {
  margin: 30px 0 0;
  font-size: clamp(40px, 6.4vw, 62px);
  line-height: 0.96;
  font-weight: 900;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.doc-subtitle {
  max-width: 620px;
  margin: 18px 0 0;
  font-size: 16.5px;
  line-height: 1.5;
  color: #303942;
}

/* -------------------------------------------------------- reader orientation */

.before-you-begin {
  margin: 38px 0 0;
  padding-top: 32px;
  border-top: 2px solid var(--ink);
}

.orientation-reassurance {
  margin: 22px 0;
  padding: 17px 20px;
  background: var(--example);
}

.orientation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 20px 0 26px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.orientation-grid article {
  min-height: 128px;
  padding: 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.orientation-grid article:nth-child(2),
.orientation-grid article:nth-child(3) {
  background: var(--field);
}

.orientation-grid p,
.minimum-council-note p {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
}

.orientation-role {
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.minimum-council-note {
  margin: 20px 0 28px;
  padding: 18px 20px;
  border: 1px solid var(--soft-line);
  background: var(--field);
}

.orientation-questions {
  margin: 0;
  padding-left: 20px;
}

.orientation-questions li {
  margin-bottom: 3px;
  font-size: 13.5px;
}

.orientation-goal {
  border-color: var(--ink);
}

@media (max-width: 680px) {
  .orientation-grid { grid-template-columns: 1fr; }
  .orientation-grid article { min-height: auto; }
  .orientation-grid article:nth-child(3) { background: var(--paper); }
  .orientation-grid article:nth-child(4) { background: var(--field); }
}

/* --------------------------------------------------------------- contents */

.toc { margin: 44px 0 8px; }

.toc-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1.5px solid var(--ink);
}

.toc-list li { border-bottom: 1px solid var(--soft-line); }

.toc-list a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 2px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
}

.toc-list a:hover { background: var(--field); }

.toc-num {
  flex: none;
  width: 34px;
  font-weight: 900;
  font-size: 12px;
}

.toc-title { font-weight: 700; }

.toc-leader {
  flex: 1;
  border-bottom: 1px dotted var(--soft-line);
  transform: translateY(-3px);
}

.toc-note {
  flex: none;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.toc-note.gate { color: var(--pink); }

/* ------------------------------------------------------------ part opener */

.part {
  margin: 72px 0 34px;
  padding-top: 34px;
  border-top: 2px solid var(--ink);
}

.part-head {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}

.part-mark {
  position: relative;
  width: 96px;
  height: 96px;
}

.part-mark .number {
  position: absolute;
  inset: 18px;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.part-mark .dot { position: absolute; }
.part-mark .d1 { left: 4px;  top: 38px; }
.part-mark .d2 { left: 13px; top: 13px; }
.part-mark .d3 { left: 42px; top: 1px; }
.part-mark .d4 { right: 16px; top: 10px; }
.part-mark .d5 { right: 2px;  top: 36px; }
.part-mark .d6 { right: 13px; bottom: 10px; }
.part-mark .d7 { left: 44px;  bottom: 0; }
.part-mark .d8 { left: 12px;  bottom: 11px; }

.part-title {
  margin: 8px 0 0;
  font-size: clamp(27px, 4vw, 36px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.part-lede {
  max-width: 640px;
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: #303942;
}

/* --------------------------------------------------------------- sections */

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 52px 0 18px;
}

.section-title .index {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 900;
}

.section-title h3 {
  margin: 0;
  font-size: 21.5px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.section-title::after {
  content: "";
  height: 1px;
  min-width: 24px;
  flex: 1;
  margin-left: 4px;
  background: var(--soft-line);
}

h4.sub {
  margin: 30px 0 10px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h4.sub .tick {
  display: inline-block;
  width: 14px;
  height: 3px;
  margin-right: 8px;
  vertical-align: 3px;
  background: var(--accent, var(--pink));
}

/* ------------------------------------------------------------------ prose */

p, ul, ol {
  margin: 0 0 15px;
  font-size: 15px;
  line-height: 1.62;
}

ul, ol { padding-left: 24px; }
li { margin-bottom: 6px; }
li::marker { font-weight: 900; color: var(--ink); }

strong { font-weight: 800; }

.lead {
  font-size: 16.5px;
  line-height: 1.6;
}

.thesis {
  margin: 26px 0;
  padding: 4px 0;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -0.005em;
}

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

.table-wrap { overflow-x: auto; margin: 22px 0; }

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
}

th {
  padding: 8px 10px;
  background: var(--ink);
  color: #fff;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-align: left;
  border: 1px solid var(--line);
}

td {
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  vertical-align: top;
}

tbody tr:nth-child(even) td { background: var(--field); }

td .tag { font-weight: 900; }

/* ---------------------------------------------------------------- figures */

figure {
  margin: 30px 0;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--soft-line);
}

figcaption {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

figcaption .fig-num {
  flex: none;
  color: var(--ink);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 30px 0;
}

.fig-grid figure { margin: 0; }

@media (max-width: 680px) { .fig-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- field work */

.fieldwork {
  margin: 30px 0;
  border: 1.5px solid var(--ink);
  background: var(--paper);
}

.fieldwork-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: var(--ink);
  color: #fff;
}

.fieldwork-head .label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.fieldwork-head .name {
  font-size: 12.5px;
  font-weight: 700;
  color: #cfd3d5;
}

.fieldwork-head .dot-rail { margin-left: auto; }

.fieldwork-body { padding: 16px 18px 6px; }

.fw-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--field-strong);
  font-size: 13.5px;
  line-height: 1.55;
}

.fw-row:last-child { border-bottom: 0; }

.fw-key {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 2px;
}

.fw-key.do      { color: var(--blue); }
.fw-key.produce { color: var(--purple); }
.fw-key.have    { color: var(--green); }

.fw-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  padding: 2px 0;
}

.fw-checks label {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 13px;
  line-height: 1.4;
}

.fw-checks input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 2px 0 0;
  accent-color: var(--pink);
  flex: none;
}

.fw-appendix {
  margin: 0;
  padding: 8px 18px;
  border-top: 1px solid var(--field-strong);
  background: var(--field);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.fw-appendix a { color: var(--ink); }

/* ------------------------------------------------------------------ gates */

.gate {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 26px 0;
  padding: 15px 18px;
  border: 1.5px solid var(--ink);
  background: var(--field);
}

.fieldwork + .gate,
.fieldwork .gate {
  margin-top: 0;
}

.fieldwork .gate {
  margin: 0;
  border: 0;
  border-top: 1.5px solid var(--ink);
}

.gate-mark {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 2px solid var(--pink);
  border-radius: 50%;
  color: var(--pink);
  font-size: 13px;
  font-weight: 900;
}

.gate-body { font-size: 13.5px; line-height: 1.55; }

.gate-body .gate-name {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink);
}

/* --------------------------------------------------------------- meridian */

.meridian {
  margin: 26px 0;
  padding: 15px 18px 13px;
  border: 1px solid var(--soft-line);
  background: var(--example);
}

.meridian .tag {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
}

.meridian p { font-size: 13.5px; line-height: 1.6; margin-bottom: 10px; }
.meridian p:last-child { margin-bottom: 0; }

.meridian .table-wrap { margin: 12px 0 6px; }
.meridian table { font-size: 12px; background: var(--paper); }

/* ------------------------------------------------------------ pull quotes */

blockquote.pull {
  margin: 28px 0;
  padding: 18px 22px;
  border: 1.5px solid var(--ink);
  background: var(--field);
  font-size: 15.5px;
  line-height: 1.55;
  font-weight: 700;
}

blockquote.pull p { margin: 0; font-size: inherit; }

.example-line {
  margin: 10px 0 18px;
  padding: 9px 14px;
  background: var(--example);
  border: 1px solid var(--soft-line);
  font-size: 13px;
  line-height: 1.5;
  font-style: italic;
  color: #303942;
}

/* -------------------------------------------------------------- 5D frames */

.framework-rows { margin: 22px 0; border-top: 1.5px solid var(--ink); }

.fr-row {
  display: grid;
  grid-template-columns: 44px 150px minmax(0, 1fr) 190px;
  gap: 14px;
  align-items: start;
  padding: 12px 2px;
  border-bottom: 1px solid var(--soft-line);
}

.fr-num {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 900;
}

.fr-name { font-size: 15px; font-weight: 900; letter-spacing: -0.01em; padding-top: 4px; }

.fr-name .q {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
}

.fr-def { font-size: 13.5px; line-height: 1.5; padding-top: 4px; }

.fr-out {
  padding-top: 4px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.fr-out b {
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

@media (max-width: 680px) {
  .fr-row { grid-template-columns: 40px minmax(0, 1fr); }
  .fr-def, .fr-out { grid-column: 2; }
}

/* --------------------------------------------------------- appendix index */

.appendix-list { margin: 22px 0; border-top: 1.5px solid var(--ink); }

.ap-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 90px 120px;
  gap: 14px;
  align-items: center;
  padding: 10px 2px;
  border-bottom: 1px solid var(--soft-line);
  font-size: 13.5px;
}

.ap-row .fr-num { width: 28px; height: 28px; font-size: 11.5px; }

.ap-name { font-weight: 700; }

.ap-sec {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ap-link {
  justify-self: end;
  padding: 5px 12px;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ap-link:hover { background: var(--ink); color: #fff; }

@media (max-width: 680px) {
  .ap-row { grid-template-columns: 40px minmax(0, 1fr); }
  .ap-sec, .ap-link { grid-column: 2; justify-self: start; }
}

/* ---------------------------------------------------------- utility notes */

.production-notes {
  margin: 48px 0 0;
  padding: 18px 20px;
  border: 1px dashed var(--soft-line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.production-notes .tag {
  display: block;
  margin-bottom: 8px;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.production-notes p { font-size: inherit; margin-bottom: 8px; }
.production-notes p:last-child { margin-bottom: 0; }

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

.doc-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 64px;
  padding-top: 16px;
  border-top: 2px solid var(--ink);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.doc-footer .footer-dots { display: flex; gap: 4px; margin: 0 auto; }
.doc-footer .footer-dots .dot { width: 5px; height: 5px; }

/* ------------------------------------------------------------------ print */

@page { size: Letter portrait; margin: 0.65in 0.7in; }

@media print {
  html, body { background: #fff; }
  body { padding: 0; }
  .doc { max-width: none; box-shadow: none; }
  .page-body, .title-block { padding-left: 0; padding-right: 0; }
  .cover { border-bottom: 0; }
  .cover img { max-height: 9.2in; width: auto; margin: 0 auto; }
  .cover { break-after: page; }
  .part { break-before: auto; break-inside: avoid; margin: 34px 0 26px; padding-top: 22px; }
  .toc-list a { padding: 6px 2px; }
  .ap-link { display: none; }
  a { color: inherit; text-decoration: none; }

  /* Print typography: slightly tighter than screen so a page holds more and
     the unbreakable blocks below are proportionally smaller. */
  p, ul, ol { font-size: 10.4pt; line-height: 1.5; margin-bottom: 10px; orphans: 3; widows: 3; }
  li { margin-bottom: 4px; }
  .lead { font-size: 11.2pt; line-height: 1.5; }
  .part-lede { font-size: 10.6pt; }
  .thesis { font-size: 12pt; margin: 18px 0; }

  /* A heading must never be the last thing on a page, and the numbered
     circle must never separate from its own title. */
  .part-head, .section-title { break-inside: avoid; }
  .part-head, .part-title, .part-lede,
  .section-title, h4.sub, .toc, .kicker { break-after: avoid; }
  .section-title { margin: 26px 0 12px; }
  h4.sub { margin: 18px 0 8px; }

  /* Structured units stay whole — splitting them looks broken. Tightened so
     they fit in the space that remains rather than jumping and stranding it. */
  .fieldwork, .gate, figure, .fr-row, .ap-row, blockquote.pull,
  .orientation-grid, .orientation-grid article, .minimum-council-note,
  .orientation-reassurance { break-inside: avoid; }
  .fieldwork { margin: 20px 0; }
  .fieldwork-body { padding: 11px 15px 4px; }
  .fw-row { padding: 6px 0; font-size: 10pt; line-height: 1.45; }
  .fw-checks label { font-size: 9.6pt; }
  .gate { margin: 18px 0; padding: 12px 15px; }
  .gate-body { font-size: 10pt; }
  blockquote.pull { margin: 20px 0; padding: 14px 18px; font-size: 11.4pt; }
  blockquote.orientation-goal { margin: 10px 0 0; padding: 10px 14px; font-size: 10.4pt; line-height: 1.4; }

  /* Meridian callouts are prose. Letting a long one split across a page break
     is far better than pushing the whole box down and leaving half a page
     blank — but never strand fewer than three lines on either side. */
  .meridian { break-inside: auto; orphans: 3; widows: 3; margin: 20px 0; }
  .meridian p { font-size: 10pt; line-height: 1.5; }
  .meridian .tag { break-after: avoid; }

  /* Figures at full width ran ~4in tall, so one landing mid-page could push a
     4in hole to the bottom. Capping the height keeps them legible and lets
     them fit far more often. */
  figure { margin: 20px 0; }
  figure img { max-height: 3.5in; width: auto; max-width: 100%; margin: 0 auto; }
  .fig-grid { gap: 14px; margin: 20px 0; }
  .fig-grid figure img { max-height: 2.5in; }
  figcaption { font-size: 9pt; margin-top: 6px; }

  /* Tables may run across pages; the header repeats and no row splits. */
  .table-wrap { margin: 16px 0; overflow: visible; }
  table { font-size: 9.6pt; }
  th, td { padding: 5px 8px; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }

  .framework-rows { margin: 18px 0; }
  .production-notes { break-inside: avoid; font-size: 9.6pt; margin-top: 30px; }
  .doc-footer { margin-top: 34px; }

  /* Keep the 15-row appendix index on one page rather than stranding a
     single row on a page of its own. */
  .appendix-list { margin: 16px 0; }
  .ap-row { padding: 7px 2px; font-size: 10.4pt; }
  .ap-row .fr-num { width: 25px; height: 25px; font-size: 10pt; }
}
