:root {
  --ink: #424a54;
  --muted: #5e6875;
  --soft: #f5f7f6;
  --line: #e4e8e6;
  --green: #0f9360;
  --green-dark: #087449;
  --green-pale: #e9f8f1;
  --orange: #ff6b2c;
  --white: #ffffff;
  --shadow: 0 18px 48px rgba(20, 35, 29, 0.07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.header-inner,
main,
.site-footer {
  width: min(1180px, calc(100% - 64px));
  margin-inline: auto;
}

.header-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--green);
  background: var(--green-pale);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-copy { display: grid; gap: 6px; min-width: 0; }
.brand-copy strong { color: #3f4751; font-size: 16px; line-height: 1.2; }
.brand-copy span { color: var(--muted); font-size: 12px; line-height: 1.35; }

.part-count {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: 1px solid #ffd3be;
  border-radius: 999px;
  color: var(--orange);
  background: #fff7f2;
  font-size: 14px;
  font-weight: 600;
  cursor: default;
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.part-count:hover { color: #d95017; border-color: #ffb891; background: #fff1e9; box-shadow: 0 7px 18px rgba(255, 107, 44, .12); transform: translateY(-1px); }

main { padding: 16px 0 96px; }

.section-nav { margin-bottom: 56px; }
.section-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 7px; }

.section-tile {
  min-height: 72px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--white);
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.section-tile:hover { transform: translateY(-2px); border-color: #b8d8c9; box-shadow: 0 10px 28px rgba(20, 35, 29, .08); }
.section-tile:focus-visible { outline: 3px solid rgba(15, 147, 96, .25); outline-offset: 2px; }
.section-tile.active { border-color: var(--green); color: var(--green-dark); background: var(--white); }
.tile-number { font-size: 10px; font-weight: 700; }
.tile-name { font-size: 10px; font-weight: 600; line-height: 1.25; }

.content-shell { max-width: 940px; margin-inline: auto; }
.section-heading { margin-bottom: 42px; }
.section-kicker { margin: 0 0 12px; color: var(--green); font-size: 14px; font-weight: 700; }
.section-heading h2 { margin: 0; color: #454d57; font-size: 16px; line-height: 1.3; letter-spacing: 0; }

.summary-grid { display: grid; gap: 18px; }
.summary-card { position: relative; padding: 0 64px 34px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.summary-card::after { content: ""; position: absolute; top: 64px; right: 0; left: 0; height: 1px; background: var(--line); }
.card-label { width: auto; height: 64px; margin: 0 8px 0 0; display: inline-flex; align-items: center; color: var(--ink); background: transparent; font-size: 16px; font-weight: 700; }
.summary-card h3 { display: inline; margin: 0; font-size: 16px; line-height: 1.3; letter-spacing: 0; }
.summary-card.unnumbered-card h3 { height: 64px; display: flex; align-items: center; }
.summary-card p { margin: 32px 0 0; color: #505965; font-size: 16px; font-weight: 400; line-height: 1.75; }
.summary-card p + p { margin-top: 16px; }
.summary-card ul { margin: 12px 0 0; padding-left: 34px; color: #505965; font-size: 16px; font-weight: 400; line-height: 1.75; }
.summary-card ol { margin: 12px 0 0; padding-left: 34px; color: #505965; font-size: 16px; font-weight: 400; line-height: 1.75; }
.summary-card > ul:first-of-type { margin-top: 32px; }
.summary-card > ol:first-of-type { margin-top: 32px; }
.summary-card li + li { margin-top: 5px; }
.summary-card h4 { margin: 28px 0 -18px; color: #454d57; font-size: 16px; font-weight: 600; line-height: 1.5; }
.content-label { display: block; color: #454d57; font-size: 16px; font-weight: 700; line-height: 1.5; }
.stories-label { margin-top: 22px; }
.stories-label + ul { margin-top: 8px; }
.journey-flow { margin: 16px 0 0; padding: 18px 20px; border-left: 3px solid var(--green); border-radius: 0 10px 10px 0; color: #3f4c47; background: var(--green-pale); font-size: 15px; font-weight: 600; line-height: 1.7; }

.architecture-position { position: relative; overflow: hidden; padding: 0 64px 34px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.architecture-position::after { content: ""; position: absolute; top: 64px; right: 0; left: 0; height: 1px; background: var(--line); }
.architecture-position .card-label { display: inline-flex; }
.architecture-position h3 { height: 64px; display: flex; align-items: center; margin: 0; color: #454d57; font-size: 16px; line-height: 1.3; }
.architecture-position p { margin: 32px 0 0; color: #505965; font-size: 16px; line-height: 1.75; }
.architecture-position p + p { margin-top: 16px; }
.block-heading { min-height: 64px; padding: 0 30px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.block-heading span { font-size: 13px; font-weight: 700; color: var(--green); }
.block-heading h3 { margin: 0; color: #454d57; font-size: 16px; }
.block-body { padding: 30px; }
.block-body p { margin: 0; color: #505965; font-size: 16px; line-height: 1.75; }
.block-body p + p { margin-top: 20px; }

.architecture-section { margin-top: 54px; }
.actors-section { width: 100%; }
.subsection-heading { margin-bottom: 20px; }
.subsection-heading .section-kicker { margin-bottom: 8px; }
.subsection-heading h3 { margin: 0; color: #454d57; font-size: 20px; line-height: 1.35; }
.architecture-tile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.actors-grid { width: min(1180px, calc(100vw - 64px)); margin-left: 50%; grid-template-columns: repeat(5, minmax(0, 1fr)); transform: translateX(-50%); }
.architecture-tile { position: relative; min-height: 160px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); transition: transform .18s ease, box-shadow .18s ease; }
.architecture-tile:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(20, 35, 29, .10); }
.architecture-tag { position: absolute; top: 20px; right: 20px; display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.architecture-tile h4 { display: block; margin: 0; padding-right: 64px; color: #454d57; font-size: 16px; line-height: 1.4; }
.architecture-tile p { margin: 18px 0 0; color: #5a6470; font-size: 13px; line-height: 1.65; }

.architecture-diagram { margin: 0; padding: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #f9fbff; }
.architecture-diagram img { width: 100%; height: auto; display: block; border-radius: 8px; }

.component-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.component-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.component-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--white); transition: transform .18s ease, box-shadow .18s ease; }
.component-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(20, 35, 29, .10); }
.component-head { min-height: 70px; padding: 16px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.component-head span { flex: 0 0 auto; color: var(--green); font-size: 12px; font-weight: 700; line-height: 1.5; }
.component-head h4 { margin: 0; color: #454d57; font-size: 15px; line-height: 1.5; }
.type-chip { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; color: #fff !important; font-size: 10px !important; font-weight: 700; letter-spacing: .02em; line-height: 1.2 !important; }
.type-chip.actor, .architecture-tag.actor { color: #fff; background: #6046a8; }
.type-chip.internal { background: #1d6f8f; }
.type-chip.provider { background: #20b455; }
.type-chip.partner { background: #ea7f0b; }
.type-chip.external { background: #cc13aa; }
.architecture-tile.type-actor { border-color: #6046a8; }
.component-card.type-internal { border-color: #1d6f8f; }
.component-card.type-provider { border-color: #20b455; }
.component-card.type-partner { border-color: #ea7f0b; }
.component-card.type-external { border-color: #cc13aa; }
.component-card ul { margin: 0; padding: 20px 22px 22px 40px; color: #505965; font-size: 14px; line-height: 1.65; }
.component-card li + li { margin-top: 6px; }
.component-description { margin: 0; padding: 20px 20px 0; color: #5a6470; font-size: 14px; line-height: 1.65; }
.component-description + ul { padding-top: 14px; }
.single-component { grid-template-columns: minmax(0, 1fr); max-width: calc(50% - 7px); }
.component-card.centered-card { width: calc(50% - 7px); grid-column: 1 / -1; justify-self: center; }
.roadmap-list { display: grid; gap: 16px; }
.roadmap-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.roadmap-page-heading > span { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.roadmap-group { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.roadmap-group summary { min-height: 66px; padding: 16px 20px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; color: #454d57; cursor: pointer; list-style: none; }
.roadmap-group summary::-webkit-details-marker { display: none; }
.roadmap-group summary:hover { background: #fafcfb; }
.roadmap-group summary > strong { font-size: 16px; line-height: 1.4; }
.roadmap-toggle { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: var(--green-dark); background: var(--green-pale); }
.roadmap-toggle::before { content: "+"; font-size: 17px; font-weight: 600; line-height: 1; }
.roadmap-group[open] .roadmap-toggle::before { content: "−"; }
.activity-count { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.roadmap-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.roadmap-table { width: 100%; border-collapse: collapse; table-layout: fixed; color: #505965; font-size: 13px; line-height: 1.55; }
.roadmap-table th { padding: 12px 14px; color: #454d57; background: #f7f9f8; font-size: 12px; font-weight: 700; text-align: left; }
.roadmap-table th:first-child { width: 70px; }
.roadmap-table th:nth-child(2) { width: 34%; }
.roadmap-table td { padding: 14px; border-top: 1px solid var(--line); vertical-align: top; }
.roadmap-table th + th, .roadmap-table td + td { border-left: 1px solid var(--line); }
.roadmap-table tbody tr:first-child td { border-top: 0; }
.roadmap-table tbody tr:hover { background: #fbfcfc; }
.roadmap-table td:first-child { color: var(--green-dark); font-weight: 700; }
.roadmap-table td strong { color: #454d57; font-weight: 600; }
.mvp-boundary { margin-top: 18px; padding: 24px 28px; border: 1px solid #cce8dc; border-radius: 16px; background: var(--green-pale); }
.mvp-boundary span { display: block; margin-bottom: 8px; color: var(--green-dark); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.mvp-boundary p { margin: 0; color: #46534d; font-size: 14px; line-height: 1.7; }

.empty-state { padding: 64px 40px; border: 1px dashed #cbd3cf; border-radius: 22px; background: var(--soft); text-align: center; }
.empty-state span { display: inline-grid; width: 42px; height: 42px; place-items: center; margin-bottom: 20px; border-radius: 50%; color: var(--green); background: var(--green-pale); font-weight: 700; }
.empty-state h2 { margin: 0 0 12px; font-size: 30px; }
.empty-state p { margin: 0; color: var(--muted); line-height: 1.7; }

.site-footer { padding: 28px 0; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.site-footer strong { color: var(--ink); font-weight: 700; }

.back-to-top {
  --zoom-compensation: 1;
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 10;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--green);
  border-radius: 50%;
  color: var(--green-dark);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 24px rgba(20, 35, 29, .14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(var(--zoom-compensation));
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease, background .2s ease;
}

.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0) scale(var(--zoom-compensation)); }
.back-to-top:hover { color: var(--white); background: var(--green); }
.back-to-top:focus-visible { outline: 3px solid rgba(15, 147, 96, .25); outline-offset: 3px; }
.back-to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 900px) {
  .section-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .architecture-tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actors-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .component-grid-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .single-component { max-width: none; }
}

@media (max-width: 620px) {
  .header-inner, main, .site-footer { width: min(100% - 36px, 1180px); }
  .header-inner { min-height: 96px; }
  .brand-mark { width: 44px; height: 44px; flex-basis: 44px; }
  .brand-copy span, .part-count { display: none; }
  main { padding: 14px 0 72px; }
  .section-nav { margin-bottom: 44px; }
  .section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-tile { min-height: 76px; flex-direction: row; justify-content: flex-start; align-items: center; }
  .summary-card { padding-right: 24px; padding-left: 24px; }
  .block-heading, .block-body { padding-right: 22px; padding-left: 22px; }
  .architecture-position { padding-right: 24px; padding-left: 24px; }
  .architecture-tile-grid, .component-grid { grid-template-columns: 1fr; }
  .component-card.centered-card { width: 100%; }
  .roadmap-group summary { grid-template-columns: auto 1fr; }
  .roadmap-page-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .activity-count { grid-column: 2; }
  .roadmap-table, .roadmap-table tbody, .roadmap-table tr, .roadmap-table td { display: block; width: 100%; }
  .roadmap-table thead { display: none; }
  .roadmap-table tr { padding: 14px 18px; border-top: 1px solid var(--line); }
  .roadmap-table tbody tr:first-child { border-top: 0; }
  .roadmap-table td { padding: 4px 0; border: 0 !important; }
  .roadmap-table td::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
  .actors-grid { width: 100%; margin-left: 0; transform: none; }
  .architecture-tile { min-height: 0; }
  .architecture-diagram { padding: 8px; }
  .site-footer { flex-direction: column; }
  .back-to-top { right: 18px; bottom: 18px; width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .section-tile { transition: none; }
  .back-to-top { transition: none; }
  .architecture-tile, .component-card, .part-count { transition: none; }
}
