/* telos-only rules. Loaded after cubesite.css, so they build on its tokens and
   classes rather than restating them. The page shapes (hero, feature grid,
   flow, steps, docs) follow mcp-router's site. */

:root {
  --bg-alt: #f3f3f1;
  --accent-2: #7c3aed;
  --pass: #16a34a;
  --fail: #dc2626;
  --code-bg: #0f1117;
  --code-fg: #e6e9ef;
  --code-cmt: #7f8ea3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg-alt: #161619;
    --accent-2: #a78bfa;
    --pass: #4ade80;
    --fail: #f87171;
    --code-bg: #08090c;
  }
}

html {
  scroll-behavior: smooth;
}

/* The mark at cubicecho.com's size, so the header matches the org site's. */
.mark {
  width: 80px;
  height: 80px;
}

/* hero */

.home-hero {
  position: relative;
  padding: 4rem clamp(1rem, 4vw, 2.5rem) 3rem;
  margin-top: 0.5rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 1.5);
  background:
    radial-gradient(800px 320px at 10% -20%, color-mix(in srgb, var(--accent) 20%, transparent), transparent),
    radial-gradient(700px 300px at 100% 0%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent),
    var(--card);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.9rem;
}
.home-hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.1;
  margin: 0 0 1.1rem;
  letter-spacing: -0.02em;
  max-width: 20ch;
}
.lede {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: var(--muted);
  max-width: 62ch;
  margin: 0;
}
.hero p.lede {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
}

/* the screenshot under the hero's buttons */

.shot.hero-shot {
  margin-top: 2.75rem;
}

/* the note under the extras */

.board-caption {
  margin: 1.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* home sections */

.home .section {
  padding-top: 4rem;
}
.home .section > h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}
.home .section > .section-intro {
  margin-top: -1rem;
  margin-bottom: 1.75rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}
.feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
}
.feature-icon {
  font-size: 1.6rem;
  margin-bottom: 0.7rem;
}
.feature h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}
.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* screenshots, each in a browser frame, enlarged in the lightbox */

.home .section > .section-intro {
  color: var(--muted);
}
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}
.shot {
  margin: 0;
}
.shot-wide {
  grid-column: 1 / -1;
}
.shot-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-alt);
  padding-top: 1.6rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.35);
}
.shot-frame::before {
  content: '';
  position: absolute;
  top: 0.6rem;
  left: 0.75rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--line);
  box-shadow: 0.85rem 0 0 var(--line), 1.7rem 0 0 var(--line);
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-top: 1px solid var(--line);
  cursor: zoom-in;
}
.shot img:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.shot figcaption {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.lightbox {
  max-width: min(96vw, 1800px);
  max-height: 96vh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.8);
}
.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  margin: 0 auto;
  border-radius: var(--radius);
  cursor: zoom-out;
}
.lightbox-caption {
  margin: 0.6rem 0 0;
  text-align: center;
  color: #e5e7eb;
  font-size: 0.9rem;
}
.lightbox-close {
  position: absolute;
  top: -2.4rem;
  right: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

/* how it works */

.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.85rem;
}
.flow-node {
  flex: 1 1 11rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.flow-node span {
  color: var(--muted);
  font-size: 0.88rem;
}
.flow-node.flow-key {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.flow-arrow {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-weight: 600;
}
.flow-routes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.flow-routes code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
}
.flow-routes .pass {
  color: var(--pass);
}
.flow-routes .fail {
  color: var(--fail);
}
.flow-caption {
  margin: 1.4rem 0 0;
  color: var(--muted);
  max-width: 72ch;
}

/* final call to action */

.cta-final {
  text-align: center;
  padding-bottom: 1rem;
}
.home .cta-final > h2 {
  margin-bottom: 0.75rem;
}
.cta-final > p {
  color: var(--muted);
  margin: 0 auto;
  max-width: 52ch;
}
.cta-final .cta {
  justify-content: center;
  margin-top: 1.5rem;
}

/* code: a dark block on both themes, with comments dimmed */

pre.code {
  background: var(--code-bg);
  color: var(--code-fg);
  border-color: color-mix(in srgb, var(--code-fg) 12%, transparent);
  line-height: 1.6;
}
pre.code code {
  color: inherit;
  white-space: pre;
}
.cmt {
  color: var(--code-cmt);
}
.pill {
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
  color: var(--muted);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.5rem;
}

/* page heads on the inner pages */

.page-hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}
.page-hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
}

/* get started: a numbered walkthrough */

.steps {
  counter-reset: step;
  max-width: 54rem;
}
.step {
  position: relative;
  padding-left: 4.25rem;
  margin-bottom: 3.25rem;
}
.step:last-child {
  margin-bottom: 0;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 50%;
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(1.375rem - 1px);
  top: 3.25rem;
  bottom: -3.25rem;
  width: 2px;
  background: var(--line);
}
.step h2 {
  margin: 0.4rem 0 0.6rem;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.step h3 {
  margin: 1.4rem 0 0.5rem;
  font-size: 0.95rem;
}
.step > p,
.step li {
  color: var(--muted);
}
.step strong {
  color: var(--fg);
}
.step ul,
.step ol {
  padding-left: 1.25rem;
}
.step li {
  margin-bottom: 0.4rem;
}
.gs-callout {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.95rem;
}
.gs-callout strong {
  color: var(--fg);
}

/* docs: a sticky table of contents beside the text */

.docs-layout {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 3rem;
  align-items: start;
  padding-top: 2rem;
}
.toc {
  position: sticky;
  top: 1.5rem;
  font-size: 0.9rem;
}
.toc-title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 0.65rem;
}
.toc nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toc nav a {
  color: var(--muted);
}
.toc nav a:hover {
  color: var(--accent);
  text-decoration: none;
}
.toc-foot {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.docs-body {
  min-width: 0;
  max-width: 46rem;
}
.docs-body h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}
.docs-body h2 {
  font-size: 1.5rem;
  margin: 3rem 0 0.9rem;
  letter-spacing: -0.01em;
  scroll-margin-top: 1rem;
}
.docs-body h3 {
  font-size: 1.1rem;
  margin: 1.75rem 0 0.6rem;
}
.docs-body p,
.docs-body li {
  color: var(--muted);
}
.docs-body strong {
  color: var(--fg);
}
.docs-body li {
  margin-bottom: 0.5rem;
}
.docs-body .table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 1rem 0;
}
.docs-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.docs-body th,
.docs-body td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.docs-body th {
  background: var(--bg-alt);
  color: var(--fg);
  font-weight: 600;
}
.docs-body tr:last-child td {
  border-bottom: 0;
}
.docs-body td code {
  white-space: nowrap;
}

/* glossary: terms from the domain model */

.glossary {
  margin: 0;
}
.glossary-entry {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 1rem;
}
.glossary-entry:last-child {
  border-bottom: 0;
}
.glossary dt {
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.glossary dt a {
  color: var(--fg);
}
.glossary-entry:target dt a {
  color: var(--accent);
}
.glossary-alias {
  margin-left: 0.5rem;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--muted);
}
.glossary dd {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 780px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .toc {
    position: static;
  }
  .flow {
    flex-direction: column;
  }
  .gallery {
    grid-template-columns: 1fr;
  }
  .flow-arrow {
    justify-content: center;
    transform: rotate(90deg);
  }
}
@media (max-width: 560px) {
  .step {
    padding-left: 0;
  }
  .step::before {
    position: static;
    margin-bottom: 0.75rem;
  }
  .step:not(:last-child)::after {
    display: none;
  }
}

/* inline code outside .prose, which cubesite already covers */

.feature code,
.cta-final code,
.board-caption code,
.step code,
.gs-callout code,
.docs-body :not(pre) > code {
  font-family: var(--font-mono);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
}
