:root {
  color-scheme: light;
  --teal: #1f6f6b;
  --teal-deep: #12504d;
  --tagline: #9fd3cc;
  --status: #bfe0dc;
  --code-blue: #2d5da8;
  --amber: #c6862a;
  --discharged: #4c8c5c;
  --ink: #142b2a;
  --ink-soft: #5c7573;
  --hint: #9aadab;
  --bg: #edf2f1;
  --floor: #f4f7f6;
  --card: #ffffff;
  --line: #dce5e3;
  --line-strong: #c9d6d3;
  --teal-pale: #dceae8;
  --amber-pale: #f6ead4;
  --code-blue-pale: #e4ecf9;
  --discharged-pale: #e1f0e4;
  --muted: rgba(20, 43, 42, 0.68);
  --shadow: 0 28px 70px rgba(18, 80, 77, 0.18);
  --header-h: 4.5rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(220, 234, 232, 0.55), transparent 18rem),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(201, 214, 211, 0.28) 27px,
      rgba(201, 214, 211, 0.28) 28px
    ),
    var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  line-height: 1.55;
  font-weight: 400;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 40;
  padding: 0.65rem 1rem;
  background: var(--teal-deep);
  color: white;
  border-radius: 0.35rem;
}

.skip-link:focus {
  top: 1rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0.75rem;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1100px, calc(100% - 1.5rem));
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0.55rem 0.7rem 0.55rem 0.7rem;
  border: 1px solid rgba(220, 234, 232, 0.35);
  border-radius: 0.4rem;
  background: rgba(18, 80, 77, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(18, 80, 77, 0.28);
  color: var(--status);
  animation: header-in 700ms var(--ease-out) both;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.brand-mark {
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 0.35rem;
  overflow: hidden;
  background: var(--teal-deep);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(191, 224, 220, 0.2);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wordmark {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: white;
  white-space: nowrap;
}

.wordmark em {
  font-style: normal;
  color: var(--tagline);
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 1.35rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a {
  color: rgba(191, 224, 220, 0.88);
  transition: color 160ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: white;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 1rem;
  border-radius: 0.3rem;
  background: var(--tagline);
  color: var(--teal-deep);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Hero: one composition, brand first, full-bleed teal field */

.hero {
  position: relative;
  min-height: min(100vh, 54rem);
  display: grid;
  align-items: end;
  margin-top: -5.25rem;
  padding:
    calc(5.25rem + clamp(3rem, 8vw, 5rem))
    0
    clamp(3rem, 8vw, 5rem);
  overflow: hidden;
  color: white;
  background:
    radial-gradient(ellipse 70% 55% at 80% 20%, rgba(159, 211, 204, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 40% at 12% 70%, rgba(45, 93, 168, 0.2), transparent 50%),
    linear-gradient(165deg, #0e3f3c 0%, var(--teal-deep) 42%, #0a3533 100%);
}

.hero-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(191, 224, 220, 0.45) 1px, transparent 1px),
    linear-gradient(90deg, rgba(191, 224, 220, 0.45) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, black 30%, transparent 92%);
}

.hero-pulse {
  position: absolute;
  left: 8%;
  bottom: 18%;
  width: min(42vw, 22rem);
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--tagline), transparent);
  opacity: 0.55;
  animation: ekg 4.2s ease-in-out infinite;
}

.hero-stage {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 20rem);
  align-items: end;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  animation: rise-in 900ms var(--ease-out) 80ms both;
}

.hero-inner {
  position: relative;
  min-width: 0;
}

.chart-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.4rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tagline);
}

.chart-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--discharged);
  box-shadow: 0 0 0 0 rgba(76, 140, 92, 0.55);
  animation: pulse-dot 2.4s ease-out infinite;
}

.hero-brand {
  margin: 0 0 1.1rem;
  max-width: 12ch;
  font-size: clamp(3.2rem, 9vw, 5.6rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-weight: 700;
}

.hero-lede {
  margin: 0;
  max-width: 26ch;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  line-height: 1.4;
  font-weight: 400;
  color: rgba(191, 224, 220, 0.92);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.1rem;
}

.phone-wrap {
  position: relative;
  display: grid;
  place-items: end center;
  padding-bottom: 0.25rem;
}

.phone {
  width: min(100%, 18.5rem);
  border: 0.55rem solid #0a2f2d;
  border-radius: 1.65rem;
  background: #0a2f2d;
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(191, 224, 220, 0.15);
  overflow: hidden;
}

.phone-screenshot {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0 1.25rem;
  border-radius: 0.3rem;
  font-weight: 600;
  font-size: 0.98rem;
  transition:
    transform 180ms var(--ease-out),
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.button:not(a) {
  cursor: default;
}

a.button:hover,
a.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--tagline);
  color: var(--teal-deep);
}

.button-ghost {
  border: 1px solid rgba(191, 224, 220, 0.45);
  color: white;
  background: transparent;
}

a.button-ghost:hover,
a.button-ghost:focus-visible {
  border-color: var(--tagline);
  background: rgba(159, 211, 204, 0.1);
}

/* Sections */

.section {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 5.5rem) 0;
}

.section-head {
  max-width: 38rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.eyebrow {
  margin: 0 0 0.7rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
}

h2 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.85rem, 4.2vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--ink);
}

h3 {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--ink);
}

.section-lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 36rem;
}

p {
  margin-top: 0;
}

/* Protocol steps */

.protocol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line-strong);
}

.protocol-step {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 1rem 1.5rem;
  padding: 1.55rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.protocol-step p {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
}

.protocol-index {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--teal);
  letter-spacing: 0.04em;
  padding-top: 0.15rem;
}

/* Screenshot gallery */

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.shot {
  margin: 0;
  min-width: 0;
}

.shot-frame {
  border: 1px solid var(--line-strong);
  border-radius: 1.1rem;
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(18, 80, 77, 0.1);
}

.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.shot figcaption {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 0.15rem 0;
}

.shot strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.shot span {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Features: open list, not card grid chrome */

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line-strong);
}

.feature {
  padding: 1.5rem 1.25rem 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.feature:nth-child(odd) {
  padding-right: 1.75rem;
  border-right: 1px solid var(--line);
}

.feature:nth-child(even) {
  padding-left: 1.75rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* Condition bands */

.band-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.band {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.25rem 1.2rem;
  border-left: 4px solid transparent;
  background: var(--card);
  box-shadow: 0 1px 0 var(--line);
}

.band.stable {
  border-left-color: var(--discharged);
  background: linear-gradient(90deg, var(--discharged-pale), var(--card) 55%);
}

.band.serious {
  border-left-color: var(--amber);
  background: linear-gradient(90deg, var(--amber-pale), var(--card) 55%);
}

.band.critical {
  border-left-color: var(--code-blue);
  background: linear-gradient(90deg, var(--code-blue-pale), var(--card) 55%);
}

.band-code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.band-note {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Close */

.close {
  text-align: left;
  padding-top: 0;
  padding-bottom: clamp(4rem, 10vw, 6.5rem);
}

.close .section-lede {
  margin-bottom: 1.75rem;
}

.close-label {
  color: var(--teal);
}

.close h2 {
  max-width: 18ch;
}

/* Footer */

.site-footer {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  padding: 1.75rem 0 2.5rem;
  border-top: 1px solid var(--line-strong);
  display: grid;
  gap: 1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

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

.footer-brand img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.3rem;
}

.footer-brand strong {
  display: block;
  font-size: 1rem;
}

.footer-brand span {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.footer-note {
  margin: 0;
  max-width: 36rem;
}

/* Motion */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes header-in {
  from {
    opacity: 0;
    transform: translateY(-0.6rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 140, 92, 0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(76, 140, 92, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 140, 92, 0);
  }
}

@keyframes ekg {
  0%,
  100% {
    transform: scaleX(0.35);
    opacity: 0.25;
  }
  40% {
    transform: scaleX(1);
    opacity: 0.65;
  }
  70% {
    transform: scaleX(0.7);
    opacity: 0.4;
  }
}

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

  .site-header,
  .hero-inner,
  .chart-dot,
  .hero-pulse {
    animation: none;
  }

  a.button:hover,
  a.button:focus-visible {
    transform: none;
  }
}

/* Responsive */

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }

  .hero-stage {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .phone-wrap {
    width: min(16rem, 72%);
    justify-self: center;
  }

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

  .feature-list {
    grid-template-columns: 1fr;
  }

  .feature:nth-child(odd),
  .feature:nth-child(even) {
    padding-left: 0;
    padding-right: 0;
    border-right: none;
  }

  .band-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .protocol-step {
    grid-template-columns: 3rem minmax(0, 1fr);
    gap: 0.75rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .header-cta {
    display: none;
  }

  .screenshot-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
  }
}
