/* =========================================================
   Cuelinks MCP — sections (tools, clients, auth, use cases)
   ========================================================= */

/* ---------- Stats / facts strip ---------- */
.stats { padding: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 32px 28px; border-left: 1px solid var(--line); position: relative; }
.stat:first-child { border-left: 0; }
.stat-value { font-size: 36px; letter-spacing: -0.03em; font-weight: 500; line-height: 1; margin-bottom: 8px; font-feature-settings: "tnum", "ss01"; }
.stat-value .unit { color: var(--ink-3); font-weight: 400; font-size: 22px; }
.stat-label { font-size: 13px; color: var(--ink-3); }
.stat-tag { position: absolute; top: 32px; right: 28px; font-family: var(--mono); font-size: 11px; color: var(--accent); }
@media (max-width: 820px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(4) { border-top: 1px solid var(--line); }
}

/* ---------- Tool reference ---------- */
.tools {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--bg-1);
}
.tool {
  padding: 28px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
  min-height: 280px; position: relative;
}
.tool:last-child { border-right: 0; }
.tool-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.tool-name {
  font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--ink);
}
.tool-name .at { color: var(--accent); }
.tool-kind {
  font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-3); padding: 3px 8px;
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg-2); letter-spacing: 0.04em; text-transform: uppercase;
}
.tool-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.tool-params {
  font-family: var(--mono); font-size: 11.5px;
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
  color: var(--ink-3); border-top: 1px dashed var(--line); padding-top: 14px;
}
.tool-params .p-name { color: var(--ink-2); }
.tool-params .p-type { color: var(--accent); }
.tool-returns {
  margin-top: auto; font-family: var(--mono); font-size: 11px;
  color: var(--ink-4); letter-spacing: 0.04em; text-transform: uppercase;
}
@media (max-width: 980px) {
  .tools { grid-template-columns: 1fr; }
  .tool { border-right: 0; border-bottom: 1px solid var(--line); }
  .tool:last-child { border-bottom: 0; }
}

/* ---------- Install / quickstart ---------- */
.qs-layout {
  display: grid; grid-template-columns: 0.9fr 1.1fr;
  gap: 40px; align-items: start;
}
@media (max-width: 980px) { .qs-layout { grid-template-columns: 1fr; } }
.steps { display: flex; flex-direction: column; }
.step {
  display: grid; grid-template-columns: 40px 1fr;
  gap: 16px; padding: 20px 0;
  border-top: 1px solid var(--line); align-items: start;
}
.step:first-child { border-top: 0; padding-top: 0; }
.step-num { font-family: var(--mono); font-size: 11px; color: var(--ink-3); padding-top: 3px; }
.step-num .box {
  display: inline-grid; place-items: center; width: 24px; height: 24px;
  border: 1px solid var(--line-2); border-radius: 5px; font-weight: 500;
}
.step h4 { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.step p { font-size: 13.5px; color: var(--ink-3); line-height: 1.55; }

/* Code switcher */
.code-switch {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card);
}
.code-tabs {
  display: flex; align-items: center; gap: 2px;
  padding: 6px 6px 0 6px; border-bottom: 1px solid var(--line);
  background: var(--bg-2); overflow-x: auto;
}
.code-tab {
  background: transparent; border: 0; color: var(--ink-3);
  padding: 8px 14px; font-family: var(--mono); font-size: 12px;
  border-radius: 6px 6px 0 0; border: 1px solid transparent; border-bottom: 0;
  position: relative; top: 1px; transition: 120ms; white-space: nowrap;
}
.code-tab:hover { color: var(--ink-2); }
.code-tab.active { color: var(--ink); background: var(--bg-1); border-color: var(--line); }
.code-tabs .spacer { flex: 1; }
.code-tabs .copy-btn {
  background: transparent; border: 1px solid var(--line-2);
  color: var(--ink-3); padding: 4px 10px; border-radius: 4px;
  font-family: var(--mono); font-size: 10.5px; transition: 120ms;
  align-self: flex-end; margin-bottom: 6px;
}
.code-tabs .copy-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.code-tabs .copy-btn.copied { color: var(--accent); border-color: var(--accent-dim); }
.code-body {
  padding: 18px 20px; font-family: var(--mono);
  font-size: 12.5px; line-height: 1.7;
  max-height: 440px; overflow: auto;
}
.code-body pre { margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }
.code-body .cm { color: var(--com); }
.code-body .kw { color: var(--key); }
.code-body .st { color: var(--str); }
.code-body .nm { color: var(--num); }
.code-body .fl { color: var(--accent); }

/* ---------- Lifecycle trace (how it works) ---------- */
.lifecycle { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-1); }
.lifecycle-head { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.lifecycle-col { padding: 28px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.lifecycle-col:last-child { border-right: 0; }
.lifecycle-col .tag {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  letter-spacing: 0.08em; text-transform: uppercase; display: flex; align-items: center; gap: 8px;
}
.lifecycle-col .tag .pip {
  width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center;
  background: var(--bg-2); border: 1px solid var(--line-2); font-size: 11px;
}
.lifecycle-col h4 { font-size: 17px; font-weight: 500; }
.lifecycle-col p { font-size: 13.5px; color: var(--ink-3); line-height: 1.55; }

.lifecycle-trace {
  padding: 22px 28px; background: var(--bg-2); display: flex; flex-direction: column; gap: 10px;
  font-family: var(--mono); font-size: 12px;
}
.trace-row {
  display: grid; grid-template-columns: 72px 110px 1fr;
  gap: 14px; align-items: baseline; color: var(--ink-2);
}
.trace-row .ts { color: var(--ink-4); }
.trace-row .ev { color: var(--accent); }
.trace-row .ev.dim { color: var(--ink-3); }
.trace-row .msg .hl { color: var(--ink); font-weight: 500; }
@media (max-width: 820px) {
  .lifecycle-head { grid-template-columns: 1fr; }
  .lifecycle-col { border-right: 0; border-bottom: 1px solid var(--line); }
  .lifecycle-col:last-child { border-bottom: 0; }
  .trace-row { grid-template-columns: 60px 1fr; }
  .trace-row .ev { grid-column: 1 / -1; }
}

/* ---------- Clients grid ---------- */
.clients {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--bg-1);
}
.client {
  padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px; min-height: 180px;
}
.client:nth-child(4n) { border-right: 0; }
.client:nth-last-child(-n+4) { border-bottom: 0; }
.client-name {
  display: flex; align-items: center; gap: 8px; font-weight: 500;
}
.client-name .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.client-mode { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; }
.client-body { font-size: 13px; color: var(--ink-3); line-height: 1.55; margin-top: 4px; }
.client-foot {
  margin-top: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-4);
  display: flex; align-items: center; gap: 6px;
}
@media (max-width: 980px) {
  .clients { grid-template-columns: repeat(2, 1fr); }
  .client:nth-child(4n) { border-right: 1px solid var(--line); }
  .client:nth-child(2n) { border-right: 0; }
  .client:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); }
  .client:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 560px) {
  .clients { grid-template-columns: 1fr; }
  .client { border-right: 0; border-bottom: 1px solid var(--line); }
  .client:last-child { border-bottom: 0; }
}

/* ---------- Auth block ---------- */
.auth {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; } }
.auth-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-1); padding: 24px; display: flex; flex-direction: column; gap: 12px;
}
.auth-card h4 { font-size: 16px; font-weight: 500; }
.auth-card p { font-size: 13.5px; color: var(--ink-3); line-height: 1.55; }
.scope-list {
  display: flex; flex-direction: column; gap: 6px; margin-top: 4px;
}
.scope-row {
  display: grid; grid-template-columns: 150px 1fr;
  gap: 14px; font-family: var(--mono); font-size: 12px;
  padding: 6px 0; border-top: 1px solid var(--line);
}
.scope-row:first-child { border-top: 0; }
.scope-row .s-name { color: var(--accent); }
.scope-row .s-desc { color: var(--ink-3); }

/* ---------- Use cases ---------- */
.uses {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
@media (max-width: 820px) { .uses { grid-template-columns: 1fr; } }
.use {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-1); padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 220px;
}
.use-eyebrow { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; }
.use h4 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.use p { font-size: 13.5px; color: var(--ink-3); line-height: 1.55; }
.use .prompt {
  margin-top: auto; padding: 10px 12px; border-radius: 6px;
  background: var(--bg-2); border-left: 2px solid var(--accent);
  font-family: var(--mono); font-size: 12px; color: var(--ink-2); line-height: 1.5;
}

/* ---------- Final CTA ---------- */
.final-cta {
  text-align: center; padding: 72px 24px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 100% at 50% 100%, var(--accent-glow), transparent 70%),
    var(--bg-1);
}
.final-cta h2 { max-width: 22ch; margin: 0 auto 16px; }
.final-cta p { color: var(--ink-2); max-width: 52ch; margin: 0 auto 28px; font-size: 17px; }
.final-cta .hero-actions { justify-content: center; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 36px 0 56px; color: var(--ink-3); }
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; }
.foot-links a:hover { color: var(--ink); }
.foot-brand { display: flex; align-items: center; gap: 10px; font-size: 13px; }

/* ---------- Tweaks panel ---------- */
#tweaks-panel {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  width: 280px; background: var(--bg-1);
  border: 1px solid var(--line-2); border-radius: 10px;
  padding: 14px; box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  font-size: 13px; display: none;
}
#tweaks-panel.show { display: block; }
#tweaks-panel h4 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center;
}
#tweaks-panel .row {
  display: flex; justify-content: space-between; align-items: center; padding: 6px 0;
}
#tweaks-panel .row label { color: var(--ink-2); }
#tweaks-panel select, #tweaks-panel button.chip {
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--ink); padding: 4px 8px; border-radius: 5px; font-size: 12px;
}

/* ---------- Tools: the other 10 ---------- */
.tools-extra-head {
  display: flex; align-items: baseline; gap: 16px;
  margin: 44px 0 18px;
  padding-top: 28px; border-top: 1px dashed var(--line);
}
.eyebrow-mini {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  padding: 4px 8px; border: 1px solid var(--accent);
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  border-radius: 4px; white-space: nowrap;
}
.tools-extra-head p {
  font-size: 14px; color: var(--ink-3); margin: 0;
}
.tools-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.tool-mini {
  padding: 18px 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 8px;
}
.tool-mini:nth-child(2n) { border-right: 0; }
.tool-mini:nth-last-child(-n+2) { border-bottom: 0; }
.tm-name {
  font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink);
}
.tm-name .at { color: var(--accent); }
.tm-kind {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-3);
  padding: 2px 7px; border: 1px solid var(--line); border-radius: 3px;
  align-self: start;
}
.tool-mini p {
  grid-column: 1 / -1;
  font-size: 13px; color: var(--ink-3); line-height: 1.5; margin: 0;
}
@media (max-width: 720px) {
  .tools-grid { grid-template-columns: 1fr; }
  .tool-mini { border-right: 0; }
  .tool-mini:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .tool-mini:last-child { border-bottom: 0; }
}

/* Hero install sub-caption */
.hi-sub {
  font-size: 12.5px; color: var(--ink-3); margin-top: 10px;
  font-family: var(--mono); letter-spacing: 0.01em;
}
