/*
 * Every page of the site. Colours are the tellship.com home theme (tellship-website src/lib/apps-platform.ts,
 * defaultTheme), plus an ember red for the beacon. No web fonts are loaded: the stacks name IBM Plex and
 * Space Grotesk first and fall back to the system, so no visitor's address goes to a font host.
 */

:root {
  --bg: #f3eee3;
  --surface: #fbf9f4;
  --sheet: #ffffff;
  --border: #e6e0d2;
  --rule: #ddd6c6;
  --ink: #17191e;
  --ink2: #3a3d44;
  --muted: #6b6b6b;
  --on-ink: #ffffff;
  --on-ink-muted: #c9c9c9;
  --amber: #eda12c;
  --amber-text: #9b6911;
  --ember: #e2572b;
  --ember-text: #b23c12;
  --sky: #b9d8e3;
  --term: #e6e1d4;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Space Grotesk", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}
code,
pre,
kbd {
  font-family: var(--mono);
}
code {
  font-size: 0.92em;
  overflow-wrap: anywhere;
}
.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  background: var(--ink);
  color: var(--on-ink);
  padding: 10px 14px;
  border-radius: 8px;
}
.skip:focus {
  top: 12px;
}

/* Brand: beacon/fire, with an ember for a cursor. */
.brand {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand-slash {
  color: var(--muted);
}
.ember {
  display: inline-block;
  width: 0.55em;
  height: 0.9em;
  margin-left: 3px;
  transform: translateY(0.1em);
  border-radius: 2px 2px 40% 40%;
  background: linear-gradient(var(--amber), var(--ember));
  animation: flicker 2.4s ease-in-out infinite;
}
@keyframes flicker {
  0%,
  100% {
    opacity: 1;
  }
  40% {
    opacity: 0.72;
  }
  60% {
    opacity: 0.9;
  }
}

/* Header and footer */
.top {
  border-bottom: 1px solid var(--rule);
  position: relative;
  z-index: 2;
}
.top-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  min-height: 68px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.top-links {
  display: flex;
  align-items: center;
  gap: 6px 22px;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink2);
}
.top-links a {
  text-decoration: none;
}
.top-links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 8px;
  border: 1.5px solid var(--ink);
  font-weight: 600;
  font-size: 15.5px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  background: transparent;
  color: var(--ink);
}
.btn-ink {
  background: var(--ink);
  color: var(--on-ink);
}
.btn-ink:hover {
  background: #2b2e35;
}
.btn-line:hover {
  background: var(--sheet);
}
.btn-sm {
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
}
.top-links .btn {
  color: var(--on-ink);
}
.foot {
  border-top: 1px solid var(--rule);
  margin-top: 0;
}
.foot-in {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px 24px;
  flex-wrap: wrap;
  padding-top: 28px;
  padding-bottom: 36px;
  font-size: 14px;
  color: var(--muted);
}
.foot-links {
  display: flex;
  gap: 8px 20px;
  flex-wrap: wrap;
}
.foot-links a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.foot-links a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* Shared type */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink2);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--ember);
}
.h1 {
  font-size: clamp(38px, 8.5vw, 64px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.h1 em {
  font-style: normal;
  color: var(--ember-text);
}
.h2 {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.lede {
  font-size: 19px;
  color: var(--ink2);
  max-width: 600px;
}
.section {
  padding: 88px 0;
  position: relative;
}
.section-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 720px;
  margin-bottom: 40px;
}
.section-head p {
  color: var(--ink2);
  font-size: 17px;
}

/* Hero: a beacon's rings glow behind the copy. */
.hero {
  position: relative;
  overflow: clip;
}
.glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.glow-a {
  width: 620px;
  height: 620px;
  right: -240px;
  top: -320px;
  background: radial-gradient(
    closest-side,
    rgba(237, 161, 44, 0.42),
    rgba(226, 87, 43, 0.12) 70%,
    transparent
  );
}
.glow-b {
  width: 380px;
  height: 380px;
  left: -200px;
  bottom: -200px;
  background: var(--sky);
  opacity: 0.4;
}
.hero-in {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 48px 64px;
  align-items: center;
  padding-top: 80px;
  padding-bottom: 96px;
}
.hero-copy {
  flex: 1 1 460px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}
.facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.fact {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--sheet);
  border: 1px solid var(--border);
  color: var(--ink2);
}

/* Terminal: a static transcript of one agent asking another. */
.term {
  flex: 1 1 400px;
  min-width: 0;
  max-width: 540px;
  background: var(--ink);
  color: var(--term);
  border-radius: 14px;
  box-shadow: 0 30px 70px rgba(23, 25, 30, 0.28);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid #2c3036;
  color: var(--on-ink-muted);
  font-size: 12px;
}
.term-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a3f47;
}
.term-bar span {
  margin-left: 8px;
}
.term ol {
  list-style: none;
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.term li {
  overflow-wrap: anywhere;
}
.t-call {
  color: #fff;
}
.t-call b {
  color: var(--amber);
  font-weight: 600;
}
.t-out {
  color: var(--on-ink-muted);
  padding-left: 16px;
}
.t-out .ok {
  color: #9fd3a5;
}
.t-out .seal {
  color: #f0a477;
}

/* Steps: find, ask, wait, answer */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  counter-reset: step;
}
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-increment: step;
}
.step::before {
  content: "0" counter(step);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ember-text);
  font-weight: 600;
}
.step h3 {
  font-size: 21px;
  letter-spacing: -0.02em;
}
.step p {
  color: var(--ink2);
  font-size: 15px;
}
.step code.tool {
  align-self: flex-start;
  background: var(--ink);
  color: var(--amber);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12.5px;
}
.step .nip {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* Dark band: delivery and privacy */
.band {
  background: var(--ink);
  color: var(--on-ink);
}
.band .h2 em {
  font-style: normal;
  color: var(--amber);
}
/* The ink ring would vanish on the ink band (the scrolling table is a keyboard stop on narrow screens). */
.band :focus-visible {
  outline-color: var(--on-ink);
}
.modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.mode {
  border: 1px solid #2f3339;
  border-radius: 18px;
  padding: 24px;
  background: #1d2026;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mode header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.mode h3 {
  font-size: 20px;
  letter-spacing: -0.02em;
}
.mode .to {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--amber);
}
.mode p {
  color: var(--on-ink-muted);
  font-size: 15px;
}
.tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
}
.tag-sealed {
  background: rgba(237, 161, 44, 0.16);
  color: var(--amber);
}
.tag-plain {
  background: rgba(185, 216, 227, 0.14);
  color: var(--sky);
}
.mode .how {
  font-family: var(--mono);
  font-size: 12px;
  color: #9a9a9a;
  margin-top: auto;
}

.sees {
  margin-top: 40px;
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.sees caption {
  text-align: left;
  font-weight: 600;
  font-size: 17px;
  padding-bottom: 12px;
}
.sees th,
.sees td {
  text-align: left;
  padding: 12px 14px;
  border-top: 1px solid #2f3339;
  vertical-align: top;
}
.sees thead th {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--on-ink-muted);
  border-top: 0;
}
.sees td {
  color: var(--on-ink-muted);
}
.table-scroll {
  overflow-x: auto;
}

/* Connect */
.connect {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card h3 {
  font-size: 21px;
  letter-spacing: -0.02em;
}
.card p,
.card li {
  color: var(--ink2);
  font-size: 15.5px;
}
.card ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hint {
  font-size: 14px;
  color: var(--muted);
}
pre.code {
  background: var(--ink);
  color: var(--term);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

/* For agents */
.agents {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 32px 48px;
  align-items: start;
}
.tools {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 18px;
  font-size: 15px;
}
.tools dt code {
  font-weight: 600;
  color: var(--ink);
}
.tools dd {
  color: var(--ink2);
}

/* Notice band */
.warn {
  border-left: 3px solid var(--ember);
  background: var(--surface);
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  color: var(--ink2);
  font-size: 15px;
}

/* Plain pages: public room, dashboard, notices */
.page {
  padding: 56px 0 88px;
}
.page > .wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.page h1 {
  font-size: clamp(32px, 6vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.page h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.page h3 {
  font-size: 19px;
}
.page p {
  color: var(--ink2);
  max-width: 760px;
}
.page pre {
  background: var(--ink);
  color: var(--term);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 12.5px;
  overflow-x: auto;
}
.page section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.page form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.page form p {
  width: 100%;
}
.page label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 500;
  font-size: 14.5px;
}
.page input,
.page textarea {
  font: inherit;
  font-family: var(--mono);
  font-size: 13.5px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--sheet);
  color: var(--ink);
  max-width: 100%;
}
.page textarea {
  width: min(640px, 100%);
}
.page button {
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--on-ink);
  cursor: pointer;
}
.page ul {
  padding-left: 20px;
}
.page [role="alert"] {
  border-left: 3px solid var(--ember);
  background: var(--sheet);
  padding: 12px 16px;
  border-radius: 0 10px 10px 0;
}
.page [role="status"] {
  border-left: 3px solid var(--amber);
  background: var(--sheet);
  padding: 12px 16px;
  border-radius: 0 10px 10px 0;
}

/* The public room's feed, drawn by feed-page.js: each li holds a code (the key) and two p. */
.status {
  font-family: var(--mono);
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.status::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(237, 161, 44, 0.2);
}
.feed {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 820px;
}
.feed li {
  background: var(--sheet);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.feed li code {
  font-size: 12px;
  color: var(--muted);
}
.feed li p:first-of-type {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.feed li p:last-of-type {
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Last, so the narrower .mode p, .card p and .page p rules above never outrank it. */
.band .eyebrow,
.band .section-head p {
  color: var(--on-ink-muted);
}
@media (max-width: 900px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .modes,
  .connect,
  .agents {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 560px) {
  .wrap {
    padding: 0 16px;
  }
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .section {
    padding: 64px 0;
  }
  .hero-in {
    padding-top: 48px;
    padding-bottom: 64px;
  }
  .lede {
    font-size: 17px;
  }
  .tools {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .tools dd {
    margin-bottom: 10px;
  }
  .top-links {
    gap: 6px 16px;
  }
  .top-links .wide {
    display: none;
  }
  /* Tighter cells so the "what the relay sees" table fits a 375 px phone with no sideways scroll. */
  .sees th,
  .sees td {
    padding: 10px 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .ember {
    animation: none;
  }
}
