/* ==========================================================================
   Building Designed by Venu (built-with-ai.html): the portfolio told as a product case study.
   Page-specific pieces on top of the master case-study system (css/case-study.css): the product
   loop, the natural-language flow, owner cards, the decision chain, the decision record,
   guardrails, the human acceptance subsection and lessons. Site tokens only, no new colors; the human role is the visual anchor
   (accent outline), release gates are solid ink, everything else stays quiet.
   ========================================================================== */

/* Page intro rhythm (polish patch 2026-10-27): the first eyebrow 48px under the sticky header at every viewport, like the
   homepage's section anchor stops and the other top-level pages; the case-study hero's own responsive padding stays for the
   case studies. */
.cs-hero.bd-hero {
  padding-top: 48px;
}
.bd-hero__support {
  max-width: 46rem;
  margin: 1rem 0 0;
  color: var(--color-text-muted);
}

/* "On this page" (01–08): a grid of equal chips, for this page only; the case-study index elsewhere keeps
   its wrapping row. One column on narrow phones, two from 440px, two rows of four from 1000px. Every chip
   has the same width and height (at least 44px), the gap is the same both ways, and long labels wrap
   inside the chip. */
.bd-hero .cs-index {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: 1fr;
}
.bd-hero .cs-index a {
  min-height: 2.75rem;
  text-wrap: balance;
}
@media (min-width: 440px) {
  .bd-hero .cs-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1000px) {
  .bd-hero .cs-index {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Think → Build → Challenge: a short chain of pills, arrows between them */
.bd-chain,
.bd-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}
.bd-chain {
  gap: 0.55rem 1.45rem;
}
.bd-chain li {
  position: relative;
  padding: 0.32rem 0.72rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}
.bd-chain li:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -1.12rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-weight: 400;
}

/* Chip chains that wrap (how a decision is made, and how each decision moved): the arrow leads each
   chip after the first, in the flow, so when a chain wraps the arrow moves to the next row with the
   chip it points to instead of trailing the row above */
.bd-legend {
  gap: 0.55rem 0.5rem;
}
.bd-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
}
.bd-legend li + li::before {
  content: "→";
  color: var(--color-text-muted);
  font-weight: 400;
}
.bd-legend span {
  padding: 0.32rem 0.72rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface);
}
.bd-legend li.is-decision span {
  border-color: transparent;
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
/* Light theme: accent text on the accent tint measured 4.15:1 (section 03) and 4.29:1 (section 04, on the band),
   below WCAG AA. Body ink on the same tint is 12.4:1 and 12.9:1; the tint still marks the human decision. The dark
   theme keeps the accent (7.1:1 and 6.3:1). */
:root:not([data-theme="dark"]) .bd-legend li.is-decision span {
  color: var(--color-text);
}

/* Natural language is the control layer: one vertical flow from the human's direction to release. Each step
   is a card (role first, then who); the connector under it names what passes to the next step. The human
   steps are outlined in accent, the natural-language hand-off is accent, and Release is solid ink. */
.bd-nl {
  margin: 0;
  display: grid;
  gap: 1.1rem;
  padding: clamp(1.1rem, 0.8rem + 1.5vw, 2rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.bd-nl__flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
}
.bd-tag {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.bd-tag--human {
  color: var(--color-accent);
}
.bd-nl__card {
  display: grid;
  gap: 0.2rem 1rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
}
.bd-nl__card h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
}
.bd-nl__who {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text-muted);
}
.bd-nl .is-human .bd-nl__card {
  border: 2px solid var(--color-accent);
  background: var(--color-bg);
}
.bd-nl .is-human .bd-nl__who {
  color: var(--color-accent);
}
.bd-gate {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.4rem 0 0;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.bd-gate svg {
  width: 0.95rem;
  height: 0.95rem;
}
.bd-nl .is-release .bd-nl__card {
  justify-self: start;
  padding: 0.5rem 1.3rem;
  border: 2px solid var(--color-text);
  border-radius: 999px;
  background: var(--color-text);
  color: var(--color-bg);
}
.bd-nl .is-release h3 {
  font-size: 1rem;
}
.bd-nl__hand { /* the connector: a line down from the card with an arrowhead, labeled with what is passed on */
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.75rem;
  margin: 0 0 0 1.4rem;
  padding: 0.7rem 0 0.8rem 1rem;
  border-left: 2px solid var(--color-border-strong);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text-muted);
}
.bd-nl__hand::after {
  content: "";
  position: absolute;
  left: -6px;
  bottom: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--color-border-strong);
}
.bd-nl__hand.is-language {
  border-left-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 700;
}
.bd-nl__hand.is-language::after {
  border-top-color: var(--color-accent);
}
.bd-nl__hand svg {
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
}
.bd-nl figcaption {
  margin: 0;
  text-align: center;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}
@media (min-width: 560px) {
  .bd-nl__card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  .bd-nl__card .bd-tag,
  .bd-nl__card .bd-gate {
    grid-column: 1 / -1;
  }
  .bd-nl__who {
    grid-column: 2;
    grid-row: 2;
    text-align: right;
  }
}

/* Numbered tracks: the product loop (10 steps, with owners) and the evolution (5 stages).
   A vertical timeline on phones and tablets, one row on wide screens. */
.bd-track {
  --node: 2rem;
  --cols: 10;
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  counter-reset: bd-track;
}
.bd-evo {
  --cols: 5;
}
.bd-track::before { /* the line through the nodes */
  content: "";
  position: absolute;
  left: calc(var(--node) / 2 - 1px);
  top: calc(var(--node) / 2);
  bottom: calc(var(--node) / 2);
  width: 2px;
  background: var(--color-border-strong);
}
.bd-track li {
  counter-increment: bd-track;
  position: relative;
  display: grid;
  grid-template-columns: var(--node) minmax(0, 1fr);
  align-items: center;
  column-gap: 0.85rem;
}
.bd-track li::before {
  content: counter(bd-track, decimal-leading-zero);
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: var(--node);
  height: var(--node);
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  background: var(--color-surface);
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
}
.bd-track b {
  grid-column: 2;
  font-weight: 700;
  line-height: 1.25;
}
.bd-track small {
  grid-column: 2;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.bd-track li.is-human::before,
.bd-track li.is-now::before {
  background: var(--color-accent);
  color: var(--color-bg);
}
.bd-track li.is-gate::before {
  border-color: var(--color-text);
  background: var(--color-text);
  color: var(--color-bg);
}
.bd-track li.is-loop::before {
  content: "↺";
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.bd-loop li.is-human small,
.bd-loop li.is-gate small {
  color: var(--color-text);
}
@media (min-width: 1000px) {
  .bd-track {
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: 0 0.5rem;
  }
  .bd-track::before {
    left: calc(100% / (var(--cols) * 2));
    right: calc(100% / (var(--cols) * 2));
    top: calc(var(--node) / 2 - 1px);
    bottom: auto;
    width: auto;
    height: 2px;
  }
  .bd-track li {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    align-content: start;
    row-gap: 0.55rem;
    text-align: center;
  }
  .bd-track li::before {
    grid-row: auto;
  }
  .bd-track b,
  .bd-track small {
    grid-column: 1;
  }
  .bd-loop b {
    font-size: 0.86rem;
  }
  .bd-loop small {
    margin-top: -0.3rem;
    font-size: 0.64rem;
  }
}

/* Who owns what: four cards, the human first and outlined */
.bd-owners {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr));
  gap: 1rem;
}
.bd-owners > li {
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.bd-owners > li.is-human {
  border: 2px solid var(--color-accent);
}
.bd-owners h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
}
.bd-owners__role {
  margin: 0.2rem 0 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text-muted);
}
.bd-owners > li.is-human .bd-owners__role {
  color: var(--color-accent);
}
.bd-owners ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.bd-owners li li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.92rem;
  line-height: 1.4;
}
.bd-owners li li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--color-border-strong);
}
.bd-owners > li.is-human li::before {
  background: var(--color-accent);
}
.bd-owners__tech {
  margin: 0.85rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--color-border-strong);
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* Why separate the roles: the principle, then Think → Build → Challenge */
.bd-why {
  display: grid;
  gap: 1rem;
}
/* Three equal steps: every column takes the widest step's width (the Challenge pill), each pill fills its
   column, the role sits centered under its pill, and each arrow is centered in the same gap. Phones get a
   tighter gap and pill padding; below 360px the steps stack, arrows pointing down. */
.bd-chain--why {
  --why-gap: 2.25rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  width: max-content;
  max-width: 100%;
  gap: var(--why-gap);
}
.bd-chain--why li { /* the pill is the step; the role sits quietly underneath */
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.3rem;
  padding: 0;
  border: 0;
  background: none;
}
.bd-chain--why b {
  position: relative;
  justify-self: stretch;
  padding: 0.32rem 0.85rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface);
  text-align: center;
}
.bd-chain--why small {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--color-text-muted);
}
.bd-chain--why li:not(:last-child)::after {
  content: none;
}
.bd-chain--why li:not(:last-child) b::after {
  content: "→";
  position: absolute;
  top: 50%;
  left: calc(100% + 1px); /* from the pill's outer edge */
  width: var(--why-gap);
  transform: translateY(-50%);
  text-align: center;
  color: var(--color-text-muted);
  font-weight: 400;
}
@media (max-width: 479px) {
  .bd-chain--why {
    --why-gap: 1.5rem;
  }
  .bd-chain--why b {
    padding-inline: 0.6rem;
  }
}
@media (max-width: 359px) {
  .bd-chain--why {
    grid-auto-flow: row;
  }
  .bd-chain--why li:not(:last-child) b::after {
    content: none;
  }
  .bd-chain--why li:not(:last-child)::after {
    content: "↓";
    top: 100%;
    right: 0;
    left: 0;
    height: var(--why-gap);
    display: grid;
    place-items: center;
    transform: none;
  }
}

/* How a decision is made: lighter than the pills above. Plain steps with an arrow between each, and only
   "Venu decides" sits on a tint. The steps stack in order, arrows pointing down, until the whole flow fits on
   one line. */
.bd-approve {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0;
}
.bd-approve li {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.bd-approve li + li::before {
  content: "↓";
  padding-inline: 0.72rem;
}
.bd-approve span {
  border: 0;
  background: none;
}
.bd-approve li.is-decision span {
  border-radius: var(--radius-sm);
}
@media (min-width: 1080px) {
  .bd-approve,
  .bd-approve li {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }
  .bd-approve li + li::before {
    content: "→";
    padding-inline: 0;
  }
  .bd-approve li:not(.is-decision) span {
    padding-inline: 0;
  }
}

.bd-note {
  margin: 0;
  max-width: 46rem;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}
/* Section 01: the first mention of Nova says what Nova is, right under the product loop, the same 0.85rem below it as
   the loop sits below its label */
.bd-note--nova {
  margin-top: 0.85rem;
}
/* Section 06: one short paragraph under the evolution track naming the October 2026 milestones (P016). Body text, not a
   card or a list, so the five-stage track stays the section's figure. */
.bd-evo__note {
  margin: 0;
  max-width: 46rem;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* Decisions, not prompts: one row per decision; open a row to see the chain of ownership */
.bd-decisions {
  display: grid;
  gap: 0.6rem;
}
.bd-dec {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.bd-dec[open] {
  border-color: var(--color-border-strong);
}
.bd-dec summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.15rem;
  list-style: none;
  cursor: pointer;
  border-radius: var(--radius-md);
}
.bd-dec summary::-webkit-details-marker {
  display: none;
}
.bd-dec summary::after {
  content: "+";
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--color-border-strong);
  color: var(--color-accent);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}
.bd-dec[open] summary::after {
  content: "−";
}
.bd-dec summary:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}
.bd-dec__n {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
}
.bd-dec__t b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.25;
}
.bd-dec__t span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--color-text-muted);
}
.bd-dec__chain {
  list-style: none;
  margin: 0;
  padding: 0 1.15rem 1.15rem;
  display: grid;
  gap: 0.55rem;
}
.bd-dec__chain li {
  position: relative;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-size: 0.92rem;
  line-height: 1.45;
}
.bd-dec__chain b {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.bd-dec__chain li.is-decision {
  border-left: 3px solid var(--color-accent);
  background: var(--color-accent-soft);
  font-weight: 600;
}
.bd-dec__chain li.is-decision b {
  color: var(--color-accent);
}
@media (min-width: 760px) {
  .bd-dec__chain {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem 1.2rem;
  }
  .bd-dec__chain li:nth-child(3n + 1)::after,
  .bd-dec__chain li:nth-child(3n + 2)::after {
    content: "→";
    position: absolute;
    right: -0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-weight: 400;
  }
}

/* Guardrails: four standing rules, each with a check */
.bd-guards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 0.6rem;
}
.bd-guards li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}
.bd-guards li::before {
  content: "✓";
  flex: none;
  display: grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0.05rem;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Human acceptance before release: one plain editorial subsection between the guardrails and "By design" */
.bd-uat {
  display: grid;
  gap: 1rem;
  max-width: 46rem;
}
.bd-uat h3 {
  font-size: var(--fs-h3);
}

/* What this changed: five short lessons */
.bd-lessons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  max-width: 48rem;
}
.bd-lessons li {
  padding: 0.55rem 0 0.55rem 1.1rem;
  border-left: 2px solid var(--color-border-strong);
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  font-weight: 700;
  line-height: 1.3;
}

.bd-actions {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Visual QA 2026-10-19 (presentation only):
   - "Who owns what": two by two between 600 and 1000px, instead of three cards and one alone.
   - Guard cards and decision lines: no single word left on a last line. */
@media (min-width: 600px) and (max-width: 1000px) {
  .bd-owners {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.bd-guards li,
.bd-dec__t span {
  text-wrap: pretty;
}
