:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #5a5f66;
  --accent: #005b96;
  --accent-hover: #004473;
  --border: #e2e5ea;
  --shadow: 0 8px 28px rgba(16, 24, 40, 0.08);
  --radius: 10px;
  --container: 960px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

.container {
  width: min(100% - 2rem, var(--container));
  margin: 0 auto;
  padding: 1.75rem 0 3.5rem;
}

/* —— Brand (never look like a blue/purple hyperlink) —— */
a.brand-lockup,
a.brand-lockup:link,
a.brand-lockup:visited,
a.brand-lockup:hover,
a.brand-lockup:active,
a.brand-lockup:focus {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 1.15rem;
}

a.brand-lockup:hover .brand-dose {
  color: var(--accent-hover);
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

.brand-word {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-dose {
  font-weight: 700;
  color: var(--accent);
}

.brand-relay {
  font-weight: 500;
  color: var(--text);
}

/* —— Type —— */
header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 {
  font-size: clamp(1.7rem, 4.2vw, 2.35rem);
  margin-bottom: 0.7rem;
  font-weight: 700;
}

h2 {
  font-size: 1.28rem;
  margin: 2.1rem 0 0.75rem;
  font-weight: 650;
}

h3 {
  font-size: 1.02rem;
  margin-bottom: 0.45rem;
  font-weight: 650;
}

p {
  margin-bottom: 1rem;
  font-size: 1.05rem;
  color: #2c3036;
}

.lead {
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  color: var(--muted);
  max-width: 38em;
  margin-bottom: 0;
}

ul,
ol {
  margin: 0 0 1.25rem 1.25rem;
}

li {
  margin-bottom: 0.4rem;
  font-size: 1.02rem;
  color: #2c3036;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #eef1f5;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--accent);
  color: #fff;
  padding: 0.72rem 1.25rem;
  text-decoration: none;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.98rem;
  line-height: 1.2;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  font-family: inherit;
}

.btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn:focus-visible {
  outline: 3px solid rgba(0, 91, 150, 0.35);
  outline-offset: 2px;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover {
  background: rgba(0, 91, 150, 0.06);
  color: var(--accent);
}

.btn-row {
  margin: 1.5rem 0 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

/* —— Cards / steps —— */
.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin: 1.35rem 0 1.75rem;
}

.step-card {
  background: var(--surface);
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.step-card h3 {
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.step-card p:last-child {
  margin-bottom: 0;
}

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

/* —— Diagrams —— */
.diagram {
  width: 100%;
  margin: 1rem 0 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.diagram-caption {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* —— DEMO VIEWER: single page + arrows (reference layout) —— */
.demo-viewer {
  margin: 1.75rem 0 1.25rem;
}

.demo-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  min-height: min(72vh, 780px);
  padding: clamp(1rem, 3vw, 2.25rem) clamp(3.25rem, 8vw, 5rem);
  border-radius: 20px;
  background:
    radial-gradient(120% 90% at 50% 0%, #ffffff 0%, #eef2f7 55%, #e6ebf2 100%);
  border: 1px solid var(--border);
  overflow: hidden;
}

.demo-page-card {
  position: relative;
  width: min(100%, 420px);
  max-height: min(68vh, 720px);
  background: #fff;
  border-radius: 14px;
  box-shadow:
    0 24px 48px rgba(15, 23, 42, 0.12),
    0 4px 12px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(226, 229, 234, 0.9);
  overflow: hidden;
  cursor: zoom-in;
}

.demo-page-card img {
  width: 100%;
  height: auto;
  max-height: min(68vh, 720px);
  object-fit: contain;
  object-position: top center;
  background: #fff;
  user-select: none;
  -webkit-user-drag: none;
  /* High-DPI source (300dpi A4) — browser downscales cleanly; avoid pixelation */
  image-rendering: auto;
  -ms-interpolation-mode: bicubic;
}

.demo-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: #8b919a;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.demo-nav-btn:hover {
  background: #6f757e;
}

.demo-nav-btn:focus-visible {
  outline: 3px solid rgba(0, 91, 150, 0.4);
  outline-offset: 2px;
}

.demo-nav-btn:active {
  transform: translateY(-50%) scale(0.96);
}

.demo-nav-prev {
  left: clamp(0.65rem, 2vw, 1.25rem);
}

.demo-nav-next {
  right: clamp(0.65rem, 2vw, 1.25rem);
}

.demo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.demo-counter {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

/* —— Fullscreen PDF-like reader —— */
.demo-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  flex-direction: column;
  background: #0f141c;
  color: #fff;
}

.demo-fullscreen.is-open {
  display: flex;
}

.demo-fullscreen-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.9rem;
  background: rgba(8, 12, 18, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-fullscreen-bar .btn {
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
}

.demo-fullscreen-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  margin-right: auto;
}

.demo-fullscreen-count {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

.demo-fullscreen-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.demo-fullscreen-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.demo-fullscreen-body {
  position: relative;
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 0.75rem 2rem;
  background: #1a2030;
}

.demo-fullscreen-pages {
  width: min(100%, 820px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.demo-fullscreen-pages img {
  width: 100%;
  height: auto;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  image-rendering: auto;
  -ms-interpolation-mode: bicubic;
}

body.demo-fs-open {
  overflow: hidden;
}

/* —— Disclaimer / footer —— */
.disclaimer {
  font-size: 0.875rem;
  color: #4b5058;
  background: #eef1f5;
  padding: 1rem 1.1rem;
  border-radius: 8px;
  margin-top: 1.75rem;
  line-height: 1.5;
  border: 1px solid var(--border);
}

footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.35rem;
  align-items: center;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.footer-note {
  flex-basis: 100%;
  margin-top: 0.25rem;
  color: #777;
  font-size: 0.8rem;
  line-height: 1.45;
}

/* —— Landing extras —— */
.hero-cta {
  margin-top: 1.35rem;
}

.pill-list {
  list-style: none;
  margin: 1rem 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.pill-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.95rem;
  margin: 0;
  font-size: 0.98rem;
}

.pill-list strong {
  color: var(--accent);
}

@media (max-width: 640px) {
  .demo-stage {
    min-height: 58vh;
    padding: 1rem 3rem;
  }

  .demo-page-card {
    width: 100%;
    max-height: min(58vh, 560px);
  }

  .demo-page-card img {
    max-height: min(58vh, 560px);
  }

  .demo-nav-btn {
    width: 42px;
    height: 42px;
  }
}

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