/*
 * Prime Longevity website. The app's house look (SPEC.md section 3, src/theme/tokens.ts): ink on white, cold blues,
 * Poppins 800 display with negative tracking, Space Mono uppercase labels, hexagons and bonds. No motion.
 * Fonts are self-hosted (SIL Open Font License, see /assets/fonts/OFL-*.txt).
 */

@font-face {
  font-family: 'Poppins';
  src: url('/assets/fonts/Poppins_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('/assets/fonts/Poppins_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('/assets/fonts/Poppins_800ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Mono';
  src: url('/assets/fonts/SpaceMono_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Mono';
  src: url('/assets/fonts/SpaceMono_700Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------ tokens (light) */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --wash: #f6f8fb;
  --surface: #ffffff;
  --text: #0b0b0c;
  --muted: #46505f;
  --subtle: rgba(11, 11, 12, 0.62);
  --ink-blue: #2a52be;
  --lit: #7ab8ff;
  --blue: #4a90e2;
  --navy: #1f3a5f;
  --border: rgba(42, 82, 190, 0.16);
  --border-strong: rgba(42, 82, 190, 0.3);
  --rule: rgba(42, 82, 190, 0.3);
  --grid-line: rgba(42, 82, 190, 0.05);
  --watermark: rgba(42, 82, 190, 0.07);
  --shadow: 0 1px 2px rgba(11, 20, 40, 0.04), 0 4px 16px rgba(11, 20, 40, 0.05);
  --display: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'Space Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --gutter: 16px;
  --max: 1120px;
}

/* ------------------------------------------------------------ tokens (dark) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --wash: #17191e;
    --surface: #17191e;
    --text: #ffffff;
    --muted: #bfc5c9;
    --subtle: rgba(255, 255, 255, 0.62);
    --ink-blue: #7ab8ff;
    --border: rgba(122, 184, 255, 0.16);
    --border-strong: rgba(122, 184, 255, 0.3);
    --rule: rgba(122, 184, 255, 0.3);
    --grid-line: transparent;
    --watermark: transparent;
    --shadow: none;
  }
}

/* ------------------------------------------------------------ base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--muted);
  font-family: var(--display);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img,
svg {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
h1,
h2,
h3 {
  color: var(--text);
  font-family: var(--display);
  font-weight: 800;
  margin: 0;
}
p {
  margin: 0 0 1em;
}
strong {
  color: var(--text);
  font-weight: 600;
}
a {
  color: var(--ink-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 2px solid var(--ink-blue);
  outline-offset: 3px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
@media (min-width: 768px) {
  :root {
    --gutter: 32px;
  }
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  background: var(--bg);
  color: var(--ink-blue);
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.skip:focus {
  top: 12px;
}

/* the mono label: Space Mono Bold caps with wide tracking, in solid ink-blue so it reads at 4.5:1 */
.mono {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-blue);
}
.annotation {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.6;
  color: var(--subtle);
}

/* ------------------------------------------------------------ header */
.site-header {
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  width: 22px;
  height: 24px;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-block;
  padding: 6px 0;
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ------------------------------------------------------------ hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 56px 0 64px;
}
/* engineering paper, faded out with a mask; invisible in dark (the token is transparent) */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 20%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse at 70% 20%, #000 0%, transparent 70%);
  pointer-events: none;
}
.hero .watermark {
  position: absolute;
  top: -70px;
  right: -90px;
  width: 340px;
  height: 340px;
  pointer-events: none;
}
.hero .watermark path {
  fill: none;
  stroke: var(--watermark);
  stroke-width: 1.5;
}
.hero .wrap {
  position: relative;
}
/* the hero label stays on one line at 320 px: below 360 px it tracks a little tighter */
@media (max-width: 359px) {
  .hero .wrap > .mono:first-child {
    letter-spacing: 0.08em;
  }
}
.hero h1 {
  font-size: clamp(38px, 10.5vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 11ch;
  margin: 16px 0 20px;
}
.hero .subline {
  color: var(--text);
  font-size: clamp(18px, 4.6vw, 22px);
  line-height: 1.45;
  max-width: 32ch;
  margin-bottom: 20px;
}
.hero .lead {
  max-width: 54ch;
  margin-bottom: 28px;
}
.status {
  display: inline-block;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--bg);
}

/* the four parts as a chain of hexagons joined by bonds */
.chain {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 0;
  max-width: 720px;
}
.chain li {
  position: relative;
}
.chain li:nth-child(odd)::after {
  content: '';
  position: absolute;
  top: 27px;
  left: calc(50% + 30px);
  width: calc(100% - 60px);
  height: 1px;
  background: var(--rule);
}
.chain a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  text-align: center;
  padding: 0 4px 4px;
}
.chain a:hover .hexnode path {
  stroke-width: 2;
}
.hexnode {
  position: relative;
  width: 50px;
  height: 56px;
}
.hexnode svg {
  width: 50px;
  height: 56px;
}
.hexnode path {
  fill: var(--bg);
  stroke: var(--ink-blue);
  stroke-width: 1.5;
}
.hexnode span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
@media (min-width: 600px) {
  .chain {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .chain li:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 27px;
    left: calc(50% + 30px);
    width: calc(100% - 60px);
    height: 1px;
    background: var(--rule);
  }
}

/* ------------------------------------------------------------ seam (registration mark between chapters) */
.seam {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto;
  width: 76%;
  max-width: 760px;
}
.seam::before,
.seam::after {
  content: '';
  flex: 1;
  height: 1px;
}
.seam::before {
  background: linear-gradient(90deg, transparent, var(--rule));
}
.seam::after {
  background: linear-gradient(90deg, var(--rule), transparent);
}
.seam svg {
  width: 13px;
  height: 13px;
  flex: none;
}
.seam path {
  fill: var(--bg);
  stroke: var(--ink-blue);
  stroke-opacity: 0.6;
  stroke-width: 1.7;
}

/* ------------------------------------------------------------ parts */
.part {
  padding: 64px 0;
  scroll-margin-top: 16px;
}
.part + .part {
  border-top: 1px solid var(--border);
}
.part .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}
.part h2,
.section h2 {
  font-size: clamp(30px, 7.6vw, 48px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  margin: 10px 0 20px;
  max-width: 16ch;
}
.lines {
  list-style: none;
  margin: 0 0 20px;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--rule);
  max-width: 56ch;
}
.lines li + li {
  margin-top: 10px;
}
.note {
  max-width: 56ch;
}
.shot {
  margin: 0;
  justify-self: center;
  width: 100%;
  max-width: 280px;
}
.shot img {
  width: 100%;
  border-radius: 28px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  background: #ffffff;
}
.shot figcaption {
  margin-top: 14px;
}
@media (min-width: 860px) {
  .part .wrap {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 64px;
  }
  .shot {
    max-width: 300px;
  }
}

/* the comparison diagram: two hexagons joined by one bond */
.compare {
  justify-self: center;
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 20px 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.compare .pair {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.compare .node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 92px;
  text-align: center;
}
.compare .node svg {
  width: 64px;
  height: 72px;
}
.compare .node path {
  fill: none;
  stroke: var(--ink-blue);
  stroke-width: 1.5;
}
.compare .node.latest path {
  fill: var(--blue);
  fill-opacity: 0.12;
}
.compare .bond {
  flex: 1;
  height: 1px;
  margin-top: 36px;
  background: var(--rule);
}
.compare p {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ------------------------------------------------------------ sections on the wash */
.section {
  padding: 72px 0;
}
.section.wash {
  background: var(--wash);
}
.cards {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}
@media (min-width: 760px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: var(--shadow);
}
.card.accent {
  border-color: var(--border-strong);
}
.card h3 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 10px 0 16px;
}
.price {
  font-family: var(--display);
  font-weight: 800;
  color: var(--text);
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 10px 0 4px;
}
.price-alt {
  color: var(--text);
  margin-bottom: 16px;
}
.card .lines {
  margin-bottom: 16px;
}
.vector {
  margin-top: 16px;
}
.privacy-list {
  max-width: 64ch;
}
.closing {
  padding: 56px 0 64px;
}
.closing p {
  max-width: 64ch;
}

/* ------------------------------------------------------------ legal pages */
.doc {
  padding: 48px 0 72px;
}
.doc .wrap {
  max-width: 820px;
}
.doc h1 {
  font-size: clamp(34px, 9vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin: 12px 0 16px;
}
.doc h2 {
  font-size: clamp(22px, 5.6vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 48px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 16px;
}
.doc h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 28px 0 6px;
}
.doc h2 + h3 {
  margin-top: 0;
}
.doc .updated {
  margin-bottom: 32px;
}
.doc ul {
  list-style: none;
  margin: 0 0 1em;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--rule);
}
.doc ul li + li,
.doc ol li + li {
  margin-top: 8px;
}
.doc ol {
  margin: 0 0 1em;
  padding-left: 28px;
}
.doc ol li::marker {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--ink-blue);
}
.doc .byline {
  color: var(--text);
}
.toc {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 0 0 8px;
  background: var(--wash);
}
.toc ol {
  margin: 10px 0 0;
  padding-left: 28px;
}
.toc li + li {
  margin-top: 4px;
}
.aside {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* tables: real tables from 760 px; below that every row stacks into a card with its column names as labels */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 24px;
  font-size: 15px;
  line-height: 1.55;
}
.table th,
.table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--border);
}
.table thead th {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-blue);
  border-bottom: 1px solid var(--border-strong);
}
.table tbody th {
  color: var(--text);
  font-weight: 600;
}
@media (max-width: 759px) {
  .table,
  .table tbody,
  .table tr,
  .table th,
  .table td {
    display: block;
    width: 100%;
  }
  .table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .table tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--surface);
  }
  .table th,
  .table td {
    border: 0;
    padding: 0;
  }
  .table td {
    margin-top: 12px;
  }
  .table td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-blue);
    margin-bottom: 2px;
  }
}

/* ------------------------------------------------------------ footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 48px;
  font-size: 15px;
}
.site-footer .wrap {
  display: grid;
  gap: 28px;
}
@media (min-width: 760px) {
  .site-footer .wrap {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.site-footer address {
  font-style: normal;
}
.site-footer address p {
  margin: 0;
}
.site-footer .company {
  color: var(--text);
  font-weight: 600;
}
.site-footer ul {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.site-footer li + li {
  margin-top: 6px;
}
.site-footer .copy {
  grid-column: 1 / -1;
  margin: 0;
}

/* ------------------------------------------------------------ 404 */
.notfound {
  padding: 88px 0 104px;
}
.notfound h1 {
  font-size: clamp(36px, 10vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  margin: 12px 0 16px;
}
