/* ==========================================================
   Component: chromeb  (prefix: cb-)
   Signature band: the draggable 3D letter B + "Make Waco look twice."
   Every selector starts with .cb- so nothing leaks into the page.
   Uses the v3 tokens from styles.css, with fallbacks.
   Numbers marked "sync" are also used in script.js.
   ========================================================== */

.cb-band {
  --cb-bs: clamp(160px, 22vw, 280px);    /* letter size */
  --cb-depth: calc(var(--cb-bs) * .26);  /* how thick the letter looks */
  --cb-ring: calc(var(--cb-bs) * 1.55);  /* orbit ring width, capped to the column below */
  position: relative;
  overflow: hidden;
  overflow: clip;
  padding: clamp(56px, 8vw, 104px) 0;
  color: #fff;
  background-color: var(--ink, #10271f);
  background-image: radial-gradient(75% 45% at 50% 84%, rgba(30, 83, 65, .7), rgba(30, 83, 65, 0) 72%);
}

.cb-grid {
  display: grid;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.cb-copy { min-width: 0; }

/* the big line */
.cb-title {
  color: #fff;
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  line-height: .98;
  letter-spacing: -.04em;
  font-weight: 750;
  font-stretch: 86%;
}
.cb-title em {
  display: block;
  font-size: 1.06em;
  color: var(--lime, #d6ea68);
  letter-spacing: -.01em;
}
.cb-line {
  margin-top: 1.1rem;
  max-width: 30em;
  font-size: clamp(1.08rem, 1.5vw, 1.25rem);
  color: rgba(255, 255, 255, .86);
}
.cb-cta { margin-top: 1.8rem; max-width: 100%; }

/* keyboard focus that shows up on the dark band */
.cb-band :focus-visible { outline: 3px solid var(--lime, #d6ea68); outline-offset: 3px; }

/* ---------- the stage ---------- */
.cb-art {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-width: 0;
}
.cb-stage {
  position: relative;
  width: 100%;
  height: calc(var(--cb-bs) * 1.2);
  display: grid;
  place-items: center;
  perspective: 1100px;                   /* sync: PERSPECTIVE */
  border-radius: 24px;
  touch-action: pan-y;                   /* vertical swipes still scroll the page */
  touch-action: pan-y pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.cb-stage.cb-ready { cursor: grab; }
.cb-stage.cb-grabbing { cursor: grabbing; }
.cb-band .cb-stage:focus-visible { outline-offset: 2px; border-radius: 24px; }

/* finishes: face gradient, side colors (near the face -> back), glow */
.cb-stage,
.cb-stage[data-cb-finish="chrome"] {
  --cb-face: linear-gradient(155deg, #fff 0%, #d5deeb 20%, #7c879c 46%, #eef2f8 60%, #8792a7 80%, #cad4e3 100%);
  --cb-side-hi: #d3dbe8;
  --cb-side-lo: #414b5e;
  --cb-side-mid: #8a94a6;
  --cb-glow: rgba(200, 225, 240, .24);
}
.cb-stage[data-cb-finish="forest"] {
  --cb-face: linear-gradient(155deg, #7fb89a 0%, #2f7058 22%, #153d30 50%, #3f8468 68%, #1b4a3a 100%);
  --cb-side-hi: #d6ea68;
  --cb-side-lo: #174232;
  --cb-side-mid: #7d9a3f;
  --cb-glow: rgba(214, 234, 104, .2);
}
.cb-stage[data-cb-finish="lime"] {
  --cb-face: linear-gradient(155deg, #fbffe0 0%, #e4f38f 22%, #c9e04f 48%, #eef7b0 64%, #b3cc34 100%);
  --cb-side-hi: #2f7058;
  --cb-side-lo: #0c2a20;
  --cb-side-mid: #1e5341;
  --cb-glow: rgba(214, 234, 104, .34);
}

/* soft light under the letter */
.cb-glow {
  position: absolute;
  left: 50%;
  top: calc(50% + var(--cb-bs) * .38);
  z-index: 0;
  width: calc(var(--cb-bs) * 1.25);
  height: calc(var(--cb-bs) * .34);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--cb-glow), rgba(0, 0, 0, 0));
  pointer-events: none;
}

/* orbit ring, drawn twice: the far half behind the B, the near half in front of it */
.cb-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(var(--cb-ring), 94%);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .42);
  box-shadow: 0 0 22px rgba(214, 234, 104, .16), inset 0 0 22px rgba(214, 234, 104, .12);
  transform: translate(-50%, -50%) rotateZ(-14deg) rotateX(72deg);   /* sync: TILT_Z, TILT_X */
  pointer-events: none;
}
.cb-orbit-back { z-index: 1; clip-path: polygon(-25% -25%, 125% -25%, 125% 50%, -25% 50%); }
.cb-orbit-front { z-index: 4; clip-path: polygon(-25% 50%, 125% 50%, 125% 125%, -25% 125%); }

/* the little light that travels the ring (placed by script.js) */
.cb-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: none;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--lime, #d6ea68);
  box-shadow: 0 0 14px 3px rgba(214, 234, 104, .55);
  pointer-events: none;
  will-change: transform;
}
.cb-stage.cb-ready .cb-dot { display: block; }
.cb-stage .cb-dot.cb-dot-front { z-index: 5; }

/* the letter: a stack of flat "B"s pushed back in space */
.cb-b {
  position: relative;
  z-index: 3;
  width: var(--cb-bs);
  height: var(--cb-bs);
  font-family: var(--font, "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif);
  font-size: var(--cb-bs);
  font-weight: 800;
  font-stretch: 88%;
  line-height: 1;
  transform-style: preserve-3d;
  transform: rotateX(10deg) rotateY(-28deg);   /* resting angle, sync: REST_X, REST_Y */
  will-change: transform;
  pointer-events: none;
}
.cb-layer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
  width: max-content;                    /* tight box = less memory per layer */
  height: 1em;
  line-height: 1;
  pointer-events: none;
}
.cb-front {
  color: var(--cb-side-hi);
  transform: translateZ(0);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .cb-front {
    color: transparent;
    -webkit-text-fill-color: transparent;
    background: var(--cb-face);
    -webkit-background-clip: text;
    background-clip: text;
  }
}
.cb-side {
  color: var(--cb-side-mid);
  transform: translateZ(calc(var(--cb-t, 0) * var(--cb-depth) * -1));
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .cb-side { color: color-mix(in srgb, var(--cb-side-hi) calc((1 - var(--cb-t, 0)) * 100%), var(--cb-side-lo)); }
}

/* ---------- finish buttons ---------- */
.cb-finish {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  border-radius: 28px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .2);
}
.cb-finish[hidden], .cb-help[hidden] { display: none; }
.cb-finish button {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  min-height: 40px;
  margin: 0;
  padding: .45em .8em;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, .9);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.1;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.cb-finish button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.cb-finish button[aria-pressed="true"] { background: var(--lime, #d6ea68); color: var(--green, #153d30); }
.cb-swatch {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 0 0 1px rgba(16, 39, 31, .45);
}
.cb-finish [data-cb-finish="chrome"] .cb-swatch { background: linear-gradient(135deg, #fff, #8a94a6); }
.cb-finish [data-cb-finish="forest"] .cb-swatch { background: linear-gradient(135deg, #3f8468, #0f3326); box-shadow: inset 0 0 0 2px #d6ea68, 0 0 0 1px rgba(16, 39, 31, .45); }
.cb-finish [data-cb-finish="lime"] .cb-swatch { background: linear-gradient(135deg, #eef7b0, #b3cc34); box-shadow: inset 0 0 0 2px #1e5341, 0 0 0 1px rgba(16, 39, 31, .45); }

.cb-help {
  margin: 0;
  font-size: .88rem;
  text-align: center;
  color: rgba(255, 255, 255, .74);
}

/* ---------- layout ---------- */
@media (min-width: 861px) {
  .cb-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  .cb-band { background-image: radial-gradient(45% 70% at 76% 55%, rgba(30, 83, 65, .7), rgba(30, 83, 65, 0) 72%); }
}
@media (max-width: 560px) {
  .cb-cta { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .cb-finish button { transition: none; }
}
@media (forced-colors: active) {
  .cb-finish button[aria-pressed="true"] { outline: 2px solid ButtonText; outline-offset: -2px; }
  .cb-b, .cb-orbit, .cb-dot, .cb-glow { forced-color-adjust: none; }
}
