/* Aagami CareOS landing — "Clinical Precision" design system
   Light clinical surface, Inter type, Clinical Blue primary, Safety Teal for AI. */

:root {
  --surface:        #f6fafe;
  --surface-low:    #f0f4f8;
  --surface-2:      #eaeef2;
  --surface-high:   #e4e9ed;
  --white:          #ffffff;

  --ink:            #171c1f;
  --ink-soft:       #424751;
  --ink-mute:       #5b616b;
  --outline:        #737783;
  --outline-soft:   #c2c6d3;
  --hairline:       rgba(115, 119, 131, 0.14);

  --primary:        #00346f;
  --primary-c:      #004a99;
  --primary-fixed:  #d7e2ff;
  --primary-dim:    #abc7ff;
  --on-primary:     #ffffff;

  --teal:           #006a62;
  --teal-c:         #79f4e5;
  --teal-fixed:     #7cf6e7;
  --teal-dim:       #5ddacb;

  --ai:             var(--teal);
  --ok:             var(--primary-c);

  --error:          #ba1a1a;
  --error-c:        #ffdad6;
  --warn:           #9a6a00;
  --warn-c:         #ffe5b0;

  --focus: 0 0 0 3px rgba(0, 74, 153, 0.32);

  --sh-card: 0 4px 12px rgba(0, 74, 153, 0.05);
  --sh-soft: 0 10px 26px -18px rgba(0, 30, 80, 0.22);
  --sh-lg:   0 22px 50px -28px rgba(0, 30, 80, 0.30);

  --maxw: 1200px;
  --section-y: clamp(3.75rem, 2.6rem + 4vw, 6.5rem);

  --r:    8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 9999px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--ink); margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--primary-dim); color: var(--primary); }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--primary); color: var(--on-primary);
  padding: 10px 16px; border-radius: var(--r); font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

.shell { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 0.4rem + 3vw, 3rem); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.95rem; line-height: 1;
  padding: 0.8rem 1.25rem; border-radius: var(--r-md);
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease),
              box-shadow 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn--sm { padding: 0.55rem 1rem; font-size: 0.875rem; }
.btn--lg { padding: 0.95rem 1.6rem; font-size: 1rem; }

.btn--primary { background: var(--primary-c); color: var(--on-primary); box-shadow: var(--sh-soft); }
.btn--primary:hover { background: var(--primary); box-shadow: var(--sh-lg); }

.btn--outline { background: transparent; color: var(--primary); border-color: var(--outline-soft); }
.btn--outline:hover { border-color: var(--primary-c); background: var(--white); }

.btn--invert { background: var(--white); color: var(--primary); }
.btn--invert:hover { background: var(--primary-fixed); }

.btn--ghost-invert { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, 0.45); }
.btn--ghost-invert:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.8); }

/* ---------- shared section primitives ---------- */
.band { padding-block: var(--section-y); }

.eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--teal); margin-bottom: 0.85rem;
}
.eyebrow--amber { color: var(--warn); }
.eyebrow--invert { color: var(--teal-dim); }

.band__head { max-width: 40rem; margin-bottom: clamp(2.5rem, 1.8rem + 2vw, 3.5rem); }
.band__head--center { margin-inline: auto; text-align: center; }

.band__title { font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.4rem); font-weight: 700; }
.band__title--invert { color: var(--white); }

.band__lede { margin-top: 1rem; font-size: 1.075rem; line-height: 1.6; color: var(--ink-mute); }
.band__lede--invert { color: var(--primary-fixed); }

.boundary {
  background: var(--white);
  border: 1px solid var(--hairline);
  box-shadow: var(--sh-card);
  border-radius: var(--r-lg);
  padding: 24px;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 250, 254, 0.82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.topbar.is-scrolled { border-bottom-color: var(--hairline); box-shadow: 0 6px 18px -16px rgba(0, 30, 80, 0.4); }
.topbar__inner { display: flex; align-items: center; gap: 1.5rem; height: 72px; }

.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; }
.wordmark__text { font-weight: 700; font-size: 1.18rem; letter-spacing: -0.02em; color: var(--primary); }

.topnav { display: flex; gap: 1.5rem; margin-inline: auto; }
.topnav a {
  font-size: 0.92rem; font-weight: 500; color: var(--ink-mute);
  padding-bottom: 2px; border-bottom: 2px solid transparent; transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.topnav a:hover { color: var(--primary-c); border-bottom-color: var(--primary-c); }

.topbar__actions { display: flex; align-items: center; gap: 0.85rem; }

.status-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.78rem; font-weight: 600; color: var(--ink-soft);
  background: var(--white); border: 1px solid var(--hairline);
  padding: 0.4rem 0.75rem; border-radius: var(--r-pill);
}
.status-pill__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--outline-soft); }
.status-pill[data-state="up"] .status-pill__dot { background: var(--teal); box-shadow: 0 0 0 3px rgba(0, 106, 98, 0.18); }
.status-pill[data-state="down"] .status-pill__dot { background: var(--error); box-shadow: 0 0 0 3px rgba(186, 26, 26, 0.16); }
.status-pill[data-state="checking"] .status-pill__dot,
.status-pill[data-state="unknown"] .status-pill__dot { background: var(--warn); }

.navtoggle { display: none; flex-direction: column; gap: 5px; width: 42px; height: 42px;
  align-items: center; justify-content: center; background: var(--white);
  border: 1px solid var(--hairline); border-radius: var(--r); cursor: pointer; }
.navtoggle span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.2s var(--ease), opacity 0.2s var(--ease); }
.navtoggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navtoggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.navtoggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobilenav { display: none; flex-direction: column; gap: 0.4rem; padding: 0.5rem clamp(1rem, 0.4rem + 3vw, 3rem) 1.25rem; border-bottom: 1px solid var(--hairline); background: var(--surface); }
.mobilenav a:not(.btn) { padding: 0.7rem 0; font-weight: 500; color: var(--ink-soft); border-bottom: 1px solid var(--hairline); }
.mobilenav .btn { margin-top: 0.6rem; }

/* ---------- reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; transition: none; } }

/* ---------- hero ---------- */
.hero { padding-block: clamp(3rem, 1.6rem + 5vw, 6rem) clamp(3.5rem, 2rem + 5vw, 7rem); }
.hero__inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 1rem + 4vw, 4.5rem); align-items: center; }

.badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; font-weight: 600; color: var(--teal);
  background: var(--teal-c); border-radius: var(--r-pill);
  padding: 0.4rem 0.85rem; margin-bottom: 1.4rem;
}
.badge svg { color: var(--teal); }

.hero h1 { font-size: clamp(2.3rem, 1.5rem + 3.6vw, 3.5rem); font-weight: 700; letter-spacing: -0.025em; color: var(--primary); }
.hero__lede { margin-top: 1.4rem; max-width: 34rem; font-size: 1.13rem; line-height: 1.6; color: var(--ink-mute); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }

.hero__stats { display: flex; flex-wrap: wrap; gap: 2.25rem; margin-top: 2.75rem; padding-top: 2rem; border-top: 1px solid var(--hairline); }
.hero__stats dt { font-size: 0.8rem; font-weight: 500; color: var(--ink-mute); }
.hero__stats dd { margin: 0.25rem 0 0; display: flex; align-items: baseline; gap: 0.15rem; font-size: 2rem; font-weight: 700; color: var(--primary); letter-spacing: -0.02em; }
.hero__stats .unit { font-size: 1.3rem; }
.hero__stats small { display: block; width: 100%; margin-top: 0.1rem; font-size: 0.72rem; font-weight: 500; color: var(--ink-mute); }

.hero__art { position: relative; margin: 0; padding-top: 14px; }
.boundary--tilt {
  padding: 18px;
  transform-origin: 50% 0;
  transform: rotate(-2.4deg);
  animation: note-swing 4.6s ease-in-out infinite;
  will-change: transform;
}
.hero__art:hover .boundary--tilt { animation-play-state: paused; }
/* push-pin holding the verified audit note */
.hero__art::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  width: 19px;
  height: 19px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #74849f 0%, #3c4c6a 47%, #1f2b47 100%);
  box-shadow: 0 3px 7px rgba(15, 30, 60, 0.32), inset 0 1.5px 1.5px rgba(255, 255, 255, 0.55), inset 0 -2px 3px rgba(0, 0, 0, 0.28);
  z-index: 4;
}
.hero__art::after {
  content: "";
  position: absolute;
  top: 17px;
  left: 50%;
  width: 2px;
  height: 9px;
  transform: translateX(-50%);
  background: linear-gradient(#aab4c8, rgba(89, 105, 135, 0));
  z-index: 3;
}
@keyframes note-swing {
  0%, 100% { transform: rotate(-2.4deg); }
  50% { transform: rotate(2.4deg); }
}
@media (prefers-reduced-motion: reduce) {
  .boundary--tilt { animation: none; transform: rotate(-1.8deg); }
}
.hero__blob { position: absolute; border-radius: 50%; filter: blur(48px); z-index: -1; }
.hero__blob--a { width: 180px; height: 180px; top: -40px; right: -30px; background: rgba(124, 246, 231, 0.4); }
.hero__blob--b { width: 240px; height: 240px; bottom: -50px; left: -50px; background: rgba(0, 74, 153, 0.12); }
.hero__cap { margin-top: 1rem; font-size: 0.82rem; line-height: 1.5; color: var(--ink-mute); text-align: center; }

/* ---------- audit panel ---------- */
.panel { background: var(--white); border-radius: var(--r-md); overflow: hidden; }
.panel__head {
  display: flex; align-items: center; gap: 0.55rem;
  font-family: var(--mono); font-size: 0.78rem; color: var(--ink-mute);
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--hairline); background: var(--surface-low);
}
.panel__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px rgba(0, 106, 98, 0.16); }
.panel__log { margin: 0; padding: 1.1rem 1rem; overflow-x: auto; background: var(--white); }
.panel__log code { font-family: var(--mono); font-size: 0.78rem; line-height: 1.85; color: var(--ink-soft); white-space: pre; }
.panel__log .ln { color: var(--ink); font-weight: 600; }
.panel__log .ln--ok { color: var(--primary-c); }
.panel__log .ln--ai { color: var(--teal); }

.panel__seal { display: flex; align-items: center; gap: 0.7rem; padding: 0.85rem 1rem; border-top: 1px solid var(--hairline); background: var(--teal-c); }
.panel__seal-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 700; }
.panel__seal-text { font-weight: 700; color: var(--teal); font-size: 0.9rem; }
.panel__seal-text small { display: block; font-weight: 500; color: var(--on-secondary-container, #006f66); font-size: 0.72rem; }

.panel__foot { display: flex; flex-wrap: wrap; gap: 1rem; padding: 0.8rem 1rem; border-top: 1px solid var(--hairline); font-size: 0.74rem; color: var(--ink-mute); }
.panel__foot strong { color: var(--primary); font-size: 0.95rem; }

/* ---------- infrastructure ---------- */
.infra, .system { background: var(--surface-low); }
.infra__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 1rem + 3vw, 3.5rem); align-items: center; }

.infra__art { padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.stacks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.stack { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.85rem 0.75rem; border-radius: var(--r-md); background: var(--surface); border: 1px dashed var(--outline-soft); min-width: 0; }
.stack__label { font-family: var(--mono); font-size: 0.72rem; font-weight: 600; color: var(--primary); text-align: center; margin-bottom: 0.2rem; overflow-wrap: anywhere; }
.stack__layer { font-size: 0.78rem; font-weight: 600; text-align: center; padding: 0.55rem 0.4rem; border-radius: var(--r); overflow-wrap: anywhere; }
.stack__layer--app   { background: var(--primary-c); color: #fff; }
.stack__layer--db    { background: var(--primary-fixed); color: var(--primary); }
.stack__layer--store { background: var(--teal-c); color: var(--teal); }
.stacks__note { margin-top: 1.25rem; font-size: 0.82rem; text-align: center; color: var(--ink-mute); }

.featlist { display: grid; gap: 1rem; }
.feat { display: flex; gap: 1rem; padding: 1.25rem; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--hairline); transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease); }
.feat:hover { box-shadow: var(--sh-soft); transform: translateY(-2px); }
.feat__icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md); background: var(--primary-fixed); color: var(--primary-c); }
.feat h3 { font-size: 1.05rem; font-weight: 600; color: var(--primary); margin-bottom: 0.25rem; }
.feat p { font-size: 0.92rem; color: var(--ink-mute); }

/* ---------- workflow steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.step {
  position: relative; padding: 1.75rem; border-radius: var(--r-lg);
  background: var(--white); border: 1px solid var(--hairline);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.step:hover { border-color: var(--teal-dim); box-shadow: var(--sh-soft); transform: translateY(-3px); }
.step__num { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md); background: var(--primary); color: #fff; font-weight: 700; font-size: 1.05rem; margin-bottom: 1.1rem; transition: background 0.2s var(--ease); }
.step:hover .step__num { background: var(--teal); }
.step h3 { font-size: 1.08rem; font-weight: 600; color: var(--primary); margin-bottom: 0.45rem; }
.step p { font-size: 0.92rem; color: var(--ink-mute); }

/* ---------- gateway (dark) ---------- */
.gateway { background: var(--primary); color: var(--on-primary); position: relative; overflow: hidden; }
.gateway::before { content: ""; position: absolute; width: 460px; height: 460px; top: -160px; right: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(124, 246, 231, 0.16), transparent 70%); }
.gateway__inner { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 1rem + 4vw, 4rem); align-items: center; }

.gateway__card { display: flex; gap: 1rem; margin-top: 2rem; padding: 1.4rem; border-radius: var(--r-lg); background: rgba(0, 74, 153, 0.4); border: 1px solid rgba(171, 199, 255, 0.22); backdrop-filter: blur(6px); }
.gateway__card-icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-md); background: rgba(124, 246, 231, 0.16); color: var(--teal-fixed); }
.gateway__card h3 { color: #fff; font-size: 1.05rem; margin-bottom: 0.3rem; }
.gateway__card p { font-size: 0.9rem; color: var(--primary-dim); }

.gateway__art { display: flex; flex-direction: column; gap: 1.25rem; }
.flow { display: flex; flex-direction: column; gap: 0; }
.flow-node {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 0.85rem;
  align-items: center; padding: 0.95rem 1.15rem; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(171, 199, 255, 0.18);
  opacity: 0.55; transition: opacity 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease), transform 0.4s var(--ease);
}
.flow-node.is-lit { opacity: 1; }
.flow-node__icon { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 50%; background: rgba(124, 246, 231, 0.14); position: relative; }
.flow-node__icon::before { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; background: var(--teal-fixed); -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat; }
.flow-node__icon[data-glyph="record"]  { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h16v3H4zM4 9h16v2H4zM4 13h11v2H4zM4 17h11v2H4z'/%3E%3C/svg%3E"); }
.flow-node__icon[data-glyph="gateway"] { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 3 6v6c0 5 3.8 8.4 9 10 5.2-1.6 9-5 9-10V6z'/%3E%3C/svg%3E"); }
.flow-node__icon[data-glyph="ai"]      { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2l1.8 4.7L18.5 8 14 10l-2 5-2-5L5.5 8 10.2 6.7z'/%3E%3C/svg%3E"); }
.flow-node__icon[data-glyph="approve"] { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E"); }
.flow-node__icon[data-glyph="commit"]  { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h13l3 3v13H4zM7 7v4h7V7z'/%3E%3C/svg%3E"); }
.flow-node__name { font-weight: 600; color: #fff; font-size: 0.95rem; }
.flow-node__sub { grid-column: 2; font-size: 0.78rem; color: var(--primary-dim); font-family: var(--mono); }
/* quiet destination marker: rests like the others, with a thin teal endpoint stripe */
.flow-node--commit { position: relative; }
.flow-node--commit::after {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px; width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--teal-dim);
}

/* a glow travels through the nodes, one stage every 1.5s, lighting then dimming.
   5 stages x 1.5s = 7.5s loop; animation-delay permanently phase-shifts each node. */
.flow.is-playing .flow-node {
  animation: nodeglow 7.5s var(--ease) infinite;
  animation-delay: calc(var(--n) * 1.5s);
}
@keyframes nodeglow {
  0%, 22%, 100% {
    opacity: 0.82;
    box-shadow: 0 0 0 1px rgba(124, 246, 231, 0.12), 0 0 9px rgba(124, 246, 231, 0.12);
  }
  8% {
    opacity: 1;
    box-shadow: 0 0 0 1px var(--teal-dim), 0 0 28px rgba(124, 246, 231, 0.55);
  }
}
.flow.is-playing .flow-node__icon { animation: iconglow 7.5s var(--ease) infinite; animation-delay: calc(var(--n) * 1.5s); }
@keyframes iconglow {
  0%, 22%, 100% { background: rgba(124, 246, 231, 0.18); }
  8% { background: rgba(124, 246, 231, 0.42); }
}

.flow-link { width: 2px; height: 18px; margin-left: calc(1.15rem + 17px); background: linear-gradient(var(--teal-dim), rgba(124, 246, 231, 0.2)); opacity: 0.45; }
/* each link lights half a stage after its source node, as the pulse crosses to the next */
.flow.is-playing .flow-link {
  animation: linkglow 7.5s var(--ease) infinite;
  animation-delay: calc((var(--n) + 0.5) * 1.5s);
}
@keyframes linkglow {
  0%, 28%, 100% { opacity: 0.35; box-shadow: 0 0 0 0 rgba(124, 246, 231, 0); }
  12% { opacity: 1; box-shadow: 0 0 12px rgba(124, 246, 231, 0.6); }
}

@media (prefers-reduced-motion: reduce) {
  .flow.is-playing .flow-node,
  .flow.is-playing .flow-node__icon,
  .flow.is-playing .flow-link { animation: none; }
}

.flow__cap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.25rem; font-size: 0.8rem; color: var(--primary-dim); }
.flow__cap-key { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-right: 0.1rem; }
.flow__cap-key--ai { background: var(--teal-fixed); }
.flow__cap-key--ok { background: var(--primary-dim); }

/* ---------- pharmacy safety ---------- */
.safety__inner { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 1rem + 3vw, 3.5rem); align-items: center; }
.pharm { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pharm__tile { padding: 1.1rem; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--hairline); box-shadow: var(--sh-card); }
.pharm__icon { display: inline-grid; place-items: center; margin-bottom: 0.6rem; }
.pharm__tile--stop .pharm__icon { color: var(--error); }
.pharm__tile--ok .pharm__icon { color: var(--teal); }
.pharm__label { font-size: 0.82rem; font-weight: 700; color: var(--ink); }
.pharm__meter { display: block; height: 4px; margin-top: 0.6rem; border-radius: var(--r-pill); }
.pharm__meter--stop { background: var(--error-c); }
.pharm__meter--ok { background: var(--teal-c); }
.pharm__quote { grid-column: 1 / -1; padding: 1.2rem 1.3rem; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--hairline); border-left: 4px solid var(--teal); box-shadow: var(--sh-card); }
.pharm__quote-tag { display: inline-block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal); margin-bottom: 0.5rem; }
.pharm__quote p { font-size: 0.92rem; font-style: italic; color: var(--ink-soft); }

.checks { display: grid; gap: 0.65rem; margin-top: 1.75rem; }
.check { display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 1.1rem; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--hairline); font-size: 0.92rem; font-weight: 500; color: var(--ink); }
.check span { flex: none; min-width: 5.5rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.28rem 0.55rem; border-radius: var(--r); text-align: center; }
.check--stop span { background: var(--error-c); color: var(--error); }
.check--warn span { background: var(--warn-c); color: var(--warn); }
.check--ai span { background: var(--teal-c); color: var(--teal); }
.check--gate span { background: var(--primary-fixed); color: var(--primary-c); }

/* ---------- platform cards ---------- */
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.card { display: flex; flex-direction: column; transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease); }
.card:hover { box-shadow: var(--sh-lg); transform: translateY(-3px); }
.card__icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: var(--r-md); background: var(--primary-fixed); color: var(--primary-c); margin-bottom: 1.1rem; }
.card h3 { font-size: 1.12rem; font-weight: 600; color: var(--primary); margin-bottom: 0.5rem; }
.card p { font-size: 0.92rem; color: var(--ink-mute); flex-grow: 1; }
.card__more { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.1rem; font-weight: 600; font-size: 0.9rem; color: var(--teal); }
.card__more:hover { text-decoration: underline; }
.card__pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 106, 98, 0.4); } 50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(0, 106, 98, 0); } }
.card__chip { margin-top: 1.1rem; align-self: flex-start; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-mute); background: var(--surface-low); padding: 0.35rem 0.65rem; border-radius: var(--r); }
.card__swatches { display: flex; margin-top: 1.1rem; }
.card__swatches span { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--white); margin-left: -8px; }
.card__swatches span:first-child { margin-left: 0; background: var(--primary-c); }
.card__swatches span:nth-child(2) { background: var(--teal); }
.card__swatches span:nth-child(3) { background: var(--warn); }

/* ---------- status ---------- */
.status__frame { padding: 0; overflow: hidden; }
.status__bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--hairline); background: var(--surface-low); }
.status__live { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.status__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--outline-soft); }
.status__live[data-state="up"] .status__dot { background: var(--teal); box-shadow: 0 0 0 3px rgba(0, 106, 98, 0.18); }
.status__live[data-state="down"] .status__dot { background: var(--error); box-shadow: 0 0 0 3px rgba(186, 26, 26, 0.16); }
.status__live[data-state="checking"] .status__dot, .status__live[data-state="unknown"] .status__dot { background: var(--warn); }
.status__out { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; font-size: 0.85rem; color: var(--primary-c); }
.status__out:hover { text-decoration: underline; }
.status__fallback { padding: 1.5rem 1.25rem; font-size: 0.9rem; color: var(--ink-mute); }
.status__fallback a { color: var(--primary-c); font-weight: 600; }

.uptime { padding: 1.25rem; display: grid; gap: 1.1rem; }
.mon { display: grid; gap: 0.5rem; min-width: 0; }
.mon__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; min-width: 0; }
.mon__name { font-weight: 600; color: var(--ink); font-size: 0.95rem; min-width: 0; overflow-wrap: anywhere; }
.mon__pct { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-mute); }
.mon__pct[data-state="up"] { color: var(--teal); }
.mon__pct[data-state="down"] { color: var(--error); }
.mon__bars { display: flex; gap: 2px; height: 30px; }
.bar { flex: 1 1 0; min-width: 2px; border-radius: 2px; background: var(--surface-2); }
.bar--up { background: var(--teal); }
.bar--down { background: var(--error); }
.bar--warn { background: var(--warn); }
.bar--none { background: var(--surface-2); }
.mon__legend { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--ink-mute); }
.mon__legend strong[data-state="up"] { color: var(--teal); }
.mon__legend strong[data-state="down"] { color: var(--error); }
.uptime__legend { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; padding-top: 0.5rem; border-top: 1px solid var(--hairline); font-size: 0.74rem; color: var(--ink-mute); }
.uptime__legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 0.3rem; }
.uptime__legend .k-up { background: var(--teal); }
.uptime__legend .k-down { background: var(--error); }
.uptime__legend .k-none { background: var(--surface-2); }

/* ---------- final CTA ---------- */
.cta { padding-block: var(--section-y); background: var(--surface-high); }
.cta__inner { max-width: 46rem; margin-inline: auto; text-align: center; }
.cta h2 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.7rem); font-weight: 700; color: var(--primary); }
.cta p { margin-top: 1rem; font-size: 1.075rem; color: var(--ink-mute); }
.cta__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; justify-content: center; margin-top: 2rem; }
.cta .btn--invert { background: var(--primary-c); color: #fff; }
.cta .btn--invert:hover { background: var(--primary); }
.cta .btn--ghost-invert { color: var(--primary); border-color: var(--outline-soft); }
.cta .btn--ghost-invert:hover { background: var(--white); border-color: var(--primary-c); }

/* ---------- footer ---------- */
.footer { background: var(--white); border-top: 1px solid var(--hairline); padding-block: 3rem 2rem; }
.footer__inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.footer__brand p { margin-top: 0.9rem; font-size: 0.88rem; color: var(--ink-mute); max-width: 18rem; }
.footer__col h4 { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--primary); margin-bottom: 0.9rem; }
.footer__col li { margin-bottom: 0.55rem; }
.footer__col a { font-size: 0.9rem; color: var(--ink-mute); }
.footer__col a:hover { color: var(--primary-c); text-decoration: underline; }
.footer__base { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--hairline); font-size: 0.82rem; color: var(--ink-mute); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .topnav { display: none; }
  .navtoggle { display: flex; }
  .mobilenav:not([hidden]) { display: flex; }
  .status-pill { display: none; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { order: -1; max-width: 32rem; }
  .infra__grid, .gateway__inner, .safety__inner { grid-template-columns: 1fr; }
  .safety__art { order: 2; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .cards3 { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  /* let stacked grid/flex children shrink instead of forcing horizontal overflow */
  .hero__inner > *, .infra__grid > *, .gateway__inner > *, .safety__inner > *,
  .featlist, .feat, .stacks { min-width: 0; }
  .boundary--tilt { min-width: 0; max-width: 100%; }
  .panel, .panel__log { min-width: 0; }
  .hero { overflow-x: clip; }
}

@media (max-width: 560px) {
  .topbar__inner { height: 64px; }
  .hero__stats { gap: 1.5rem; }
  .steps { grid-template-columns: 1fr; }
  .pharm { grid-template-columns: 1fr 1fr; }
  .footer__inner { grid-template-columns: 1fr; }
  .check span { min-width: 4.5rem; }
  /* 90-day uptime bars: thinner so the strip fits a phone instead of overflowing */
  .mon__bars { gap: 1px; }
  .bar { min-width: 1px; }
  /* tighten the isolated-stack diagram so layer words stay whole on narrow phones */
  .stacks { gap: 0.6rem; }
  .stack { padding: 0.7rem 0.45rem; }
  .stack__label { font-size: 0.66rem; }
  .stack__layer { font-size: 0.7rem; padding: 0.5rem 0.3rem; }
}
