/* The v3 homepage Build canvas, adapted from its fixed 1120 × 362 mockup.
   Motion layers follow commonFrame public/css/build.css §§3–4. */
.cf-v3-canvas {
  --cf-v3-paper: #fefbf5;
  --cf-v3-stage: #f4e9d6;
  --cf-v3-brown: #8c5a38;
  --cf-v3-blue: #0e5c82;
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(122,63,28,.24);
  border-radius: 2px;
  background: #fdf8ef;
  color: #1a1310;
  font-family: Figtree, "Figtree Fallback", system-ui, sans-serif;
}
.cf-v3-canvas * { box-sizing: border-box; }
.cf-v3-toolbar {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(122,63,28,.2);
  background: var(--cf-v3-paper);
  color: #3a2f27;
  font-size: 14px;
  white-space: nowrap;
}
.cf-v3-toolbar > strong {
  flex: 0 0 auto;
  padding-right: 20px;
  border-right: 1px solid rgba(122,63,28,.2);
  font-size: 16px;
}
.cf-v3-status, .cf-v3-memory { display: inline-flex; align-items: center; gap: 8px; }
.cf-v3-status { color: var(--cf-v3-blue); }
.cf-v3-status i, .cf-v3-memory i { width: 9px; height: 9px; border-radius: 50%; background: var(--cf-v3-blue); }
.cf-v3-memory i { background: #aa9f8c; }
.cf-v3-tabs, .cf-v3-actions { display: flex; align-items: center; gap: 8px; }
.cf-v3-tabs { margin-left: auto; gap: 0; }
.cf-v3-toolbar-label {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 7px 12px;
  border: 1px solid rgba(122,63,28,.22);
  border-radius: 2px;
  background: var(--cf-v3-paper);
  font-weight: 400;
}
.cf-v3-tabs .cf-v3-toolbar-label + .cf-v3-toolbar-label { border-left: 0; }
.cf-v3-tabs .cf-v3-toolbar-label:first-child { color: #7a3f1c; background: #f2e5d1; }
.cf-v3-toolbar-label--run { color: var(--cf-v3-paper); background: var(--cf-v3-brown); }
.cf-v3-toolbar-label--muted { color: #9f958c; }
.cf-v3-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(122,63,28,.22);
  border-radius: 2px;
  background: var(--cf-v3-paper);
  color: #4c382a;
  cursor: pointer;
}
.cf-v3-toggle:hover { background: #f2e5d1; }
.cf-v3-toggle:focus-visible { outline: 2px solid var(--cf-v3-blue); outline-offset: 2px; }
.cf-v3-toggle svg { width: 14px; height: 14px; display: block; fill: currentColor; }
.cf-v3-toggle__play { display: none !important; }
.cf-v3-canvas[data-paused="true"] .cf-v3-toggle__pause { display: none; }
.cf-v3-canvas[data-paused="true"] .cf-v3-toggle__play { display: block !important; }
.cf-v3-toggle[hidden] { display: none !important; }
.cf-v3-stage {
  position: relative;
  width: 100%;
  height: 304px;
  background-color: var(--cf-v3-stage);
  background-image: repeating-linear-gradient(0deg,transparent 0 7px,rgba(140,90,56,.045) 7px 8px),
    repeating-linear-gradient(90deg,transparent 0 7px,rgba(140,90,56,.045) 7px 8px);
}
.cf-v3-stage > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cf-v3-pipe path { fill: none; stroke-linecap: butt; }
.cf-v3-pipe__base { stroke: #b0a088; stroke-width: 10; }
.cf-v3-pipe__hi { stroke: rgba(255,255,255,.58); stroke-width: 2.5; }
.cf-v3-pipe__lo { stroke: rgba(94,78,64,.22); stroke-width: 2; }
.cf-v3-pipe__glow-outer { stroke: #0e5c82; stroke-width: 16; stroke-linecap: round !important; filter: blur(5px); opacity: 0; }
.cf-v3-pipe__glow { stroke: #62b9d5; stroke-width: 9; stroke-linecap: round !important; filter: blur(2px); opacity: 0; }
.cf-v3-pipe__wave { stroke: #62b9d5; stroke-width: 9; stroke-linecap: round !important; stroke-dasharray: 6 22; filter: blur(2.5px); opacity: 0; }
.cf-v3-pipe__wave-core { stroke: #fff9e8; stroke-width: 2.4; stroke-linecap: round !important; stroke-dasharray: 4 24; filter: drop-shadow(0 0 1px #fff9e8); opacity: 0; }
.cf-v3-block {
  position: absolute;
  top: 113px;
  width: 14.2857%;
  height: 78px;
  padding: 29px 14px 12px;
  border-radius: 3px;
  background: var(--cf-v3-paper);
  box-shadow: 0 8px 14px -4px rgba(26,19,16,.28),0 2px 4px rgba(26,19,16,.1),inset 0 1px rgba(255,255,255,.7);
  color: #1a1310;
  transition: box-shadow .35s ease;
}
.cf-v3-block strong { display: block; font-size: 15px; line-height: 1.15; text-align: left; white-space: nowrap; }
.cf-v3-block--trigger { left: 15.0893%; }
.cf-v3-block--agent { left: 42.7679%; }
.cf-v3-block--output { left: 70.4464%; }
.cf-v3-flag {
  position: absolute;
  top: 0;
  left: 0;
  height: 19px;
  padding: 3px 17px 3px 10px;
  clip-path: polygon(0 0,100% 0,calc(100% - 12px) 100%,0 100%);
  background: var(--cf-v3-brown);
  color: var(--cf-v3-paper);
  font: 500 11px/1.2 'IBM Plex Mono', 'IBM Plex Mono Fallback', ui-monospace, monospace;
  white-space: nowrap;
}
.cf-v3-port { position: absolute; top: 35px; width: 8px; height: 8px; background: #fdf8ef; box-shadow: inset 0 0 0 1.5px #b0a088; }
.cf-v3-port--in { left: -4px; }
.cf-v3-port--out { right: -4px; }
.cf-v3-canvas[data-phase="trigger"] .cf-v3-block--trigger,
.cf-v3-canvas[data-phase="agent"] .cf-v3-block--agent,
.cf-v3-canvas[data-phase="output"] .cf-v3-block--output {
  box-shadow: 0 0 0 3px rgba(14,92,130,.18),0 5px 20px rgba(14,92,130,.25),0 8px 14px -4px rgba(26,19,16,.2),inset 0 1px rgba(255,255,255,.7);
  animation: cf-v3-block-breathe 4.2s cubic-bezier(.3,.7,.3,1) infinite;
}
@keyframes cf-v3-block-breathe {
  0%,100% { filter: brightness(1); }
  50% { filter: brightness(1.065); }
}
@media (max-width: 900px) {
  .cf-v3-memory, .cf-v3-tabs, .cf-v3-actions .cf-v3-toolbar-label--muted, .cf-v3-actions .cf-v3-toolbar-label--extra { display: none; }
  .cf-v3-actions { margin-left: auto; }
}
@media (max-width: 600px) {
  .cf-v3-toolbar { height: 48px; padding: 0 10px; gap: 8px; font-size: 11px; }
  .cf-v3-toolbar > strong { font-size: 12px; padding-right: 10px; }
  .cf-v3-actions .cf-v3-toolbar-label { display: none; }
  .cf-v3-toggle { width: 32px; height: 32px; }
  .cf-v3-stage { height: 206px; }
  .cf-v3-block { top: 69px; width: 26%; height: 68px; padding: 28px 6px 8px; }
  .cf-v3-block--trigger { left: 4%; }
  .cf-v3-block--agent { left: 37%; }
  .cf-v3-block--output { left: 70%; }
  .cf-v3-block strong { font-size: 10px; }
  .cf-v3-flag { height: 17px; font-size: 8px; padding: 3px 11px 3px 5px; }
  .cf-v3-port { top: 31px; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-v3-block { animation: none !important; transition: none !important; }
}
/* The v3 canvas needs its original wide reading distance on both pages. */
.page-commonframe .hero .split--hero { display: block; }
.page-commonframe .hero .split-side { width: 100%; margin-top: 2.5rem; }
.page-home .frame-build-wide { width: min(1120px, calc(100% - 80px)); margin: 52px auto 0; }
@media (max-width: 700px) {
  .page-commonframe .hero .split-side { margin-top: 2rem; }
  .page-home .frame-build-wide { width: calc(100% - 32px); margin-top: 28px; }
}
@media (min-width: 840px) {
  .page-commonframe .hero .split-copy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; align-items: center; }
  .page-commonframe .hero .cf-hero-title-stack h1 { max-width: 16ch; }
  .page-commonframe .hero .cf-hero-lead .lede { max-width: 58ch; }
  .page-commonframe .hero .cf-hero-lead .hero-links { margin-top: 1.25rem; }
  .page-commonframe .hero .cf-hero-support { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; margin-top: 1.5rem; }
}
@media (max-width: 839px) {
  .page-commonframe .hero .cf-hero-support { margin-top: 1.25rem; }
  .page-commonframe .hero .cf-hero-support .lede + .lede { margin-top: .9rem; }
}
