/* Cortex site. No inline styles anywhere: keeps a strict CSP possible. */
/* Self-hosted fonts (SIL OFL, licenses in /assets/fonts). Latin subset. */
@font-face { font-family: 'Archivo'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url(/assets/fonts/archivo-latin-wdth-normal.woff2) format('woff2-variations'), url(/assets/fonts/archivo-latin-wdth-normal.woff2) format('woff2'); }
@font-face { font-family: 'Martian Mono'; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url(/assets/fonts/martian-mono-latin-wght-normal.woff2) format('woff2-variations'), url(/assets/fonts/martian-mono-latin-wght-normal.woff2) format('woff2'); }

:root {
  --paper: #F3F1EC;
  --paper-2: #EAE7E0;
  --ink: #121316;
  --ink-2: #2B2B30;
  --muted: #4A4A4F;
  --line: #D9D5CC;
  --grid: #E4E0D7;
  --night: #0E0F12;
  --night-2: #17181C;
  --night-line: #3A3B40;
  --night-muted: #A9A69F;
  --night-text: #C9C6BF;
  --orange: #F2541B;
  --orange-text: #B53A0E; /* orange that passes 4.5:1 on paper */
  --sans: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Martian Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --wrap: 1240px;
  --pad: clamp(20px, 4vw, 28px);
  --section: clamp(64px, 9vw, 96px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.55 var(--sans); }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, dl, dd, figure, blockquote { margin: 0; }
a { color: var(--orange-text); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--ink); color: var(--paper); padding: 10px 14px; }
.skip:focus { left: 8px; }

/* ---------- layout ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--pad); }
.section { padding-block: var(--section); }
.bordered { border-bottom: 1px solid var(--line); }
.tint { background: var(--paper-2); }
.dark { background: var(--night); color: var(--paper); }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.stack-md { display: flex; flex-direction: column; gap: 18px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }
.stack-xl { display: flex; flex-direction: column; gap: 44px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr)); gap: 48px; align-items: center; }
.two-col-top { align-items: start; }
.split-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr)); gap: 24px 32px; align-items: end; }
.measure { max-width: 46ch; }
.measure-wide { max-width: 760px; }
.narrow { max-width: 16ch; }

/* ---------- type ---------- */
.display-xl, .display-lg { font-weight: 900; font-stretch: 72%; text-transform: uppercase; text-wrap: balance; }
.display-xl { font-size: clamp(48px, 7.4vw, 104px); line-height: 0.9; letter-spacing: -0.015em; }
.display-lg { font-size: clamp(38px, 5vw, 66px); line-height: 0.95; }
mark { background: var(--orange); color: var(--ink); padding: 0 0.08em; }
.lede { font-size: clamp(18px, 2vw, 20px); line-height: 1.5; max-width: 34ch; color: var(--ink-2); text-wrap: pretty; }
.eyebrow { font: 500 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.eyebrow-hot { color: var(--orange); }
.eyebrow-hot-light { color: var(--orange-text); }
.mono-sm { font: 400 12px/1.6 var(--mono); }
.mono-label { font: 500 11px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--night-muted); }
.muted { color: var(--muted); }
.dim { color: var(--night-muted); }
.body-muted { color: #3A3A3F; }
.on-dark-muted { color: var(--night-muted); }
.on-dark-text { color: var(--night-text); }

.live-dot { width: 8px; height: 8px; background: var(--orange); display: inline-block; animation: blink 1.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 800; border: 1.5px solid transparent; cursor: pointer; font-family: var(--sans); transition: background .12s, color .12s, border-color .12s; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 15px; font-weight: 700; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 17px; }
.btn-primary { background: var(--orange); color: var(--ink); }
.btn-primary:hover { background: var(--ink); color: var(--paper); }
.btn-ghost { border-color: #8A867D; color: var(--ink); font-weight: 700; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.nav-links { display: flex; gap: 28px; font-size: 15px; font-weight: 500; margin-left: auto; margin-right: 12px; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 820px) { .nav-links { display: none; } }
.logo { font-weight: 900; font-stretch: 112%; font-size: 26px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.logo span { color: var(--orange); }
.logo:hover { color: var(--ink); }
.logo-light, .logo-light:hover { color: var(--paper); font-size: 22px; }

/* ---------- hero ---------- */
.hero { border-bottom: 1px solid var(--line); background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px; }
.hero-grid { padding-block: clamp(56px, 8vw, 88px) clamp(64px, 9vw, 96px); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 56px; align-items: center; }

.ticket-wrap { justify-self: center; width: 100%; max-width: 480px; padding: 0 18px 18px 0; }
.ticket { background: var(--night); color: var(--paper); box-shadow: 18px 18px 0 var(--ink); outline: 1.5px solid var(--ink);
  --notch: radial-gradient(circle 9px at 0 108px, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 108px, #0000 98%, #000) right / 51% 100% no-repeat;
  -webkit-mask: var(--notch); mask: var(--notch); }
.ticket-head { height: 108px; padding: 18px 26px; display: flex; flex-wrap: wrap; align-content: center; justify-content: space-between; gap: 8px 12px; border-bottom: 1px dashed var(--night-line); }
.ticket-note { width: 100%; }
.ticket-body { padding: 26px; display: flex; flex-direction: column; gap: 18px; }
.ticket-title { font-weight: 800; font-stretch: 85%; font-size: 28px; line-height: 1.1; }
.ticket-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 15px; }
.ticket-dl dt { font: 400 12px/1.9 var(--mono); color: var(--night-muted); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font: 400 12px/1 var(--mono); border: 1px solid var(--night-line); padding: 8px 10px; }
.tag-hot { border-color: var(--orange); color: var(--orange); }

.badge { font: 600 12px/1 var(--mono); letter-spacing: 0.08em; padding: 9px 12px; border: 1.5px solid transparent; white-space: nowrap; }
.badge-life { background: var(--orange); color: var(--ink); }
.badge-urgent { border-color: var(--orange); color: var(--orange); }
.badge-routine { border-color: #6B6A66; color: var(--night-text); }

/* ---------- facts strip ---------- */
.facts { border-bottom: 1px solid var(--line); }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); padding-inline: 0; }
.fact { padding: 32px var(--pad); display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: -1px; }
.fact:last-child { border-right: 0; }
.fact strong { font-weight: 900; font-stretch: 75%; font-size: 38px; line-height: 1; }
.fact span { color: var(--muted); font-size: 15px; }

/* ---------- triage demo ---------- */
.triage { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); border: 1.5px solid var(--night-line); }
.triage-input { padding: 24px; display: flex; flex-direction: column; gap: 14px; border-right: 1.5px solid var(--night-line); }
@media (max-width: 960px) { .triage-input { border-right: 0; border-bottom: 1.5px solid var(--night-line); } }
.samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); gap: 8px; margin-bottom: 10px; }
.sample { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 64px; padding: 12px 14px; text-align: left; cursor: pointer;
  background: var(--night-2); color: var(--paper); border: 1.5px solid var(--night-line); font-family: var(--sans); transition: border-color .12s, background .12s; }
.sample:hover { border-color: #6B6A66; }
.sample[aria-pressed="true"] { border-color: var(--orange); background: #1E1A18; }
.sample-tag { font: 500 10px/1 var(--mono); letter-spacing: 0.1em; color: var(--night-muted); }
.sample[aria-pressed="true"] .sample-tag { color: var(--orange); }
.sample-title { font-weight: 700; font-size: 16px; line-height: 1.2; }
textarea { width: 100%; background: var(--night-2); color: var(--paper); border: 1.5px solid var(--night-line); padding: 14px 16px;
  font: 400 18px/1.45 var(--sans); resize: vertical; min-height: 96px; }
textarea:focus { border-color: var(--orange); outline: none; }

.triage-out { display: flex; flex-direction: column; }
.triage-out-head { min-height: 64px; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--night-line); }
.triage-script { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
#t-script { font-size: 20px; line-height: 1.5; text-wrap: pretty; }
.triage-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--night-line); }
.triage-facts > div { padding: 16px 24px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--night-line); }
.triage-facts > div:last-child { border-right: 0; }
.triage-facts dt { font: 500 11px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--night-muted); }
.triage-facts dd { font-weight: 800; font-size: 18px; line-height: 1.25; }
@media (max-width: 560px) {
  .triage-facts { grid-template-columns: 1fr; }
  .triage-facts > div { border-right: 0; border-bottom: 1px solid var(--night-line); flex-direction: row; justify-content: space-between; align-items: baseline; }
  .triage-facts > div:last-child { border-bottom: 0; }
}

/* ---------- steps ---------- */
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); border-top: 2px solid var(--ink); }
.steps li { padding: 28px 28px 28px 0; display: flex; flex-direction: column; gap: 12px; }
.steps li + li { padding-left: 28px; border-left: 1px solid var(--line); }
@media (max-width: 960px) { .steps li, .steps li + li { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--line); } }
.step-n { font: 600 13px/1 var(--mono); color: var(--orange-text); text-transform: uppercase; }
.steps h3 { font-size: 24px; font-weight: 800; font-stretch: 90%; line-height: 1.15; }
.steps p { color: #3A3A3F; }

/* ---------- inbox ---------- */
.inbox { background: var(--paper); border: 1.5px solid var(--ink); }
.inbox-head { padding: 14px 20px; border-bottom: 1.5px solid var(--ink); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.inbox-list { list-style: none; padding: 0; }
.case { padding: 18px 20px; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.case + .case { border-top: 1px solid var(--line); }
.case-bar { width: 10px; height: 44px; }
.bar-life { background: var(--orange); }
.bar-urgent { background: var(--ink); }
.bar-routine { background: #B8B4AA; }
.case-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.case-text strong { font-size: 17px; }
.case-text span { font-size: 14px; color: var(--muted); }
.case-btn { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border: 1.5px solid var(--ink); font-weight: 700; font-size: 14px; }

/* ---------- calculator ---------- */
.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 24px; }
.calc-inputs { border: 1.5px solid var(--ink); padding: 28px; display: flex; flex-direction: column; gap: 30px; }
.range { display: flex; flex-direction: column; gap: 8px; }
.range-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.range label { font-weight: 700; }
.range output { font: 600 15px/1 var(--mono); white-space: nowrap; }
input[type=range] { width: 100%; height: 28px; accent-color: var(--orange); margin: 0; }
.calc-result { background: var(--night); color: var(--paper); padding: 28px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.calc-big { font-weight: 900; font-stretch: 72%; font-size: clamp(56px, 8vw, 104px); line-height: 0.9; color: var(--orange); font-variant-numeric: tabular-nums; }

/* ---------- faq ---------- */
.faq { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 0; min-height: 44px; display: flex; justify-content: space-between; gap: 16px; font-weight: 700; font-size: 19px; }
.faq summary::-webkit-details-marker { display: none; }
.plus { font-family: var(--mono); transition: transform .15s; }
.faq details[open] .plus { transform: rotate(45deg); }
.faq details p { padding-bottom: 22px; color: #3A3A3F; max-width: 60ch; }

/* ---------- CTA + form ---------- */
.cta { background: var(--orange); color: var(--ink); padding-block: var(--section); }
.cta .display-lg { font-size: clamp(42px, 6vw, 80px); }
.cta a { color: var(--ink); }
.cta-lede { font-size: 19px; max-width: 40ch; }
.demo-form { background: var(--paper); border: 1.5px solid var(--ink); box-shadow: 14px 14px 0 var(--ink); padding: clamp(20px, 3vw, 32px); display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-row > .field { flex: 1 1 200px; }
.field-row { display: flex; flex-wrap: wrap; gap: 16px; }
.field label { font-weight: 700; font-size: 15px; }
.field input, .field select { font: 400 17px/1.3 var(--sans); color: var(--ink); background: #fff; border: 1.5px solid #8A867D; min-height: 48px; padding: 10px 12px; width: 100%; border-radius: 0; }
.field input:focus, .field select:focus { border-color: var(--ink); outline: 2px solid var(--orange); outline-offset: 0; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--orange-text); }
.form-error { color: #8A2A08; font-weight: 700; }
.fine { font-size: 13px; color: var(--muted); }
.fine a { color: var(--ink); }
.demo-form .btn { align-self: flex-start; }
.hp { display: none; }

/* ---------- footer ---------- */
.site-footer { background: var(--night); color: var(--night-muted); font-size: 14px; }
.site-footer a { color: var(--night-text); }
.site-footer a:hover { color: var(--paper); }
.footer-row { padding-block: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }

/* ---------- simple pages ---------- */
.page { padding-block: var(--section); }
.prose { max-width: 68ch; display: flex; flex-direction: column; gap: 18px; }
.prose h2 { font-size: 24px; font-weight: 800; margin-top: 16px; }
.prose ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 560px) {
  .triage-input, .triage-script { padding: 18px; }
  .triage-out-head { padding: 12px 18px; }
  .sample { min-height: 58px; padding: 10px 12px; }
  .sample-title { font-size: 15px; }
}

/* ---------- pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr)); gap: 20px; align-items: stretch; }
.plan { position: relative; border: 1.5px solid var(--ink); background: var(--paper); padding: 28px; display: flex; flex-direction: column; gap: 24px; }
.plan-featured { background: var(--night); color: var(--paper); box-shadow: 14px 14px 0 var(--orange); }
.plan-flag { position: absolute; top: -13px; left: 24px; background: var(--orange); color: var(--ink); font: 600 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; padding: 7px 10px; }
.plan-head { display: flex; flex-direction: column; gap: 8px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.plan-featured .plan-head { border-bottom-color: var(--night-line); }
.plan-name { font-weight: 900; font-stretch: 75%; font-size: 34px; line-height: 1; text-transform: uppercase; }
.plan-for { color: var(--muted); font-size: 15px; line-height: 1.55; min-height: 3.1em; }
.plan-featured .plan-for { color: var(--night-text); }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.plan-amt { font-weight: 900; font-stretch: 72%; font-size: 64px; line-height: 0.9; font-variant-numeric: tabular-nums; }
.plan-featured .plan-amt { color: var(--orange); }
.plan-per { font: 500 13px/1 var(--mono); color: var(--muted); }
.plan-featured .plan-per { color: var(--night-muted); }
.plan-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; flex-grow: 1; font-size: 16px; }
.plan-list li { padding-left: 22px; position: relative; }
.plan-list li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 10px; height: 2px; background: var(--orange-text); }
.plan-featured .plan-list li::before { background: var(--orange); }
.plan-list li.plan-plus { padding-left: 0; font-weight: 700; }
.plan-list li.plan-plus::before { display: none; }
.plan-btn { width: 100%; }
.plan-featured .btn-primary:hover { background: var(--paper); color: var(--ink); }
.soon { display: inline-block; font: 600 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid var(--orange-text); color: var(--orange-text); padding: 4px 6px; vertical-align: 2px; margin-left: 4px; }
.plan-featured .soon { border-color: var(--orange); color: var(--orange); }
