/* Page 1: hero, origins, rules, prompt library */

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(40px, 7vw, 96px) clamp(36px, 5vw, 64px);
}

.hero__drafting {
  position: absolute;
  top: clamp(12px, 3vw, 40px);
  right: var(--gutter);
  width: clamp(180px, 26vw, 360px);
  height: auto;
  color: var(--line-strong);
  opacity: 0.7;
  pointer-events: none;
}

.hero__title {
  position: relative;
  max-width: 13ch;
  margin-top: 16px;
  font-size: clamp(2.7rem, 6.4vw, 5.6rem);
  font-weight: 800;
  font-stretch: 118%;
  letter-spacing: -0.015em;
  line-height: 1.02;
}

.hero__lead {
  position: relative;
  max-width: 60ch;
  margin-top: 22px;
  font-size: var(--fs-lg);
  color: var(--text-2);
}

/* BLUEPRINTS: one tile per block */
.bp {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: clamp(2px, 0.7vw, 10px);
  margin: clamp(36px, 5vw, 56px) 0 0;
  padding: 0;
  list-style: none;
}

.bp__item {
  position: relative;
}

/* The hovered letter's question box must sit above the group labels below it */
.bp__item:hover,
.bp__item:focus-within {
  z-index: 30;
}

.bp__tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 14px 2px 12px;
  color: var(--text);
  font: inherit;
  background: none;
  border: 1px solid transparent;
  cursor: var(--cur-pointer);
  transition: transform var(--t2) var(--ease), background var(--t2), border-color var(--t2);
}

.bp__tile:hover,
.bp__tile:focus-visible {
  transform: translateY(-4px);
  background: color-mix(in srgb, var(--pc) 9%, transparent);
  border-color: color-mix(in srgb, var(--pc) 45%, transparent);
}

.bp__letter {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(2.4rem, 7.6vw, 7.4rem);
  line-height: 0.9;
  background: linear-gradient(100deg, var(--pc) 42%, #ffffff 50%, var(--pc) 58%);
  background-size: 320% 100%;
  background-position: 0 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--pc) 40%, transparent));
  animation: bp-shine 1400ms var(--ease) both;
  animation-delay: calc(200ms + var(--i) * 80ms);
}

@keyframes bp-shine {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

.bp__name {
  font-family: var(--font-mono);
  font-size: clamp(9px, 0.95vw, 12px);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
}

.bp__q {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 5;
  width: max-content;
  max-width: 230px;
  padding: 10px 12px;
  font-size: var(--fs-sm);
  line-height: 1.4;
  text-align: left;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid color-mix(in srgb, var(--pc) 60%, transparent);
  box-shadow: var(--shadow);
  transform: translate(-50%, 4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t1), transform var(--t2) var(--ease);
}

.bp__item:first-child .bp__q,
.bp__item:nth-child(2) .bp__q {
  left: 0;
  transform: translate(0, 4px);
}

.bp__item:last-child .bp__q,
.bp__item:nth-child(9) .bp__q {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}

.bp__tile:hover .bp__q,
.bp__tile:focus-visible .bp__q {
  opacity: 1;
  transform: translate(-50%, 0);
}

.bp__item:first-child .bp__tile:hover .bp__q,
.bp__item:first-child .bp__tile:focus-visible .bp__q,
.bp__item:nth-child(2) .bp__tile:hover .bp__q,
.bp__item:nth-child(2) .bp__tile:focus-visible .bp__q,
.bp__item:last-child .bp__tile:hover .bp__q,
.bp__item:last-child .bp__tile:focus-visible .bp__q,
.bp__item:nth-child(9) .bp__tile:hover .bp__q,
.bp__item:nth-child(9) .bp__tile:focus-visible .bp__q {
  transform: none;
}

/* Group brackets under the letters, drawn like dimension lines */
.bp-groups {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: clamp(2px, 0.7vw, 10px);
  margin-top: 10px;
}

.bp-group {
  position: relative;
  padding-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
  color: var(--text-3);
  border-top: 1px solid var(--line-strong);
}

.bp-group::before,
.bp-group::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 1px;
  height: 9px;
  background: var(--line-strong);
}

.bp-group::before {
  left: 0;
}

.bp-group::after {
  right: 0;
}

.bp-group--intent { grid-column: 1 / span 3; }
.bp-group--engineering { grid-column: 4 / span 4; }
.bp-group--delivery { grid-column: 8 / span 3; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 34px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.hero__meta span + span::before {
  content: "/";
  margin-inline-end: 18px;
  color: var(--line-strong);
}

.hero__note {
  max-width: 70ch;
  margin-top: 14px;
  font-size: var(--fs-sm);
  color: var(--text-3);
}

@media (max-width: 760px) {
  .bp {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    row-gap: 14px;
  }
  .bp__letter {
    font-size: clamp(2.6rem, 13vw, 4.4rem);
  }
  .bp__name {
    max-width: 100%;
    font-size: 9px;
    letter-spacing: 0.02em;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .bp__q {
    display: none;
  }
  .bp-groups {
    display: none;
  }
  .hero__drafting {
    display: none;
  }
}

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(48px, 7vw, 96px);
}

.section__head {
  display: grid;
  gap: 12px;
  max-width: 72ch;
  margin-bottom: 30px;
}

.section__head h2 {
  font-size: clamp(1.9rem, 3.8vw, 3.1rem);
  font-weight: 800;
  font-stretch: 114%;
}

.section__lead {
  color: var(--text-2);
  font-size: var(--fs-lg);
}

.section__head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  max-width: none;
}

.section__intro {
  display: grid;
  gap: 12px;
  max-width: 72ch;
}

/* ---------- Origins ---------- */
.origins {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.fw {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.fw--new {
  border-color: var(--line-strong);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--brand) 60%, transparent), transparent 70%),
    var(--surface);
}

.fw__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
}

.fw__name {
  font-size: var(--fs-2xl);
  font-weight: 800;
  font-stretch: 120%;
  letter-spacing: 0.01em;
}

.fw__year {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.fw__letters {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fw__letters li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: var(--fs-sm);
}

.fw__letters b {
  width: 1.1em;
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 118%;
  font-size: var(--fs-lg);
  color: var(--accent);
}

.fw__text {
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.fw__quote {
  margin: 0;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--code-bg);
  border-left: 2px solid var(--accent);
}

.fw__note {
  margin-top: auto;
  font-size: 12.5px;
  color: var(--text-3);
}

@media (max-width: 1100px) {
  .origins {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

/* Coverage matrix */
.matrix-wrap {
  position: relative; /* keeps the screen-reader labels inside the scroll box */
  margin-top: 26px;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
}

.matrix {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.matrix th,
.matrix td {
  padding: 11px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.matrix thead th {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--code-bg);
}

.matrix tbody th {
  font-weight: 400;
}

.matrix__part {
  display: flex;
  align-items: center;
  gap: 12px;
}

.matrix__part b {
  display: block;
  font-weight: 700;
}

.matrix__part small {
  display: block;
  font-size: 12.5px;
  color: var(--text-3);
}

.matrix td {
  color: var(--text-2);
  white-space: nowrap;
}

.matrix tr.is-gap > * {
  background: color-mix(in srgb, var(--pc) 6%, transparent);
}

.cov {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-inline-end: 10px;
  vertical-align: -1px;
  border: 1.5px solid var(--accent);
  transform: rotate(45deg);
}

.cov[data-v="2"] {
  background: var(--accent);
}

.cov[data-v="1"] {
  background: linear-gradient(135deg, var(--accent) 50%, transparent 50%);
}

.cov[data-v="0"] {
  border-color: var(--line-strong);
}

.matrix caption {
  caption-side: bottom;
  padding: 14px 16px;
  text-align: left;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.matrix__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
}

/* ---------- Rules ---------- */
.rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.rule {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.rule h3 {
  font-size: var(--fs-xl);
  font-weight: 700;
  font-stretch: 108%;
}

.rule p {
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.rule__tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

@media (max-width: 980px) {
  .rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

/* ---------- Library filter ---------- */
.seg {
  display: inline-flex;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.seg button {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  font: 700 var(--fs-sm) / 1 var(--font-body);
  color: var(--text-2);
  background: none;
  border: 0;
  cursor: var(--cur-pointer);
  transition: color var(--t1), background var(--t1);
}

.seg button small {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
}

.seg button:hover {
  color: var(--text);
}

.seg button[aria-pressed="true"] {
  color: var(--text-on-accent);
  background: var(--accent);
}

.seg button[aria-pressed="true"] small {
  color: inherit;
  opacity: 0.8;
}

/* ---------- Drawers ---------- */
.drawers {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.drawer {
  position: relative;
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}

.drawer__h {
  margin: 0;
  font: inherit;
}

.drawer__head {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  width: 100%;
  padding: 18px 22px;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: var(--cur-pointer);
  transition: background var(--t2), border-color var(--t2), box-shadow var(--t2);
}

.drawer__head::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  bottom: -1px;
  width: 3px;
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity var(--t2);
}

.drawer__head:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.drawer__head:hover::before,
.drawer.is-open .drawer__head::before {
  opacity: 1;
}

.drawer.is-open .drawer__head {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-glow);
}

.drawer__num {
  min-width: 2.2ch;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.3px var(--accent);
  transition: color var(--t2);
}

.drawer__head:hover .drawer__num,
.drawer.is-open .drawer__num {
  color: var(--accent);
}

.drawer__main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.drawer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}

.drawer__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  font-stretch: 110%;
  line-height: 1.2;
}

.drawer__sum {
  max-width: 72ch;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.drawer__tech {
  display: grid;
  gap: 2px;
  max-width: 24ch;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.drawer__tech b {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}

.drawer__chev {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--accent);
  border: 1px solid var(--line);
  transition: transform var(--t3) var(--ease), background var(--t2);
}

.drawer.is-open .drawer__chev {
  transform: rotate(180deg);
  background: var(--accent-soft);
}

.drawer__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--t3) var(--ease);
}

.drawer.is-open .drawer__panel {
  grid-template-rows: 1fr;
}

.drawer__panel.no-anim {
  transition: none;
}

.drawer__clip {
  min-height: 0;
  overflow: hidden;
  overflow: clip;
}

@media (max-width: 860px) {
  .drawer__head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px 16px;
    padding: 16px;
  }
  .drawer__tech {
    grid-column: 2 / -1;
    grid-row: 2;
    max-width: none;
    text-align: left;
  }
  .drawer__chev {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
  }
}

/* ---------- Prompt window ---------- */
.pw {
  position: relative;
  margin-top: 10px;
  padding: 20px 22px 22px;
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.pw__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
}

.tb {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  font-family: var(--font-mono);
  border: 1px solid var(--line);
}

.tb > div {
  padding: 7px 14px;
  border-right: 1px solid var(--line);
}

.tb > div:last-child {
  border-right: 0;
}

.tb dt {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

.tb dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pw__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Prompt DNA: one segment per block, sized by word count */
.dna {
  margin-top: 22px;
}

.dna__bar {
  display: flex;
  gap: 3px;
  height: 14px;
}

.dna__seg {
  flex: var(--w) 1 0;
  min-width: 8px;
  padding: 0;
  background: var(--pc);
  border: 0;
  opacity: 0.8;
  cursor: var(--cur-pointer);
  transform-origin: left center;
  transition: opacity var(--t1), transform var(--t2) var(--ease), box-shadow var(--t2);
}

.dna__seg:hover,
.dna__seg.is-active {
  opacity: 1;
  transform: scaleY(1.6);
  box-shadow: 0 0 14px color-mix(in srgb, var(--pc) 60%, transparent);
}

.dna__dim {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.dna__dim::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--line-strong);
}

.dna__dim i {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border: solid var(--line-strong);
  border-width: 0 0 1px 1px;
}

.dna__dim i:first-child {
  left: 0;
  transform: translateY(-50%) rotate(45deg);
}

.dna__dim i:last-child {
  right: 0;
  transform: translateY(-50%) rotate(-135deg);
}

.dna__dim span {
  position: relative;
  padding: 0 12px;
  background: var(--surface-strong);
}

/* Blocks and the explanation dock */
.pw__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0fr);
  gap: 0;
  align-items: start;
  margin-top: 20px;
  transition: grid-template-columns var(--t3) var(--ease), column-gap var(--t3) var(--ease);
}

.pw.has-dock .pw__grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  column-gap: 20px;
}

.blocks {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.blk {
  position: relative;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 16px 14px 14px;
  background: color-mix(in srgb, var(--pc) 4%, transparent);
  border: 1px solid transparent;
  border-left: 3px solid color-mix(in srgb, var(--pc) 65%, transparent);
  cursor: var(--cur-pointer);
  transition: background var(--t2), border-color var(--t2), box-shadow var(--t2);
}

.blk:hover {
  background: color-mix(in srgb, var(--pc) 10%, transparent);
  border-color: color-mix(in srgb, var(--pc) 32%, transparent);
  border-left-color: var(--pc);
}

.blk.is-active {
  background: color-mix(in srgb, var(--pc) 14%, transparent);
  border-color: color-mix(in srgb, var(--pc) 62%, transparent);
  border-left-color: var(--pc);
  box-shadow: 0 0 30px color-mix(in srgb, var(--pc) 20%, transparent);
}

.pw.has-dock .blk.is-active::after {
  content: "";
  position: absolute;
  top: 18px;
  right: -8px;
  width: 14px;
  height: 14px;
  background: color-mix(in srgb, var(--pc) 14%, var(--surface-strong));
  border: solid color-mix(in srgb, var(--pc) 62%, transparent);
  border-width: 1px 1px 0 0;
  transform: rotate(45deg);
}

.blk__gutter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.blk__label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.blk__name {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
  color: var(--text-2);
}

.blk__why {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 6px;
  font: 600 12px / 1 var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--pc);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--pc) 45%, transparent);
  cursor: var(--cur-pointer);
  opacity: 0.75;
  transition: opacity var(--t1), background var(--t1), color var(--t1);
}

.blk__why .icon {
  width: 14px;
  height: 14px;
}

.blk:hover .blk__why,
.blk.is-active .blk__why,
.blk__why:focus-visible {
  opacity: 1;
}

.blk__why:hover {
  color: var(--text-on-accent);
  background: var(--pc);
}

.blk__tech {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pc);
}

.blk__body {
  min-width: 0;
  font-size: var(--fs-md);
  line-height: 1.62;
}

.pw.is-booting .dna__seg {
  animation: seg-in 560ms var(--ease) both;
  animation-delay: calc(120ms + var(--i) * 45ms);
}

.pw.is-booting .blk {
  animation: rise-in 480ms var(--ease) both;
  animation-delay: calc(220ms + var(--i) * 45ms);
}

@keyframes seg-in {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: none; opacity: 0.8; }
}

.pw__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.pw__foot b {
  color: var(--text);
}

.pw__foot .icon {
  width: 16px;
  height: 16px;
  color: var(--accent);
  vertical-align: -3px;
  margin-inline-end: 6px;
}

@media (max-width: 760px) {
  .pw {
    padding: 16px 14px 16px;
  }
  .blk {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }
  .blk__gutter {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .blk__why {
    opacity: 1;
  }
}

@media (hover: none) {
  .blk__why {
    opacity: 1;
  }
}

/* Dock: the explanation window beside the blocks on wide screens */
.dock {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  min-width: 0;
  max-height: calc(100vh - var(--topbar-h) - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dock__body {
  min-width: 340px;
}

/* ---------- Explanation content (dock and modal) ---------- */
.ex {
  position: relative;
  padding: 22px 22px 18px;
}

.holo--modal .ex {
  padding: 26px 26px 20px;
}

.ex__head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 44px;
}

.ex__letter {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 3.6rem;
  line-height: 0.85;
  color: var(--pc);
  text-shadow: 0 0 28px color-mix(in srgb, var(--pc) 45%, transparent);
}

.ex__kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.ex__name {
  font-size: var(--fs-2xl);
  font-weight: 800;
  font-stretch: 114%;
}

.ex__name:focus {
  outline: none;
}

.ex__tech {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--text-on-accent);
  background: var(--pc);
}

.ex__tech .icon {
  width: 15px;
  height: 15px;
}

.ex__does {
  margin-top: 14px;
  padding-left: 12px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  border-left: 2px solid var(--pc);
}

.ex__quote {
  position: relative;
  max-height: 10.5em;
  margin-top: 16px;
  padding: 12px 14px;
  overflow: hidden;
  font-size: var(--fs-sm);
  background: color-mix(in srgb, var(--pc) 7%, transparent);
  border: 1px dashed color-mix(in srgb, var(--pc) 45%, transparent);
}

.ex__quote.is-full {
  max-height: none;
}

.ex__quote:not(.is-full)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3em;
  background: linear-gradient(transparent, var(--surface-strong));
}

.ex__more {
  margin-top: 6px;
  padding: 2px 0;
  font: 600 12px / 1.4 var(--font-mono);
  color: var(--accent);
  background: none;
  border: 0;
  cursor: var(--cur-pointer);
}

.ex__sec {
  margin-top: 18px;
}

.ex__sec p {
  font-size: var(--fs-md);
}

.ex__sec--without h4 {
  color: var(--text-2);
}

.ex__sec--without p {
  color: var(--text-2);
}

.ex__sec--tip p {
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.ex__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ex__foot .btn {
  min-height: 36px;
  padding: 7px 12px;
}

.ticks {
  display: flex;
  gap: 2px;
}

.tick {
  width: 16px;
  height: 22px;
  padding: 0;
  background: none;
  border: 0;
  cursor: var(--cur-pointer);
}

.tick::before {
  content: "";
  display: block;
  width: 100%;
  height: 5px;
  background: color-mix(in srgb, var(--tc) 38%, transparent);
  transition: height var(--t1), background var(--t1);
}

.tick:hover::before {
  background: var(--tc);
}

.tick[aria-current="true"]::before {
  height: 9px;
  background: var(--tc);
  box-shadow: 0 0 10px var(--tc);
}

.is-booting .ex > * {
  animation: rise-in 420ms var(--ease) both;
}

.is-booting .ex > :nth-child(2) { animation-delay: 60ms; }
.is-booting .ex > :nth-child(3) { animation-delay: 110ms; }
.is-booting .ex > :nth-child(4) { animation-delay: 160ms; }
.is-booting .ex > :nth-child(5) { animation-delay: 210ms; }
.is-booting .ex > :nth-child(6) { animation-delay: 260ms; }
.is-booting .ex > :nth-child(7) { animation-delay: 310ms; }
.is-booting .ex > :nth-child(8) { animation-delay: 360ms; }

.is-swapping .ex {
  animation: ex-swap 320ms var(--ease) both;
}

@keyframes ex-swap {
  from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 14px)); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .ex,
  .holo--modal .ex {
    padding: 22px 18px 16px;
  }
  .ex__letter {
    font-size: 2.8rem;
  }
  .ticks {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

/* ---------- Rich prompt text ---------- */
.rich p {
  margin: 0 0 0.55em;
}

.rich > :last-child {
  margin-bottom: 0;
}

.rich .md-h {
  margin: 0 0 0.3em;
  font-weight: 800;
}

.rich .md-mark {
  margin-inline-end: 0.45em;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-3);
}

.rich .xml-tag {
  margin: 0 0 0.3em;
  font-family: var(--font-mono);
  font-size: 0.86em;
  font-weight: 600;
  color: var(--pc, var(--accent));
}

.rich .xml-tag + .xml-tag {
  margin-top: -0.1em;
}

.rich ul,
.rich ol {
  margin: 0.15em 0 0.55em;
  padding-left: 1.35em;
}

.rich li {
  margin: 0.18em 0;
}

.rich li::marker {
  color: var(--pc, var(--accent));
  font-weight: 700;
}

.rich pre {
  margin: 0.45em 0 0.7em;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  background: var(--code-bg);
  border: 1px solid var(--line);
}

.rich pre code {
  font-size: inherit;
}
