/* Deedspan website. Tokens follow the Deedhold design system. */

:root {
  --navy-800: #0F172A;
  --purple-500: #7C3AED;
  --purple-600: #5B21B6;
  --white: #FFFFFF;
  --muted-100: #F8F6FC;
  --muted-200: #F0EEF5;
  --muted-300: #D2CBDA;
  --muted-600: #716D77;
  --info-100: #F1EAFC;
  --success-500: #16A34A;
  --success-100: #EAF7EF;
  --warning-500: #D97706;
  --warning-100: #FDF4E0;
  --error-500: #B63650;
  --error-100: #FBECEF;
  --grid-line: #F9F5FF;

  --code-bg: var(--navy-800);
  --code-text: #E2E8F0;
  --code-key: #C4B5FD;
  --code-comment: #94A3B8;
  --code-prompt: #A78BFA;

  --font-heading: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Albert Sans", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --cut-s: 24px;
  --cut-m: 32px;
  --cut-l: 48px;

  --gutter: 16px;
  --container: 1200px;
  --section-y: 72px;
}

@media (min-width: 768px) {
  :root {
    --gutter: 32px;
    --section-y: 112px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--navy-800);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.375rem, 6vw, 4.5rem);
}

h2 {
  font-size: clamp(1.875rem, 3.6vw, 3rem);
}

h3 {
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--purple-500);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--purple-600);
}

:focus-visible {
  outline: 2px solid var(--purple-500);
  outline-offset: 3px;
}

code,
pre {
  font-family: var(--font-mono);
}

p code,
li code,
dd code {
  padding: 1px 5px;
  background: var(--info-100);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Layout */

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

.section-tight-top {
  padding-top: 0;
}

/* The cut-corner motif: top-left and bottom-right. */
.cut {
  --cut: var(--cut-s);
  clip-path: polygon(
    var(--cut) 0,
    100% 0,
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    0 100%,
    0 var(--cut)
  );
}

.overline {
  margin-bottom: 16px;
  color: var(--purple-500);
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro {
  max-width: calc(820px + 2 * var(--gutter));
  text-align: left;
}

.intro .lead {
  margin-top: 20px;
}

.lead {
  color: var(--muted-600);
  font-size: 1.125rem;
  line-height: 1.55;
}

.intro + .container {
  margin-top: 48px;
}

@media (min-width: 768px) {
  .intro {
    text-align: center;
  }

  .lead {
    font-size: 1.25rem;
  }

  .intro + .container {
    margin-top: 72px;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 28px;
  border: 2px solid transparent;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--purple-500);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--purple-600);
  color: var(--white);
}

.btn-secondary {
  border-color: var(--navy-800);
  color: var(--navy-800);
}

.btn-secondary:hover {
  border-color: var(--purple-600);
  color: var(--purple-600);
}

.btn-inverse {
  background: var(--white);
  color: var(--purple-600);
}

.btn-inverse:hover {
  background: var(--navy-800);
  color: var(--white);
}

.btn-small {
  min-height: 44px;
  padding: 8px 20px;
  font-size: 0.9375rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

@media (min-width: 768px) {
  .actions {
    justify-content: center;
  }
}

/* Tags */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--info-100);
  color: var(--purple-600);
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tag-success {
  background: var(--success-100);
  color: #116B33;
}

.tag-warning {
  background: var(--warning-100);
  color: #8F4E04;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--white);
  border-bottom: 1px solid var(--muted-200);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--navy-800);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--navy-800);
}

.wordmark svg {
  flex: none;
  width: 36px;
  height: 36px;
}

.wordmark-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.wordmark-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.wordmark-by {
  margin-top: 3px;
  color: var(--muted-600);
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: none;
  align-items: center;
  gap: 28px;
}

.nav a,
.header-cta {
  white-space: nowrap;
}

.nav a,
.menu-panel a {
  color: var(--navy-800);
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover,
.menu-panel a:hover {
  color: var(--purple-500);
}

.header-cta {
  display: none;
}

.menu {
  position: relative;
}

.menu summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  cursor: pointer;
  list-style: none;
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu summary svg {
  width: 24px;
  height: 24px;
}

.menu[open] .icon-open,
.menu:not([open]) .icon-close {
  display: none;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 14px);
  right: calc(-1 * var(--gutter));
  display: flex;
  flex-direction: column;
  width: 100vw;
  padding: 8px var(--gutter) 24px;
  background: var(--white);
  border-bottom: 1px solid var(--muted-200);
}

.menu-panel a {
  padding: 14px 0;
  border-bottom: 1px solid var(--muted-200);
  font-size: 1.0625rem;
}

.menu-panel .btn {
  margin-top: 20px;
  border-bottom: 0;
  color: var(--white);
}

@media (min-width: 1040px) {
  .nav {
    display: flex;
  }

  .header-cta {
    display: inline-flex;
    margin-left: 12px;
  }

  .menu {
    display: none;
  }
}

/* Hero */

.hero {
  position: relative;
  padding-top: 56px;
  background-image:
    linear-gradient(to right, var(--grid-line) 2px, transparent 2px),
    linear-gradient(to bottom, var(--grid-line) 2px, transparent 2px);
  background-position: center top;
  background-size: 128px 128px;
}

.hero .lead {
  max-width: 680px;
}

.hero .tag {
  margin-bottom: 24px;
}

.tag-dot {
  width: 8px;
  height: 8px;
  background: var(--purple-500);
}

@media (min-width: 768px) {
  .hero {
    padding-top: 96px;
  }

  .hero .lead {
    margin-inline: auto;
  }
}

/* Hero diagram: plain boxes, no cut corners. */

.diagram {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--muted-300);
}

.diagram-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.diagram-label {
  color: var(--muted-600);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.node {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--muted-100);
  border: 1px solid var(--muted-200);
}

.node svg {
  flex: none;
  width: 28px;
  height: 28px;
}

.node-title {
  display: block;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

.node-sub {
  display: block;
  color: var(--muted-600);
  font-size: 0.875rem;
  line-height: 1.35;
}

.engine {
  flex: 1;
  padding: 20px;
  border: 2px solid var(--purple-500);
  background: var(--white);
}

.engine-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.engine-name svg {
  width: 24px;
  height: 24px;
}

.engine-steps {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.engine-steps li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 12px;
  background: var(--info-100);
  font-size: 0.9375rem;
  line-height: 1.35;
  counter-increment: step;
}

.engine-steps li::before {
  content: counter(step);
  color: var(--purple-500);
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
}

.engine-note {
  margin-top: 14px;
  color: var(--muted-600);
  font-size: 0.875rem;
  line-height: 1.4;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  padding: 2px 8px;
  background: var(--white);
  border: 1px solid var(--muted-300);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.node-shop {
  align-items: flex-start;
}

@media (min-width: 1000px) {
  .diagram {
    grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1.05fr) 150px minmax(0, 1fr);
    padding: 32px;
  }

}

/* Cards */

.card-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
  }
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 48px 24px;
  background: var(--muted-100);
  text-align: center;
}

.card-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
}

.card p {
  margin-top: 12px;
  color: var(--muted-600);
}

@media (min-width: 768px) {
  .card {
    padding: 48px;
  }
}

/* Source and result strips inside a card */

.io {
  display: grid;
  gap: 0;
  margin-top: 28px;
  text-align: left;
}

.io-block {
  min-width: 0;
  background: var(--white);
}

.io-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 10px 16px 0;
  color: var(--muted-600);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.io-label b {
  color: var(--purple-500);
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.io pre {
  margin: 0;
  padding: 8px 16px 14px;
  overflow-x: auto;
  color: var(--navy-800);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.io .ok {
  color: var(--success-500);
}

.io .same {
  color: var(--muted-600);
}

.io .gone {
  color: var(--error-500);
}

.io-arrow {
  position: relative;
  height: 28px;
}

.io-arrow::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 9px;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: var(--purple-500);
}

.io-arrow::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top: 8px solid var(--purple-500);
  border-bottom: 0;
}

/* Bands */

.band {
  --cut: var(--cut-s);
  padding: 64px var(--gutter);
  background: var(--muted-100);
}

.band-wrap {
  max-width: 1400px;
  margin-inline: auto;
}

.band .container {
  padding-inline: 0;
}

.band .intro {
  max-width: 820px;
}

@media (min-width: 768px) {
  .band-wrap {
    padding-inline: var(--gutter);
  }

  .band {
    --cut: var(--cut-l);
    padding: 96px 48px;
  }
}

/* Code panels */

.code-panel {
  --cut: var(--cut-s);
  min-width: 0;
  padding: 48px 20px;
  background: var(--code-bg);
  color: var(--code-text);
}

.code-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--code-comment);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.code-title::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--purple-500);
}

.code-panel pre {
  margin: 0;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.75;
  tab-size: 2;
}

.code-panel .k {
  color: var(--code-key);
}

.code-panel .c {
  color: var(--code-comment);
}

.code-panel .p {
  color: var(--code-prompt);
  user-select: none;
}

.code-panel .o {
  color: var(--code-comment);
}

.code-panel .g {
  color: #86EFAC;
}

.mark {
  display: inline-block;
  min-width: 20px;
  margin-right: 10px;
  background: var(--purple-500);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.mark-none {
  background: none;
}

@media (min-width: 768px) {
  .code-panel {
    padding: 48px;
  }
}

/* Flow section: code beside its notes */

.split {
  display: grid;
  gap: 40px;
  align-items: start;
}

@media (min-width: 1024px) {
  .split {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 56px;
  }

  .split-even {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    align-items: center;
  }
}

.notes {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notes li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--muted-300);
}

.notes li:first-child {
  padding-top: 0;
}

.notes li:last-child {
  border-bottom: 0;
}

.notes .mark {
  min-width: 28px;
  height: 28px;
  margin: 0;
  font-size: 0.875rem;
  line-height: 28px;
}

.notes h3 {
  font-size: 1.125rem;
}

.notes p {
  margin-top: 6px;
  color: var(--muted-600);
  font-size: 1rem;
}

/* Steps */

.steps {
  display: grid;
  gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  padding-top: 24px;
  border-top: 2px solid var(--navy-800);
  counter-increment: step;
}

.steps li::before {
  content: "0" counter(step);
  display: block;
  margin-bottom: 16px;
  color: var(--purple-500);
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.steps p {
  margin-top: 12px;
  color: var(--muted-600);
}

.steps .cmd {
  display: inline-block;
  margin-top: 16px;
  padding: 4px 10px;
  background: var(--info-100);
  color: var(--purple-600);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px 32px;
  }
}

@media (min-width: 1100px) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.callout {
  --cut: var(--cut-s);
  display: grid;
  gap: 16px;
  margin-top: 56px;
  padding: 48px 24px;
  background: var(--info-100);
}

.callout svg {
  width: 40px;
  height: 40px;
}

.callout p {
  margin-top: 8px;
  color: var(--navy-800);
}

@media (min-width: 768px) {
  .callout {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 28px;
    padding: 48px 56px;
  }
}

/* Licence band */

.keep-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 768px) {
  .keep-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .keep-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.keep-grid .card {
  padding: 48px 24px;
  background: var(--white);
}

.fineprint {
  max-width: 760px;
  margin: 40px auto 0;
  color: var(--muted-600);
  font-size: 0.9375rem;
}

@media (min-width: 768px) {
  .fineprint {
    text-align: center;
  }
}

/* Getting started */

.start-copy h2 {
  margin-bottom: 20px;
}

.start-copy .actions {
  justify-content: flex-start;
}

.start-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.start-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--muted-200);
}

.start-list li:first-child {
  border-top: 1px solid var(--muted-200);
}

/* CTA band */

.cta {
  --cut: var(--cut-s);
  padding: 64px 24px;
  background: var(--purple-500);
  color: var(--white);
}

.cta .overline {
  color: var(--white);
  opacity: 0.85;
}

.cta .lead {
  max-width: 640px;
  margin-top: 20px;
  color: var(--white);
  opacity: 0.92;
}

.cta-note {
  margin-top: 20px;
  font-size: 0.9375rem;
  opacity: 0.85;
}

@media (min-width: 768px) {
  .cta {
    --cut: var(--cut-l);
    padding: 96px;
    text-align: center;
  }

  .cta .lead {
    margin-inline: auto;
  }
}

/* Footer */

.site-footer {
  padding-block: 64px 40px;
  background: var(--muted-200);
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  gap: 40px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: 48px;
  }
}

.footer-about p {
  max-width: 340px;
  margin-top: 16px;
  color: var(--muted-600);
}

.site-footer h2 {
  margin-bottom: 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li {
  padding: 5px 0;
}

.site-footer li a {
  color: var(--navy-800);
  text-decoration: none;
}

.site-footer li a:hover {
  color: var(--purple-500);
  text-decoration: underline;
}

.footer-bottom {
  display: grid;
  gap: 8px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--muted-300);
  color: var(--muted-600);
  font-size: 0.875rem;
}

@media (min-width: 900px) {
  .footer-bottom {
    grid-template-columns: 1fr auto;
    gap: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn {
    transition: none;
  }
}

/* Two-tone icons: a Muted 300 shape with a Purple 500 accent. */

.i-shape {
  fill: var(--muted-300);
}

.i-accent {
  fill: var(--purple-500);
}

/* Numbered markers in the gutter of a code panel. */

.code-panel pre.marked {
  position: relative;
  padding-left: 34px;
}

.code-panel pre .mark {
  position: absolute;
  left: 0;
  margin: 2px 0 0;
}

/* Two-way arrows between the columns of the hero diagram. */

.pipes {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 14px 0;
}

.pipe {
  --pipe: var(--purple-500);
  position: relative;
  display: flex;
  align-items: center;
  max-width: 130px;
  min-height: 56px;
  padding-left: 20px;
  color: var(--muted-600);
  font-size: 0.8125rem;
  line-height: 1.3;
}

.pipe::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 6px;
  left: 5px;
  width: 2px;
  background: var(--pipe);
}

.pipe::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  border-top: 8px solid var(--pipe);
  border-right: 6px solid transparent;
  border-left: 6px solid transparent;
}

.pipe-back::before {
  top: 6px;
  bottom: 0;
}

.pipe-back::after {
  top: 0;
  bottom: auto;
  border-top: 0;
  border-bottom: 8px solid var(--pipe);
}

@media (min-width: 1000px) {
  .pipes {
    flex-direction: column;
    gap: 32px;
    padding: 0 14px;
  }

  .pipe {
    display: block;
    max-width: none;
    min-height: 0;
    padding: 0 0 14px;
    text-align: center;
  }

  .pipe::before {
    top: auto;
    right: 6px;
    bottom: 5px;
    left: 0;
    width: auto;
    height: 2px;
  }

  .pipe::after {
    right: 0;
    bottom: 0;
    left: auto;
    border-top: 6px solid transparent;
    border-right: 0;
    border-bottom: 6px solid transparent;
    border-left: 8px solid var(--pipe);
  }

  .pipe-back::before {
    top: auto;
    right: 0;
    bottom: 5px;
    left: 6px;
  }

  .pipe-back::after {
    top: auto;
    right: auto;
    bottom: 0;
    left: 0;
    border-top: 6px solid transparent;
    border-right: 8px solid var(--pipe);
    border-bottom: 6px solid transparent;
    border-left: 0;
  }
}

/* Framework section: the any-to-any hub. A diagram, so no cut corners. */

.hub {
  display: grid;
  gap: 12px;
}

.hub-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}

.hub-group {
  position: relative;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--muted-300);
}

.hub-group h3 {
  font-size: 1rem;
}

.hub-group p {
  margin-top: 2px;
  color: var(--muted-600);
  font-size: 0.875rem;
  line-height: 1.4;
}

.hub-core {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 24px;
  background: var(--white);
  border: 2px solid var(--purple-500);
  text-align: center;
}

.hub-core svg {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
}

.hub-core h3 {
  font-size: 1.375rem;
}

.hub-core p {
  margin-top: 8px;
  color: var(--muted-600);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.hub-core .chips {
  justify-content: center;
  margin-top: 18px;
}

.chip-code {
  background: var(--info-100);
  border-color: var(--info-100);
  color: var(--purple-600);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.7;
}

@media (min-width: 900px) {
  .hub {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 330px) minmax(0, 1fr);
    gap: 0 56px;
  }

  .hub-col:first-child .hub-group::after,
  .hub-col:last-child .hub-group::before {
    content: "";
    position: absolute;
    top: 50%;
    width: 57px;
    height: 2px;
    background: var(--purple-500);
  }

  .hub-col:first-child .hub-group::after {
    left: 100%;
  }

  .hub-col:last-child .hub-group::before {
    right: 100%;
  }
}

.subhead {
  margin: 64px 0 32px;
}

.subhead p {
  max-width: 720px;
  margin-top: 10px;
  color: var(--muted-600);
}

@media (min-width: 768px) {
  .subhead {
    margin-top: 88px;
    text-align: center;
  }

  .subhead p {
    margin-inline: auto;
  }
}

.parts {
  display: grid;
  gap: 24px;
}

.parts .card {
  background: var(--white);
}

.parts .chips {
  justify-content: center;
  margin-top: 20px;
}

.parts .chip {
  padding: 4px 10px;
  font-size: 0.875rem;
}

@media (min-width: 900px) {
  .parts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .parts .card {
    padding: 48px 32px;
  }
}

@media (min-width: 900px) {
  .steps-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.steps .safety {
  display: block;
  margin-top: 12px;
  color: var(--navy-800);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Operations grid */

.ops {
  display: grid;
  gap: 40px;
}

.ops article {
  padding-top: 24px;
  border-top: 1px solid var(--muted-300);
}

.ops svg {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
}

.ops p {
  margin-top: 10px;
  color: var(--muted-600);
}

@media (min-width: 768px) {
  .ops {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px 32px;
  }
}

@media (min-width: 1100px) {
  .ops {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Observability: a mock run detail. A diagram, so no cut corners. */

.obs-split {
  align-items: stretch;
}

@media (min-width: 1024px) {
  .obs-split {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 40px;
  }
}

.run {
  min-width: 0;
  margin: 0;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--muted-300);
}

@media (min-width: 768px) {
  .run {
    padding: 32px;
  }
}

.run-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.run-flow {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.run-meta,
.run-label {
  color: var(--muted-600);
  font-size: 0.8125rem;
}

.run-chunks {
  margin-top: 24px;
}

.chunk-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 6px;
}

.chunk-bar i {
  height: 10px;
  background: var(--success-500);
}

.chunk-bar .has-failed {
  background: linear-gradient(to right, var(--success-500) 0 88%, var(--error-500) 88% 100%);
}

.run-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0 0;
}

.run-counts div {
  padding: 12px 14px;
  background: var(--muted-100);
}

.run-counts dt {
  color: var(--muted-600);
  font-size: 0.8125rem;
}

.run-counts dd {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

@media (min-width: 560px) {
  .run-counts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.run .ok {
  color: var(--success-500);
}

.run .bad {
  color: var(--error-500);
}

.run .same {
  color: var(--muted-600);
}

.run-records {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.run-records li {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-top: 1px solid var(--muted-200);
}

.run-records code {
  padding: 0;
  background: none;
  font-size: 0.8125rem;
}

.run-records span {
  color: var(--muted-600);
}

.run-records b {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
}

.run-error {
  margin-top: 4px;
  padding: 16px;
  background: var(--error-100);
  border-left: 4px solid var(--error-500);
  font-size: 0.9375rem;
}

.run-error code {
  background: var(--white);
}

.run-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}

.run-link {
  color: var(--purple-600);
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.obs-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.obs-side .code-panel {
  flex: 1;
}

.obs-caption {
  margin-top: 16px;
  color: var(--muted-600);
  font-size: 0.9375rem;
}

.obs-grid {
  margin-top: 56px;
}

.band .callout {
  background: var(--white);
}

.duo {
  margin-top: 40px;
}

@media (min-width: 768px) {
  .duo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The hero story: one labelled record at a time, driven by main.js.
   Without JS or with reduced motion the diagram is static and the steps show as a list. */

.diagram {
  position: relative;
}

.node,
.engine-steps li,
.hub-core {
  position: relative;
}

.node::after,
.engine-steps li::after,
.hub-core::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.node::after {
  border: 2px solid var(--purple-500);
}

.engine-steps li::after,
.hub-core::after {
  background: var(--purple-500);
}

.node.is-on::after {
  opacity: 1;
}

.engine-steps li.is-on::after {
  opacity: 0.22;
}

.story-chip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 3px 10px;
  background: var(--navy-800);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  transition: transform 0.5s ease-in-out, opacity 0.3s;
}

.story-chip.is-in {
  background: var(--purple-500);
}

.story-chip.is-skipped {
  background: var(--muted-600);
}

.story-chip.is-visible {
  opacity: 1;
}

.story-result {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 1px 8px;
  background: var(--success-100);
  color: #116B33;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.35s;
}

.story-result-top {
  top: 18px;
  bottom: auto;
}

.story-result.is-shown {
  opacity: 1;
}

.story-steps {
  max-width: 720px;
  margin: 24px auto 0;
  padding-left: 1.4em;
  color: var(--muted-600);
  font-size: 0.9375rem;
}

.is-live .pipe {
  --pipe: var(--muted-300);
}

.is-live .pipe.is-on {
  --pipe: var(--purple-500);
  color: var(--navy-800);
}

.is-live .story-steps {
  min-height: 3.2em;
  padding: 0;
  list-style: none;
  color: var(--navy-800);
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 500;
  text-align: center;
}

.is-live .story-steps li {
  display: none;
}

.is-live .story-steps li.is-on {
  display: block;
  animation: caption-in 0.4s ease-out;
}

@keyframes caption-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@keyframes core-pulse {
  0%, 60%, 100% { opacity: 0; }
  30% { opacity: 0.07; }
}

@media (prefers-reduced-motion: no-preference) {
  .hub-core::after {
    animation: core-pulse 5s ease-in-out infinite;
  }
}
