/* ==========================================================================
   CURE8: site styles
   White base, black type, EXINI blue as the single accent.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --soft: #f5f5f3;
  --ink: #0b0b0c;
  --muted: #5c6066;
  --line: #e3e3df;
  --accent: #004769;   /* EXINI blue */

  --font: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --gutter: clamp(20px, 4vw, 56px);
  --section: clamp(72px, 10vw, 152px);
  --header-h: 68px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, figure, address { margin: 0; padding: 0; }
ul, ol { list-style: none; }
address { font-style: normal; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.container { width: 100%; max-width: 1360px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section--tight { padding-top: 0; }
.section--soft { background: var(--soft); }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 4px; }
.skip:focus { top: 12px; }

/* ---------- Type ---------- */
.label { font-size: 15px; font-weight: 500; color: var(--accent); }
.display {
  font-size: clamp(1.9rem, 3.6vw, 3.25rem);
  font-weight: 500; line-height: 1.08; letter-spacing: -.03em; text-wrap: balance;
}
.lede { font-size: clamp(1.05rem, 1.3vw, 1.2rem); line-height: 1.55; color: var(--muted); max-width: 34em; }
/* Running text is justified; headings stay left-aligned.
   The five study steps are too narrow to justify without large gaps. */
.lede, .hero__lede, .row__text, .integrations__list p, .footer__about p { text-align: justify; }
/* The feature columns are too narrow to justify cleanly, so their text is left-aligned and never hyphenated */
.section-head { display: grid; gap: 18px; max-width: 860px; margin-bottom: clamp(48px, 6vw, 88px); }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 50px; padding: 0 26px; border-radius: 999px;
  background: var(--ink); color: #fff;
  font-size: 15.5px; font-weight: 500; white-space: nowrap;
  transition: background .3s var(--ease);
}
.btn:hover { background: var(--accent); }
.btn--small { height: 38px; padding: 0 20px; font-size: 14.5px; }
.btn--large { height: 60px; padding: 0 34px; font-size: 17px; }

.link { font-size: 15.5px; font-weight: 500; color: var(--accent); padding: 12px 4px; }
.link span { display: inline-block; transition: transform .35s var(--ease); }
.link:hover span { transform: translateX(4px); }

/* ---------- Header ---------- */
.header { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h); }
/* The bar is a pseudo-element so its blur does not trap the fixed mobile menu */
.header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.header.is-scrolled::before, .header.is-open::before { border-bottom-color: var(--line); }
.header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: flex; align-items: center; gap: 16px; flex: none; }
.brand__cure8 { height: 22px; width: auto; }
.brand__sep { width: 1px; height: 22px; background: var(--line); }
.brand__exini { height: 15px; width: auto; }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 36px); font-size: 15px; }
.nav a:not(.btn) { color: var(--muted); transition: color .25s; }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--ink); }

.menu-toggle { display: none; align-items: center; gap: 12px; height: 44px; font-size: 15px; }
.menu-toggle__icon { position: relative; width: 22px; height: 10px; }
.menu-toggle__icon::before, .menu-toggle__icon::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
  transition: transform .35s var(--ease), top .35s var(--ease);
}
.menu-toggle__icon::before { top: 0; }
.menu-toggle__icon::after { top: 8.5px; }
.header.is-open .menu-toggle__icon::before { top: 4px; transform: rotate(45deg); }
.header.is-open .menu-toggle__icon::after { top: 4px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding-top: var(--header-h); }
.hero__inner {
  min-height: min(calc(100svh - var(--header-h)), 800px);
  display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  align-items: center; gap: clamp(24px, 4vw, 64px);
  padding-block: clamp(48px, 7vw, 96px);
}
.hero__text { display: grid; gap: clamp(22px, 2.4vw, 32px); justify-items: start; }
.hero__title {
  font-size: clamp(2.3rem, 4.2vw, 4rem);
  font-weight: 500; line-height: 1.05; letter-spacing: -.04em; text-wrap: balance;
}
.hero__title .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.hero__title .w > span { display: inline-block; }
.js .hero__title .w > span { transform: translateY(115%); transition: transform .9s var(--ease); transition-delay: calc(var(--i) * 40ms + 80ms); }
.js .hero__title.is-in .w > span { transform: none; }
.hero__lede { font-size: clamp(1.05rem, 1.35vw, 1.25rem); line-height: 1.5; color: var(--muted); max-width: 31em; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.hero__note { font-size: 15px; color: var(--muted); }
.hero__note span { margin-inline: 8px; color: #b3b4b0; }

/* Hero visual: scan images being organised and read (see js/main.js) */
.hero__visual { pointer-events: none; }
.hero-canvas { display: block; width: 100%; height: min(70vh, 580px); }

/* ---------- Inner page hero ---------- */
.page-hero { padding-top: var(--header-h); }
.page-hero__inner { padding-block: clamp(64px, 9vw, 128px) clamp(56px, 7vw, 104px); }
.page-hero__inner--split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.page-hero__text { display: grid; gap: clamp(20px, 2.2vw, 28px); justify-items: start; max-width: 880px; }

/* Multi-site transfer animation (Clinical Trials, see js/main.js) */
.page-hero__visual { pointer-events: none; }
.trial-canvas { display: block; width: 100%; height: min(54vh, 440px); }

/* Code sample (Developers) */
.code {
  margin: 0; padding: 28px 32px; overflow-x: auto; border-radius: 8px;
  background: var(--ink); color: #e6e6e2;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14.5px; line-height: 1.8;
}
.code code { font: inherit; display: block; }
.code span { display: block; white-space: pre; }
.code b { font-weight: 400; color: #6fd0ff; }
.code span { min-height: 1.8em; }
.code code { transition: opacity .4s var(--ease); }
.code .is-typing::after {
  content: ""; display: inline-block; width: .55em; height: 1.1em; margin-left: 2px;
  vertical-align: -.18em; background: #6fd0ff;
}
.api-demo { display: grid; }
.api-canvas { display: block; width: 100%; height: 130px; }

/* Two-column facts table (Clinical Trials) */
.spec { margin: 0; border-top: 1px solid var(--ink); }
.spec > div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 8px 32px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.spec dt { font-weight: 500; }
.spec dd { margin: 0; color: var(--muted); text-align: justify; }

/* ---------- Three ways in ---------- */
.rows { border-top: 1px solid var(--line); }
.rows li { border-bottom: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 5fr) 170px;
  align-items: start; gap: 16px clamp(24px, 4vw, 64px);
  padding: clamp(28px, 3.4vw, 48px) 0;
}
.row__title { font-size: clamp(1.5rem, 2.5vw, 2.25rem); font-weight: 500; line-height: 1.1; letter-spacing: -.03em; transition: color .3s; }
.row__text { color: var(--muted); max-width: 32em; padding-top: .3em; }
.row__link { font-size: 15.5px; font-weight: 500; color: var(--accent); white-space: nowrap; text-align: right; padding-top: .55em; }
.row__link span { display: inline-block; transition: transform .35s var(--ease); }
.row:hover .row__title { color: var(--accent); }
.row:hover .row__link span { transform: translateX(5px); }

/* ---------- On the record ---------- */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.split__text { display: grid; gap: 20px; }

.features {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px clamp(20px, 2.4vw, 40px); margin-top: clamp(56px, 7vw, 104px);
}
.features--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
.split--top { align-items: start; }
/* Each column shares the row tracks of the grid (subgrid), so every heading
   takes the height of the tallest one and all paragraphs start on the same line */
.features li {
  border-top: 1px solid var(--ink); padding-top: 20px;
  display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 10px; align-content: start;
}
.features h3 { font-size: 1.2rem; font-weight: 500; line-height: 1.2; letter-spacing: -.015em; }
.features p { color: var(--muted); font-size: 16px; }

/* ---------- Image placeholders ---------- */
.ph {
  position: relative; display: grid; place-items: center; overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--soft); border: 1px solid var(--line); border-radius: 6px;
}
.ph--wide { aspect-ratio: 16 / 10; }
.ph figcaption { text-align: center; font-size: 14.5px; line-height: 1.5; color: var(--muted); padding: 16px; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- How a study runs: layers that stack on scroll ---------- */
.stack { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.stack__head { position: sticky; top: calc(var(--header-h) + 48px); display: grid; gap: 18px; }
.stack__layers { --top: calc(var(--header-h) + 48px); }
.layer {
  position: sticky; top: calc(var(--top) + var(--i) * 16px);   /* each layer stops a little lower, so the ones beneath stay visible */
  height: 320px; margin-bottom: 28px;
  display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 24px; align-items: center;
  padding: 36px 40px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 -12px 32px rgba(11, 11, 12, .05);
}
.layer:last-child { margin-bottom: 0; }
.layer__text { display: grid; gap: 12px; align-content: start; }
.layer h3 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); font-weight: 500; line-height: 1.12; letter-spacing: -.025em; }
.layer__text p:not(.label) { color: var(--muted); max-width: 26em; }
.layer svg { display: block; width: 100%; height: auto; }
.layer svg rect { fill: none; stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.layer svg .is-sheet { fill: #fff; }
.layer svg .is-ink { fill: var(--ink); }
.layer svg .is-accent { fill: var(--accent); stroke: var(--accent); }
.layer svg .is-page { fill: #fff; stroke: #a9aba8; }

/* ---------- Integrations ---------- */
.integrations { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.integrations__list { border-top: 1px solid var(--line); }
.integrations__list li { display: grid; gap: 6px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.integrations__list h3 { font-size: clamp(1.15rem, 1.5vw, 1.35rem); font-weight: 500; line-height: 1.2; letter-spacing: -.02em; }
.integrations__list p { color: var(--muted); font-size: 16px; }
.integrations__image { position: sticky; top: calc(var(--header-h) + 32px); }

/* ---------- CTA ---------- */
.cta { border-top: 1px solid var(--line); }
.cta__inner { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px 48px; }
.cta__text { display: grid; gap: 20px; max-width: 800px; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #fff; padding: clamp(56px, 7vw, 96px) 0 28px; font-size: 15.5px; }
.footer__grid { display: grid; grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2fr)); gap: 40px clamp(24px, 4vw, 64px); }
.footer__about { display: grid; gap: 20px; align-content: start; }
.footer__about img { height: 24px; width: auto; }
.footer__about p, .footer address { color: rgba(255, 255, 255, .62); max-width: 24em; line-height: 1.6; }
.footer h2 { font-size: 15.5px; font-weight: 400; color: rgba(255, 255, 255, .5); margin-bottom: 14px; }
.footer ul { display: grid; gap: 8px; }
.footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer__legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  margin-top: clamp(48px, 6vw, 88px); padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: 14px; color: rgba(255, 255, 255, .5);
}

/* ---------- Reveal on scroll ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  body { font-size: 16.5px; }

  .menu-toggle { display: inline-flex; }
  .nav {
    position: fixed; inset: var(--header-h) 0 0 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 32px; overflow-y: auto; background: var(--bg);
    font-size: 1.6rem; letter-spacing: -.025em;
    opacity: 0; visibility: hidden;
    transition: opacity .3s var(--ease), visibility 0s .3s;
  }
  .header.is-open .nav { opacity: 1; visibility: visible; transition-delay: 0s; }
  .nav a:not(.btn) { padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
  .nav .btn { margin-top: 28px; height: 54px; font-size: 17px; letter-spacing: 0; }

  .hero__inner { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-bottom: 24px; }
  .hero-canvas { height: 400px; }
  .trial-canvas { height: 340px; }

  .row { grid-template-columns: minmax(0, 1fr); }
  .row__text { padding-top: 0; }
  .row__link { text-align: left; padding-top: 0; }

  .split, .integrations, .page-hero__inner--split { grid-template-columns: minmax(0, 1fr); }
  .features--3 { grid-template-columns: minmax(0, 1fr); }
  .integrations__image { position: static; order: -1; }

  /* Study layers: the title pins above the layers instead of beside them */
  .stack { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .stack__head { top: var(--header-h); z-index: 3; background: var(--soft); padding: 20px 0 24px; gap: 12px; }
  .stack__layers { --top: calc(var(--header-h) + var(--head-h, 160px)); }
  .layer { height: 290px; padding: 28px 32px; }

  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__about { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  /* kept short enough that a stacked layer is fully visible on a small phone */
  .layer { grid-template-columns: minmax(0, 1fr); height: 350px; align-content: center; gap: 20px; padding: 24px; }
  .layer svg { order: -1; width: 116px; }
  .brand { gap: 12px; }
  .brand__cure8 { height: 19px; }
  .brand__exini { height: 13px; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .cta__inner .btn { width: 100%; }
  .spec > div { grid-template-columns: minmax(0, 1fr); }
  /* phone columns are too narrow to justify without wide gaps between words */
  .lede, .hero__lede, .row__text, .features p, .integrations__list p, .footer__about p, .spec dd { text-align: left; }
  .code { padding: 22px 20px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js [data-reveal], .js .hero__title .w > span { opacity: 1; transform: none; }
}
