/* ============================================================
   Harness Engineering — talk deck
   A hand-rolled, dependency-free slide engine.
   Design system: dark surface, one blue accent, orange = danger.
   Palette values validated with the dataviz palette validator.
   ============================================================ */

:root {
  /* surfaces */
  --page:        #0d0d0d;   /* page plane */
  --surface:     #1a1a19;   /* card / chart surface */
  --surface-2:   #232322;
  --hairline:    rgba(255,255,255,0.10);
  --hairline-2:  rgba(255,255,255,0.06);

  /* ink */
  --ink:         #ffffff;
  --ink-2:       #c3c2b7;   /* secondary */
  --ink-3:       #898781;   /* muted */

  /* accents (validated dark-mode categorical slots) */
  --blue:        #3987e5;   /* primary accent */
  --blue-soft:   rgba(57,135,229,0.14);
  --orange:      #d95926;   /* danger / failure */
  --orange-soft: rgba(217,89,38,0.14);
  --aqua:        #199e70;   /* success / verify */
  --yellow:      #c98500;
  --violet:      #9085e9;
  --good:        #0ca30c;
  --critical:    #d03b3b;

  /* type */
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* JetBrains first: it is the face the deck loads, so slides render the same on any machine */
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, "Cascadia Code", monospace;

  /* rhythm */
  --pad: clamp(2.5rem, 6vw, 6rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
  overflow: hidden;
}

/* ---------- deck / slide layout ---------- */

.deck { position: fixed; inset: 0; }

.slide {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: center;
  padding: var(--pad);
  opacity: 0;
  overflow: hidden;
}

.slide.active {
  display: flex;
  animation: slideIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(22px) scale(0.995); }
  to   { opacity: 1; transform: none; }
}

/* stagger children in */
.slide.active .reveal {
  opacity: 0;
  animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.slide.active .reveal:nth-child(1) { animation-delay: 0.10s; }
.slide.active .reveal:nth-child(2) { animation-delay: 0.20s; }
.slide.active .reveal:nth-child(3) { animation-delay: 0.30s; }
.slide.active .reveal:nth-child(4) { animation-delay: 0.40s; }
.slide.active .reveal:nth-child(5) { animation-delay: 0.50s; }
.slide.active .reveal:nth-child(6) { animation-delay: 0.60s; }
.slide.active .reveal:nth-child(7) { animation-delay: 0.70s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- typography ---------- */

.eyebrow {
  font-size: clamp(0.75rem, 1vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1.4rem;
}
.eyebrow.danger { color: var(--orange); }
.eyebrow.ok { color: var(--aqua); }

h1 {
  font-size: clamp(2.6rem, 6.5vw, 5.6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
h2 {
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  font-weight: 780;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
h3 {
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
p, li { font-size: clamp(1.05rem, 1.7vw, 1.5rem); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.lead { font-size: clamp(1.2rem, 2.2vw, 1.9rem); color: var(--ink-2); max-width: 24ch; }

.accent { color: var(--blue); }
.danger { color: var(--orange); }
.ok { color: var(--aqua); }
.muted { color: var(--ink-3); }
.nowrap { white-space: nowrap; }

/* big statement slides */
.statement { justify-content: center; }
.statement h1 {
  font-size: clamp(2.8rem, 7.5vw, 6.4rem);
  max-width: 18ch;
}
.statement .sub { margin-top: 2rem; font-size: clamp(1.1rem, 2vw, 1.7rem); color: var(--ink-3); max-width: 40ch; }

/* ---------- lists ---------- */

ul.clean { list-style: none; display: flex; flex-direction: column; gap: 1.15rem; margin-top: 2.2rem; max-width: 46ch; }
/* marker hangs outside the text block so <strong> stays inline and
   wrapped lines align under the first word, not under the flex item */
ul.clean li { position: relative; padding-left: 1.9rem; }
ul.clean li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.7rem; height: 0.7rem;
  border-radius: 3px;
  background: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}
ul.clean.danger li::before { background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }

/* ---------- cards / grids ---------- */

.grid { display: grid; gap: 1.2rem; margin-top: 2.4rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 1.6rem 1.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.card .k { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); }
.card .k.danger { color: var(--orange); }
.card .k.ok { color: var(--aqua); }
.card h3 { color: var(--ink); }
.card p { font-size: clamp(0.95rem, 1.3vw, 1.15rem); color: var(--ink-2); }

/* stat tiles */
.stat { align-items: flex-start; }
.stat .num {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 820;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat .num.blue { color: var(--blue); }
.stat .num.orange { color: var(--orange); }
.stat .num.aqua { color: var(--aqua); }
.stat .lbl { color: var(--ink-2); font-size: clamp(0.9rem, 1.2vw, 1.1rem); margin-top: 0.4rem; }

/* ---------- layout helpers ---------- */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; height: 100%; }
.split.narrow-left { grid-template-columns: 0.85fr 1.15fr; }

.chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; color: var(--ink-2);
  background: var(--surface);
}
.chip .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--blue); }

/* contact: bio slide list + closing-slide strip */
.contact { list-style: none; margin-top: 1.4rem; display: flex; flex-direction: column; gap: 0.55rem; }
.contact li { display: flex; align-items: baseline; gap: 0.9rem; font-size: clamp(0.9rem, 1.2vw, 1.1rem); }
.contact .c-k {
  flex: 0 0 5.5rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}
.contact a { font-family: var(--mono); }

.contact-strip { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 0.7rem; }
.contact-strip .chip { font-weight: 500; }

.slide a { color: var(--blue); text-decoration: none; border-bottom: 1px solid var(--blue-soft); }
.slide a:hover { border-bottom-color: var(--blue); }

/* pull quote */
.pull { max-width: 24ch; }
.pull .mark { color: var(--blue); font-size: 4rem; line-height: 0.4; font-weight: 800; display: block; margin-bottom: 0.4rem; }
.pull h2 { font-weight: 600; letter-spacing: -0.01em; }
.pull .cite { margin-top: 1.6rem; color: var(--ink-3); font-size: 1rem; font-weight: 600; letter-spacing: 0.02em; }

/* flow / pipeline diagram */
.flow { display: flex; align-items: stretch; gap: 0; margin-top: 2.6rem; flex-wrap: wrap; }
.flow .node {
  flex: 1 1 0; min-width: 140px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 1.2rem 1rem; text-align: center;
  display: flex; flex-direction: column; gap: 0.35rem; justify-content: center;
}
.flow .node .n-k { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.flow .node .n-t { font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.flow .arrow { display: flex; align-items: center; color: var(--blue); font-size: 1.4rem; padding: 0 0.6rem; }

/* loop badge */
.loop-band { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 2.4rem; }
.loop-band .pill {
  padding: 0.7rem 1.2rem; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--surface);
  font-weight: 700; color: var(--ink); font-size: 1.05rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.loop-band .pill .idx { color: var(--blue); font-variant-numeric: tabular-nums; }

/* ---------- chart ---------- */
.chart-wrap { margin-top: 1.5rem; width: 100%; }
.chart-legend { display: flex; gap: 1.6rem; margin-top: 1rem; flex-wrap: wrap; }
.chart-legend .item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; color: var(--ink-2); font-weight: 600; }
.chart-legend .swatch { width: 1.1rem; height: 0.28rem; border-radius: 2px; }

/* ---------- chrome (progress, footer, nav) ---------- */

.progress {
  position: fixed; top: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--aqua));
  width: 0; z-index: 50; transition: width 0.4s cubic-bezier(0.16,1,0.3,1);
}

.footer {
  position: fixed; bottom: 1.5rem; left: var(--pad); right: var(--pad);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; color: var(--ink-3); z-index: 40;
  letter-spacing: 0.04em;
}
.footer .brand { font-weight: 700; color: var(--ink-2); }
.footer .brand .sq { display: inline-block; width: 0.55rem; height: 0.55rem; background: var(--blue); border-radius: 2px; margin-right: 0.5rem; vertical-align: middle; }
.footer .count { font-variant-numeric: tabular-nums; }

.hint {
  position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%);
  font-size: 0.75rem; color: var(--ink-3); z-index: 40; opacity: 0.7;
  transition: opacity 0.5s; letter-spacing: 0.05em;
}
.hint.hidden { opacity: 0; }
.hint kbd {
  font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: 5px; padding: 0.1rem 0.4rem; font-size: 0.72rem; color: var(--ink-2);
}

/* speaker notes overlay */
.notes {
  position: fixed; right: 1.5rem; bottom: 3.5rem; width: min(420px, 40vw);
  max-height: 45vh; overflow: auto;
  background: rgba(20,20,19,0.97); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 1.2rem 1.4rem; z-index: 60;
  display: none; backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.notes.show { display: block; }
.notes .nh { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--blue); margin-bottom: 0.6rem; font-weight: 700; }
.notes p { font-size: 0.95rem; line-height: 1.5; color: var(--ink-2); }

/* ambient background glow */
.glow {
  position: fixed; pointer-events: none; z-index: 0;
  width: 60vw; height: 60vw; border-radius: 50%;
  filter: blur(120px); opacity: 0.16;
}
.glow.a { top: -20vw; right: -10vw; background: var(--blue); }
.glow.b { bottom: -25vw; left: -15vw; background: var(--violet); }

.slide > * { position: relative; z-index: 1; }

/* number / kicker in corner */
.kicker {
  position: absolute; top: var(--pad); left: var(--pad);
  font-family: var(--mono); font-size: 0.85rem; color: var(--ink-3);
  letter-spacing: 0.1em;
}

/* code-ish inline */
code, .mono { font-family: var(--mono); font-size: 0.92em; color: var(--aqua); background: rgba(25,158,112,0.10); padding: 0.1rem 0.4rem; border-radius: 5px; }

/* ---------- annotated code block (demo section) ----------
   A readable-from-the-back-row snippet: filename tab, big mono lines,
   dimmed inline annotations. Deliberately NOT syntax-rainbow — one ink
   for code, one muted ink for the human note, one accent for the point. */
.codeblock {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 14px; overflow: hidden; margin-top: 1.6rem;
}
.codeblock .cb-head {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem 1.1rem; border-bottom: 1px solid var(--hairline-2);
  background: var(--surface-2);
  font-family: var(--mono); font-size: 0.85rem; color: var(--ink-3); letter-spacing: 0.02em;
}
.codeblock .cb-head .fname { color: var(--ink-2); font-weight: 600; }
.codeblock .cb-head .tag {
  margin-left: auto; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px;
  border: 1px solid var(--hairline); color: var(--ink-3);
}
.codeblock .cb-head .tag.ok { color: var(--aqua); border-color: rgba(25,158,112,0.4); }
.codeblock .cb-head .tag.danger { color: var(--orange); border-color: rgba(217,89,38,0.4); }
.codeblock pre {
  margin: 0; padding: 1.1rem 1.3rem;
  font-family: var(--mono);
  font-size: clamp(0.9rem, 1.35vw, 1.2rem); line-height: 1.75;
  color: var(--ink); overflow: hidden; white-space: pre-wrap; word-break: break-word;
}
.codeblock pre .cm { color: var(--ink-3); }          /* dimmed code comment */
.codeblock pre .an { color: var(--blue); font-style: normal; }  /* the point we annotate */
.codeblock pre .kw { color: var(--violet); }         /* keyword-ish */
.codeblock pre .str { color: var(--aqua); }          /* string / value */
.codeblock pre .bad { color: var(--orange); }        /* the blocked / denied token */

/* the callout line under a snippet — the one sentence to remember */
.cb-take { margin-top: 1.4rem; font-size: clamp(1.05rem, 1.6vw, 1.4rem); color: var(--ink); max-width: 52ch; }

/* two stacked snippets (config that registers → script that runs) */
.codeblock + .codeblock { margin-top: 0.7rem; }
.cb-rel {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0.55rem 0 0.15rem; padding-left: 0.2rem;
  font-family: var(--mono); font-size: 0.75rem; color: var(--ink-3); letter-spacing: 0.04em;
}
.cb-rel .arr { color: var(--blue); }

/* responsive */
@media (max-width: 900px) {
  /* content that fits a projector overflows a phone. let the slide scroll
     instead of silently cutting the bottom off; touch nav is a swipe, so a
     vertical scroll does not collide with it. */
  .slide { overflow-y: auto; justify-content: flex-start; padding-block: 2rem; }
  .split, .split.narrow-left { grid-template-columns: 1fr; gap: 1.5rem; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .flow { flex-direction: column; }
  .flow .arrow { transform: rotate(90deg); padding: 0.3rem 0; }
}

/* print / PDF export: one slide per landscape page.
   Chrome --print-to-pdf honors @page size; force 16:9 landscape and
   lay every slide out in document flow (screen mode display:none is
   overridden here) so each slide becomes its own page. */
@media print {
  @page { size: 1280px 720px; margin: 0; }
  html, body { overflow: visible; height: auto; background: var(--page) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .progress, .footer, .hint, .notes, .glow { display: none !important; }
  .deck { position: static; }
  .slide {
    display: flex !important; opacity: 1 !important; position: relative;
    inset: auto; width: 1280px; height: 720px; animation: none;
    padding: 4.5rem 5rem; justify-content: center;
    break-after: page; page-break-after: always; overflow: hidden;
  }
  .slide:last-child { break-after: auto; page-break-after: auto; }
  .slide .reveal { opacity: 1 !important; animation: none !important; transform: none !important; }
  /* the kicker is absolutely positioned for screen; in print flow it
     collides with the eyebrow, and both name the same thing — drop it. */
  .slide .kicker { display: none; }
  /* keep two-column layouts as real columns on the printed page */
  .split, .split.narrow-left { display: grid; grid-template-columns: 1fr 1fr; height: auto; }
  .split.narrow-left { grid-template-columns: 0.85fr 1.15fr; }
  /* code blocks: pin a print-safe size so a full snippet fits one page */
  .codeblock pre { font-size: 0.95rem; line-height: 1.6; }
  .codeblock { margin-top: 1rem; }
}
