/* CellPatri — "Stain" design system
   Hematoxylin violet + eosin pink on a cool lavender-white.
   Headings: Bricolage Grotesque. Body: Atkinson Hyperlegible. */

@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-400.woff2") format("woff2");
  font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-700.woff2") format("woff2");
  font-weight: 700; font-display: swap; }

:root {
  --paper: #FBF9FC;
  --white: #FFFFFF;
  --tint: #F3E6EE;
  --tint-2: #ECE8F6;
  --hema: #2E2A6B;
  --hema-hover: #403A8F;
  --eosin: #C2185B;
  --ink: #1C1A2E;
  --muted: #5B5770;
  --line: #E4DCE8;
  --ok: #2F7D5B;
  --ok-bg: #E4F2EA;
  --warn: #8A5300;
  --warn-bg: #FBEFD9;
  --err: #B3261E;
  --err-bg: #FBE6E4;
  --focus: #C2185B;

  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.889rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.563rem;
  --step-3: 1.953rem;
  --step-4: clamp(2.2rem, 4.2vw, 3.6rem);

  --radius-s: 6px;
  --radius-m: 10px;
  --page: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
@media (max-width: 600px) { html { font-size: 106.25%; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--hema); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--eosin); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--tint); }

h1, h2, h3 { font-family: var(--display); color: var(--hema); line-height: 1.1; letter-spacing: -0.015em;
  margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: var(--step-4); letter-spacing: -0.025em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -0.005em; }
p { margin: 0 0 1em; max-width: 66ch; }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink); max-width: 38ch; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--hema); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 72px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--hema);
  font-family: var(--display); font-weight: 700; font-size: 1.35rem; letter-spacing: -0.02em; }
.brand svg { width: 30px; height: 30px; }
.nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink); font-size: var(--step--1); padding: 6px 0;
  border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--hema); border-bottom-color: var(--line); }
.nav a[aria-current="page"] { color: var(--hema); border-bottom-color: var(--eosin); }
.nav a.portal-link { border: 1.5px solid var(--hema); border-radius: var(--radius-s); padding: 6px 14px;
  color: var(--hema); font-weight: 700; }
.nav a.portal-link:hover { background: var(--hema); color: #fff; }
.nav a.portal-link[aria-current="page"] { background: var(--hema); color: #fff; }
@media (max-width: 640px) {
  .site-header .wrap { padding-top: 12px; padding-bottom: 12px; }
  .nav { width: 100%; justify-content: space-between; gap: 8px; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 var(--step-0)/1.2 var(--body); padding: 13px 22px; border-radius: var(--radius-s);
  border: 1.5px solid var(--hema); background: var(--hema); color: #fff; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--hema-hover); border-color: var(--hema-hover); color: #fff; }
.btn.secondary { background: transparent; color: var(--hema); }
.btn.secondary:hover { background: var(--tint-2); color: var(--hema); }
.btn.small { padding: 7px 12px; font-size: var(--step--1); }
.btn.danger { background: transparent; color: var(--err); border-color: transparent; }
.btn.danger:hover { background: var(--err-bg); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px 24px; flex-wrap: wrap; align-items: center; }
.text-link { font-weight: 700; color: var(--hema); text-decoration: underline; text-decoration-color: var(--eosin);
  text-decoration-thickness: 2px; text-underline-offset: 5px; }

/* ---------- sections ---------- */
section { padding: clamp(48px, 7vw, 88px) 0; }
section + section { border-top: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 40px; }

/* ---------- hero ---------- */
.hero { padding: clamp(40px, 6vw, 80px) 0 clamp(48px, 7vw, 96px); border-top: 0; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px);
  align-items: center; }
.hero h1 { max-width: 11ch; }
.hero .lede { margin-bottom: 28px; }
.umap { position: relative; }
.umap canvas { width: 100%; height: auto; aspect-ratio: 7 / 6; cursor: crosshair; }
.umap figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 8px; }
.umap-tip { position: absolute; pointer-events: none; background: var(--white); border: 1px solid var(--line);
  border-left: 4px solid var(--hema); border-radius: var(--radius-s); padding: 8px 12px; font-size: var(--step--1);
  line-height: 1.4; box-shadow: 0 6px 20px rgba(46, 42, 107, 0.12); opacity: 0; transition: opacity .12s;
  max-width: 240px; }
.umap-tip.show { opacity: 1; }
.umap-tip b { display: block; font-family: var(--display); color: var(--hema); font-size: 1rem; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero h1 { max-width: 14ch; }
}

/* ---------- send / receive ---------- */
.exchange { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line);
  border-radius: var(--radius-m); background: var(--white); overflow: hidden; }
.exchange > div { padding: clamp(24px, 3.5vw, 40px); }
.exchange > div + div { border-left: 1px solid var(--line); background: var(--tint); }
.exchange ul { margin: 0; padding-left: 1.1em; }
.exchange li { margin: 0 0 0.55em; }
.exchange li::marker { color: var(--eosin); }
@media (max-width: 760px) {
  .exchange { grid-template-columns: 1fr; }
  .exchange > div + div { border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- steps (a real sequence) ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 40px); counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: 56px; }
.steps li::before { content: counter(step); position: absolute; top: 0; left: 0; width: 40px; height: 40px;
  border-radius: 50%; background: var(--hema); color: #fff; font: 700 1.1rem/40px var(--display); text-align: center; }
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 20px; left: 52px; right: -12px;
  border-top: 2px dotted var(--line); }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .steps li::after { display: none; }
}

/* ---------- report preview ---------- */
.report { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 56px);
  align-items: start; }
.report figure { margin: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 16px; }
.report figure img { width: 100%; height: auto; }
.report figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 8px; }
.report dl { margin: 0; }
.report dt { font-family: var(--display); font-weight: 700; color: var(--hema); font-size: 1.05rem; margin-top: 18px; }
.report dt:first-child { margin-top: 0; }
.report dd { margin: 4px 0 0; }
@media (max-width: 860px) { .report { grid-template-columns: 1fr; } }

/* ---------- privacy band ---------- */
.privacy { background: var(--hema); color: #EDEBFA; }
.privacy h2 { color: #fff; }
.privacy a { color: #fff; }
.privacy-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: 32px; }
.privacy-grid h3 { color: #fff; font-size: 1.05rem; margin-bottom: 6px; }
.privacy-grid p { color: #D7D4F0; font-size: var(--step--1); }
@media (max-width: 860px) { .privacy-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .privacy-grid { grid-template-columns: 1fr; } }

.closing { background: var(--tint); padding: clamp(36px, 5vw, 56px) 0; }
.closing .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.closing h2 { margin: 0; }

/* ---------- services ---------- */
.page-head { padding: clamp(40px, 6vw, 72px) 0 clamp(24px, 4vw, 40px); border-top: 0; }
.page-head + section { border-top: 0; padding-top: 0; }
.packages { border-top: 2px solid var(--hema); }
.package { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(16px, 4vw, 56px);
  padding: 36px 0; border-bottom: 1px solid var(--line); }
.package .price { font-family: var(--display); font-size: var(--step-2); color: var(--ink); font-weight: 600;
  letter-spacing: -0.01em; margin: 4px 0 2px; }
.package .unit { color: var(--muted); font-size: var(--step--1); }
.package ul { margin: 0 0 12px; padding-left: 1.1em; columns: 2; column-gap: 32px; }
.package li { margin-bottom: 6px; break-inside: avoid; }
.package li::marker { color: var(--eosin); }
.package .turnaround { font-size: var(--step--1); color: var(--muted); }
.package.featured h3::after { content: "Most clients start here"; display: table; margin-top: 8px;
  font: 700 0.72rem/1 var(--body); color: var(--eosin); background: var(--tint); padding: 5px 8px;
  border-radius: 99px; vertical-align: middle; letter-spacing: 0; }
@media (max-width: 760px) {
  .package { grid-template-columns: 1fr; padding: 28px 0; }
  .package ul { columns: 1; }
}

table.data { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-m); overflow: hidden; font-size: var(--step--1); }
table.data th, table.data td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line);
  vertical-align: top; }
table.data th { background: var(--tint-2); color: var(--hema); font-weight: 700; }
table.data tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.table-scroll table.data { min-width: 620px; }
table.data code { overflow-wrap: anywhere; }

.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; max-width: 760px; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--hema); list-style-position: outside; }
.faq details p { margin: 10px 0 0; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
label { display: block; font-weight: 700; margin-bottom: 6px; font-size: var(--step--1); }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.82rem; margin-top: 4px; line-height: 1.4; }
input, select, textarea { width: 100%; font: inherit; font-size: var(--step-0); color: var(--ink);
  background: var(--white); border: 1.5px solid #CFC6D6; border-radius: var(--radius-s); padding: 11px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--hema);
  box-shadow: 0 0 0 3px rgba(46, 42, 107, 0.15); }
textarea { min-height: 140px; resize: vertical; }
input[type="checkbox"] { width: auto; accent-color: var(--hema); transform: scale(1.2); margin-right: 8px; }
.check { display: flex; align-items: center; font-weight: 400; }
.hp { position: absolute; left: -5000px; }
.notice { border-radius: var(--radius-s); padding: 12px 14px; font-size: var(--step--1); margin: 0 0 16px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.err { background: var(--err-bg); color: var(--err); }
.notice.info { background: var(--tint-2); color: var(--hema); }
.notice:empty { display: none; }

.contact-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(28px, 5vw, 72px); }
.contact-layout aside { border-left: 3px solid var(--eosin); padding-left: 24px; align-self: start; }
.contact-layout aside ol { padding-left: 1.2em; margin: 0; }
.contact-layout aside li { margin-bottom: 12px; }
@media (max-width: 860px) {
  .contact-layout { grid-template-columns: 1fr; }
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: var(--step--1); color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

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

/* =================================================================== portal */
.portal-main { padding: clamp(28px, 5vw, 56px) 0 80px; }
.auth-card { max-width: 440px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: clamp(24px, 4vw, 36px); }
.auth-card h1 { font-size: var(--step-3); }
.auth-card form > div { margin-bottom: 16px; }
.auth-card .btn { width: 100%; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: clamp(28px, 6vw, 80px); align-items: start; }
.auth-layout aside { padding-top: 12px; max-width: 420px; }
.auth-layout aside h2 { font-size: var(--step-2); }
@media (max-width: 860px) { .auth-layout { grid-template-columns: 1fr; } }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--hema); text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; font-size: var(--step--1); }

.app-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap;
  margin-bottom: 28px; }
.app-bar h1 { font-size: var(--step-3); margin: 0; }
.app-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .app-grid { grid-template-columns: 1fr; } }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px; }
.panel h2 { font-size: var(--step-1); margin-bottom: 4px; }
.panel > .muted { font-size: var(--step--1); margin-bottom: 16px; }
.app-grid + .panel { margin-top: 24px; }

.dropzone { display: block; border: 2px dashed #CBBFD6; border-radius: var(--radius-m); padding: 28px 20px;
  text-align: center; cursor: pointer; background: var(--paper); font-weight: 400; font-size: var(--step-0);
  transition: background .15s, border-color .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--hema); background: var(--tint-2); }
.dropzone strong { color: var(--hema); display: block; font-family: var(--display); font-size: 1.15rem; margin-bottom: 4px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

.uploads { list-style: none; margin: 14px 0 0; padding: 0; }
.uploads li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--step--1); }
.uploads li:last-child { border-bottom: 0; }
.uploads .row { display: flex; justify-content: space-between; gap: 12px; }
.uploads .name { overflow-wrap: anywhere; font-weight: 700; }
.bar { height: 6px; background: var(--tint-2); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--hema); width: 0; transition: width .3s; }
.bar.done > span { background: var(--ok); }
.bar.failed > span { background: var(--err); }

.file-table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.file-table th { text-align: left; color: var(--muted); font-weight: 700; padding: 0 8px 8px 0; border-bottom: 1px solid var(--line); }
.file-table td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.file-table tr:last-child td { border-bottom: 0; }
.file-table td.name { overflow-wrap: anywhere; font-weight: 700; }
.file-table td.actions { text-align: right; white-space: nowrap; }
.empty { color: var(--muted); font-size: var(--step--1); padding: 12px 0; margin: 0; }

.jobs { list-style: none; margin: 0; padding: 0; }
.job { border-top: 1px solid var(--line); padding: 18px 0; display: grid;
  grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; }
.job:first-child { border-top: 0; padding-top: 4px; }
.job h3 { font-size: 1.1rem; margin: 0 0 2px; }
.job .meta { font-size: var(--step--1); color: var(--muted); }
.job .status-line { font-size: var(--step--1); margin-top: 6px; }
.job .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: start; justify-content: flex-end; }
.job .detail { grid-column: 1 / -1; }
.job .facts { display: flex; gap: 24px; flex-wrap: wrap; font-size: var(--step--1); margin-top: 4px; }
.job .facts b { font-family: var(--display); color: var(--hema); font-size: 1.15rem; margin-right: 4px; }
.job details { margin-top: 8px; font-size: var(--step--1); }
.job details summary { cursor: pointer; color: var(--hema); }
.job details ul { margin: 8px 0 0; padding-left: 1.1em; columns: 2; }
.job .bar { max-width: 360px; }
@media (max-width: 600px) {
  .job { grid-template-columns: 1fr; }
  .job .actions { justify-content: flex-start; }
}
.pill { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 99px;
  vertical-align: middle; margin-left: 8px; }
.pill.STARTING, .pill.RUNNING { background: var(--tint-2); color: var(--hema); }
.pill.COMPLETED { background: var(--ok-bg); color: var(--ok); }
.pill.FAILED { background: var(--err-bg); color: var(--err); }

dialog { border: 0; border-radius: var(--radius-m); padding: 0; max-width: 560px; width: calc(100% - 32px);
  box-shadow: 0 24px 60px rgba(28, 26, 46, 0.25); color: var(--ink); }
dialog::backdrop { background: rgba(28, 26, 46, 0.45); }
dialog form { padding: 28px; }
dialog h2 { font-size: var(--step-2); }
dialog .form-grid { margin: 18px 0 22px; }
dialog details { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; }
dialog details summary { cursor: pointer; color: var(--hema); font-weight: 700; margin-bottom: 12px; }
dialog details .form-grid { margin: 8px 0 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
