/* cogyard.com — landing page
   Palette + type from branding/BRAND.md:
   indigo #3F3D9E (does the work) · amber #F59E0B (one live thing) ·
   ink #17162A · paper #FFFFFF. Poppins headings, Inter body, mono for code. */

:root {
  --indigo: #3F3D9E;
  --indigo-deep: #2d2b7a;
  --amber: #F59E0B;
  --ink: #17162A;
  --paper: #FFFFFF;
  --paper-soft: #f6f6fb;
  --muted: #5a5870;
  --line: #e6e6f0;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Poppins", "Inter", sans-serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 5.5rem 1.5rem;
}

/* ---------- nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.55rem; }
.brand:hover { text-decoration: none; }
.brand-mark { display: block; }
.brand-word {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 2rem;
  color: var(--ink);
}
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-cta {
  color: var(--indigo) !important;
  font-weight: 600 !important;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.nav-cta:hover { text-decoration: none; }

/* ---------- hero ---------- */
.hero { text-align: center; padding-top: 4rem; padding-bottom: 4.5rem; }
.eyebrow {
  color: var(--amber);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 1rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  margin-bottom: 1.25rem;
}
.lede {
  max-width: 640px;
  margin: 0 auto 2rem;
  font-size: 1.15rem;
  color: var(--muted);
}
.lede strong { color: var(--ink); }

.cta-row {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: transform .06s ease, background .15s ease;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.gh { flex-shrink: 0; }
.btn-primary { background: var(--indigo); color: #fff; }
.btn-primary:hover { background: var(--indigo-deep); }
.btn-ghost { color: var(--indigo); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--indigo); }

/* ---------- hero install pill ---------- */
.hero-install { margin: 0 auto 1.75rem; }
.hero-install code {
  display: inline-block;
  background: var(--ink);
  color: #e9e8f5;
  border-radius: 8px;
  padding: 0.7rem 1.1rem;
  font-size: 0.95rem;
}
.hero-install .prompt { color: var(--amber); margin-right: 0.55rem; }
.hero-meta {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  color: var(--muted);
}

/* ---------- the shift — arrow timeline ---------- */
.shift { text-align: center; }
.shift h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 0; }
.shift-lede {
  max-width: 680px;
  margin: 0.85rem auto 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--indigo);
}

.arrow { position: relative; padding: 0 1rem; margin-top: 4.5rem; }

/* the arrow line itself — indigo, fading in from the left, arrowhead at the right */
.axis {
  position: absolute;
  top: 50%;
  left: 0;
  right: 1.4rem;            /* leave room for the arrowhead */
  height: 3px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(63, 61, 158, 0) 0%, var(--indigo) 18%, var(--indigo) 100%);
  border-radius: 2px;
}
.axis::after {              /* arrowhead pointing into the future */
  content: "";
  position: absolute;
  right: -1.4rem;
  top: 50%;
  transform: translateY(-50%);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 16px solid var(--indigo);
}

.markers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  position: relative;
  z-index: 1;
}
.marker {
  flex: 1;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* dot sits on the axis (both centered at 50%) */
.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--indigo);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px rgba(63, 61, 158, 0.25);
}

/* connector stem from the dot to the callout */
.marker::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 2px;
  height: 30px;
  background: var(--line);
  transform: translateX(-50%);
}
.marker.up::after   { bottom: 50%; }
.marker.down::after { top: 50%; }

/* callouts alternate above / below the arrow
   (namespaced .tl-callout — the docs page owns a different .callout) */
.tl-callout {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 88%;
  max-width: 210px;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  text-align: center;
}
.marker.up   .tl-callout { bottom: calc(50% + 30px); }
.marker.down .tl-callout { top: calc(50% + 30px); }

.tl-callout .when {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.tl-callout .label {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
}
.tl-callout .note {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.4;
}

/* inflection points — amber, dominant */
.marker.inflection .dot {
  width: 24px;
  height: 24px;
  background: var(--amber);
  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.18);
}
.marker.inflection::after { background: var(--amber); }
.marker.inflection .when  { color: #b9760a; }
.marker.inflection .label { font-size: 1.18rem; color: var(--ink); }
.marker.inflection .note  {
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--ink);
}
.marker.inflection .tl-callout { max-width: 230px; }

/* ---------- why / rationale ---------- */
.rationale { text-align: center; }
.rationale h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 1rem; }
.rationale-lede {
  max-width: 680px;
  margin: 0 auto 2.75rem;
  font-size: 1.1rem;
  color: var(--muted);
}
.principles {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 880px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem 2.5rem;
  text-align: left;
}
.principle {
  border-left: 3px solid var(--indigo);
  padding-left: 1.15rem;
  color: var(--muted);
}
.principle strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.principle code {
  font-size: 0.86em;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.08rem 0.38rem;
  color: var(--ink);
}

/* ---------- quickstart ---------- */
.quickstart { max-width: 840px; }
.quickstart h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 1.75rem; }
.terminal {
  background: var(--ink);
  border-radius: 14px;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 24px 60px -28px rgba(23, 22, 42, 0.55);
}
.terminal-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  background: #221f3c;
}
.terminal-bar span { width: 12px; height: 12px; border-radius: 50%; background: #45436a; }
.terminal pre { margin: 0; padding: 1.4rem 1.5rem; overflow-x: auto; }
.terminal code {
  font-size: 0.92rem;
  line-height: 1.9;
  color: #e9e8f5;
}
.terminal .p { color: var(--amber); }
.terminal .c { color: #8b88b8; }
.quickstart-note {
  margin: 1.5rem 0 0;
  text-align: left;
  color: var(--muted);
  font-size: 1rem;
}
.quickstart-note code,
.card p code {
  font-size: 0.86em;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.08rem 0.38rem;
  color: var(--ink);
}

/* ---------- features ---------- */
.how { text-align: center; }
.how h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 0.85rem; }
.how-lede {
  max-width: 680px;
  margin: 0 auto 2.5rem;
  font-size: 1.1rem;
  color: var(--muted);
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  text-align: left;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.85rem;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.card:hover {
  border-color: #cdcce6;
  box-shadow: 0 10px 30px -12px rgba(63, 61, 158, 0.25);
  transform: translateY(-2px);
}
.card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(63, 61, 158, 0.09);
  color: var(--indigo);
  margin-bottom: 1.1rem;
}
.card-badge svg { width: 24px; height: 24px; }
.card h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.card p { margin: 0; color: var(--muted); }

/* ---------- task snippet ---------- */
.snippet-section { max-width: 760px; text-align: center; }
.snippet-section h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.snippet-lede {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 auto 2rem;
  max-width: 560px;
}
.snippet {
  text-align: left;
  background: var(--ink);
  border-radius: 14px;
  margin: 0;
  padding: 1.5rem 1.7rem;
  overflow-x: auto;
  box-shadow: 0 24px 60px -28px rgba(23, 22, 42, 0.55);
}
.snippet code { font-size: 0.92rem; line-height: 1.75; color: #e9e8f5; }
.snippet .c { color: #8b88b8; }
.snippet .k { color: #b3b0ff; }
.snippet .h { color: var(--amber); }

/* ---------- final / closing ---------- */
.final {
  text-align: center;
  background: var(--indigo);
  color: #fff;
  max-width: none;
  border-radius: 0;
}
.final h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); color: #fff; margin-bottom: 1.5rem; }
.final .cta-row { margin-bottom: 0; }
.final .btn-primary { background: var(--amber); color: var(--ink); }
.final .btn-primary:hover { background: #e08e09; }
.btn-ghost-light { color: #fff; border: 1px solid rgba(255, 255, 255, 0.4); }
.btn-ghost-light:hover { border-color: #fff; }

/* ---------- footer ---------- */
.footer {
  text-align: center;
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--line);
}
.footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin: 1rem 0;
}
.footer-links a { color: var(--muted); font-weight: 500; }
.footer-note { color: var(--muted); font-size: 0.9rem; margin: 0; }
.build-stamp {
  display: block;
  margin-top: 0.35rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.75;
}

/* ===================================================================
   DOCS PAGE (docs.html) — left sticky TOC + anchored reference sections
   =================================================================== */

.docs-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

/* docs hero strip (full-width-ish, above the two-column shell) */
.docs-head {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 1.5rem;
}
.docs-head .eyebrow { text-align: left; }
.docs-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 0.75rem; }
.docs-head p { max-width: 680px; color: var(--muted); font-size: 1.1rem; margin: 0; }

/* ---- table of contents ---- */
.docs-toc {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  font-size: 0.92rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}
.docs-toc h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}
.docs-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.docs-toc li { counter-increment: toc; margin: 0.15rem 0; }
.docs-toc a {
  display: block;
  color: var(--muted);
  padding: 0.3rem 0.5rem 0.3rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  font-weight: 500;
}
.docs-toc a::before { content: counter(toc) ". "; color: var(--line); }
.docs-toc a:hover { color: var(--ink); text-decoration: none; border-left-color: var(--line); }
.docs-toc a.active { color: var(--indigo); border-left-color: var(--indigo); }

/* ---- content column ---- */
.docs-body { min-width: 0; padding-bottom: 5rem; }
.doc-section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 1.5rem;
}
.doc-section:first-child { border-top: none; padding-top: 0.5rem; }
.doc-section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.doc-section h2 .sec-num { color: var(--amber); font-size: 0.7em; font-weight: 600; }
.doc-section h3 { font-size: 1.15rem; margin-top: 1.75rem; }
.doc-section p, .doc-section li { color: var(--ink); }
.doc-section p { margin: 0.85rem 0; }
.doc-section ul, .doc-section ol { padding-left: 1.25rem; }
.doc-section li { margin: 0.4rem 0; }
.doc-section strong { color: var(--ink); }
.lead { font-size: 1.12rem; color: var(--muted) !important; }

/* inline code */
.doc-section :not(pre) > code {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
  font-size: 0.88em;
  color: var(--indigo-deep);
}

/* ---- code blocks: reuse the landing page's .terminal / .snippet, just space them ---- */
.doc-section .terminal,
.doc-section .snippet { margin: 1.25rem 0; }

/* ---- reference tables ---- */
.doc-table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.92rem; }
.doc-table th, .doc-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.doc-table th {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--paper-soft);
}
.doc-table td code { white-space: nowrap; }
.doc-table tr:last-child td { border-bottom: none; }

/* ---- version label (v1 badge in a section heading) ---- */
.v-label {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--indigo);
  border-radius: 999px;
  font-family: "Poppins", sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: 0.65em;
  letter-spacing: 0.04em;
  color: var(--indigo);
}

/* ---- callouts ---- */
.callout {
  border-left: 3px solid var(--amber);
  background: #fff8ec;
  border-radius: 0 8px 8px 0;
  padding: 0.85rem 1.1rem;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}
.callout strong { color: var(--ink); }
.callout.invariant { border-left-color: var(--indigo); background: #f3f3fb; }

/* ---- "deep reference" link-out chips ---- */
.deeplink {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.5rem;
}
.deeplink::before { content: "↳"; color: var(--amber); }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .docs-shell { grid-template-columns: 1fr; gap: 0; }
  .docs-toc {
    position: static;
    max-height: none;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
  }
  .docs-toc ol { columns: 2; column-gap: 1.5rem; }
}

@media (max-width: 760px) {
  section { padding: 3.5rem 1.25rem; }
  .cards { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; gap: 1.4rem; }
  .terminal code, .snippet code { font-size: 0.8rem; line-height: 1.8; }
  .nav { flex-wrap: wrap; row-gap: 0.25rem; }
  .nav-links { width: 100%; justify-content: center; gap: 1rem; font-size: 0.95rem; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-word { font-size: 1.5rem; }
  .docs-toc ol { columns: 1; }
  .terminal, .snippet { font-size: 0.78rem; }
  .doc-table { font-size: 0.85rem; }
  .doc-table th, .doc-table td { padding: 0.5rem 0.5rem; }

  /* arrow timeline → vertical rail, callouts to the right of the line */
  .arrow { padding: 0; margin-top: 3rem; }
  .axis {                       /* vertical line down the left rail */
    top: 0;
    bottom: 1.6rem;             /* room for the downward arrowhead */
    left: 11px;
    right: auto;
    width: 3px;
    height: auto;
    transform: none;
    background: linear-gradient(180deg, rgba(63, 61, 158, 0) 0%, var(--indigo) 14%, var(--indigo) 100%);
  }
  .axis::after {                /* arrowhead pointing down */
    right: auto;
    left: 11px;
    top: auto;
    bottom: -1.6rem;
    transform: translateX(-50%);
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 16px solid var(--indigo);
    border-bottom: 0;
  }
  .markers { flex-direction: column; gap: 1.9rem; }
  .marker {
    min-height: 0;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1.1rem;
    padding-left: 3px;
  }
  .marker .dot { flex-shrink: 0; margin-top: 0.15rem; order: -1; }
  /* reset desktop connector stems */
  .marker::after { content: none; }
  .tl-callout {
    position: static;
    transform: none;
    width: auto;
    max-width: none;
    text-align: left;
    align-items: flex-start;
  }
  .marker.up .tl-callout,
  .marker.down .tl-callout { inset: auto; }
  .marker.inflection .dot { margin-left: -4px; }
}
