:root {
  --ink: #0b1526;
  --muted: #4a607a;
  --paper: #f3f6fa;
  --paper-deep: #e5edf6;
  --accent-red: #ff3131;
  --accent-cyan: #00d2ff;
  --rule: rgba(11, 21, 38, 0.12);

  /* Architecture diagrams (inline SVG inherits these) */
  --diagram-ink: var(--ink);
  --diagram-muted: var(--muted);
  --diagram-surface: #f7fafc;
  --diagram-card: #ffffff;
  --diagram-border: rgba(11, 21, 38, 0.16);
  --diagram-edge: #5a718c;
  --diagram-accent: #0a7a8a;
  --diagram-accent-soft: rgba(0, 210, 255, 0.14);
  --diagram-ok: #1a7a4c;
  --diagram-ok-soft: rgba(26, 122, 76, 0.12);
  --diagram-font: "IBM Plex Sans", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eef7;
    --muted: #9aa8b8;
    --paper: #0c121a;
    --paper-deep: #121a24;
    --rule: rgba(232, 238, 247, 0.14);
    --diagram-surface: #121a24;
    --diagram-card: #1a2430;
    --diagram-border: rgba(232, 238, 247, 0.16);
    --diagram-edge: #8a9bb0;
    --diagram-accent: #00d2ff;
    --diagram-accent-soft: rgba(0, 210, 255, 0.12);
    --diagram-ok: #3dd68c;
    --diagram-ok-soft: rgba(61, 214, 140, 0.12);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(0, 210, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(255, 49, 49, 0.12), transparent 50%),
    linear-gradient(165deg, var(--paper) 0%, var(--paper-deep) 100%);
  line-height: 1.55;
}

a {
  color: var(--ink);
}

a:hover {
  color: #0a5f73;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
}

.topnav .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topnav .brand img {
  width: 2rem;
  height: 2rem;
}

.topnav .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.95rem;
}

.topnav .links a {
  text-decoration: none;
  color: var(--muted);
}

.topnav .links a:hover,
.topnav .links a[aria-current="page"] {
  color: var(--ink);
}

.shell {
  min-height: calc(100vh - 4rem);
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 3rem;
}

.hero {
  width: min(44rem, 100%);
  text-align: center;
}

.mark {
  width: clamp(7rem, 22vw, 10rem);
  height: auto;
  margin: 0 auto 1.5rem;
  display: block;
  filter: drop-shadow(0 18px 40px rgba(11, 21, 38, 0.25));
  animation: rise 0.9s ease-out both;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  animation: rise 0.9s ease-out 0.08s both;
}

.tag {
  margin: 1rem auto 0;
  max-width: 32rem;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--muted);
  animation: rise 0.9s ease-out 0.16s both;
}

.cta {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  animation: rise 0.9s ease-out 0.24s both;
}

.cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.15rem;
  border-radius: 0.55rem;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.cta a:hover {
  transform: translateY(-1px);
}

.cta a.primary {
  background: var(--ink);
  color: #f4f7fb;
}

.cta a.secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px rgba(11, 21, 38, 0.22);
}

.note {
  margin-top: 2.5rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--muted);
  animation: rise 0.9s ease-out 0.32s both;
}

.note a {
  color: inherit;
}

.page {
  width: min(44rem, 100%);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  animation: rise 0.7s ease-out both;
}

.page h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  animation: none;
}

.lede {
  margin: 0.85rem 0 2rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feed li {
  border-top: 1px solid var(--rule);
  padding: 1.35rem 0;
}

.feed li:last-child {
  border-bottom: 1px solid var(--rule);
}

.feed time {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.feed a.title {
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.feed p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.article header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.article time {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--muted);
}

.article h1 {
  margin-top: 0.5rem;
  animation: none;
}

.article .summary {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.article .body > :first-child {
  margin-top: 0;
}

.article .body h2 {
  margin-top: 2rem;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.article .body p,
.article .body li {
  color: #243447;
}

.article .body a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.article .body code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.9em;
}

.back {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.back:hover {
  color: var(--ink);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-footer {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  border-top: 1px solid var(--rule);
}

.footer-related-label {
  margin: 0 0 0.5rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-related-links {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
}

.footer-related-links a {
  color: var(--ink);
  text-decoration: none;
}

.footer-related-links a:hover {
  color: #0a5f73;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.diagram-figure {
  margin: 2rem 0 0;
  text-align: left;
}

.diagram-figure img,
.diagram-figure .diagram-svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  border: 1px solid var(--diagram-border);
  background: var(--diagram-surface);
}

.diagram-caption {
  margin: 0.75rem 0 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.architecture {
  width: min(44rem, 100%);
  margin: 0 auto;
  padding: 0 0 3rem;
}

.architecture h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.architecture .lede {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

