/* Chris Clark, build demo pages
   Extends style.css. Brand tokens come from there; this file adds the
   two-column demo layout, the whiteboard, the terminal and the risk table. */

.builds .wrap { max-width: 1000px; }

/* ---- Two-column layout: sticky section nav + content ---- */
.layout {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.doc { min-width: 0; max-width: 64ch; }

/* style.css sets `nav { display:flex }` for the header, undo it here so the
   section nav stacks. */
.toc { display: block; position: sticky; top: 34px; }
.toc h2 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
}
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: block;
  padding: 6px 0 6px 22px;
  position: relative;
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--ink-faint);
  border-bottom: 0;
  border-left: 1px solid var(--line);
  margin-left: -1px;
}
.toc a::before {
  content: counter(toc);
  position: absolute;
  left: 9px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  opacity: .6;
}
.toc a:hover { color: var(--ink-soft); }
.toc a.current {
  color: var(--ink);
  font-weight: 500;
  border-left: 1px solid var(--sage);
}
.toc a.current::before { color: var(--sage-deep); opacity: 1; }

/* ---- Page head ---- */
.crumb { margin: 0 0 16px; }
.crumb a { color: var(--ink-faint); border-bottom: 0; }
.crumb a:hover { color: var(--sage-deep); }
.doc h1 { font-size: 44px; line-height: 1.05; }
.standfirst {
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.55;
}
.byline { margin: 18px 0 0; color: var(--ink-faint); font-size: 13.5px; line-height: 1.5; }

/* ---- Sections: the heading is the heading, not a kicker ---- */
.sec {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}
.sec > .eyebrow {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: 10px;
}
.sec > h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 6px;
}
.sec > .sub {
  margin: 0 0 22px;
  color: var(--ink-faint);
  font-size: 14.5px;
  line-height: 1.5;
}
.sec p { color: var(--ink-soft); font-size: 15.5px; margin: 0 0 14px; }
.sec p:last-child { margin-bottom: 0; }
.sec strong { color: var(--ink); font-weight: 600; }

/* ---- Whiteboard ----
   Numbered stages, serif numerals, cards, connectors. Same visual language as
   the Clark & Crawford whiteboard sheets. */
.wb { --card: #FBF9F3; margin: 2px 0 20px; }

.wb-stage { opacity: 0; transform: translateY(9px); animation: wb-rise .55s ease forwards; }
.wb-stage:nth-of-type(1) { animation-delay: .04s; }
.wb-stage:nth-of-type(3) { animation-delay: .15s; }
.wb-stage:nth-of-type(5) { animation-delay: .26s; }
.wb-stage:nth-of-type(7) { animation-delay: .37s; }
@keyframes wb-rise { to { opacity: 1; transform: none; } }

.wb-label { display: flex; align-items: baseline; gap: 13px; margin: 0 0 14px; }
.wb-num {
  font-family: var(--font-display); font-style: italic; font-size: 28px;
  color: var(--clay); line-height: 1; min-width: 34px;
}
.wb-label h3 {
  font-family: var(--font-display); font-weight: 400; font-size: 22px;
  letter-spacing: -0.02em; margin: 0; color: var(--ink);
}
.wb-hint {
  font-size: 13px; color: var(--ink-faint); margin-left: auto;
  max-width: 30ch; text-align: right; line-height: 1.4;
}

.wb-arrow {
  width: 2px; height: 30px; background: var(--line);
  margin: 10px 0 10px 17px; position: relative;
}
.wb-arrow::after {
  content: "▼"; position: absolute; bottom: -7px; left: -5px;
  color: var(--line); font-size: 11px;
}

.wb-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.wb-chip {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 7px; padding: 10px 14px; font-size: 13.5px; color: var(--ink);
}
.wb-chip .m { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--sage-deep); }
.wb-feed { font-size: 13px; color: var(--ink-faint); margin: 13px 0 0 !important; }

.wb-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.wb-head {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px; border-bottom: 1px solid var(--line); background: var(--paper-deep);
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: var(--ink);
}
.wb-who {
  margin-left: auto; font-family: var(--font-body);
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
}
.wb-who.code { color: var(--sage-deep); }
.wb-who.me { color: var(--ink-faint); }
.wb-who.gate { color: var(--clay); }

.wb-cols { display: grid; grid-template-columns: 1fr 1fr; }
.wb-col { padding: 20px 22px; }
.wb-col + .wb-col { border-left: 1px solid var(--line); }
.wb-col h4 {
  font-family: var(--font-body); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; font-weight: 600; margin: 0 0 14px;
}
.wb-col.keep h4 { color: var(--sage-deep); }
.wb-col.drop h4 { color: var(--clay); }
.wb-item { display: flex; gap: 11px; padding: 8px 0; border-top: 1px dashed var(--line); }
.wb-item:first-of-type { border-top: 0; }
.wb-i-num {
  font-family: var(--font-display); font-style: italic; font-size: 16px;
  min-width: 20px; line-height: 1.3;
}
.wb-col.keep .wb-i-num { color: var(--sage-deep); }
.wb-col.drop .wb-i-num { color: var(--clay); }
.wb-item b { font-weight: 600; display: block; font-size: 13.5px; color: var(--ink); }
.wb-item span.d { color: var(--ink-soft); font-size: 12.5px; }

.wb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.wb-out { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 15px 17px; }
.wb-out .m {
  display: block; margin-bottom: 6px; font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px; color: var(--clay);
}
.wb-out b { font-size: 14px; color: var(--ink); }
.wb-out p { margin: 4px 0 0 !important; font-size: 12.5px !important; color: var(--ink-soft); }

.wb-untouched {
  margin-top: 12px; border: 1px dashed var(--sage-light); border-radius: 10px;
  padding: 14px 18px; font-size: 13.5px; color: var(--ink-soft);
  background: rgba(107, 127, 92, .05);
}
.wb-untouched b { color: var(--sage-deep); }

.wb-gate {
  background: var(--sage-deep); color: #EFEDE2; border-radius: 12px; padding: 22px 24px;
}
.wb-gate h4 {
  font-family: var(--font-display); font-weight: 400; font-size: 20px;
  margin: 0 0 6px; color: #fff;
}
.wb-gate p { margin: 0 !important; font-size: 13.5px !important; color: #C9CFC2 !important; max-width: 60ch; }

.wb-note {
  margin-top: 26px; border: 1px dashed var(--clay); border-radius: 10px;
  padding: 15px 19px; font-size: 14px; color: var(--ink-soft);
  background: rgba(184, 149, 106, .07);
}
.wb-note b { color: var(--clay); }

@media (prefers-reduced-motion: reduce) {
  .wb-stage { animation: none; opacity: 1; transform: none; }
}

/* ---- Terminal ---- */
.term {
  background: #252220; color: #E8E2D6; border-radius: 5px;
  padding: 18px 20px; overflow-x: auto; white-space: pre;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.65; margin: 0 0 14px;
}
.term .cmd { color: #9FBE8C; }
.term .hd { color: #C9C2B4; }
.term .flag { color: #E3B778; }
.term .ok { color: #9FBE8C; }
.term .dim { color: #8A8278; }

/* ---- Output table ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 10px; font-variant-numeric: tabular-nums; }
.tbl th {
  text-align: left; font-weight: 500; font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint);
  padding: 0 10px 8px 0; border-bottom: 1px solid var(--line);
}
.tbl th.num, .tbl td.num { text-align: right; }
.tbl td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.tbl tr.flagged td { color: var(--ink); }
.tbl .note { font-size: 11px; color: var(--clay); letter-spacing: .04em; white-space: nowrap; }
.tbl tr.total td { font-weight: 500; color: var(--ink); border-bottom: 0; }

/* ---- Risk table ---- */
.risk { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.risk th {
  text-align: left; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 500; padding: 0 12px 8px 0;
}
.risk td { padding: 13px 12px 13px 0; border-top: 1px solid var(--line); color: var(--ink-soft); vertical-align: top; }
.risk td:first-child { color: var(--ink); font-weight: 500; white-space: nowrap; }
.dial { position: relative; width: 104px; height: 3px; background: var(--line); border-radius: 2px; margin: 9px 0 0; }
.dial i { position: absolute; top: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--clay); transform: translateX(-50%); }
.dial b {
  position: absolute; top: 10px; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 500; transform: translateX(-50%); white-space: nowrap;
}

/* ---- Notes stub ---- */
.pending {
  display: inline-block; font-size: 10.5px; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; margin-bottom: 14px;
}
.notes { background: var(--paper-deep); border-left: 2px solid var(--sage-light); padding: 18px 22px; border-radius: 0 3px 3px 0; }
.notes p { margin: 0; color: var(--ink-faint); font-size: 14px; }
.notes ul { margin: 10px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 15px; }
.notes li { margin-bottom: 6px; }

.code {
  background: var(--paper-deep); border-radius: 4px; padding: 14px 18px; white-space: pre;
  font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--ink); overflow-x: auto;
}

/* ---- Demo index ---- */
.demo-list { list-style: none; margin: 0; padding: 0; }
.demo-list li { border-top: 1px solid var(--line); padding: 26px 0; }
.demo-list h2 { font-size: 24px; margin: 0 0 8px; }
.demo-list p { color: var(--ink-soft); font-size: 15.5px; margin: 0; max-width: 60ch; }
.demo-list .meta { display: block; margin-bottom: 10px; color: var(--sage-deep); }
.demo-list .soon { color: var(--ink-faint); }
.demo-list .soon h2 { color: var(--ink-faint); }

/* ---- Walkthrough card ----
   The walkthrough is linked, not embedded. It needs the whole window: inside
   an iframe it either trips its own narrow breakpoint or gets clipped, at
   every viewport we tried. A card that plainly says "new tab" is better than
   a frame that squeezes it. */
.wt-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "play copy" "play go";
  gap: 4px 18px;
  align-items: start;
  margin: 4px 0 14px;
  padding: 22px 24px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-left: 2px solid var(--sage);
  border-radius: 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease;
}
.wt-card:hover { background: #E8E2D4; border-left-color: var(--sage-deep); }
.wt-card:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; }

.wt-play {
  grid-area: play;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--sage-deep); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; padding-left: 3px; margin-top: 2px;
}
.wt-copy { grid-area: copy; display: block; }
.wt-kicker {
  display: block; font-size: 10.5px; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--sage-deep); margin-bottom: 6px;
}
.wt-title {
  display: block; font-family: var(--font-display); font-size: 22px;
  letter-spacing: -0.02em; line-height: 1.2; color: var(--ink); margin-bottom: 6px;
}
.wt-sub {
  display: block; font-size: 14px; line-height: 1.5; color: var(--ink-soft); max-width: 52ch;
}
.wt-go {
  grid-area: go; margin-top: 12px;
  font-size: 14px; font-weight: 500; color: var(--sage-deep);
}
.wt-card:hover .wt-go { color: var(--sage); }

@media (max-width: 620px) {
  .wt-card { grid-template-columns: 1fr; grid-template-areas: "play" "copy" "go"; gap: 12px; padding: 18px; }
  .wt-play { width: 40px; height: 40px; font-size: 13px; }
  .wt-title { font-size: 20px; }
  .wt-go { margin-top: 0; }
}

.demo-video {
  display: block; width: 100%; height: auto;
  border-radius: 4px; border: 1px solid var(--line);
  margin: 4px 0 20px; background: var(--paper-deep);
}

.fineprint {
  margin-top: 18px !important;
  font-size: 13px !important;
  line-height: 1.55;
  color: var(--ink-faint) !important;
}
.fineprint code, .sec code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: .92em;
  background: var(--paper-deep);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Wide content scrolls inside its own box, never the page. */
.scroll { overflow-x: auto; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  /* A nine-item index above the headline is noise on a phone, and the page
     reads linearly anyway. */
  .toc { display: none; }
  .doc { max-width: none; }
  .doc h1 { font-size: 34px; }
  .wb-hint { display: none; }
  .wb-cols { grid-template-columns: 1fr; }
  .wb-col + .wb-col { border-left: 0; border-top: 1px solid var(--line); }
  .wb-grid { grid-template-columns: 1fr; }
  .tbl { font-size: 13.5px; }
  .risk td, .risk th { padding-right: 8px; }
}
