:root {
  --ink: #0e0b1f;
  --ink-2: #171430;
  --ink-3: #1f1a3a;
  --line: #2c2557;
  --text: #edeaf7;
  --muted: #a7a0c8;
  --accent: #8b7bff;
  --signal: #ffc46b;
  --radius: 14px;
  --measure: 62ch;
  --step--1: clamp(0.82rem, 0.78rem + 0.2vw, 0.92rem);
  --step-0: clamp(1rem, 0.95rem + 0.3vw, 1.12rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.6vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.4rem + 1.2vw, 2.3rem);
  --step-3: clamp(2.4rem, 1.8rem + 3.4vw, 4.4rem);
  --pad: clamp(1.25rem, 4vw, 3.5rem);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Bricolage Grotesque", "IBM Plex Sans", sans-serif;
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0;
}

p { margin: 0; }

a { color: inherit; }

code, .terminal, .thread__fingerprint {
  font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: min(1180px, 100% - 2 * var(--pad));
  margin: 0 auto;
  padding: 1.4rem 0;
}

.wordmark {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.topnav {
  display: flex;
  gap: 1.4rem;
  margin-inline: auto;
  font-size: var(--step--1);
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.2rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.topnav a:hover { color: var(--text); border-color: var(--line); }

.button {
  display: inline-block;
  background: var(--accent);
  color: #120f26;
  font-weight: 600;
  font-size: var(--step-0);
  text-decoration: none;
  padding: 0.8em 1.4em;
  border-radius: 999px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.button:hover { transform: translateY(-1px); background: #a294ff; }

.button--small { font-size: var(--step--1); padding: 0.55em 1.1em; }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  width: min(1180px, 100% - 2 * var(--pad));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem);
}

.hero h1 {
  font-size: var(--step-3);
  max-width: 15ch;
}

.lede {
  margin-top: 1.6rem;
  max-width: var(--measure);
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.4rem;
  margin-top: 2.2rem;
}

.link-arrow {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.15rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.link-arrow:hover { border-color: var(--accent); }

.fineprint {
  margin-top: 1.4rem;
  font-size: var(--step--1);
  color: var(--muted);
}

/* ---------- thread ---------- */

.thread {
  margin: 0;
  background: linear-gradient(180deg, var(--ink-2), #141129);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding: 1.3rem;
  box-shadow: 0 40px 80px -50px #000, 0 0 0 1px #ffffff0a inset;
}

.thread__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.thread__who { font-weight: 600; }

.thread__seal {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--signal);
  font-size: var(--step--1);
}

.thread__seal svg { width: 16px; height: 16px; }

.thread__messages {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.msg {
  max-width: 82%;
  padding: 0.65rem 0.95rem;
  border-radius: 12px;
  font-size: var(--step-0);
  line-height: 1.45;
  opacity: 0;
  animation: arrive 0.5s ease forwards;
}

.msg--in {
  align-self: flex-start;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.msg--out {
  align-self: flex-end;
  background: var(--accent);
  color: #120f26;
  border-bottom-right-radius: 4px;
}

.msg:nth-child(1) { animation-delay: 0.15s; }
.msg:nth-child(2) { animation-delay: 0.7s; }
.msg:nth-child(3) { animation-delay: 1.25s; }

.typing {
  display: flex;
  gap: 0.3rem;
  margin-top: 1rem;
  padding-left: 0.3rem;
  opacity: 0;
  animation: arrive 0.4s ease 1.8s forwards;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1.3s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

.thread__fingerprint {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes blink {
  0%, 60%, 100% { opacity: 0.25; }
  30% { opacity: 1; }
}

/* ---------- bands ---------- */

.band {
  border-top: 1px solid var(--line);
  padding: clamp(3rem, 7vw, 6rem) 0;
}

.band > h2,
.band__lead h2,
.band--host h2 {
  font-size: var(--step-2);
  max-width: 22ch;
}

.band { width: min(1180px, 100% - 2 * var(--pad)); margin: 0 auto; }

.points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-top: 3rem;
}

.point h3 { font-size: var(--step-1); }

.point p {
  margin-top: 0.7rem;
  color: var(--muted);
  max-width: 40ch;
}

/* numbered steps — a real sequence */
.band--split {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 6vw, 5rem);
}

.band__lead p {
  margin-top: 1.3rem;
  color: var(--muted);
  max-width: 42ch;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.6rem;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 1.1rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

.steps__n {
  grid-row: span 2;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: var(--step-2);
  color: var(--accent);
  line-height: 1;
}

.steps h3 { font-size: var(--step-1); }

.steps p { color: var(--muted); max-width: 46ch; }

.steps code {
  font-size: 0.85em;
  color: var(--signal);
  background: var(--ink-2);
  padding: 0.1em 0.4em;
  border-radius: 5px;
}

/* ---------- host ---------- */

.band--host {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.band--host p {
  margin: 1.3rem 0 1.6rem;
  color: var(--muted);
  max-width: 40ch;
}

.terminal {
  margin: 0;
  background: #0b0917;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  font-size: var(--step--1);
  line-height: 1.9;
  color: var(--text);
  overflow-x: auto;
}

.terminal__c { color: var(--accent); }
.terminal__k { color: var(--signal); }

/* ---------- call to action ---------- */

.band--cta {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 1.2rem;
}

.band--cta h2 { font-size: var(--step-2); }

.band--cta p { color: var(--muted); max-width: 42ch; }

/* ---------- footer ---------- */

.foot {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  width: min(1180px, 100% - 2 * var(--pad));
  margin: 0 auto;
  padding: 2.4rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--step--1);
}

.wordmark--foot { font-size: 1.2rem; color: var(--text); }

.foot p { margin-right: auto; }

.foot nav { display: flex; gap: 1.3rem; }

.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { max-width: 18ch; }
  .points { grid-template-columns: 1fr; }
  .band--split,
  .band--host { grid-template-columns: 1fr; }
  .topnav { display: none; }
}

@media (max-width: 560px) {
  .topbar { gap: 1rem; }
  .foot { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .msg, .typing { animation: none; opacity: 1; }
  .typing span { animation: none; opacity: 0.6; }
  .button, .topnav a, .link-arrow { transition: none; }
}
