@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/GeistMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* PMX Health design system v2.0 tokens */
:root {
  --brand: #00625b;
  --brand-700: #003e3a;
  --brand-300: #9dcec6;
  --sage: #c9dfbb;
  --sand: #f8efe5;
  --sand-stroke: #e8e0d6;
  --page: #faf6f1;
  --card: #fcfcfd;
  --ink: #152319;
  --ink-2: #3e4a42;
  --ink-3: #838d86;
  --stroke: #e4e7ec;

  --font: "Geist", "Inter", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", monospace;

  --text-hero: clamp(2.6rem, 1.2rem + 5.2vw, 5.4rem);
  --text-h2: clamp(1.6rem, 1.1rem + 1.8vw, 2.4rem);
  --space-section: clamp(4rem, 2.5rem + 6vw, 8.5rem);
  --gutter: clamp(1.25rem, 0.5rem + 3vw, 3rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow-float: 0 1px 2px rgb(21 35 25 / 6%), 0 18px 40px -18px rgb(21 35 25 / 28%);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--brand);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--brand-700);
}
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--card);
  border-radius: 8px;
  z-index: 10;
}
.skip:focus {
  left: 0.5rem;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
}
.brand img {
  height: 41px;
  width: auto;
}
.header-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.55rem 1rem;
  border: 1px solid var(--sand-stroke);
  border-radius: 999px;
  transition: background-color 160ms, border-color 160ms;
}
.header-link:hover {
  color: var(--ink);
  background: var(--sand);
  border-color: var(--ink-3);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgb(0 98 91 / 14%);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 4rem) var(--gutter) var(--space-section);
}
h1 {
  margin: 0;
  font-size: var(--text-hero);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.035em;
}
h1 em {
  font-style: normal;
  color: var(--brand);
}
.lede {
  max-width: 34ch;
  margin: 1.5rem 0 2.25rem;
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
  color: var(--ink-2);
}

.download-card {
  max-width: 460px;
}
.btn-download {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.05rem 1.5rem;
  color: var(--card);
  background: var(--brand);
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: 0 1px 0 rgb(255 255 255 / 18%) inset, 0 14px 28px -14px rgb(0 62 58 / 70%);
  transition: transform 220ms var(--ease-out), background-color 160ms, box-shadow 220ms var(--ease-out);
}
.btn-download:hover {
  color: var(--card);
  background: var(--brand-700);
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgb(255 255 255 / 18%) inset, 0 20px 34px -14px rgb(0 62 58 / 75%);
}
.btn-download:active {
  transform: translateY(0) scale(0.99);
}
.btn-download svg {
  flex: none;
  padding: 9px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgb(255 255 255 / 14%);
}
.btn-download span {
  display: grid;
}
.btn-download strong {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.btn-download small {
  font-size: 0.82rem;
  color: var(--brand-300);
}

.release-meta {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1.1rem 0 0;
  padding: 0 0.25rem;
}
.release-meta div {
  min-width: 0;
}
.release-meta dt {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.release-meta dd {
  margin: 0.1rem 0 0;
  font-weight: 500;
  font-size: 0.92rem;
  white-space: nowrap;
}
.alt-store {
  margin: 1.25rem 0 0;
  padding: 0 0.25rem;
  font-size: 0.9rem;
  color: var(--ink-3);
}

.platform-note {
  display: none;
  max-width: 460px;
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  font-size: 0.92rem;
  color: var(--ink-2);
  background: var(--sand);
  border: 1px solid var(--sand-stroke);
  border-radius: 14px;
}
body[data-platform="ios"] .platform-ios {
  display: block;
}

/* Phone mock */
.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 560px;
}
.halo {
  position: absolute;
  inset: 8% 4% 6% 14%;
  border-radius: 46% 54% 42% 58% / 52% 44% 56% 48%;
  background: var(--sage);
  opacity: 0.7;
}
.phone {
  position: relative;
  width: 272px;
  padding: 11px;
  border-radius: 44px;
  background: var(--ink);
  box-shadow: 0 2px 0 #2b3a30 inset, 0 40px 70px -30px rgb(21 35 25 / 55%), 0 12px 24px -12px rgb(21 35 25 / 35%);
  transform: rotate(-4deg);
  animation: rise 900ms var(--ease-out) both;
}
.phone-screen {
  display: grid;
  gap: 12px;
  padding: 18px 16px 22px;
  border-radius: 34px;
  background: var(--page);
  overflow: hidden;
}
.ps-status {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
}
.ps-icons {
  width: 38px;
  height: 9px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--ink) 0 60%, transparent 60% 68%, var(--ink) 68%);
  opacity: 0.8;
}
.ps-hello {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--ink-3);
}
.ps-name {
  margin: -8px 0 4px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.ps-ring {
  position: relative;
  display: grid;
  place-items: center;
  padding: 10px 0;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--stroke);
}
.ps-ring svg {
  width: 112px;
  transform: rotate(-90deg);
}
.ps-ring circle {
  fill: none;
  stroke-width: 11;
  stroke-linecap: round;
}
.ring-bg {
  stroke: var(--sand);
}
.ring-fg {
  stroke: var(--brand);
  stroke-dasharray: 314;
  stroke-dashoffset: 88;
  animation: ring 1400ms 300ms var(--ease-out) both;
}
.ps-ring > div {
  position: absolute;
  display: grid;
  text-align: center;
}
.ps-ring b {
  font-size: 22px;
  letter-spacing: -0.02em;
}
.ps-ring span {
  font-size: 10px;
  color: var(--ink-3);
}
.ps-card {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--stroke);
}
.ps-card-teal {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--card);
}
.ps-label {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}
.ps-title {
  font-size: 14px;
  font-weight: 600;
}
.ps-sub {
  font-size: 11px;
  color: var(--brand-300);
}
.ps-bars {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}
.ps-bars i {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--sage);
}
.ps-bars i:nth-child(2) {
  background: var(--brand);
}

.qr-card {
  display: none;
  position: absolute;
  right: 0;
  bottom: 6%;
  align-items: center;
  gap: 0.9rem;
  width: 280px;
  padding: 0.9rem;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  box-shadow: var(--shadow-float);
  animation: rise 900ms 250ms var(--ease-out) both;
}
.qr-card img {
  flex: none;
  width: 92px;
  height: 92px;
  padding: 6px;
  background: #fff;
  border-radius: 10px;
}
.qr-card p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink-2);
}
.qr-card strong {
  display: block;
  color: var(--ink);
}
body[data-platform="desktop"] .qr-card {
  display: flex;
}

/* Steps */
.steps,
.details {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-section);
}
.section-head {
  max-width: 560px;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}
h2 {
  margin: 0;
  font-size: var(--text-h2);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.section-head p:last-child {
  margin: 1rem 0 0;
  color: var(--ink-2);
}
.step-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}
.step-list li {
  padding: 1.75rem clamp(1rem, 2.5vw, 2.25rem) 0 0;
}
.step-list li + li {
  padding-left: clamp(1rem, 2.5vw, 2.25rem);
  border-left: 1px solid var(--sand-stroke);
}
.num {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--brand);
}
.step-list h3 {
  margin: 0.9rem 0 0.5rem;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.step-list p {
  margin: 0;
  color: var(--ink-2);
}
.step-list b {
  font-weight: 600;
  color: var(--ink);
}

/* Details */
.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.details article {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: var(--radius-lg);
}
.whats-new {
  background: var(--ink);
  color: var(--card);
}
.whats-new .eyebrow {
  color: var(--brand-300);
}
.whats-new ul {
  display: grid;
  gap: 0.7rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.whats-new li {
  position: relative;
  padding-left: 1.4rem;
  color: rgb(252 252 253 / 82%);
}
.whats-new li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--sage);
}
.verify {
  background: var(--card);
  border: 1px solid var(--stroke);
}
.details:not(:has(.whats-new:not([hidden]))) .verify {
  grid-column: 1 / -1;
}
.verify > p:not(.eyebrow) {
  max-width: 46ch;
  margin: 1rem 0 0;
  color: var(--ink-2);
}
.checksum {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  background: var(--page);
  border: 1px solid var(--sand-stroke);
  border-radius: 12px;
}
.checksum-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-3);
}
.checksum code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.btn-copy {
  padding: 0.4rem 0.8rem;
  font: 500 0.8rem var(--font);
  color: var(--brand);
  background: transparent;
  border: 1px solid var(--brand-300);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 160ms;
}
.btn-copy:hover {
  background: rgb(0 98 91 / 8%);
}
.btn-copy[data-copied] {
  color: var(--card);
  background: var(--brand);
  border-color: var(--brand);
}

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem var(--gutter) 2.5rem;
  font-size: 0.85rem;
  color: var(--ink-3);
  border-top: 1px solid var(--sand-stroke);
}
.site-footer p {
  margin: 0;
}
.site-footer nav {
  display: flex;
  gap: 1.5rem;
}
.site-footer a {
  color: var(--ink-2);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--brand);
}

/* 404 */
.not-found {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-section) var(--gutter);
}
.not-found h1 {
  font-size: clamp(2.2rem, 1.4rem + 3vw, 3.6rem);
}
.not-found p {
  color: var(--ink-2);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px) rotate(-4deg);
  }
}
@keyframes ring {
  from {
    stroke-dashoffset: 314;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    min-height: 0;
    padding: 1rem 0 0;
  }
  .halo {
    inset: 6% 12% 4% 12%;
  }
  .phone {
    width: 236px;
  }
  .qr-card {
    position: relative;
    margin-top: 2rem;
    bottom: auto;
  }
  .step-list {
    grid-template-columns: 1fr;
  }
  .step-list li,
  .step-list li + li {
    padding: 1.5rem 0;
    border-left: 0;
  }
  .step-list li + li {
    border-top: 1px solid var(--sand-stroke);
  }
  .details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .release-meta {
    grid-template-columns: repeat(2, 1fr);
  }
}
