/* pitch.css — the /pitch/{client}/ proposal engine.
 *
 * Generic by design: everything client-specific lives in the page content
 * (names, logos, cluster seeds, form id). This sheet + pitch.js are the
 * reusable half of the proposal product.
 *
 * Loads after styles.css + admiralty-tokens.css and leans on their tokens:
 * --ink --paper --paper-warm --surface --line --forest --forest-deep
 * --brass --brass-soft --brass-ink --clay --fog --fog-ink --radius --shadow
 */

/* ---------- shell ---------- */

.pitch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(20px, 5vw, 56px);
  background: var(--forest-deep);
  border-bottom: 1px solid var(--line-dark);
}

.pitch-header .brand span { color: var(--white); }

.pitch-mark {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fog-dim);
}

/* ---------- hero ---------- */

.pitch-hero {
  position: relative;
  overflow: hidden;
  background: var(--forest-deep);
  color: var(--white);
  padding: clamp(72px, 9vw, 128px) 0 clamp(56px, 7vw, 96px);
}

.pitch-hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pitch-hero .section-inner { position: relative; }

.pitch-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.pitch-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1.04;
  margin: 14px 0 18px;
}

.pitch-hero .hero-sub { color: var(--fog); max-width: 34em; }

.pitch-quote {
  margin: 22px 0 0;
  padding-left: 14px;
  border-left: 2px solid var(--brass);
  color: var(--fog);
  font-size: 0.95rem;
}
.pitch-quote cite { color: var(--fog-dim); font-style: normal; font-size: 0.85rem; }

/* Portrait plate — mirrors the founder cutout treatment on /about */
.portrait-plate {
  justify-self: center;
  text-align: center;
}

/* Soft-cornered plate, whole photo — no avatar-coin zoom. The source is a
   square head-and-shoulders studio shot; show all of it. */
.portrait-plate img {
  width: clamp(200px, 24vw, 300px);
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--brass);
  box-shadow: var(--shadow);
  display: block;
  margin: 0 auto;
}

.portrait-plate figcaption {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-soft);
}

/* ---------- shared plates ---------- */

.plate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.plate {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

/* Light-surface cards sit inside dark bands too (.section-contrast sets
   color: var(--white) and children inherit it). Pin the text color at the
   card boundary so nothing on a white surface can inherit band-white. */
.plate, .agent-card, .proof-doc { color: var(--ink); }
.plate h3, .agent-card h3, .proof-doc h4 { color: var(--ink); }

.plate h3 { font-size: 1.02rem; margin: 0 0 8px; }
.plate p, .plate li { font-size: 0.92rem; color: var(--ink-soft); }
.plate ul { margin: 0; padding-left: 18px; }

.plate-logo {
  height: 40px;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.plate-logo img { max-height: 100%; max-width: 160px; object-fit: contain; }

/* generated engraving sits on light plates; multiply melts its paper bg away */
.plate-logo .emblem-img { max-height: 56px; mix-blend-mode: multiply; }

.plate-glyph {
  width: 40px; height: 40px;
  border: 1.5px solid var(--brass);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--brass-ink);
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.receipts {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--fog-ink);
}

/* ---------- the architecture (S3) ---------- */

.arch-section { background: var(--paper-warm); }

/* Diagram on top, stage cards in a grid beneath it. No sticky, no scroll
   scrub — the earlier scroll-synced column stretched the section across
   pages of near-empty space. The diagram plays its build once on entering
   view (pitch.js); the cards are simply the legend. */
.arch-frame { position: relative; }

.arch-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 48px);
  margin: 0 auto;
}

.arch-steps {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.arch-step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brass);
  border-radius: var(--radius);
  padding: 16px 18px;
  height: 100%;
}

.arch-step-card .step-no {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--clay);
  text-transform: uppercase;
}

.arch-step-card h3 { margin: 6px 0 6px; font-size: 1rem; }
.arch-step-card p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }

/* --- SVG staging. Default (no JS / reduced motion): fully settled. --- */

.arch-svg .st { transition: opacity 0.7s ease, transform 0.7s ease; }
.arch-svg .edge {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.9s ease 0.15s;
}

/* JS marks the section data-anim="1" only when motion is allowed; then
   stages hide until data-stage reaches them. */
[data-anim="1"] .arch-svg [data-s] { opacity: 0; transform: translateY(10px); }
[data-anim="1"] .arch-svg [data-s] .edge { stroke-dashoffset: 1; }

[data-anim="1"][data-stage="1"] .arch-svg [data-s="1"],
[data-anim="1"][data-stage="2"] .arch-svg [data-s="1"],
[data-anim="1"][data-stage="2"] .arch-svg [data-s="2"],
[data-anim="1"][data-stage="3"] .arch-svg [data-s="1"],
[data-anim="1"][data-stage="3"] .arch-svg [data-s="2"],
[data-anim="1"][data-stage="3"] .arch-svg [data-s="3"],
[data-anim="1"][data-stage="4"] .arch-svg [data-s="1"],
[data-anim="1"][data-stage="4"] .arch-svg [data-s="2"],
[data-anim="1"][data-stage="4"] .arch-svg [data-s="3"],
[data-anim="1"][data-stage="4"] .arch-svg [data-s="4"],
[data-anim="1"][data-stage="5"] .arch-svg [data-s] {
  opacity: 1;
  transform: none;
}

[data-anim="1"][data-stage="1"] .arch-svg [data-s="1"] .edge,
[data-anim="1"][data-stage="2"] .arch-svg [data-s="2"] .edge,
[data-anim="1"][data-stage="2"] .arch-svg [data-s="1"] .edge,
[data-anim="1"][data-stage="3"] .arch-svg [data-s="3"] .edge,
[data-anim="1"][data-stage="3"] .arch-svg [data-s="2"] .edge,
[data-anim="1"][data-stage="3"] .arch-svg [data-s="1"] .edge,
[data-anim="1"][data-stage="4"] .arch-svg [data-s="4"] .edge,
[data-anim="1"][data-stage="4"] .arch-svg [data-s="3"] .edge,
[data-anim="1"][data-stage="4"] .arch-svg [data-s="2"] .edge,
[data-anim="1"][data-stage="4"] .arch-svg [data-s="1"] .edge,
[data-anim="1"][data-stage="5"] .arch-svg .edge {
  stroke-dashoffset: 0;
}

/* ---------- runtime chips ---------- */

.runtime-bar {
  margin: 26px auto 0;
  max-width: 560px;
  background: var(--forest-deep);
  border: 1px solid var(--brass);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
  color: var(--white);
}

.runtime-slot {
  font-family: var(--mono);
  letter-spacing: 0.14em;
  color: var(--brass-soft);
  font-size: 1rem;
  display: block;
  margin-bottom: 12px;
}

.runtime-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.runtime-chips button {
  font: 600 0.72rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog);
  background: transparent;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.runtime-chips button[aria-pressed="true"] {
  color: #17120c;
  background: var(--brass);
  border-color: var(--brass);
}

.runtime-note {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--fog-dim);
}

/* ---------- worked examples (S5) ---------- */

.agent-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}

.agent-card h3 { margin: 0 0 4px; }
.agent-kicker {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
}

.agent-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 12px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.agent-flow li {
  counter-increment: step;
  font-size: 0.84rem;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px 7px 10px;
}

.agent-flow li::before {
  content: counter(step);
  font: 700 0.68rem/1.6 var(--mono);
  color: var(--brass-ink);
  border: 1px solid var(--brass);
  border-radius: 50%;
  display: inline-block;
  width: 1.6em; height: 1.6em;
  text-align: center;
  margin-right: 7px;
}

.agent-guard {
  font-size: 0.84rem;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  margin: 0;
}
.agent-guard strong { color: var(--brass-ink); }

/* ---------- offer chips ---------- */

.offer-chip {
  display: inline-block;
  font: 600 0.66rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass-ink);
  border: 1px solid var(--brass);
  border-radius: 999px;
  padding: 5px 10px;
  margin-top: 12px;
}

/* ---------- proof gallery (S7) ---------- */

/* 2×2: graph captures across the top, the two finished proposals below.
   Auto-fit made three ragged columns out of four very different heights. */
.proof-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 26px;
  align-items: start;
}
@media (min-width: 720px) {
  .proof-grid { grid-template-columns: 1fr 1fr; }
}

/* The three finished deliverables ride their own row — three tall artifacts
   side by side on wide screens, pairs at tablet, stacked on phones. */
@media (min-width: 1080px) {
  .proof-grid.proof-docs { grid-template-columns: 1fr 1fr 1fr; }
}

.proof-shot img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line-dark);
  display: block;
}

.proof-shot figcaption,
.proof-doc figcaption {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--fog);
}

.proof-doc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.proof-doc .doc-head {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--fog-ink);
  background: var(--paper-warm);
  border-bottom: 1px solid var(--line);
  padding: 8px 14px;
}

.proof-doc .doc-body {
  padding: 14px 16px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* Finished-work plates: real proposal pages stacked under the file path. */
.proof-doc .doc-pages {
  display: grid;
  gap: 3px;
  background: var(--line);
}
.proof-doc .doc-pages img {
  width: 100%;
  height: auto;
  display: block;
}

.proof-doc .doc-body h4 { font-size: 0.85rem; color: var(--ink); margin: 0 0 6px; }
.proof-doc .doc-body ol, .proof-doc .doc-body ul { padding-left: 18px; margin: 6px 0; }
.proof-doc .doc-flag {
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--brass-ink);
  border: 1px dashed var(--brass);
  border-radius: 4px;
  padding: 2px 6px;
  display: inline-block;
  margin-bottom: 8px;
}

/* dark band variant */
.section-contrast .proof-doc { background: var(--surface); }

/* ---------- form embed ---------- */

.pitch-form-frame iframe {
  display: block;
  width: 100%;
  min-height: 900px;
  border: none;
  border-radius: var(--radius);
  background: var(--surface);
}

/* ---------- reveal (self-contained; motion.js not loaded here) ---------- */

.p-reveal { opacity: 0; transform: translateY(16px); }
.p-reveal.is-in { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.7s ease; }

@media (prefers-reduced-motion: reduce) {
  .p-reveal { opacity: 1; transform: none; }
  .arch-svg .st, .arch-svg .edge { transition: none; }
}

@media (max-width: 720px) {
  .pitch-hero-grid { grid-template-columns: 1fr; }
  .portrait-plate { order: -1; }
}
