/* ── sections: nav, hero + console, page sections, footer ─────── */

/* ══ NAV ══ */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-block: 0.8rem;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
}
.b-last { font-weight: 300; letter-spacing: 0.005em; }
.b-tms {
  font-weight: 460;
  font-variation-settings: 'wdth' 122;
  letter-spacing: 0.03em;
}
.b-ai { color: var(--teal); font-weight: 520; }
.nav-links {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-links a:hover { color: var(--teal); }
.nav-cta { padding: 0.6em 1.1em; white-space: nowrap; margin-left: auto; }
.nav-links + .nav-cta { margin-left: 0; }

/* ══ HERO ══ */
.hero {
  position: relative;
  padding-block: clamp(4rem, 10vh, 7.5rem) clamp(3rem, 7vh, 5rem);
  overflow: clip;
}
.hero .container { position: relative; z-index: 1; }

.hero-routes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--teal);
  opacity: 0.13;
  z-index: 0;
  pointer-events: none;
}
.routes-labels text {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: currentColor;
}
.js .routes-lines path {
  stroke-dashoffset: 400;
  stroke-dasharray: 6 7;
  animation: routes-draw 2.2s var(--ease-out) forwards;
}
@keyframes routes-draw {
  to { stroke-dashoffset: 0; }
}

.hero-title {
  font-size: var(--text-hero);
  font-variation-settings: 'wdth' 115;
  font-weight: 680;
  text-transform: uppercase;
  letter-spacing: -0.018em;
  line-height: 1.02;
  max-width: 16ch;
}
.hero-line { display: block; overflow: clip; }
.hero-line > span { display: inline-block; }
.hero-line-teal { color: var(--teal); }
.js .hero-line > span {
  transform: translateY(112%);
  animation: hero-rise 0.75s var(--ease-out) forwards;
}
.js .hero-line:nth-child(2) > span { animation-delay: 0.12s; }
@keyframes hero-rise {
  to { transform: translateY(0); }
}

.hero-lede {
  margin-top: 1.75rem;
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.25rem);
  max-width: 52ch;
}

/* ══ CONSOLE ══ */
.console {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-deep);
  overflow: clip;
}
.console-chrome {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
}
.console-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  animation: dot-pulse 2.4s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.console-transport { margin-left: auto; color: var(--faint); }

.console-body {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 2.1fr;
  min-height: 480px;
  border-bottom: 1px solid var(--line-soft);
}
.console-log {
  padding: 1.1rem 1.2rem;
  overflow-y: auto;
  max-height: 480px;
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  line-height: 1.8;
  border-right: 1px solid var(--line-soft);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.console-log > div { margin-bottom: 0.35rem; }
.log-user { color: var(--ink); font-weight: 500; }
.log-user::before { content: '❯ '; color: var(--teal); }
.log-call { color: var(--teal); }
.log-args { color: var(--faint); padding-left: 1.1em; }
.log-result { color: var(--muted); }
.log-json { color: var(--faint); white-space: pre; overflow-x: auto; }
.log-note { color: var(--muted); }
.log-hot { color: var(--coral); }
.log-ok { color: var(--teal); }
.log-cursor::after {
  content: '▋';
  color: var(--teal);
  animation: cursor-blink 0.9s steps(2) infinite;
}
@keyframes cursor-blink {
  50% { opacity: 0; }
}

.console-stage {
  position: relative;
  background: oklch(0.15 0.019 190);
  min-height: 300px;
}
.console-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
}
.console-stage iframe.is-live { opacity: 1; }
.console-stage-empty {
  position: absolute;
  inset: 1.1rem;
  border: 1px dashed var(--line);
  border-radius: 4px;
  display: grid;
  place-content: center;
  gap: 0.4rem;
  text-align: center;
  color: var(--faint);
  padding: 1rem;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.console-stage-empty p:first-child { color: var(--muted); }
.console-stage.has-app .console-stage-empty { opacity: 0; visibility: hidden; }

.console-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.85rem 1.1rem;
}
.console-prompt {
  font-family: var(--font-mono);
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.5em 0.85em;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.console-prompt:hover { border-color: var(--teal); color: var(--teal); }
.console-prompt[aria-pressed="true"] {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-ghost);
}
.console-caption {
  margin-top: 0.9rem;
  color: var(--faint);
}
.console-caption a { color: var(--muted); text-underline-offset: 3px; }
.console-caption a:hover { color: var(--teal); }

/* ══ PREMISE ══ */
.premise .prose { margin-top: 1.75rem; }
.premise-ledger {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 3.5rem;
}
.premise-ledger > div {
  padding: 1.5rem 2rem 0.5rem 0;
}
.premise-ledger > div + div {
  border-left: 1px solid var(--line-soft);
  padding-left: 2rem;
}
.premise-ledger dt {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 106;
  font-weight: 620;
  font-size: 1.2rem;
}
.premise-ledger dd {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: var(--text-small);
}

/* ══ DATA LAYER ══ */
.datalayer-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(2rem, 5vw, 4rem);
  margin-top: 3rem;
  align-items: start;
}
.board {
  width: 100%;
  border-collapse: collapse;
}
.board td {
  border-top: 1px solid var(--line-soft);
  padding: 1.05rem 1rem 1.05rem 0;
  vertical-align: baseline;
}
.board tr:last-child td { border-bottom: 1px solid var(--line-soft); }
.board tr { transition: background var(--dur-fast) var(--ease-out); }
.board tbody tr:hover { background: var(--surface); }
.board-name { color: var(--teal); width: 7.5rem; letter-spacing: 0.05em; }
.board-detail { color: var(--muted); }

.terminal, .tooldef {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-deep);
  overflow: clip;
}
.terminal-bar {
  display: block;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--faint);
}
.terminal pre, .tooldef pre {
  padding: 1.1rem;
  overflow-x: auto;
  line-height: 1.75;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.terminal code, .tooldef code { color: var(--ink); }
.t-prompt { color: var(--teal); }
.t-dim { color: var(--muted); }
.t-hot { color: var(--coral); }
.t-key { color: var(--teal); }
.t-str { color: var(--muted); }
.t-hotline {
  display: inline-block;
  background: var(--coral-ghost);
  border-radius: 2px;
  padding-inline: 0.3em;
  margin-inline: -0.3em;
}
.t-hotline .t-key, .t-hotline .t-str { color: var(--coral); }
.tooldef-note {
  display: block;
  padding: 0 1.1rem 1rem;
  color: var(--coral);
}

/* ══ MCP SERVER ══ */
.mcp .prose { margin-top: 1.5rem; }
.mcp-grid {
  display: grid;
  grid-template-columns: 6fr 6fr;
  gap: clamp(2rem, 5vw, 4rem);
  margin-top: 3rem;
  align-items: start;
}
.datalayer-grid > *, .mcp-grid > *, .shapes-grid > * { min-width: 0; }

.toolcat {
  list-style: none;
  padding: 0;
}
.toolcat code { overflow-wrap: anywhere; }
.toolcat li {
  display: grid;
  grid-template-columns: minmax(13rem, auto) 1fr;
  gap: 1rem;
  align-items: baseline;
  border-top: 1px solid var(--line-soft);
  padding: 0.72rem 0.5rem 0.72rem 0;
  transition: background var(--dur-fast) var(--ease-out);
}
.toolcat li:last-child { border-bottom: 1px solid var(--line-soft); }
.toolcat li:hover { background: var(--surface); }
.toolcat code { color: var(--teal); font-size: var(--text-mono); }
.toolcat span { color: var(--muted); font-size: var(--text-small); }

/* ══ MCP APPS ══ */
.apps .prose { margin-top: 1.5rem; }
.apps .prose + .prose { margin-top: 1rem; }
.flow {
  list-style: none;
  counter-reset: flow;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 0;
  margin-top: 3.25rem;
}
.flow li {
  counter-increment: flow;
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  position: relative;
}
.flow li::before {
  content: counter(flow, decimal-leading-zero);
  position: absolute;
  top: -0.7rem;
  left: 0;
  background: var(--bg);
  padding-right: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--faint);
}
.flow-step { display: block; color: var(--teal); overflow-wrap: anywhere; }
.flow-desc {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: var(--text-small);
}
.apps-tagline {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 112;
  font-weight: 670;
  font-size: clamp(1.7rem, 1rem + 2.8vw, 2.9rem);
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin-top: 3.5rem;
  max-width: 22ch;
  line-height: 1.1;
}
.apps-tagline::after { content: ' ●'; color: var(--coral); font-size: 0.45em; vertical-align: 0.08em; }
.apps-clients {
  margin-top: 1.75rem;
  color: var(--faint);
  max-width: 62ch;
  line-height: 2;
}
.apps-clients span { color: var(--muted); white-space: nowrap; }
.apps-clients a { color: var(--teal); text-underline-offset: 3px; }

/* ══ SHAPES ══ */
.shapes .prose { margin-top: 1.5rem; }
.shapes-grid {
  display: grid;
  grid-template-columns: 5fr 4fr 3fr;
  gap: 1.5rem;
  align-items: start;
  margin-top: 3.25rem;
}
.shape {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-deep);
  overflow: clip;
}
.shape-ops { margin-top: 2.25rem; }
.shape-slack { margin-top: 4rem; }
.shape-label {
  display: block;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--faint);
  letter-spacing: 0.08em;
}
.shape-chat { padding: 1rem; display: grid; gap: 0.75rem; }
.shape-user {
  background: var(--surface-2);
  border-radius: 3px;
  padding: 0.65rem 0.85rem;
  font-size: var(--text-small);
  justify-self: end;
  max-width: 90%;
}
.shape-tool { color: var(--teal); }
.shape-appstrip {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.shape-appstrip .pill { color: var(--ink); }
.shape-ok { color: var(--teal); }
.shape-browser table { width: 100%; border-collapse: collapse; }
.shape-browser-bar {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--muted);
}
.shape-browser td {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
}
.shape-browser tr:first-child td { border-top: 0; }
.shape-num { text-align: right; color: var(--teal); }
.shape-alert { color: var(--coral); }
.shape-msg { padding: 1rem; }
.shape-msg-head { color: var(--faint); }
.shape-msg p:nth-child(2) {
  margin-top: 0.6rem;
  font-size: var(--text-small);
  color: var(--ink);
}
.shape-msg-action {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--teal);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.45rem 0.65rem;
}

/* ══ TRUST ══ */
.trust-ledger {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 3rem;
  margin-top: 3.5rem;
}
.trust-ledger > div {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}
.trust-ledger dt { color: var(--teal); letter-spacing: 0.06em; }
.trust-ledger dd {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: var(--text-small);
}

/* ══ PROOF ══ */
.proof .prose { margin-top: 1.5rem; }
.manifest {
  margin-top: 2.75rem;
  border-collapse: collapse;
  width: 100%;
  max-width: 46rem;
}
.manifest th {
  text-align: left;
  color: var(--teal);
  letter-spacing: 0.06em;
  font-weight: 500;
  width: 10rem;
  padding: 0.95rem 1rem 0.95rem 0;
  vertical-align: baseline;
}
.manifest td { padding: 0.95rem 0; color: var(--ink); }
.manifest tr { border-top: 1px solid var(--line-soft); }
.manifest tr:last-child { border-bottom: 1px solid var(--line-soft); }

/* ══ CTA ══ */
.cta {
  background: var(--bg-deep);
  border-block: 1px solid var(--line-soft);
  text-align: center;
}
.cta-title {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 113;
  font-weight: 680;
  font-size: clamp(2.1rem, 1rem + 4.6vw, 4.1rem);
  text-transform: uppercase;
  letter-spacing: -0.018em;
}
.cta-teal { color: var(--teal); }
.cta .prose {
  margin: 1.5rem auto 0;
}
.cta-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
}

/* ══ FOOTER ══ */
.footer {
  border-top: 1px solid var(--line-soft);
  padding-block: 3rem 2.25rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-brand {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 0.6rem;
}
.footer-tag { grid-column: 1 / -1; color: var(--faint); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.03em;
}
.footer-links a:hover { color: var(--teal); }
.footer-legal { flex-basis: 100%; color: var(--faint); margin-top: 0.5rem; }

/* ══ REVEALS ══ */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--reveal-i, 0) * 70ms);
}

/* ══ RESPONSIVE ══ */
@media (max-width: 960px) {
  .datalayer-grid, .mcp-grid { grid-template-columns: 1fr; }
  .shapes-grid { grid-template-columns: 1fr 1fr; }
  .shape-slack { margin-top: 0; }
  .trust-ledger { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .console-body { grid-template-columns: 1fr; }
  .console-log {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    max-height: 220px;
  }
  .console-stage { min-height: 440px; }
  .premise-ledger { grid-template-columns: 1fr; }
  .premise-ledger > div { padding: 1.25rem 0; border-top: 1px solid var(--line-soft); }
  .premise-ledger > div + div { border-left: 0; padding-left: 0; }
  .flow { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-inner { gap: 0.75rem; }
  .nav-cta { padding: 0.55em 0.8em; }
  .console-transport { display: none; }
  .console-chrome span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .shapes-grid { grid-template-columns: 1fr; }
  .shape-ops, .shape-slack { margin-top: 0; }
  .trust-ledger { grid-template-columns: 1fr; gap: 1.75rem; }
  .flow { grid-template-columns: 1fr; gap: 1.75rem; }
  .toolcat li { grid-template-columns: 1fr; gap: 0.15rem; }
  .board-detail { display: block; }
  .board td { padding-block: 0.85rem; }
  .hero-title { max-width: 12ch; }
}
/* ══ MODALS ══ */
.modal {
  margin: auto; /* the global margin reset kills the UA centering */
  background: var(--bg-deep);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
  width: min(92vw, 26rem);
  max-height: 92vh;
  overflow-y: auto;
}
.modal::backdrop { background: oklch(0.1 0.018 190 / 0.72); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h2 {
  font-size: var(--text-mono);
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.modal-x {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius);
}
.modal-x:hover { color: var(--coral); }
.modal-form {
  display: grid;
  gap: 0.9rem;
  padding: 1.25rem;
}
.modal-form label {
  display: grid;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.modal-form input,
.modal-form select,
.modal-form textarea {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6em 0.7em;
  width: 100%;
}
.modal-form textarea { resize: vertical; }
.modal-submit { justify-content: center; margin-top: 0.35rem; }
.modal-note { color: var(--faint); text-align: center; }
.modal-done { padding: 2.25rem 1.25rem 2.5rem; text-align: center; }
.modal-done-lede {
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.modal-done .mono-sm { color: var(--muted); }
