/* Microheart — clinical instrument aesthetic
   Type: Schibsted Grotesk (display + body) · IBM Plex Mono (data, labels)
   Palette: cool paper, navy ink, single brand-blue accent (from the logo) */

/* ---------- Fonts (self-hosted) ---------- */

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/schibsted-grotesk-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/schibsted-grotesk-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/schibsted-grotesk-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

/* ---------- Tokens ---------- */

:root {
  --ink: #101828;
  --ink-2: #0c1322;
  --ink-3: #182238;
  --paper: #ffffff;
  --paper-2: #f5f7fa;
  --accent: #0060b1;
  --accent-deep: #004c8f;
  --accent-soft: #7ab3e8;
  --accent-wash: #eef4fb;
  --muted: #4c566b;
  --faint: #7d879c;
  --line: #e4e8ef;
  --line-strong: #c9d0dc;
  --chart-context: #8f9094;
  --wide: 1120px;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  --z-header: 10;
}

/* ---------- Base ---------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 400 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.inner {
  width: min(var(--wide), calc(100% - 3rem));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: #fff;
  border-radius: 4px;
  font-size: 0.85rem;
}

.skip-link:focus {
  left: 0.5rem;
  color: #fff;
}

/* Mono utility label — the site's structural voice */
.mono-label {
  margin: 0 0 1.1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.mono-label::before {
  content: "";
  display: inline-block;
  width: 1.4rem;
  height: 1px;
  background: var(--accent);
  vertical-align: 0.22em;
  margin-right: 0.65rem;
}

/* ---------- Header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.top.is-scrolled {
  border-bottom-color: var(--line);
}

.top .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand img {
  width: 38px;
  height: 30px;
  flex: none;
}

.brand-name {
  font-size: 1.14rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-name .co {
  color: var(--faint);
  font-weight: 400;
}

.top nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 1.6rem;
  font-size: 0.9rem;
}

.top nav a {
  color: var(--muted);
  font-weight: 500;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.top nav a:hover {
  color: var(--ink);
}

.top nav a.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.nav-cta {
  padding: 0.45rem 1rem !important;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink) !important;
  border-bottom-width: 1px !important;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.nav-cta:hover {
  border-color: var(--accent);
  background: var(--accent-wash);
}

/* ---------- Hero ---------- */

.hero {
  padding: 5.5rem 0 5.5rem;
}

.hero h1 {
  margin: 0 0 1.6rem;
  font-size: clamp(2.7rem, 6.2vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.04;
  max-width: 13.5em;
  text-wrap: balance;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.lede {
  margin: 0 0 2.3rem;
  max-width: 34em;
  font-size: 1.13rem;
  line-height: 1.7;
  color: var(--muted);
  text-wrap: pretty;
}

.lede strong {
  color: var(--ink);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.4rem;
}

.btn {
  display: inline-block;
  padding: 0.78rem 1.6rem;
  background: var(--ink);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.15s ease;
}

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

.btn:active {
  transform: translateY(1px);
}

.btn-quiet {
  font-size: 0.95rem;
  font-weight: 500;
}

.btn-quiet::after {
  content: " \2192";
  display: inline-block;
  transition: transform 0.2s ease;
}

.btn-quiet:hover::after {
  transform: translateX(3px);
}

/* ---------- Stats band ---------- */

.strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  padding: 2.6rem 0;
}

.strip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 3rem;
}

.stat .num {
  font-family: var(--mono);
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.stat .num .unit {
  font-size: 0.5em;
  color: var(--faint);
  letter-spacing: 0;
}

.stat .lab {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 18em;
}

/* ---------- Sections ---------- */

.block {
  padding: 5.5rem 0 6rem;
}

.block.alt {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.display {
  margin: 0 0 2.25rem;
  font-size: clamp(1.9rem, 3.8vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  max-width: 17em;
  text-wrap: balance;
}

.block h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.block p {
  margin: 0 0 1rem;
  color: var(--muted);
  max-width: 40em;
}

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

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 3.5rem;
  margin-bottom: 3.5rem;
}

.two p {
  max-width: none;
  font-size: 0.98rem;
}

.small,
.foot {
  font-size: 0.8rem;
  color: var(--faint);
  line-height: 1.55;
}

.block p.small,
.block p.foot {
  color: var(--faint);
}

.intro {
  font-size: 1.12rem;
  max-width: 36em;
  text-wrap: pretty;
}

.block p.intro {
  margin-bottom: 3rem;
}

/* ---------- Survival chart ---------- */

.chart {
  margin: 0 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 1.75rem 2rem 1.9rem;
}

.chart-title {
  margin: 0 0 0.2rem;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.chart-sub {
  margin: 0 0 1.6rem;
  font-size: 0.82rem;
  color: var(--faint);
}

.chart-rows {
  display: grid;
  gap: 0.85rem;
}

.crow {
  display: grid;
  grid-template-columns: 9.5em 1fr;
  align-items: center;
  gap: 1.1rem;
}

.crow-name {
  font-size: 0.86rem;
  color: var(--muted);
  text-align: right;
  line-height: 1.3;
}

.crow-track {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-left: 1px solid var(--line-strong);
  padding-left: 2px;
  min-height: 22px;
}

.crow-area {
  flex: 1;
  min-width: 0;
}

.crow-bar {
  display: block;
  height: 18px;
  width: calc(var(--v) * 1%);
  background: var(--chart-context);
  border-radius: 0 4px 4px 0;
  transform-origin: left center;
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.2s ease;
}

.crow-val {
  flex: none;
  width: 3.2em;
}

.crow:hover .crow-bar {
  filter: brightness(1.12);
}

.crow:hover .crow-name {
  color: var(--ink);
}

.crow-val {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.crow.is-hl .crow-name {
  color: var(--ink);
  font-weight: 700;
}

.crow.is-hl .crow-bar {
  background: var(--accent);
}

.crow.is-hl .crow-val {
  color: var(--ink);
}

.js .chart:not(.is-in) .crow-bar {
  transform: scaleX(0);
}

.chart .crow:nth-child(2) .crow-bar { transition-delay: 0.07s; }
.chart .crow:nth-child(3) .crow-bar { transition-delay: 0.14s; }
.chart .crow:nth-child(4) .crow-bar { transition-delay: 0.21s; }
.chart .crow:nth-child(5) .crow-bar { transition-delay: 0.28s; }
.chart .crow:nth-child(6) .crow-bar { transition-delay: 0.35s; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Comparison table ---------- */

.compare-wrap {
  overflow-x: auto;
  margin-bottom: 3.5rem;
}

.simple {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.simple caption {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  caption-side: top;
  padding-bottom: 0.8rem;
}

.simple th,
.simple td {
  text-align: left;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.simple tbody tr:last-child th,
.simple tbody tr:last-child td {
  border-bottom: 0;
}

.simple thead th,
.simple thead td {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line-strong);
}

.simple thead th.col-echoph {
  color: var(--accent);
  box-shadow: inset 0 3px 0 var(--accent);
}

.simple tbody th {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  width: 20%;
}

.simple td {
  color: var(--muted);
  width: 40%;
}

.simple td.col-echoph {
  color: var(--ink);
  background: var(--accent-wash);
}

/* ---------- Care pathway ---------- */

.pathway {
  margin: 0 0 3.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 1.9rem 2rem 1.7rem;
}

.pathway-title {
  margin: 0 0 1.8rem;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.pathway-grid {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  row-gap: 1.1rem;
  align-items: center;
}

.pathway-key {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  line-height: 1.45;
}

.pathway-stages {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.stage-name {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.pathway-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  min-height: 22px;
  align-items: center;
}

.pathway-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--line-strong);
}

.tick {
  position: relative;
  height: 22px;
}

.tick-point {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px var(--paper);
}

.track-span {
  position: relative;
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
}

.track-span::before,
.track-span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--paper);
}

.track-span::before { left: -2px; }
.track-span::after { right: -2px; }

.pathway-note {
  margin: 1.6rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 44em;
}

/* ---------- Jobs ---------- */

.jobs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.job {
  border-top: 2px solid var(--ink);
  padding-top: 1.3rem;
}

.job-n {
  margin: 0 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.job p:last-child {
  font-size: 0.95rem;
  max-width: none;
}

/* ---------- Contact / footer (dark close) ---------- */

.contact-block {
  background: var(--ink-2);
  color: #cbd3e1;
  padding: 5.5rem 0 0;
}

.contact-block .mono-label {
  color: #6e7b94;
}

.contact-display {
  margin: 0 0 1.6rem;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: #f2f4f8;
  max-width: 18em;
  text-wrap: balance;
}

.mail-line {
  margin: 0 0 0.9rem;
}

.mail {
  font-family: var(--mono);
  font-size: clamp(1.1rem, 2.6vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--accent-soft);
  border-bottom: 1px solid rgba(122, 179, 232, 0.4);
  padding-bottom: 0.15rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.mail:hover {
  color: #fff;
  border-bottom-color: #fff;
}

.contact-block .small {
  color: #8a94a9;
}

.ecg-divider {
  margin-top: 4rem;
  height: 44px;
  overflow: hidden;
  opacity: 0.5;
}

.ecg-divider svg {
  width: 100%;
  height: 100%;
}

.foot-bar {
  border-top: 1px solid var(--ink-3);
  padding: 1.4rem 0 1.8rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: #6e7b94;
}

.foot-bar .inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.foot-bar a {
  color: #93a0b8;
}

.foot-bar a:hover {
  color: var(--accent-soft);
}

/* ---------- 404 ---------- */

.error-page {
  min-height: 70dvh;
  display: grid;
  place-content: center;
  text-align: left;
  padding: 4rem 0;
}

.error-code {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin: 0 0 1rem;
}

/* ---------- Scroll reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Reduced motion ---------- */

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

  .js .reveal,
  .crow-bar,
  .btn,
  .btn-quiet::after {
    transition: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .chart:not(.is-in) .crow-bar {
    transform: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero {
    padding: 3.5rem 0 3.5rem;
  }
}

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

  .inner {
    width: calc(100% - 2.25rem);
  }

  .block {
    padding: 3.5rem 0 4rem;
  }

  .strip-grid,
  .two,
  .jobs {
    grid-template-columns: 1fr;
  }

  .top .inner {
    padding: 0.7rem 0;
  }

  .brand img {
    width: 30px;
    height: 24px;
  }

  .brand-name {
    font-size: 1rem;
  }

  .brand-name .co {
    display: none;
  }

  .top nav {
    gap: 0.3rem 0.8rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .nav-cta {
    padding: 0 !important;
    border: 0;
    border-radius: 0;
    color: var(--accent) !important;
  }

  .nav-cta:hover {
    background: transparent;
  }

  .chart {
    padding: 1.4rem 1.1rem 1.5rem;
  }

  .crow {
    grid-template-columns: 7.5em 1fr;
    gap: 0.7rem;
  }

  .crow-name {
    font-size: 0.78rem;
  }

  .pathway {
    padding: 1.5rem 1.1rem 1.4rem;
  }

  .pathway-grid {
    grid-template-columns: 1fr;
    row-gap: 0.55rem;
  }

  .pathway-key:empty {
    display: none;
  }

  .pathway-key {
    margin-top: 0.8rem;
  }

  .pathway-key br {
    display: none;
  }

  .stage-name {
    font-size: 0.54rem;
    letter-spacing: 0.04em;
  }

  .compare-wrap .simple {
    min-width: 540px;
  }

  .simple thead th,
  .simple thead td,
  .simple td,
  .simple tbody th {
    padding: 0.7rem 0.75rem;
  }
}
