/* CircuitProver redesign components for the new pages (home, pricing, login, account). Values come from theme.css. */
.cp { font-family: var(--font-sans); color: var(--ink); background: var(--bg); }
.cp *, .cp *::before, .cp *::after { box-sizing: border-box; }
.cp img { max-width: 100%; }
.cp-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.cp-narrow { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Type */
.cp-display { font-size: clamp(44px, 6.4vw, 76px); line-height: 1; font-weight: 650; letter-spacing: -0.025em; margin: 0; }
.cp-h1 { font-size: clamp(36px, 4.6vw, 52px); line-height: 1.08; font-weight: 640; letter-spacing: -0.02em; margin: 0; }
.cp-h2 { font-size: 32px; line-height: 38px; font-weight: 620; letter-spacing: -0.015em; margin: 0; }
.cp-h3 { font-size: 21px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.cp-lede { font-size: 20px; line-height: 28px; color: var(--ink-2); margin: 0; }
.cp-small { font-size: 14px; line-height: 20px; }
.cp-caption { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-3); letter-spacing: .01em; }
.cp-mono { font-family: var(--font-mono); font-size: 13px; line-height: 18px; }
.cp-muted { color: var(--ink-2); }

/* Buttons */
.cp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 24px; border-radius: var(--r-pill); border: 0;
  font: 600 16px/1 var(--font-sans); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s ease, color .15s ease, transform .1s ease; }
.cp-btn:active { transform: scale(.98); }
.cp-btn-primary { background: var(--ink); color: var(--on-ink) !important; }
.cp-btn-primary:hover { background: var(--ink-2); color: var(--on-ink) !important; }
.cp-btn-soft { background: var(--surface-2); color: var(--ink) !important; }
.cp-btn-soft:hover { background: var(--line-mid); color: var(--ink) !important; }
.cp-btn-outline { background: transparent; color: var(--ink) !important; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.cp-btn-outline:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.cp-btn-ghost { background: transparent; color: var(--ink) !important; padding: 0 12px; }
.cp-btn-ghost:hover { background: var(--surface-2); }
.cp-btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.cp-btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.cp-btn-block { width: 100%; }

/* Surfaces */
.cp-panel { background: var(--surface); border-radius: var(--r-xl); padding: 32px; }
.cp-card { background: var(--raised); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 24px; }
.cp-card-flat { background: var(--surface); border-radius: var(--r-lg); padding: 24px; }

/* Tags and verdicts */
.cp-tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font: 600 12px/1 var(--font-sans); white-space: nowrap; }
.cp-tag-issue { background: var(--issue-soft); color: var(--issue-c); }
.cp-tag-check { background: var(--check-soft); color: var(--check-c); }
.cp-tag-clear { background: var(--clear-soft); color: var(--clear-c); }
.cp-tag-neutral { background: var(--surface-2); color: var(--ink-2); }
.cp-tag-outline { box-shadow: inset 0 0 0 1px var(--line-strong); }

/* Inputs */
.cp-label { display: block; font: 500 14px/20px var(--font-sans); color: var(--ink-2); margin-bottom: 8px; }
.cp-input { width: 100%; height: 44px; padding: 0 16px; border-radius: var(--r-md) !important; border: 1.5px solid var(--line-strong) !important; background: var(--bg); color: var(--ink); font: 400 16px/1 var(--font-sans); }
.cp-input::placeholder { color: var(--ink-3); }

/* Segmented control */
.cp-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); }
.cp-seg button { height: 30px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2); font: 600 13px/1 var(--font-sans); cursor: pointer; }
.cp-seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }

/* Top bar and footer */
.cp-nav { display: flex; align-items: center; gap: 24px; height: 64px; }
.cp-nav-bar { position: sticky; top: 0; z-index: 20; background: var(--bg); }
.cp-logo { font: 650 18px/1 var(--font-sans); letter-spacing: -0.02em; color: var(--ink) !important; text-decoration: none; }
.cp-links { display: flex; gap: 24px; }
.cp-links a { color: var(--ink-2); font: 500 15px/1 var(--font-sans); text-decoration: none; }
.cp-links a:hover, .cp-links a[aria-current="page"] { color: var(--ink); }
.cp-spacer { flex: 1; }
.cp-foot { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; padding: 56px 0 40px; color: var(--ink-3); }
.cp-foot a { color: var(--ink-3); text-decoration: none; font-size: 14px; }
.cp-foot a:hover { color: var(--ink); }

/* Sample schematic with clickable pin dots (home) */
.cp-sheet { position: relative; background: #ffffff; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 1287 / 911; }
.cp-sheet > img { display: block; width: 100%; height: 100%; }
.cp-dot { position: absolute; width: 12px; height: 12px; padding: 0; border: 0; border-radius: 50%; transform: translate(-50%, -50%); cursor: pointer;
  box-shadow: 0 0 0 2px #ffffff; transition: box-shadow .12s ease; }
.cp-dot-issue { background: var(--issue-dot); } .cp-dot-check { background: var(--check-dot); }
.cp-dot[aria-pressed="true"] { box-shadow: 0 0 0 3px #111214, 0 0 0 5px #ffffff; }
.cp-dot:hover { box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px rgba(17,18,20,.45); }
.cp-finding { background: var(--raised); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 10px; }
.cp-finding h4 { margin: 0; font: 600 16px/22px var(--font-sans); letter-spacing: -0.005em; color: var(--ink); }
.cp-finding p { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.cp-finding-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cp-meta { font: 400 12.5px/18px var(--font-mono); color: var(--ink-3); }
.cp-crop { position: relative; aspect-ratio: 2 / 1; background: #ffffff; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.cp-crop img { position: absolute; max-width: none !important; display: block; }
.cp-crop span { position: absolute; border: 2px solid; border-radius: 6px; }

/* Grids */
.cp-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cp-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cp-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cp-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }

/* Pricing */
.cp-plan { border: 1px solid var(--line-soft); border-radius: var(--r-xl); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.cp-plan.is-featured { border: 0; background: var(--surface); }
.cp-price { font-size: 32px; line-height: 38px; font-weight: 620; letter-spacing: -0.015em; }
.cp-stack { position: relative; height: 200px; }
.cp-stack > div { position: absolute; background: #ffffff; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; }
.cp-stack img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: left top; }

@media (max-width: 900px) {
  .cp-links, .cp-hide-sm { display: none; }
  .cp-grid-2, .cp-grid-3, .cp-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .cp-panel { padding: 16px; border-radius: var(--r-lg); }
  .cp-nav { gap: 12px; }
}
@media (min-width: 901px) and (max-width: 1100px) { .cp-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .cp-hide-xs { display: none; } .cp-wrap, .cp-narrow { padding: 0 16px; } }

/* Top bar: menu in the middle between the logo and Log in (CEO 11-17) */
.cp-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.cp-nav > .cp-logo { justify-self: start; }
.cp-nav > .cp-links { justify-self: center; }
.cp-nav > .cp-actions { justify-self: end; display: flex; gap: 8px; align-items: center; }
.cp-nav > .cp-spacer { display: none; }
.cp-nav > .cp-btn { justify-self: end; grid-column: 3; }
@media (max-width: 900px) { .cp-nav { grid-template-columns: 1fr auto; } .cp-nav > .cp-actions, .cp-nav > .cp-btn { grid-column: 2; } }

/* Free plan: $3 struck through, then $0 (CEO 11-17) */
.cp-was { position: relative; display: inline-block; font-size: 24px; line-height: 28px; font-weight: 600; color: var(--ink-2); text-decoration: none; margin-right: 10px; padding: 0 2px; }
/* A red pen stroke from the bottom-left corner of '$3' to its top-right corner, covering both glyphs (CEO 11-17) */
.cp-was::after { content: ''; position: absolute; left: 50%; top: 52%; width: 118%; height: 1.5px; border-radius: 2px; background: var(--accent); transform: translate(-50%, -50%) rotate(-32deg); }

/* Hand-drawn sample schematic at the top of the home page, red pen marks drawn one by one */
@font-face { font-family: 'Caveat'; src: url('fonts/caveat-latin-wght-normal.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
.cp-schem-card { background: var(--surface); border-radius: var(--r-xl); padding: 16px; }
.cp-schem-bar { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; padding: 4px 8px 12px; }
.cp-schem-wrap { background: var(--bg); border-radius: var(--r-lg); padding: 12px; }
.cp-schem { display: block; width: 100%; height: auto; font-family: var(--font-mono); }
.cp-schem .wire { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: square; }
.cp-schem .junction { fill: var(--ink); }
.cp-schem .labels { fill: var(--ink); font-family: var(--font-mono); font-size: 10px; }
.cp-schem .ref { font-size: 12px; font-weight: 600; }
.cp-schem .b { font-weight: 600; } .cp-schem .xs { font-size: 9px; } .cp-schem .caps { letter-spacing: .08em; } .cp-schem .pm { font-size: 13px; }
.cp-schem .end { text-anchor: end; } .cp-schem .mid { text-anchor: middle; }
.cp-schem .pinno { font-size: 8px; fill: var(--ink-3); }
.cp-schem .open { fill: var(--bg); }
.cp-schem .pen { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cp-schem .pen-r { stroke: var(--accent); }
.cp-schem .pen-b { stroke: var(--ink-3); }
.cp-schem .ring { stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.cp-schem .arrow { stroke-width: 1.8; }
.cp-schem .hit-area { fill: transparent; stroke: none; }
.cp-schem .note { font-family: 'Caveat', var(--font-sans); font-size: 21px; font-weight: 600; }
.cp-schem .note-r { fill: var(--accent); }
.cp-schem .note-b { fill: var(--ink-3); }
.cp-schem .pin-tag circle { stroke: var(--bg); stroke-width: 1.5; }
.cp-schem .tag-ok circle { fill: var(--ink-3); }
.cp-schem .tag-ok path { fill: none; stroke: var(--bg); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cp-schem .tag-bad circle { fill: var(--accent); }
.cp-schem .tag-bad text { fill: var(--on-accent); font-size: 7.5px; font-weight: 600; text-anchor: middle; }
/* Animation (hero-anim.js): a mark starts hidden and draws on when its finding's turn comes */
.cp-schem.is-anim .pen-r .ring { opacity: 0; transition: opacity .35s ease; }
.cp-schem.is-anim .pen-r .is-on .ring { opacity: 1; }
.cp-schem.is-anim .pen-r .arrow { opacity: 0; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .55s ease .3s, opacity 0s .3s; }
.cp-schem.is-anim .pen-r .is-on .arrow { opacity: 1; stroke-dashoffset: 0; }
.cp-schem.is-anim .note-r text, .cp-schem.is-anim .tag-bad { opacity: 0; transition: opacity .35s ease .55s; }
.cp-schem.is-anim .note-r text.is-on, .cp-schem.is-anim .tag-bad.is-on { opacity: 1; }
.cp-schem.is-anim.is-reset .pen-r .ring, .cp-schem.is-anim.is-reset .pen-r .arrow, .cp-schem.is-anim.is-reset .note-r text, .cp-schem.is-anim.is-reset .tag-bad { transition: opacity .6s ease, stroke-dashoffset 0s; }
.cp-count-live { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .cp-schem.is-anim * { transition: none !important; } }

/* ---------- Home live demo (11-17): schematic with red/orange dots, one finding card ---------- */
.cp-demo { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; text-align: left; align-items: start; }
.cp-demo-stage { position: relative; background: #fff; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line-soft); }
.cp-demo-img { display: block; width: 100%; height: auto; }
.cp-demo-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid #fff; padding: 0; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.35); opacity: 0; transition: transform .15s, opacity .3s; }
.cp-demo-stage.is-ready .cp-demo-dot { opacity: 1; }
.cp-demo-dot.is-issue { background: var(--issue-dot); }
.cp-demo-dot.is-check { background: var(--check-dot); }
.cp-demo-dot:hover, .cp-demo-dot[aria-pressed="true"] { transform: scale(1.35); }
.cp-demo-dot[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
.cp-demo-card { background: var(--raised); border: 1px solid var(--line-soft); border-radius: var(--r-xl); padding: 20px; display: grid; gap: 10px; }
.cp-demo-crop { width: 100%; background-color: #fff; background-repeat: no-repeat; border-radius: var(--r-md); border: 1px solid var(--line-soft); }
.cp-demo-tag { margin: 0; font-family: var(--font-mono, var(--mono)); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.cp-demo-tag.is-issue { color: var(--issue-c); }
.cp-demo-tag.is-check { color: var(--check-c); }
.cp-demo-title { margin: 0; font-size: 17px; line-height: 1.35; }
.cp-demo-fix { margin: 0; font-size: 14px; color: var(--ink-2); }
.cp-demo-srcs { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cp-demo-src { font-size: 12px; padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); color: var(--ink); text-decoration: none; }
.cp-demo-src:hover { border-color: var(--ink); }
.cp-demo-credit a { color: inherit; }
@media (max-width: 900px) { .cp-demo { grid-template-columns: 1fr; } .cp-demo-dot { width: 14px; height: 14px; margin: -7px 0 0 -7px; } }
/* Home demo dots: an invisible tap area around each dot, about 28px (32px on touch screens) (CEO 11-20) */
.cp-demo-dot::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; }
@media (pointer: coarse) { .cp-demo-dot::before { inset: -9px; } }

/* ---------- Header when signed in (CEO 11-21): Open CircuitProver + account menu (site-account.js) ---------- */
.cp-acct { position: relative; }
.cp-acct-btn { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 8px 0 3px; border: 0; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink); cursor: pointer; transition: background-color .15s ease; }
.cp-acct-btn:hover, .cp-acct-btn[aria-expanded="true"] { background: var(--line-mid); }
.cp-acct-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cp-acct-initial { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--on-ink);
  font: 650 13px/1 var(--font-sans); }
.cp-acct-caret { width: 12px; height: 12px; color: var(--ink-2); transition: transform .15s ease; }
.cp-acct-btn[aria-expanded="true"] .cp-acct-caret { transform: rotate(180deg); }
.cp-acct-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 288px; max-width: calc(100vw - 32px); padding: 8px;
  background: var(--raised); border: 1px solid var(--line-soft); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.cp-acct-who { display: grid; gap: 4px; padding: 12px 12px 14px; }
.cp-acct-email { font: 600 15px/20px var(--font-sans); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-acct-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 0; padding: 4px; background: var(--surface); border-radius: var(--r-md); }
.cp-acct-stats > div { padding: 10px 12px; border-radius: 12px; min-width: 0; }
.cp-acct-stats > div + div { box-shadow: inset 1px 0 0 var(--line-soft); border-radius: 0; }
.cp-acct-stats dt { font: 500 12px/16px var(--font-sans); color: var(--ink-3); }
.cp-acct-stats dd { margin: 4px 0 0; font: 650 17px/22px var(--font-sans); letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-acct-stats div + div dd { font-size: 15px; }
.cp-acct-skel { display: inline-block; width: 4.5em; height: 14px; border-radius: 7px; background: var(--surface-2); vertical-align: middle; animation: cp-acct-pulse 1.2s ease-in-out infinite; }
@keyframes cp-acct-pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .cp-acct-skel { animation: none; } }
.cp-acct-items { display: grid; gap: 2px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.cp-acct-item { display: flex; align-items: center; height: 40px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: var(--ink) !important;
  font: 500 15px/1 var(--font-sans); text-decoration: none; text-align: left; cursor: pointer; width: 100%; }
.cp-acct-item:hover { background: var(--surface-2); }
.cp-acct-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.cp-acct-item[disabled] { opacity: .5; cursor: default; }
@media (max-width: 380px) { .cp-acct-open { padding: 0 12px; font-size: 13px; } .cp-nav { gap: 8px; } }
