/* Site chrome shared by every page of raycat.org (explainers included): top bar, footer,
   buttons and banner slots. Colours and fonts come from the explainer tokens
   (camera-lens/src/style.css); every class is prefixed so explainers' own styles stay untouched. */
:root { --rc-head: #121720; --rc-dark: #090c12; --rc-dark-2: #111622; --rc-dark-edge: #1d2534; --rc-dark-text: #8c98ad; --rc-dark-hi: #e8ecf4; --rc-amber: #ffc35a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --rc-head: #2b3447; }
}
:root[data-theme="dark"] { --rc-head: #2b3447; }

.rc-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.rc-mark { display: block; flex: none; overflow: visible; }

/* ---------- top bar ---------- */
.rc-bar { padding-inline: 20px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.rc-bar-in {
  max-width: var(--wide); margin-inline: auto;
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 26px;
  padding-block: 12px;
}
.rc-home {
  display: inline-flex; align-items: center; gap: 0.3em;
  font: 600 1.32rem/1 var(--font-display); letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none;
}
.rc-home .rc-mark { width: 1.2em; height: 1.2em; }
.rc-home b { font-weight: inherit; color: var(--accent); }
.rc-nav { display: flex; flex-wrap: wrap; gap: 4px 22px; font: 500 0.76rem/1.2 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }
.rc-nav a { color: var(--ink-2); text-decoration: none; padding-block: 6px; }
.rc-nav a:hover { color: var(--ink); }
.rc-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.rc-ask, .rc-lang {
  font: 600 0.78rem/1 var(--font-mono); letter-spacing: 0.02em; text-decoration: none; white-space: nowrap;
  border-radius: 999px; padding: 0.62em 1em; border: 1px solid var(--rule); color: var(--ink);
}
.rc-ask { border-color: var(--accent); color: var(--accent); }
.rc-ask:hover { background: var(--accent); color: var(--paper); }
.rc-lang:hover { border-color: var(--ink-2); }
.rc-home:focus-visible, .rc-nav a:focus-visible, .rc-ask:focus-visible, .rc-lang:focus-visible,
.rc-foot a:focus-visible, .rc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

@media (max-width: 720px) {
  .rc-nav { order: 3; width: 100%; gap: 4px 18px; }
  .rc-ask { padding: 0.62em 0.8em; }
}
@media (max-width: 400px) {
  .rc-home { font-size: 1.15rem; }
  .rc-ask { font-size: 0.72rem; }
}

/* ---------- buttons ---------- */
.rc-btn {
  display: inline-flex; align-items: center; gap: 0.55em;
  font: 600 0.9rem/1 var(--font-mono); letter-spacing: 0.01em; text-decoration: none; cursor: pointer;
  padding: 0.95em 1.25em; border-radius: 12px; border: 1px solid var(--ink); background: transparent; color: var(--ink);
}
.rc-btn:hover { border-color: var(--accent); color: var(--accent); }
.rc-btn.primary { background: var(--ink); color: var(--paper); }
.rc-btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.rc-btn[disabled] { opacity: 0.6; cursor: progress; }
.on-dark .rc-btn { border-color: rgba(232, 236, 244, 0.35); color: var(--rc-dark-hi); }
.on-dark .rc-btn:hover { border-color: var(--rc-amber); color: var(--rc-amber); }
.on-dark .rc-btn.primary { background: var(--rc-amber); border-color: var(--rc-amber); color: var(--rc-dark); }
.on-dark .rc-btn.primary:hover { background: #ffd789; border-color: #ffd789; color: var(--rc-dark); }
.on-dark .rc-btn:focus-visible { outline-color: var(--rc-amber); }

/* ---------- footer: always dark, like the stages ---------- */
.rc-foot { padding-inline: 20px; background: var(--rc-dark); color: var(--rc-dark-text); --rc-head: #2b3447; }
.rc-foot-in {
  max-width: var(--wide); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); gap: 32px 48px;
  padding-block: 44px 28px; font-size: 0.95rem; line-height: 1.5;
}
.rc-foot .rc-home { color: var(--rc-dark-hi); font-size: 1.25rem; }
.rc-foot .rc-home b { color: var(--rc-amber); }
.rc-foot-brand { display: grid; gap: 12px; align-content: start; }
.rc-foot-brand p { margin: 0; max-width: 28ch; }
.rc-foot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.rc-foot-h { margin: 0 0 10px; font: 500 0.72rem/1.3 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--rc-dark-text); }
.rc-foot ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.rc-foot a { color: var(--rc-dark-hi); text-decoration: none; }
.rc-foot a:hover { color: var(--rc-amber); }
.rc-foot a:focus-visible { outline-color: var(--rc-amber); }
.rc-foot-base {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding-top: 20px; border-top: 1px solid var(--rc-dark-edge);
  font: 500 0.78rem/1.4 var(--font-mono); letter-spacing: 0.04em;
}
@media (max-width: 760px) {
  .rc-foot-in { grid-template-columns: minmax(0, 1fr); }
  .rc-foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- banner slots ---------- */
.ad { max-width: var(--wide); margin: clamp(2.2rem, 5vw, 3.6rem) auto 0; display: grid; gap: 6px; justify-items: center; }
.ad-label { justify-self: center; font: 500 0.64rem/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); }
.ad a { display: block; width: 100%; max-width: 970px; }
.ad img { display: block; width: 100%; height: auto; border-radius: 10px; }
.ad-erid { font: 400 0.62rem/1 var(--font-mono); color: var(--ink-2); }
.ad-demo .ad-box {
  width: 100%; max-width: 970px; aspect-ratio: 970 / 250; display: grid; place-content: center; gap: 6px; text-align: center;
  border: 1.5px dashed var(--rule); border-radius: 10px; font: 500 0.8rem/1.3 var(--font-mono); color: var(--ink-2);
}
@media (max-width: 640px) { .ad-demo .ad-box { aspect-ratio: 320 / 100; } }

/* ---------- cookie notice (only when Google Analytics is configured) ---------- */
.rc-consent {
  position: fixed; z-index: 1000; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 44rem; margin-inline: auto; display: grid; gap: 14px; padding: 18px 20px;
  border-radius: 16px; border: 1px solid var(--rc-dark-edge); background: var(--rc-dark); color: var(--rc-dark-hi);
  box-shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.65); font: 400 0.95rem/1.5 var(--font-body);
}
.rc-consent p { margin: 0; color: var(--rc-dark-hi); }
.rc-consent a { color: var(--rc-amber); }
.rc-consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rc-consent .rc-btn { border-color: rgba(232, 236, 244, 0.4); color: var(--rc-dark-hi); padding: 0.8em 1.2em; }
.rc-consent .rc-btn:hover { border-color: var(--rc-amber); color: var(--rc-amber); }
.rc-consent .rc-btn:focus-visible { outline-color: var(--rc-amber); }
.rc-foot-base .rc-foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------- YouTube, loaded only after a click (home page and explainer pages) ---------- */
.video-wrap { margin: 0; display: grid; gap: 10px; }
.video-frame { border-radius: 16px; overflow: hidden; border: 1px solid var(--stage-edge); background: var(--rc-dark); }
.yt-facade { position: relative; display: block; aspect-ratio: 16 / 9; }
.yt-facade img { display: block; width: 100%; height: 100%; object-fit: cover; }
.yt-facade::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(9, 12, 18, 0.1), rgba(9, 12, 18, 0.55)); }
.yt-play {
  position: absolute; z-index: 1; left: 50%; top: 50%; width: 86px; height: 86px; margin: -43px 0 0 -43px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(9, 12, 18, 0.72); border: 2px solid var(--rc-amber); transition: transform 0.2s ease;
}
.yt-play svg { width: 38px; height: 38px; margin-left: 4px; fill: var(--rc-amber); }
.yt-facade:hover .yt-play { transform: scale(1.07); }
.yt-facade:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.yt-dur { position: absolute; z-index: 1; right: 12px; bottom: 12px; font: 600 0.8rem/1 var(--font-mono); color: #fff; background: rgba(0, 0, 0, 0.75); padding: 5px 7px; border-radius: 6px; }
.yt-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.video-wrap figcaption { font-size: 0.92rem; line-height: 1.5; color: var(--ink-2); max-width: 70ch; }
.rc-video { max-width: var(--wide); margin: clamp(2.5rem, 6vw, 4rem) auto 0; display: grid; gap: 1rem; }
.rc-video h2 { margin: 0; display: flex; align-items: center; gap: 0.8rem; font: 600 clamp(1.35rem, 1.1rem + 1vw, 1.9rem)/1.1 var(--font-display); letter-spacing: -0.02em; }
.rc-video h2::after { content: ""; height: 1px; flex: 1; background: var(--rule); }
.video-wrap figcaption a { color: var(--accent); }
