/* Code Buddy product page. Loaded after /styles.css. */
.cb-page {
  --cb-bg: #0e0e10;
  --cb-panel: #18181b;
  --cb-panel-2: #212125;
  --cb-line: #2a2a2f;
  --cb-text: #f2f1ee;
  --cb-muted: #9b9aa1;
  --cb-orange: #ff6a2b;
  --cb-teal: #3ccfa8;
  background: var(--cb-bg);
  color: var(--cb-text);
}

.cb-page a {
  color: #ff9a6b;
}

.cb-page .site-header {
  position: absolute;
}

.cb-page .brand,
.cb-page .site-header nav a:hover {
  color: var(--cb-text);
}

.cb-page .site-header nav a {
  color: var(--cb-muted);
}

.cb-page .lang {
  border-color: var(--cb-line);
  color: var(--cb-muted);
}

.cb-page .btn-orange {
  background: var(--cb-orange);
  color: #fff;
}

.cb-page .btn-orange:hover {
  text-decoration: none;
  background: #ff7d45;
}

.cb-page .btn-ghost {
  box-shadow: inset 0 0 0 1.5px var(--cb-line);
  color: var(--cb-text);
}

.cb-page .btn-ghost:hover {
  text-decoration: none;
  box-shadow: inset 0 0 0 1.5px var(--cb-muted);
}

.cb-wrap {
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
}

/* ---------- Hero ---------- */
.cb-hero {
  position: relative;
  padding: 132px 0 96px;
  overflow: hidden;
}

.cb-hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 720px;
  background: radial-gradient(closest-side, rgba(255, 106, 43, 0.22), transparent 70%);
  pointer-events: none;
}

.cb-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.cb-eyebrow {
  margin: 0 0 18px;
  color: var(--cb-muted);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cb-hero h1 {
  margin: 0;
  font-size: clamp(44px, 6.4vw, 84px);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.cb-hero h1 em {
  font-style: normal;
  white-space: nowrap;
  color: var(--cb-orange);
}

.cb-lead {
  max-width: 540px;
  margin: 24px 0 0;
  color: #c9c8cc;
  font-size: 19px;
  line-height: 1.6;
}

.cb-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 32px;
}

.cb-cta small {
  color: var(--cb-muted);
  font-size: 14px;
}

.cb-agents {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.cb-agents li {
  padding: 6px 12px;
  border: 1px solid var(--cb-line);
  border-radius: 999px;
  color: #d8d7db;
  font-size: 14px;
}

/* Mac desktop mock */
.cb-mac {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 520px;
  margin-left: auto;
  border-radius: 28px;
  background: linear-gradient(160deg, #26262b, #141416 60%);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.cb-menubar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  height: 34px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #e7e6e1;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}

.cb-menubar .mb-buddy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-variant-numeric: tabular-nums;
}

.cb-menubar .mb-buddy svg {
  width: 18px;
  height: 18px;
}

.cb-menubar .mb-count {
  color: #a9a8ad;
}

.cb-mac-stage {
  position: absolute;
  inset: 34px 0 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
}

.cb-mac-stage .big-face {
  width: 62%;
  aspect-ratio: 1;
}

.cb-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #e7e6e1;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.cb-pill i,
.agent-row i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cb-orange);
  flex: none;
}

.st-waiting .cb-pill i,
.agent-row.st-waiting i {
  background: #ffcf3f;
  box-shadow: 0 0 0 4px rgba(255, 207, 63, 0.18);
}

.st-done .cb-pill i,
.agent-row.st-done i {
  background: var(--cb-teal);
}

.agent-row.st-idle i {
  background: #6b6a70;
}

/* ---------- Sections ---------- */
.cb-section {
  padding: 112px 0;
  border-top: 1px solid var(--cb-line);
}

.cb-head {
  max-width: 680px;
  margin-bottom: 48px;
}

.cb-head .kicker {
  margin: 0 0 12px;
  color: var(--cb-orange);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cb-head h2 {
  margin: 0;
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.cb-head p {
  margin: 18px 0 0;
  color: #c2c1c6;
  font-size: 18px;
  line-height: 1.6;
}

.cb-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px;
  align-items: stretch;
}

.cb-card {
  position: relative;
  border-radius: 22px;
  background: var(--cb-panel);
  box-shadow: inset 0 0 0 1px var(--cb-line);
  overflow: hidden;
}

/* terminal */
.cb-term {
  padding: 0 0 18px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.75;
  min-height: 360px;
}

.cb-term-bar {
  display: flex;
  gap: 7px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--cb-line);
}

.cb-term-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #3a3a40;
}

.cb-term ol {
  margin: 0;
  padding: 14px 20px 0;
  list-style: none;
  color: #d3d2d6;
}

.cb-term li {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cb-term .p {
  color: var(--cb-orange);
}

.cb-term .dim {
  color: var(--cb-muted);
}

.cb-term .ok {
  color: var(--cb-teal);
}

.cb-term .ask {
  display: inline-block;
  margin: 4px 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 207, 63, 0.12);
  color: #ffd866;
}

.cb-term .caret {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: #d3d2d6;
  animation: cb-caret 1s steps(1) infinite;
}

@keyframes cb-caret {
  50% {
    opacity: 0;
  }
}

.cb-watch {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 32px;
  min-height: 360px;
}

.cb-watch .face {
  width: min(220px, 70%);
  aspect-ratio: 1;
}

.cb-watch p {
  margin: 0;
  max-width: 300px;
  color: var(--cb-muted);
  font-size: 15px;
  line-height: 1.55;
  text-align: center;
  min-height: 3.1em;
}

/* agents */
.cb-agents-demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
}

.cb-agents-demo .who {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 36px 24px;
  background: radial-gradient(closest-side, rgba(255, 106, 43, 0.14), transparent);
}

.cb-agents-demo .who .cb-menubar {
  background: none;
}

.cb-agents-demo .who .face {
  width: min(200px, 60%);
  aspect-ratio: 1;
}

.cb-agents-demo .who .why {
  margin: 0;
  color: var(--cb-muted);
  font-size: 14px;
  text-align: center;
}

.cb-agents-demo ul {
  display: grid;
  align-content: center;
  gap: 6px;
  margin: 0;
  padding: 28px;
  list-style: none;
  border-left: 1px solid var(--cb-line);
}

.agent-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  transition: background 0.35s, box-shadow 0.35s;
}

.agent-row b {
  font-weight: 600;
}

.agent-row span {
  color: var(--cb-muted);
  font-size: 14px;
  white-space: nowrap;
}

.agent-row.pick {
  background: var(--cb-panel-2);
  box-shadow: inset 0 0 0 1px rgba(255, 106, 43, 0.45);
}

.cb-agents-demo .busy {
  font-variant-numeric: tabular-nums;
}

/* six faces */
.cb-faces {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cb-faces li {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px 12px 20px;
  border-radius: 18px;
  background: var(--cb-panel);
  box-shadow: inset 0 0 0 1px var(--cb-line);
  text-align: center;
}

.cb-faces .face {
  width: 88px;
  aspect-ratio: 1;
}

.cb-faces b {
  font-size: 16px;
}

.cb-faces span {
  color: var(--cb-muted);
  font-size: 13px;
  line-height: 1.45;
}

/* usage */
.cb-usage {
  padding: 28px;
}

.cb-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--cb-panel-2);
}

.cb-tabs span {
  padding: 6px 14px;
  border-radius: 7px;
  color: var(--cb-muted);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.3s, color 0.3s;
}

.cb-tabs span.on {
  background: var(--cb-text);
  color: #111;
}

.cb-spend {
  margin: 22px 0 4px;
  font-size: clamp(44px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.cb-spend small {
  margin-left: 10px;
  color: var(--cb-muted);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
}

.cb-by-tool {
  margin: 0 0 20px;
  color: #d8d7db;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.cb-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  margin-bottom: 22px;
}

.cb-bars i {
  flex: 1;
  height: 4%;
  border-radius: 6px 6px 3px 3px;
  background: #3a3a40;
  transition: height 0.8s var(--ease);
}

.cb-bars i:last-child {
  background: var(--cb-orange);
}

.cb-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.cb-stats div {
  padding: 14px;
  border-radius: 12px;
  background: var(--cb-panel-2);
}

.cb-stats dt {
  color: var(--cb-muted);
  font-size: 13px;
}

.cb-stats dd {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cb-meters {
  display: grid;
  align-content: start;
  gap: 26px;
  padding: 28px;
}

.cb-meter p {
  display: flex;
  justify-content: space-between;
  margin: 0 0 8px;
  font-size: 15px;
}

.cb-meter p span {
  color: var(--cb-muted);
  font-variant-numeric: tabular-nums;
}

.cb-meter .track {
  height: 8px;
  border-radius: 999px;
  background: var(--cb-panel-2);
  overflow: hidden;
}

.cb-meter .track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--cb-orange);
  transition: width 1.2s var(--ease);
}

.cb-note {
  margin: 4px 0 0;
  color: var(--cb-muted);
  font-size: 14px;
  line-height: 1.55;
}

/* styles */
.cb-styles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.cb-style {
  display: grid;
  grid-template-rows: 240px auto;
}

.cb-style .look {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
}

.cb-style .look .face {
  width: 112px;
  aspect-ratio: 1;
}

.cb-style .txt {
  padding: 20px 22px 24px;
  border-top: 1px solid var(--cb-line);
}

.cb-style h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.cb-style p {
  margin: 0;
  color: var(--cb-muted);
  font-size: 15px;
  line-height: 1.55;
}

.look-native {
  background: linear-gradient(180deg, #2b2d33, #1d1e22);
}

.look-companion {
  background: #2b1f1a;
}

.look-companion .look {
  grid-auto-flow: column;
}

.bubble {
  position: relative;
  max-width: 150px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fbf3ea;
  color: #2b1f1a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  animation: cb-bob 3.2s ease-in-out infinite;
}

@keyframes cb-bob {
  50% {
    transform: translateY(-5px);
  }
}

.look-ambient {
  background: #050505;
}

.look-ambient .look::before {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 106, 43, 0.5), rgba(255, 106, 43, 0.08) 70%, transparent);
  animation: cb-glow 3.6s ease-in-out infinite;
}

@keyframes cb-glow {
  50% {
    transform: scale(1.18);
    opacity: 0.6;
  }
}

/* privacy */
.cb-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cb-points li {
  padding: 26px;
  border-radius: 18px;
  background: var(--cb-panel);
  box-shadow: inset 0 0 0 1px var(--cb-line);
}

.cb-points b {
  display: block;
  margin-bottom: 8px;
  font-size: 19px;
}

.cb-points span {
  color: #c2c1c6;
  font-size: 15px;
  line-height: 1.6;
}

.cb-points code {
  color: #e7e6e1;
  font-size: 13px;
}

/* final call */
.cb-final {
  text-align: center;
}

.cb-final .face {
  width: 120px;
  aspect-ratio: 1;
  margin: 0 auto 20px;
}

.cb-final h2 {
  margin: 0;
  font-size: clamp(32px, 4.4vw, 52px);
  letter-spacing: -0.035em;
}

.cb-final .cb-cta {
  justify-content: center;
}

/* help, on the dark page */
.cb-help {
  border-top: 1px solid var(--cb-line);
}

.cb-page .doc {
  padding-top: 96px;
}

.cb-page .doc h2,
.cb-page .doc h3,
.cb-page .doc strong {
  color: var(--cb-text);
}

.cb-page .doc p,
.cb-page .doc li {
  color: #c9c8cc;
}

.cb-page .doc code {
  background: var(--cb-panel-2);
  color: #e7e6e1;
}

.cb-page .doc-note {
  background: var(--cb-panel);
  color: #c9c8cc;
}

.cb-page .doc-fine {
  color: var(--cb-muted);
}

.cb-page .doc .cb-help-title {
  margin: 0 0 8px;
  font-size: clamp(32px, 4.4vw, 52px);
  letter-spacing: -0.035em;
}

.cb-page .site-footer {
  border-top: 1px solid var(--cb-line);
}

/* reveal */
.js .cb-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.9s var(--ease);
}

.js .cb-reveal.in {
  opacity: 1;
  transform: none;
}

@media (max-width: 900px) {
  .cb-hero {
    padding-top: 108px;
  }

  .cb-hero-grid,
  .cb-split,
  .cb-agents-demo {
    grid-template-columns: minmax(0, 1fr);
  }

  .cb-mac {
    margin: 0 auto;
    width: 100%;
  }

  .cb-agents-demo ul {
    border-left: 0;
    border-top: 1px solid var(--cb-line);
    padding: 18px;
  }

  .cb-faces {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cb-styles,
  .cb-points {
    grid-template-columns: minmax(0, 1fr);
  }

  .cb-section {
    padding: 80px 0;
  }

  .cb-watch {
    order: -1;
    grid-template-columns: 96px minmax(0, 1fr);
    justify-items: start;
    min-height: 0;
    padding: 18px;
  }

  .cb-watch .face {
    width: 96px;
  }

  .cb-watch p {
    text-align: left;
    min-height: 0;
  }

  .cb-term {
    min-height: 300px;
  }
}

@media (max-width: 520px) {
  .cb-faces {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cb-stats dd {
    font-size: 18px;
  }

  .cb-term {
    font-size: 12.5px;
  }

  .agent-row {
    padding: 10px;
  }

  .agent-row span {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .cb-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .bubble,
  .look-ambient .look::before,
  .cb-term .caret {
    animation: none;
  }
}
