/* CAIN-42 top mark (cainstudio.online homepage).
   Owner directive 2026-11-25: the spinning five-arm mark and its motto sit at the very top of
   the page, directly under the fixed PBFT status bar, and every AGI-RSI evidence block is
   rendered below it.

   Owner fix 2026-11-26 (scroll): the band used to be `position: sticky; top: 46px`. Because it is
   a direct child of <body>, its sticky containing block was the whole document, so it stayed
   pinned for the entire scroll and covered the content. It is now `position: relative` (normal
   flow): first thing at the very top, intro spin on page load, then it scrolls away.

   Owner fix 2026-11-26 (size): the band is HALF SIZE. The full-size hero (wordmark + 340px mark +
   motto, ~380-550px tall) was too much chrome above the fold, especially on tablets. The sizes in
   the `#cain-top-mark` rules below are half the original `.c42-mark` / `.c42-motto` / `.ctm-*`
   values (the originals live in cain42.css and top100.css).

   Owner request 2026-11-26 (mark size): the spinning five-arm mark a little bigger — 132/17.5vw/224
   -> 152/20vw/258 (+15% at every breakpoint). Cache-buster bumped to v=13 in index.html and
   scripts/cain42_site/pin_top_mark.py together (the cron reverts a mismatched version). */

/* The site sets overflow-x:hidden on html/body; keep `clip` so the wide neon band never adds a
   horizontal scrollbar. Scoped to the page that actually has the mark. */
html:has(#cain-top-mark), body:has(#cain-top-mark) { overflow-x: clip; }

#cain-top-mark {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(58% 140% at 50% 0%, rgba(239, 10, 34, .22), transparent 72%),
    linear-gradient(180deg, rgba(7, 11, 20, .97), rgba(10, 15, 27, .97));
  border-bottom: 1px solid rgba(255, 42, 61, .75);
  box-shadow:
    inset 0 0 90px rgba(255, 20, 45, .38),
    0 24px 64px -20px rgba(255, 42, 61, .95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
/* Slow super-neon red pulse behind the whole block. */
#cain-top-mark::before {
  content: "";
  position: absolute;
  inset: -45% -12% -12%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(50% 58% at 50% 46%,
    rgba(255, 16, 42, .62) 0%,
    rgba(255, 16, 42, .26) 42%,
    rgba(255, 16, 42, .06) 64%,
    transparent 76%);
  filter: blur(20px);
  opacity: .55;
  animation: ctm-neon-pulse 7s ease-in-out infinite;
}
@keyframes ctm-neon-pulse {
  0%, 100% { opacity: .45; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.07); }
}
#cain-top-mark .ctm-in {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  text-align: center;
}

/* Name above the mark: CAIN-42 (big) with the short identity underneath. */
#cain-top-mark .ctm-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 4px;
  line-height: 1;
}
/* CAIN-42: a slow dark wave sweeps across the letters. (Half size.) */
#cain-top-mark .ctm-name {
  font-weight: 900;
  font-size: clamp(19px, 3.1vw, 41px);
  line-height: 1;
  letter-spacing: .01em;
  background-image: linear-gradient(100deg,
    #ffffff 0%, #ffffff 26%,
    #2a0508 38%, #6b0912 46%, #12080b 50%, #6b0912 54%, #2a0508 62%,
    #ffffff 74%, #ffffff 100%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 9px rgba(255, 59, 74, .6)) drop-shadow(0 0 30px rgba(255, 59, 74, .38));
  animation: ctm-name-wave 9s linear infinite;
}
@keyframes ctm-name-wave {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
#cain-top-mark .ctm-sub {
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: clamp(8px, .73vw, 10px);
  line-height: 1.2;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: #7fd8a8;
  text-shadow: 0 0 6px rgba(34, 255, 136, .45);
  animation: c42-motto-flicker 4.5s steps(1, end) infinite;
}

/* The spinning five-arm mark and the motto: half the hero size defined in cain42.css /
   top100.css (which mark `.c42-mark` !important, so this needs an id + !important to win). */
#cain-top-mark .c42-mark {
  width: clamp(152px, 20vw, 258px) !important;
  height: auto !important;
  margin: 0 auto 12px !important;
}
#cain-top-mark .c42-motto {
  margin: 0 auto 8px !important;
  font-size: clamp(9px, .78vw, 11px) !important;
  letter-spacing: .15em !important;
}

@media (max-width: 640px) {
  #cain-top-mark { padding: 4px 8px 0; }
  #cain-top-mark .ctm-name { font-size: clamp(17px, 5.5vw, 26px); }
  #cain-top-mark .ctm-sub { font-size: 8px; letter-spacing: .11em; margin-top: 4px; }
  #cain-top-mark .c42-mark { margin-bottom: 8px !important; }
  #cain-top-mark .c42-motto { font-size: 9px !important; margin-bottom: 6px !important; }
}

/* The mark is in normal flow, so the sticky site header no longer has to sit below it. The
   PBFT status bar (46px desktop / 64px mobile) and the header offsets come from
   cluster-status-bar.css; previously this file pushed the header down by
   calc(bar + --ctm-h), which parked it hundreds of pixels below the viewport top. */

/* Anchored jumps land below the fixed PBFT bar and the sticky site header, not underneath them. */
:target { scroll-margin-top: 122px; }
@media (max-width: 640px) {
  :target { scroll-margin-top: 134px; }
}

@media (prefers-reduced-motion: reduce) {
  #cain-top-mark::before { animation: none; opacity: .55; }
  #cain-top-mark .ctm-name {
    animation: none;
    background-image: none;
    -webkit-text-fill-color: #ffffff;
    color: #ffffff;
  }
  #cain-top-mark .ctm-sub { animation: none; }
}

/* Plain-language explainer (owner directive 2026-11-26): under the spinning mark and the motto,
   one paragraph at about a 16-year-old reading level — what CAIN-42 is, why nothing runs without
   a clear yes, and three real evidence links including a failed test. Half-size band, readable. */
#cain-top-mark .ctm-explain {
  max-width: 76ch;
  margin: 8px auto 10px;
  padding: 0 6px;
  font: 400 clamp(12px, 1.02vw, 15px)/1.55 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #cfd6e3;
  text-align: left;
  text-wrap: pretty;
}
#cain-top-mark .ctm-explain b { color: #ffffff; font-weight: 750; }
#cain-top-mark .ctm-explain a {
  color: #86efac;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#cain-top-mark .ctm-explain a:hover { color: #bbf7d0; }
#cain-top-mark .ctm-status {
  display: block;
  margin-top: 6px;
  color: #fca5a5;
  font-weight: 800;
  letter-spacing: .01em;
}
#cain-top-mark .ctm-review {
  margin: 0 auto 10px;
  font: 600 clamp(10px, .82vw, 12px)/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .06em;
  color: #9fb0c9;
  text-align: center;
}
#cain-top-mark .ctm-review a {
  color: #7fd8a8;
  text-decoration: none;
  border-bottom: 1px solid rgba(127, 216, 168, .45);
}
#cain-top-mark .ctm-review a:hover { color: #bbf7d0; border-bottom-color: #bbf7d0; }

@media (max-width: 640px) {
  #cain-top-mark .ctm-explain {
    font-size: 12px;
    line-height: 1.5;
    margin: 6px auto 8px;
    text-align: left;
  }
}

/* Owner directive 2026-11-26: the California Republic flag at the very bottom is centered on
   the page (the legal paragraph's 110ch cap was centering it inside an 828px column instead). */
.cain-footer .cf-legal p.cf-closing{max-width:none!important}
.cain-footer .cf-legal p.cf-closing .cf-caflag{display:block!important;margin:14px auto 0!important}

/* Owner directive 2026-11-26: remove Stripe buy buttons from the homepages. */
a[href*="buy.stripe.com"], .pd-stripe-btn, .pd-sticky, .pd-buy {display:none!important}

/* Official description (owner directive 2026-11-26): the identity line sits between the
   top mark and the live portal, above every evidence block. */
#cain-official-description{position:relative;z-index:59;padding:18px 16px 16px;text-align:center;
  background:linear-gradient(180deg,rgba(7,11,20,.98),rgba(11,16,29,.98));
  border-bottom:1px solid rgba(255,42,61,.55)}
#cain-official-description .cod-lead{max-width:1120px;margin:0 auto;
  font:900 clamp(17px,1.55vw,25px)/1.35 var(--c42-sans,system-ui,sans-serif);color:#fff;
  letter-spacing:-.01em;text-wrap:balance}
#cain-official-description .cod-scope{max-width:980px;margin:8px auto 0;
  font:600 clamp(10px,.8vw,12px)/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color:#9fb0c9;letter-spacing:.02em}
#cain-official-description .cod-scope b{color:#fca5a5}
@media(max-width:640px){#cain-official-description{padding:14px 12px 12px}
  #cain-official-description .cod-lead{font-size:16px}#cain-official-description .cod-scope{font-size:10px}}

/* Official description: the one-memory sentence (owner directive 2026-11-26). */
#cain-official-description .cod-memory{max-width:1120px;margin:10px auto 0;
  font:700 clamp(12px,1.02vw,15px)/1.55 var(--c42-sans,system-ui,sans-serif);color:#d7f7e5;
  letter-spacing:0;text-wrap:pretty}
#cain-official-description .cod-memory b{color:#86efac}
@media(max-width:640px){#cain-official-description .cod-memory{font-size:12px;margin-top:8px}}

/* Owner 2026-11-26: the AGI/RSI status line is centered above "Independent review wanted". */
#cain-top-mark .ctm-status{text-align:center}

/* Official description: link the claim to the live one-memory demo. */
#cain-official-description .cod-memory .cod-demo{color:#86efac;font-weight:800;text-decoration:underline;text-underline-offset:2px;white-space:nowrap}
#cain-official-description .cod-memory .cod-demo:hover{color:#bbf7d0}

/* Live OMEGA-seal auditor widget (owner directive 2026-11-26). */
#cain-verify-live{position:relative;z-index:58;padding:16px 16px 14px;background:linear-gradient(180deg,rgba(8,12,23,.98),rgba(7,11,20,.98));border-bottom:1px solid rgba(255,42,61,.35)}
#cain-verify-live .ovl-in{max-width:1180px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px 18px;align-items:center}
#cain-verify-live .ovl-kicker{margin:0 0 4px;font:800 9.5px/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.16em;color:#fca5a5}
#cain-verify-live .ovl-lead{margin:0;color:#cfd6e3;font-size:13.5px;line-height:1.5;max-width:760px}
#cain-verify-live .ovl-lead b{color:#fff}
#cain-verify-live .ovl-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-self:end}
#cain-verify-live .ovl-btn{appearance:none;border:1px solid #2b3760;background:#0d1328;color:#dbeafe;border-radius:999px;padding:8px 12px;font:700 10.5px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.03em;cursor:pointer}
#cain-verify-live .ovl-btn:hover{border-color:#86efac;color:#fff}
#cain-verify-live .ovl-btn.primary{background:#d81f2e;border-color:#d81f2e;color:#fff}
#cain-verify-live .ovl-btn.primary:hover{background:#c41a28}
#cain-verify-live .ovl-btn:disabled{opacity:.55;cursor:wait}
#cain-verify-live .ovl-link{color:#86efac;font:700 10.5px/1 ui-monospace,monospace;text-decoration:none;white-space:nowrap}
#cain-verify-live .ovl-status{grid-column:1/-1;margin:2px 0 0;font:600 11px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:#9fb0c9}
#cain-verify-live .ovl-status.ok{color:#86efac}
#cain-verify-live .ovl-status.bad{color:#fca5a5}
#cain-verify-live .ovl-status.work{color:#fde68a}
@media(max-width:760px){#cain-verify-live .ovl-in{grid-template-columns:1fr}#cain-verify-live .ovl-actions{justify-self:start}#cain-verify-live .ovl-lead{font-size:12.5px}}

/* Direct auditor entry point under the plain-language explainer. */
#cain-top-mark .ctm-audit-link{display:inline-flex;align-items:center;gap:7px;margin:2px auto 8px;padding:7px 13px;border:1px solid #86efac;border-radius:6px;background:#06150d;color:#bbf7d0;font:800 clamp(11px,1vw,13px)/1.2 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;text-decoration:none;letter-spacing:.01em}
#cain-top-mark .ctm-audit-link:hover{background:#0b2a1a;color:#fff;border-color:#22c55e}

/* Plain-language hook (owner request 2026-11-26): entice a first-time visitor in the first seconds. */
#cain-start-hook{position:relative;z-index:57;padding:14px 16px 13px;background:linear-gradient(180deg,rgba(20,8,12,.98),rgba(9,12,22,.98));border-bottom:1px solid rgba(255,209,102,.35)}
#cain-start-hook .csh-in{max-width:1120px;margin:0 auto;text-align:center}
#cain-start-hook .csh-q{font:800 clamp(15px,1.3vw,20px)/1.25 system-ui,sans-serif;color:#fff;margin:0 0 4px;letter-spacing:-.01em}
#cain-start-hook .csh-a{font-size:13.5px;line-height:1.5;color:#cfd6e3;margin:0 0 9px}
#cain-start-hook .csh-a b{color:#fde68a}
#cain-start-hook .csh-b{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:0}
#cain-start-hook .csh-btn{display:inline-block;background:#d81f2e;color:#fff;border:1px solid #d81f2e;border-radius:999px;padding:8px 13px;font:800 11.5px/1 system-ui;text-decoration:none}
#cain-start-hook .csh-btn:hover{background:#c41a28}
#cain-start-hook .csh-btn.ghost{background:transparent;color:#fff;border-color:#3a4666}
#cain-start-hook .csh-btn.ghost:hover{border-color:#86efac}
@media(max-width:640px){#cain-start-hook{padding:11px 10px 10px}#cain-start-hook .csh-q{font-size:14px}#cain-start-hook .csh-a{font-size:12px}#cain-start-hook .csh-btn{padding:7px 11px;font-size:10.5px}}

/* Viral 10-second challenge (owner request 2026-11-26). */
#cain-start-hook .csh-poll{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;align-items:center;margin:0 0 8px;font-size:11.5px;color:#9fb0c9}
#cain-start-hook .csh-poll-label{font-weight:700;color:#8f9bb5}
#cain-start-hook .csh-poll button{background:#121a2e;color:#fff;border:1px solid #3a4666;border-radius:999px;padding:5px 11px;font:700 11px/1 system-ui;cursor:pointer}
#cain-start-hook .csh-poll button:hover{border-color:#fde68a;color:#fde68a}
#cain-start-hook .csh-res{color:#fde68a;font-weight:700;max-width:100%}
#cain-start-hook .csh-share{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center;margin:8px 0 0;font-size:10.5px;color:#8f9bb5}
#cain-start-hook .csh-share a,#cain-start-hook .csh-share button{color:#cfd6e3;text-decoration:none;background:none;border:0;border-bottom:1px dotted #3a4666;padding:0 0 1px;font:700 10.5px/1.5 system-ui;cursor:pointer}
#cain-start-hook .csh-share a:hover,#cain-start-hook .csh-share button:hover{color:#86efac;border-color:#86efac}
#cain-start-hook .csh-copied{color:#86efac;font-weight:700}
@media(max-width:640px){#cain-start-hook .csh-poll{font-size:10.5px}#cain-start-hook .csh-poll button{font-size:10px;padding:4px 9px}#cain-start-hook .csh-share{font-size:9.5px;gap:6px}}
