:root {
  --paper: #f5f7f4;
  --paper-warm: #fbfaf7;
  --card: #ffffff;
  --ink: #17221f;
  --muted: #64706b;
  --line: #dfe5e1;
  --line-strong: #cdd7d1;
  --accent: #16745d;
  --accent-dark: #0d5644;
  --accent-soft: #e3f3ed;
  --owner: #6554a7;
  --owner-soft: #efecfb;
  --business: #166b91;
  --business-soft: #e7f3f8;
  --customer: #9a5b16;
  --customer-soft: #fbefdc;
  --warning: #8a4c0f;
  --warning-soft: #fff5e7;
  --shadow: 0 22px 60px rgba(24, 43, 36, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max: 1220px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 4%, rgba(25, 126, 99, 0.08), transparent 25rem),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

body[data-role="owner"] {
  --role: var(--owner);
  --role-soft: var(--owner-soft);
}

body[data-role="business"] {
  --role: var(--business);
  --role-soft: var(--business-soft);
}

body[data-role="customer"] {
  --role: var(--customer);
  --role-soft: var(--customer-soft);
}

body[data-role="hub"] {
  --role: var(--accent);
  --role-soft: var(--accent-soft);
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(22, 116, 93, 0.35);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(205, 215, 209, 0.86);
  background: rgba(251, 250, 247, 0.9);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  width: min(calc(100% - 32px), var(--max));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topnav a {
  padding: 8px 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

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

.hero {
  width: min(calc(100% - 32px), var(--max));
  margin: 42px auto 30px;
  padding: clamp(30px, 5vw, 68px);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78)),
    var(--role-soft);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  top: -190px;
  right: -100px;
  border: 72px solid color-mix(in srgb, var(--role) 12%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

.eyebrow,
.role-token,
.story-label {
  font-weight: 500;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--role);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(40px, 6.5vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.hero-lead {
  max-width: 760px;
  margin: 24px 0 0;
  color: #4d5b56;
  font-size: clamp(18px, 2.1vw, 23px);
  line-height: 1.55;
}

.role-row,
.hero-actions,
.story-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.role-row {
  margin-top: 26px;
}

.role-token {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--role) 22%, white);
  border-radius: 999px;
  background: var(--role-soft);
  color: color-mix(in srgb, var(--role) 78%, black);
  font-size: 13px;
}

.hero-actions {
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  padding: 10px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

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

.orientation {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.orientation-card {
  min-height: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.orientation-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.orientation-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.35;
}

.orientation-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.story-shell {
  width: min(calc(100% - 32px), var(--max));
  margin: 38px auto 90px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 58px);
  align-items: start;
}

.story-nav {
  position: sticky;
  top: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 14px 40px rgba(24, 43, 36, 0.05);
}

.story-nav-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.progress-track {
  height: 5px;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.progress-value {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--role);
  transition: width 220ms ease;
}

.story-nav ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.story-nav li + li {
  margin-top: 4px;
}

.story-nav a {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 7px;
  align-items: start;
  padding: 8px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
}

.story-nav a span:first-child {
  color: var(--role);
  font-variant-numeric: tabular-nums;
}

.story-nav a:hover,
.story-nav a[aria-current="step"] {
  background: var(--role-soft);
  color: var(--ink);
}

.story-content {
  min-width: 0;
}

.chapter-intro {
  margin-bottom: 24px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-warm);
}

.chapter-intro h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.chapter-intro p {
  max-width: 780px;
  margin: 14px 0 0;
  color: var(--muted);
}

.story-step {
  scroll-margin-top: 96px;
  margin-bottom: 22px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 14px 44px rgba(24, 43, 36, 0.045);
}

.step-heading {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 15px;
  align-items: start;
}

.step-number {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--role-soft);
  color: var(--role);
  font-size: 14px;
  font-weight: 650;
}

.story-label {
  margin: 1px 0 4px;
  color: var(--role);
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.story-step h2,
.story-step h3 {
  margin: 0;
  line-height: 1.17;
  letter-spacing: -0.035em;
}

.story-step h2 {
  font-size: clamp(25px, 3.8vw, 38px);
}

.step-copy {
  max-width: 790px;
  margin: 22px 0;
}

.step-copy p {
  margin: 0 0 13px;
}

.step-copy ul {
  margin: 14px 0;
  padding-left: 22px;
}

.step-copy li + li {
  margin-top: 7px;
}

.browser-frame {
  margin: 25px 0 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: #eef1ef;
  box-shadow: 0 18px 50px rgba(14, 35, 27, 0.11);
}

.browser-bar {
  min-height: 40px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line-strong);
  background: #f7f8f7;
}

.browser-dots {
  display: flex;
  gap: 5px;
}

.browser-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c6ceca;
}

.browser-address {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  padding: 4px 10px;
  border: 1px solid #e2e6e3;
  border-radius: 7px;
  background: white;
  color: #7a8580;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-frame button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.browser-frame img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: top;
  background: white;
}

.browser-frame figcaption {
  padding: 13px 16px 15px;
  color: #596660;
  font-size: 13px;
  line-height: 1.45;
}

.insight-grid,
.responsibility-grid,
.story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.insight,
.responsibility,
.story-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-warm);
}

.insight span,
.responsibility span {
  display: block;
  margin-bottom: 5px;
  color: var(--role);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insight strong,
.responsibility strong {
  display: block;
  line-height: 1.35;
}

.insight p,
.responsibility p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.callout {
  margin-top: 20px;
  padding: 17px 18px;
  border: 1px solid var(--role);
  border-radius: 13px;
  background: var(--role-soft);
}

.callout.payment {
  border-color: var(--warning);
  background: var(--warning-soft);
}

.callout strong {
  display: block;
  margin-bottom: 4px;
}

.callout p {
  margin: 0;
  color: #4f5b57;
  font-size: 15px;
}

.flow {
  margin: 22px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
}

.flow li {
  min-height: 90px;
  padding: 14px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-warm);
  font-size: 14px;
  line-height: 1.4;
}

.flow li:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -9px;
  z-index: 2;
  color: var(--role);
  transform: translateY(-50%);
}

.flow strong {
  display: block;
  margin-bottom: 4px;
}

.hub-main {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto 90px;
}

.model-section {
  margin-top: 28px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
}

.model-section h2 {
  margin: 0;
  font-size: clamp(29px, 4vw, 46px);
  letter-spacing: -0.045em;
}

.model-section > p {
  max-width: 780px;
  color: var(--muted);
}

.story-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 26px;
}

.story-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  background: white;
}

.story-card.owner {
  border-top: 4px solid var(--owner);
}

.story-card.business {
  border-top: 4px solid var(--business);
}

.story-card.customer {
  border-top: 4px solid var(--customer);
}

.story-card .role-token {
  align-self: flex-start;
}

.story-card h2,
.story-card h3 {
  margin: 18px 0 8px;
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.story-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.story-card ul {
  margin: 18px 0 22px;
  padding-left: 20px;
  color: #46534e;
  font-size: 14px;
}

.story-card .button {
  margin-top: auto;
}

.commercial-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.commercial-node {
  min-height: 135px;
  padding: 18px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper-warm);
}

.commercial-node:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -9px;
  z-index: 3;
  color: var(--accent);
  font-weight: 700;
  transform: translateY(-50%);
}

.commercial-node span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.commercial-node strong {
  display: block;
  margin-top: 7px;
  font-size: 17px;
  line-height: 1.25;
}

.commercial-node p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.next-story {
  margin-top: 28px;
  padding: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--ink);
  color: white;
}

.next-story p {
  margin: 0;
  color: #bdc9c4;
  font-size: 14px;
}

.next-story strong {
  display: block;
  margin-top: 4px;
  font-size: 21px;
}

.next-story .button {
  flex: 0 0 auto;
}

.site-footer {
  padding: 34px 16px 50px;
  border-top: 1px solid var(--line);
  background: var(--paper-warm);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(24, 43, 36, 0.08);
}

.image-dialog {
  width: min(94vw, 1500px);
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 35px 120px rgba(0, 0, 0, 0.35);
}

.image-dialog::backdrop {
  background: rgba(9, 18, 15, 0.78);
  backdrop-filter: blur(7px);
}

.dialog-bar {
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.dialog-bar p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-close {
  min-width: 38px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.dialog-image-wrap {
  max-height: calc(92vh - 58px);
  overflow: auto;
}

.image-dialog img {
  width: 100%;
  height: auto;
}

@media (max-width: 980px) {
  .story-shell {
    grid-template-columns: 1fr;
  }

  .story-nav {
    position: static;
  }

  .story-nav ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .orientation,
  .story-grid {
    grid-template-columns: 1fr;
  }

  .commercial-map,
  .flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .commercial-node:nth-child(2)::after,
  .flow li:nth-child(2)::after {
    display: none;
  }
}

@media (max-width: 700px) {
  body {
    font-size: 16px;
  }

  .topbar-inner {
    min-height: 60px;
  }

  .topnav a:not([aria-current="page"]) {
    display: none;
  }

  .hero {
    margin-top: 18px;
    border-radius: 21px;
  }

  .hero h1 {
    font-size: clamp(38px, 13vw, 58px);
  }

  .orientation,
  .story-shell,
  .hub-main,
  .hero {
    width: min(calc(100% - 20px), var(--max));
  }

  .story-nav ol,
  .insight-grid,
  .responsibility-grid,
  .commercial-map,
  .flow {
    grid-template-columns: 1fr;
  }

  .commercial-node::after,
  .flow li::after {
    display: none;
  }

  .story-step {
    border-radius: 20px;
  }

  .step-heading {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
  }

  .step-number {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .browser-frame img {
    aspect-ratio: 4 / 3;
  }

  .next-story {
    align-items: flex-start;
    flex-direction: column;
  }

  .back-top {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print {
  :root {
    --paper: white;
  }

  body {
    background: white;
    font-size: 11pt;
  }

  .topbar,
  .story-nav,
  .back-top,
  .hero-actions,
  .next-story,
  .dialog-close {
    display: none !important;
  }

  .hero,
  .story-shell,
  .hub-main,
  .orientation {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .hero,
  .story-step,
  .model-section,
  .orientation-card {
    box-shadow: none;
    break-inside: avoid;
  }

  .story-shell {
    display: block;
  }

  .story-step {
    page-break-inside: avoid;
  }
}
