:root {
  --paper: #f7f3eb;
  --paper-deep: #eee8dd;
  --surface: #fffdfa;
  --ink: #181716;
  --muted: #625f59;
  --line: #d9d2c7;
  --accent: #e54b27;
  --accent-deep: #bd2f16;
  --magenta: #c10967;
  --development: #5f43b2;
  --wrap: 1360px;
  --prose: 680px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  margin: 0;
  background:
    linear-gradient(rgba(24, 23, 22, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 23, 22, .028) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a {
  color: var(--accent-deep);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}
a:hover { color: var(--magenta); }
button { font: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.035em; }
h1 { font-size: clamp(3rem, 4vw, 4.2rem); max-width: 15ch; margin-bottom: 26px; }
h2 { font-size: clamp(2.15rem, 4vw, 4rem); max-width: 18ch; margin-bottom: 22px; }
h3 { font-size: 1.15rem; margin-bottom: 8px; }
strong { font-weight: 750; }

.public-wrap {
  width: min(var(--wrap), calc(100% - 64px));
  margin-inline: auto;
}

.site-header {
  width: min(var(--wrap), calc(100% - 64px));
  min-height: 88px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 34px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -.04em;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand img { width: 42px; height: 42px; border-radius: 50%; }
.site-nav,
.site-actions {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 34px);
}
.site-nav { justify-self: center; }
.site-actions { justify-self: end; }
.site-nav a,
.site-actions a {
  color: var(--ink);
  font-size: .93rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.site-actions a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}
.site-actions .github-link { color: var(--accent); }
.site-nav a:hover,
.site-actions a:hover { color: var(--magenta); }
.language-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 8px 0;
  font-size: .88rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.language-toggle:hover { color: var(--magenta); }

.hero {
  min-height: 460px;
  padding-block: 44px 48px;
  display: grid;
  grid-template-columns: minmax(0, .87fr) minmax(560px, 1.13fr);
  align-items: start;
  gap: clamp(42px, 7vw, 108px);
}
.hero-copy { min-width: 0; }
.hero-lead {
  max-width: 660px;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.35vw, 1.28rem);
  line-height: 1.5;
  margin-bottom: 22px;
}
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 30px 52px;
  margin-bottom: 28px;
}
.hero-links a {
  font-size: 1.25rem;
  font-weight: 750;
}
.hero-proof {
  max-width: 570px;
  padding-top: 16px;
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--accent), var(--magenta)) 1;
  font-family: "IBM Plex Mono", monospace;
  font-size: .88rem;
  line-height: 1.55;
}
.hero-tagline {
  margin: -8px 0 18px;
  color: var(--accent-deep);
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -.02em;
}
.product-proof {
  width: 100%;
  max-width: 680px;
  min-width: 0;
  margin: 0;
  justify-self: end;
  /* Named container so constellation.css can size the hero diagram off its
     own rendered width (680–980px depending on breakpoint) instead of the
     viewport — the two aren't proportional once the hero grid collapses. */
  container-type: inline-size;
  container-name: consthero;
}
.product-proof figcaption {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: .76rem;
}

.system-section,
.invitations-section,
.partner-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 250, .58);
}
.system-section .public-wrap { padding-block: 74px 68px; }
.section-intro { max-width: var(--prose); margin-bottom: 48px; }
.section-intro p {
  color: var(--muted);
  font-size: 1.1rem;
}
.system-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.system-flow li {
  position: relative;
  min-width: 0;
  padding: 24px 36px 10px 0;
}
.system-flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 36px;
  right: 20px;
  width: 52px;
  border-top: 1px solid var(--ink);
}
.flow-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 44px;
}
.flow-icon { width: 24px; height: 24px; flex: none; }
.flow-number {
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: .8rem;
  font-weight: 500;
}
.system-flow p { color: var(--muted); font-size: .94rem; margin-bottom: 0; }
.clinician-line {
  width: fit-content;
  margin: 48px 0 0 auto;
  padding-bottom: 4px;
  border-bottom: 3px solid var(--magenta);
  font-size: 1.3rem;
  font-weight: 800;
}

.status-section,
.roadmap-section {
  padding-block: 96px;
}
.status-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(52px, 7vw, 120px);
}
.status-columns article { min-width: 0; }
.status-columns article > p { color: var(--muted); max-width: 610px; }
.status-tag,
.roadmap-state {
  display: inline-block;
  width: fit-content;
  margin-bottom: 18px;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--surface);
  font-family: "IBM Plex Mono", monospace;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .02em;
}
.status-working { background: var(--accent-deep); }
.status-development { background: var(--development); }
.status-columns ul {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
}
.status-columns li {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.status-columns li:last-child { border-bottom: 0; }
.safety-note {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 3px solid var(--magenta);
  color: var(--ink) !important;
  font-weight: 750;
}

.invitations-section .public-wrap { padding-block: 88px; }

/* Roadmap Kanban */
.kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 3.5vw, 44px);
  align-items: start;
  margin-top: 8px;
}
.kanban-column { min-width: 0; }
.kanban-column h3 {
  padding-top: 16px;
  margin-bottom: 6px;
  border-top: 3px solid var(--accent-deep);
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.02em;
}
.kanban-column--prototyped h3 { border-top-color: var(--development); }
.kanban-column--planned h3 { border-top-color: var(--muted); }
.kanban-subtitle {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
}
.kanban-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kanban-cards li {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.kanban-cards h4 {
  margin: 0 0 4px;
  font-size: .96rem;
  font-weight: 750;
  letter-spacing: -.01em;
}
.kanban-cards p { margin: 0; color: var(--muted); font-size: .86rem; }

/* Roadmap stories (fully expanded inline story blocks, folded into #roadmap) */
.roadmap-stories {
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 6vw, 88px);
  margin-top: 56px;
}
.story-block {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.story-block--reverse .story-visual { order: 2; }
.story-icon { width: 28px; height: 28px; margin-bottom: 14px; }
.story-text h3 {
  margin: 0 0 14px;
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -.01em;
}
.story-text p {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: .98rem;
  line-height: 1.6;
}
.story-facts {
  list-style: none;
  margin: 18px 0 20px;
  padding: 0;
  display: grid;
  gap: 9px;
}
.story-facts li {
  position: relative;
  padding-left: 22px;
  font-size: .92rem;
  color: var(--muted);
}
.story-facts li::before {
  content: "";
  position: absolute; left: 0; top: .5em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.story-permalink {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration-color: var(--line);
}
.story-permalink:hover { color: var(--accent-deep); text-decoration-color: currentColor; }

.story-visual { min-width: 0; }
.story-illustration {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}

/* Phone mockup — coded, not an image */
.phone-mockup {
  width: min(220px, 70%);
  margin-inline: auto;
  aspect-ratio: 9 / 18.5;
  background: var(--ink);
  border-radius: 28px;
  padding: 10px;
  box-shadow: 0 18px 40px -20px rgba(24,23,22,.45);
}
.phone-mockup__notch {
  width: 40%; height: 18px;
  margin: 0 auto 8px;
  background: var(--ink);
  border-radius: 0 0 12px 12px;
}
.phone-mockup__screen {
  background: var(--surface);
  border-radius: 18px;
  height: 100%;
  padding: 18px 14px;
}
.phone-mockup__search {
  display: flex; align-items: center;
  background: var(--paper-deep);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
}
.phone-mockup__cursor {
  display: inline-block;
  width: 2px; height: 1em;
  background: var(--accent);
  margin-left: 2px;
  animation: phoneBlink 1s step-end infinite;
}
@keyframes phoneBlink { 50% { opacity: 0; } }
.phone-mockup__result {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.phone-mockup__result strong { font-size: .94rem; }
.phone-mockup__result span:not(.phone-mockup__btn) { font-size: .76rem; color: var(--muted); }
.phone-mockup__btn {
  align-self: flex-start;
  margin-top: 8px;
  background: var(--accent);
  color: #fff;
  font-size: .76rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
}

@media (max-width: 760px) {
  .story-block, .story-block--reverse {
    grid-template-columns: 1fr;
  }
  .story-block--reverse .story-visual { order: 0; }
  .story-visual { margin-bottom: 8px; }
  .phone-mockup { width: min(200px, 60%); }
}

/* Blog post page */
.post-section { padding-block: 64px 96px; }
.post-section h1 { max-width: 18ch; }
.post-body { max-width: var(--prose); }
.post-body p { margin: 0 0 20px; color: var(--ink); }
.post-body p:last-child { margin-bottom: 0; }
.post-back { margin-top: 40px; }
.post-back a { font-weight: 700; }

/* Invitations */
.invite-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 56px);
  margin-top: 8px;
}
.invite-card { min-width: 0; }
.invite-icon { width: 30px; height: 30px; margin-bottom: 16px; }
.invite-card p { color: var(--muted); }
.invite-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 16px;
}
.invite-links a { font-weight: 700; }

.partner-section .public-wrap { padding-block: 88px; }
.partner-grid {
  display: grid;
  grid-template-columns: 1fr .72fr;
  align-items: end;
  gap: 80px;
}
.partner-grid p { color: var(--muted); max-width: 720px; font-size: 1.08rem; }
.partner-grid nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.partner-grid a { font-size: 1.15rem; font-weight: 750; }

:focus-visible {
  outline: 3px solid var(--magenta);
  outline-offset: 4px;
}

@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: auto 1fr;
    padding-block: 16px;
  }
  .site-nav { justify-self: end; }
  .site-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: flex-end;
    padding-top: 13px;
    border-top: 1px solid var(--line);
  }
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 64px;
  }
  .hero-copy { max-width: 820px; }
  .product-proof { max-width: 980px; justify-self: start; }
  .system-flow { grid-template-columns: 1fr 1fr; }
  .system-flow li:nth-child(2)::after { display: none; }
  .kanban { grid-template-columns: 1fr 1fr; }
  .kanban-column--planned { grid-column: 1 / -1; }
  .kanban-column--planned .kanban-cards { flex-direction: row; flex-wrap: wrap; }
  .kanban-column--planned .kanban-cards li { flex: 1 1 220px; }
  .invite-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .public-wrap,
  .site-header {
    width: min(100% - 34px, var(--wrap));
  }
  body { background-size: 20px 20px; }
  .site-header {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .site-nav,
  .site-actions {
    justify-self: stretch;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .site-actions { grid-column: auto; padding-top: 12px; }
  .hero {
    padding-block: 50px 56px;
    gap: 42px;
  }
  h1 { font-size: clamp(2.45rem, 11vw, 3.4rem); }
  h2 { font-size: clamp(2rem, 10vw, 3rem); }
  .hero-links { margin-bottom: 34px; }
  .system-section .public-wrap,
  .invitations-section .public-wrap,
  .partner-section .public-wrap,
  .status-section,
  .roadmap-section,
  .post-section { padding-block: 64px; }
  .system-flow,
  .status-columns,
  .partner-grid,
  .kanban,
  .invite-grid {
    grid-template-columns: 1fr;
  }
  .kanban-column--planned .kanban-cards { flex-direction: column; }
  .system-flow li {
    padding: 22px 0 26px;
    border-bottom: 1px solid var(--line);
  }
  .system-flow li::after { display: none; }
  .flow-head { margin-bottom: 18px; }
  .clinician-line { margin-left: 0; }
  .status-columns { gap: 64px; }
  .kanban { gap: 44px; }
  .roadmap-stories,
  .invite-grid { gap: 28px; }
  .partner-grid { gap: 44px; }
}

@media (max-width: 390px) {
  .public-wrap,
  .site-header { width: min(100% - 24px, var(--wrap)); }
  .hero-lead { font-size: 1.08rem; }
  .hero-links { gap: 18px 28px; }
  .kanban-cards li { padding: 18px; }
}

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