/* Handover pages (owned by comp-codegeist-handover). Builds on /assets/site.css tokens.
   Direction: "the baton pass". Teal for the app, an orange baton for the moment work changes hands.
   Peak: the anatomy of a handover page, whose rows fill in as they scroll into view.
   CSS only (scroll-driven animations), skipped for reduced motion; without support everything is simply shown. */

.ho {
  --ho: #0f766e;
  --ho-strong: #115e59;
  --ho-soft: #ecfbf7;
  --ho-line: #c4e9e1;
  --ho-baton: #f97316;
  --ho-baton-soft: #ffedd5;
  --ho-baton-ink: #7c2d12;
}
@media (prefers-color-scheme: dark) {
  .ho {
    --ho: #5eead4;
    --ho-strong: #99f6e4;
    --ho-soft: #102421;
    --ho-line: #1f4641;
    --ho-baton: #fb923c;
    --ho-baton-soft: #3b2412;
    --ho-baton-ink: #fed7aa;
  }
}

/* ---------- Shared bits ---------- */
.ho-caption { margin-top: var(--s-3); color: var(--ink-3); font-size: var(--t-xs); }
.ho-key { font-family: var(--font-mono); font-size: 0.86em; color: var(--ho); font-weight: 600; white-space: nowrap; }
.ho-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--ho-soft);
  border: 1px solid var(--ho-line);
  color: var(--ho);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ho-avatar--cover { background: var(--ho-baton-soft); border-color: var(--ho-baton); color: var(--ho-baton-ink); }
.ho-person { display: inline-flex; align-items: center; gap: var(--s-2); white-space: nowrap; font-weight: 550; }
.ho-tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--ho-line);
  background: var(--ho-soft);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.ho-tag--risk { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }

/* ---------- Hero ---------- */
.ho-hero .hero__title { max-width: 14ch; }
.ho-hero .hero__title em { font-style: normal; color: var(--ho); }
.ho-scene { position: relative; padding: var(--s-8) 0 var(--s-7); isolation: isolate; }
.ho-plane { position: relative; }
.ho-chat {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  max-width: min(22rem, 78%);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-lg) var(--r-lg) var(--r-lg) 4px;
  background: var(--ho-strong);
  color: #fff;
  font-size: var(--t-sm);
  line-height: 1.45;
  box-shadow: 0 10px 24px -12px rgb(15 20 19 / 0.45);
}
@media (prefers-color-scheme: dark) { .ho-chat { background: #134e48; color: #f0fdfa; } }
.ho-chat__who { display: block; margin-bottom: 0.15rem; font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.ho-sheet {
  position: absolute;
  inset: 1.25rem -0.75rem 1.5rem 18%;
  z-index: -1;
  border: 1px solid var(--ho-line);
  border-radius: var(--r-lg);
  background: var(--ho-soft);
  transform: rotate(2.5deg);
}
.ho-page {
  margin-left: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.ho-page__head { padding: var(--s-5) var(--s-5) var(--s-3); border-bottom: 1px solid var(--line); }
.ho-page__crumb { color: var(--ink-3); font-size: var(--t-xs); }
.ho-page__title { margin-top: var(--s-1); font-size: var(--t-lg); font-weight: 650; letter-spacing: var(--track-snug); }
.ho-props { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-bottom: 1px solid var(--line); }
.ho-props > div { padding: var(--s-3) var(--s-5); border-right: 1px solid var(--line); min-width: 0; }
.ho-props > div:last-child { border-right: 0; }
.ho-props dt { color: var(--ink-3); font-size: 0.75rem; }
.ho-props dd { margin: 0.15rem 0 0; font-size: var(--t-sm); font-weight: 600; }
.ho-items { list-style: none; padding: var(--s-2) var(--s-5) var(--s-4); margin: 0; }
.ho-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.15rem var(--s-3);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--t-sm);
}
.ho-item:last-child { border-bottom: 0; }
.ho-item__what { min-width: 0; font-weight: 550; }
.ho-item__why { grid-column: 1 / -1; color: var(--ink-2); font-size: var(--t-xs); }
.ho-item__why::before { content: "Why: "; color: var(--ink-3); }
.ho-confirm {
  position: absolute;
  right: -0.25rem;
  bottom: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  background: var(--ho-baton);
  color: #1c0d02;
  font-size: var(--t-xs);
  font-weight: 650;
  box-shadow: 0 6px 18px -6px rgb(15 20 19 / 0.35);
}
.ho-confirm::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #1c0d02; }
@media (max-width: 30em) {
  .ho-scene { padding-top: 7.5rem; overflow-x: clip; }
  .ho-confirm { right: 0; }
  .ho-page { margin-left: 0; }
  .ho-chat { max-width: 92%; }
  .ho-sheet { inset: 6rem 0.25rem 1.5rem 12%; }
  .ho-props { grid-template-columns: minmax(0, 1fr); }
  .ho-props > div { border-right: 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: var(--s-3); }
  .ho-props > div:last-child { border-bottom: 0; }
  .ho-props dd { margin: 0; }
  .ho-page__head, .ho-items { padding-inline: var(--s-4); }
  .ho-props > div { padding-inline: var(--s-4); }
  .ho-confirm { right: var(--s-2); }
}

/* ---------- The problem ---------- */
.ho-problem { display: grid; gap: var(--s-6) var(--s-8); align-items: start; }
@media (min-width: 56em) { .ho-problem { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ho-problem__lead { font-size: var(--t-2xl); line-height: 1.25; letter-spacing: var(--track-tight); font-weight: 600; max-width: 22ch; }
.ho-problem__lead em { font-style: normal; color: var(--ho); }
.ho-problem__text { margin-top: var(--s-5); color: var(--ink-2); max-width: 40ch; }
.ho-asks__title { color: var(--ink-3); font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.ho-asks { list-style: none; padding: 0; margin-top: var(--s-3); border-top: 1px solid var(--line); }
.ho-asks li {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  gap: var(--s-3);
  align-items: baseline;
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--t-lg);
  font-weight: 550;
  letter-spacing: var(--track-snug);
}
.ho-asks li::before { content: "?"; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--ho-baton-soft); color: var(--ho-baton-ink); font-size: var(--t-sm); font-weight: 700; transform: translateY(0.2rem); }

/* ---------- Peak: anatomy of a handover page ---------- */
.ho-anatomy { display: grid; gap: var(--s-6); align-items: start; }
@media (min-width: 64em) {
  .ho-anatomy { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: var(--s-8); }
  .ho-legend { position: sticky; top: calc(var(--s-6)); }
}
.ho-doc {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.ho-doc__bar { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); justify-content: space-between; padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--ink-3); font-size: var(--t-xs); }
.ho-doc__body { padding: var(--s-5); }
.ho-doc__title { font-size: var(--t-xl); font-weight: 650; letter-spacing: var(--track-snug); }
.ho-doc__props { margin-top: var(--s-4); display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-size: var(--t-sm); }
.ho-doc__props dt, .ho-doc__props dd { margin: 0; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line); }
.ho-doc__props dt { background: var(--surface-2); color: var(--ink-2); font-weight: 550; }
.ho-doc__props dt:nth-last-of-type(1), .ho-doc__props dd:last-of-type { border-bottom: 0; }
.ho-part { position: relative; margin-top: var(--s-6); }
.ho-part__title { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-base); font-weight: 650; }
.ho-num {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--ho);
  color: var(--surface);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) { .ho-num { color: #04201c; } }
.ho-rows { list-style: none; padding: 0; margin-top: var(--s-3); border-top: 1px solid var(--line); }
.ho-row {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr) auto;
  gap: 0.15rem var(--s-3);
  align-items: baseline;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--t-sm);
}
.ho-row__what { min-width: 0; }
.ho-row > .ho-tag:first-child { justify-self: start; }
.ho-row__why { grid-column: 2 / -1; color: var(--ink-2); font-size: var(--t-xs); }
.ho-row__why strong { color: var(--ink); font-weight: 600; }
@media (max-width: 36em) {
  .ho-doc__body, .ho-doc__bar { padding-inline: var(--s-4); }
  .ho-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ho-row .ho-key, .ho-row > .ho-tag:first-child { grid-column: 1 / -1; }
  .ho-row__why { grid-column: 1 / -1; }
}
.ho-legend { list-style: none; padding: 0; display: grid; gap: var(--s-4); }
.ho-legend li { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: var(--s-3); }
.ho-legend h3 { font-size: var(--t-base); font-weight: 620; }
.ho-legend p { margin-top: var(--s-1); color: var(--ink-2); font-size: var(--t-sm); }

/* ---------- Three ways in ---------- */
.ho-ways { list-style: none; padding: 0; display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.ho-way { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.ho-way__visual { display: grid; align-content: center; gap: var(--s-2); min-height: 10.5rem; padding: var(--s-5); background: var(--ho-soft); border-bottom: 1px solid var(--ho-line); font-size: var(--t-xs); }
.ho-way__text { padding: var(--s-5); }
.ho-way__label { color: var(--ho); font-size: var(--t-xs); font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.ho-way h3 { margin-top: var(--s-2); font-size: var(--t-lg); font-weight: 650; letter-spacing: var(--track-snug); }
.ho-way p { margin-top: var(--s-2); color: var(--ink-2); font-size: var(--t-sm); }
.ho-bubble { max-width: 92%; padding: var(--s-2) var(--s-3); border-radius: var(--r) var(--r) var(--r) 3px; background: var(--surface); border: 1px solid var(--ho-line); line-height: 1.45; }
.ho-bubble--me, .ho-way__visual .ho-bubble--me { justify-self: end; border-radius: var(--r) var(--r) 3px var(--r); background: var(--ho-strong); border-color: var(--ho-strong); color: #fff; }
@media (prefers-color-scheme: dark) { .ho-bubble--me, .ho-way__visual .ho-bubble--me { background: #134e48; border-color: #1f6b62; color: #f0fdfa; } }
.ho-mini { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--ho-line); border-radius: var(--r-sm); font-size: 0.75rem; }
.ho-mini th, .ho-mini td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.ho-mini th { color: var(--ink-3); font-weight: 600; }
.ho-mini tr:last-child td { border-bottom: 0; }
.ho-actions { list-style: none; padding: 0; display: grid; gap: 0.3rem; font-family: var(--font-mono); font-size: 0.75rem; }
.ho-actions li { padding: 0.25rem 0.5rem; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--ho-line); overflow-wrap: anywhere; }

/* ---------- Confirm, then publish ---------- */
.ho-flow { display: grid; gap: var(--s-7); align-items: center; }
@media (min-width: 60em) { .ho-flow { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--s-8); } }
.ho-flow .steps { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
@media (min-width: 40em) { .ho-flow .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ho-flow .step { border-top-color: var(--ho); }
.ho-comment { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-2); padding: var(--s-5); }
.ho-comment__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); color: var(--ink-3); font-size: var(--t-xs); }
.ho-comment__meta .ho-person { color: var(--ink); font-size: var(--t-sm); }
.ho-comment__text { margin-top: var(--s-3); font-size: var(--t-base); line-height: 1.55; }
.ho-mention { padding: 0 0.3em; border-radius: 4px; background: var(--ho-baton-soft); color: var(--ho-baton-ink); font-weight: 600; }
.ho-comment__text a { color: var(--link); }
.ho-comment__foot { margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--line); color: var(--ink-3); font-size: var(--t-xs); }

/* ---------- Trust ---------- */
.ho-trust { display: grid; gap: var(--s-6); }
@media (min-width: 56em) { .ho-trust { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.ho-promises { list-style: none; padding: 0; display: grid; gap: var(--s-5); }
@media (min-width: 40em) { .ho-promises { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ho-promises li { padding-top: var(--s-4); border-top: 2px solid var(--ho); }
.ho-promises h3 { font-size: var(--t-base); font-weight: 620; }
.ho-promises p { margin-top: var(--s-2); color: var(--ink-2); font-size: var(--t-sm); }
.ho-maker { padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); font-size: var(--t-sm); color: var(--ink-2); }
.ho-maker > * + * { margin-top: var(--s-3); }
.ho-maker__title { color: var(--ink); font-weight: 650; font-size: var(--t-base); }

/* ---------- Closing band ---------- */
.ho-close { padding-block: var(--section); }
.ho-close__inner {
  position: relative;
  padding: clamp(1.75rem, 1rem + 3vw, 3.5rem);
  border-radius: var(--r-lg);
  background: #0b3b37;
  color: #f0fdfa;
  overflow: hidden;
}
.ho-close__inner > * { position: relative; max-width: 40rem; }
.ho-close__inner > * + * { margin-top: var(--s-4); }
.ho-close__baton { display: block; width: 4.5rem; height: 0.5rem; border-radius: var(--r-pill); background: var(--ho-baton); }
.ho-close h2 { font-size: var(--t-2xl); letter-spacing: var(--track-tight); }
.ho-close p { color: #ccfbf1; }
.ho-close a:not(.btn) { color: #fff; }
.ho-close a:focus-visible { outline-color: var(--ho-baton); }
.ho-close .btn--secondary { color: #fff; border-color: rgb(255 255 255 / 0.55); background: transparent; }
.ho-close .btn--secondary:hover { border-color: #fff; background: rgb(255 255 255 / 0.08); }
.ho-close__links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); list-style: none; padding: 0; font-size: var(--t-sm); }
.ho-close__small { font-size: var(--t-sm); }

/* ---------- Support page extras ---------- */
.ho-check { list-style: none; padding: 0; display: grid; gap: var(--s-2); margin-top: var(--s-3); }
.ho-check li { position: relative; padding-left: 1.4rem; font-size: var(--t-sm); color: var(--ink-2); }
.ho-check li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 0.55rem; height: 0.55rem; border-radius: 2px; background: var(--ho-baton); }
.ho-setup .steps { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40em) { .ho-setup .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ho-setup .step { border-top-color: var(--ho); }
.ho-setup .step__text + .step__text { margin-top: var(--s-2); }
.ho .faq__body ul, .ho .faq__body ol { padding-left: 1.25rem; display: grid; gap: var(--s-2); }
.ho .faq__body > * + * { margin-top: var(--s-3); }
.ho .faq__body code, .ho .step__text code { overflow-wrap: anywhere; }

/* ---------- Motion: CSS only, only when the visitor hasn't asked for less ---------- */
@keyframes ho-fill { from { transform: translateX(-12px); } to { transform: none; } }
@keyframes ho-drift-chat { from { transform: translateY(0); } to { transform: translateY(-26px); } }
@keyframes ho-drift-sheet { from { transform: rotate(2.5deg) translateY(0); } to { transform: rotate(4deg) translateY(-10px); } }
@keyframes ho-drift-confirm { from { transform: translateY(0); } to { transform: translateY(-40px); } }

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .ho-doc .ho-row {
      animation: ho-fill linear both;
      animation-timeline: view();
      animation-range: entry 20% cover 30%;
    }
  }
  @supports (animation-timeline: scroll()) {
    .ho-chat { animation: ho-drift-chat linear both; animation-timeline: scroll(root); animation-range: 0 70vh; }
    .ho-sheet { animation: ho-drift-sheet linear both; animation-timeline: scroll(root); animation-range: 0 70vh; }
    .ho-confirm { animation: ho-drift-confirm linear both; animation-timeline: scroll(root); animation-range: 0 70vh; }
  }
}

/* The shared site drops the first section's top padding after a hero; a tinted section needs it back. */
.hero + .section--alt { padding-top: var(--section); }
.ho-steps-4 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40em) { .ho-steps-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64em) { .ho-steps-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
