@font-face {
  font-family: "Hanken Grotesk";
  font-weight: 300 800;
  font-display: swap;
  src: url("/assets/fonts/hanken-grotesk-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
}

:root {
  --porcelain: #f6f6f3;
  --paper: #fcfcfa;
  --carbon: #111312;
  --petrol: #23484d;
  --petrol-deep: #1a3a3e;
  --ochre: #c8952e;
  --slate: #555b59;
  --line: #d6d8d5;
  --accent: var(--petrol);
  --body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --shell: 1120px;
  --radius: 20px;
  --radius-sm: 12px;
  --desk: #e8e8e3;
  --flag: #f4e8cd;
  --doc: Calibri, Carlito, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--carbon);
  background: var(--porcelain);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2 { font-weight: 500; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.08; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; }
p { margin: 0; }
.mono { font-family: var(--mono); font-size: 0.92em; }

.bar {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.bar-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.bar-for { display: inline-flex; align-items: center; gap: 12px; color: var(--slate); font-size: 0.95rem; }
.bar-for-company { color: var(--carbon); font-weight: 500; }
.bar-logo { height: 28px; width: auto; max-width: 140px; object-fit: contain; }

main { max-width: var(--shell); margin: 0 auto; padding: 0 24px 80px; }

.hero { padding: 56px 0 40px; max-width: 760px; }
.eyebrow { font-size: 0.9rem; color: var(--accent); font-weight: 600; letter-spacing: 0.02em; margin-bottom: 18px; }
.lede { font-size: 1.2rem; color: var(--slate); margin-top: 22px; max-width: 640px; }
.source { margin-top: 14px; font-size: 0.9rem; color: var(--slate); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--carbon); color: var(--porcelain); }
.btn-primary:hover { background: var(--petrol-deep); }
.btn-primary:disabled { opacity: 0.55; cursor: progress; }
.btn-ghost { border-color: var(--line); background: var(--paper); }
.btn-ghost:hover { border-color: var(--carbon); }
.btn-wide { width: 100%; margin-top: 10px; }

.video { margin: 20px 0 56px; }
.video video { width: 100%; border-radius: var(--radius); background: var(--carbon); aspect-ratio: 16 / 9; display: block; }
.caption { margin-top: 12px; color: var(--slate); font-size: 0.95rem; }

.demo { padding: 24px 0 0; }
.demo-head { max-width: 720px; margin-bottom: 26px; }
.demo-head p { margin-top: 12px; color: var(--slate); }
/* Workflow */
.flow { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.flow :where(h3, h4, p, ol, ul, dl, dd, figure) { margin: 0; padding: 0; }
.flow button { font: inherit; color: inherit; }
.flow .btn { padding: 11px 20px; white-space: nowrap; color: var(--carbon); }
.flow .btn-primary { color: var(--porcelain); }
.run { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.run-id strong { font-weight: 600; display: block; }
.run-id span { color: var(--slate); font-size: 0.95rem; }
.run-actions { display: flex; align-items: center; gap: 16px; }
.clock { color: var(--slate); font-size: 0.95rem; font-variant-numeric: tabular-nums; }

.ways { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.ways p { color: var(--slate); font-size: 0.95rem; }
.mode { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--porcelain); }
.mode button { border: 0; background: none; border-radius: 999px; padding: 7px 14px; font-size: 0.92rem; font-weight: 500; color: var(--slate); cursor: pointer; white-space: nowrap; }
.mode button[aria-pressed="true"] { background: #fff; color: var(--carbon); box-shadow: 0 0 0 1px var(--line); }
.gatebar { position: sticky; top: 12px; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 8px 20px; flex-wrap: wrap; margin-bottom: 22px; padding: 10px 12px 10px 18px; background: var(--flag); border-radius: 14px; }
.gatebar p { font-weight: 500; }
.gatebar div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.btn-link { background: none; border: 0; padding: 11px 10px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.run-error { margin-bottom: 18px; padding: 10px 16px; border: 1px solid var(--ochre); border-radius: var(--radius-sm); background: #fff; }

.flow-body { display: grid; grid-template-columns: 272px minmax(0, 1fr); }
.side-rail { border-right: 1px solid var(--line); padding: 24px 0 20px; }
.rail { list-style: none; }
.rail li { position: relative; }
.rail li::before { content: ""; position: absolute; left: 27px; top: 0; bottom: 0; width: 2px; background: var(--line); transition: background 300ms ease; }
.rail li:first-child::before { top: 12px; }
.rail li:last-child::before { bottom: auto; height: 12px; }
.rail li:has(.step[data-state="done"])::before { background: var(--accent); }
.step { position: relative; display: grid; grid-template-columns: 56px 1fr; width: 100%; text-align: left; background: none; border: 0; padding: 0 18px 0 0; cursor: pointer; }
.step:disabled { cursor: default; }
.step-mark { display: flex; justify-content: center; }
.node { position: relative; margin-top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line); transition: background 200ms ease, border-color 200ms ease, box-shadow 200ms ease; }
.node::after { content: ""; position: absolute; left: 4px; top: 1.5px; width: 4px; height: 7px; border: solid var(--paper); border-width: 0 2px 2px 0; transform: rotate(45deg); opacity: 0; }
.step[data-state="active"] .node { border-color: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 13%, transparent); }
.step[data-state="done"] .node { background: var(--accent); border-color: var(--accent); }
.step[data-state="done"] .node::after { opacity: 1; }
.step[data-state="wait"] .node { border-color: var(--ochre); box-shadow: 0 0 0 5px color-mix(in srgb, var(--ochre) 24%, transparent); }
.step-text { display: block; padding: 0 0 2px; }
.gate { position: relative; display: flex; align-items: center; gap: 7px; margin: 0 18px 0 56px; padding: 2px 0 16px; font-size: 0.82rem; color: var(--slate); cursor: pointer; }
.gate input { accent-color: var(--accent); margin: 0; width: 14px; height: 14px; }
.gate:has(input:checked) { color: var(--carbon); }
.step-title { display: block; font-weight: 600; color: var(--slate); }
.step[data-state] .step-title { color: var(--carbon); }
.step[aria-current="step"] .step-title { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.step-meta { display: block; font-size: 0.875rem; color: var(--slate); min-height: 1.4em; }

.stage { padding: 26px 28px 30px; min-height: 640px; }
.panel h3 { font-size: 1.35rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
.panel > .sub { color: var(--slate); margin-top: 6px; max-width: 600px; }
.working { margin-top: 22px; color: var(--slate); }
.reveal { opacity: 0; transform: translateY(6px); transition: opacity 320ms ease, transform 320ms ease; }
.reveal.in { opacity: 1; transform: none; }

/* Step 1: what came in */
.mail { margin-top: 22px; max-width: 620px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.mail-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; font-size: 0.95rem; }
.mail-head dt { color: var(--slate); }
.mail-head dd { font-weight: 500; }
.mail-body { padding: 16px 20px 6px; }
.files { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 20px 18px; }
.file { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-family: var(--mono); font-size: 0.8rem; overflow-wrap: anywhere; }
.file::before { content: ""; flex: none; width: 14px; height: 18px; border: 1.5px solid var(--accent); border-radius: 2px; background: linear-gradient(var(--accent), var(--accent)) 3px 5px / 6px 1.5px no-repeat, linear-gradient(var(--accent), var(--accent)) 3px 9px / 6px 1.5px no-repeat; }
.raw { margin-top: 14px; max-width: 620px; }
.raw summary { cursor: pointer; color: var(--slate); font-size: 0.95rem; }
.raw pre, .own-text, #paste { margin: 10px 0 0; padding: 14px 16px; background: var(--porcelain); border: 1px solid var(--line); border-radius: 10px; font-family: var(--mono); font-size: 0.78rem; line-height: 1.6; white-space: pre-wrap; max-height: 260px; overflow: auto; }
.own-text { margin: 14px 20px 18px; }
#paste { display: block; width: 100%; resize: vertical; color: var(--carbon); margin-bottom: 10px; }
.own { margin-top: 18px; max-width: 620px; }
.drop { position: relative; display: block; border: 1.5px dashed var(--line); border-radius: 14px; padding: 16px 20px; color: var(--slate); font-size: 0.95rem; cursor: pointer; }
.drop:hover, .drop:focus-within { border-color: var(--accent); }
.drop strong { color: var(--carbon); font-weight: 600; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.own .run-error { margin: 14px 0 0; }
.mailto { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: 16px; color: var(--slate); font-size: 0.95rem; }
.flow input[type="email"] { font: inherit; color: var(--carbon); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-width: 0; width: 220px; max-width: 100%; }

/* Step 2: extracted data */
.read { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 30px; margin-top: 22px; align-items: start; }
.read.solo { grid-template-columns: minmax(0, 1fr); }
.profile svg { width: 100%; height: auto; display: block; font-family: var(--body); }
.profile figcaption { font-size: 0.875rem; color: var(--slate); margin-top: 8px; }
.facts { color: var(--slate); font-size: 0.95rem; margin-bottom: 14px; }
table.results { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.results th { text-align: left; font-weight: 500; color: var(--slate); font-size: 0.875rem; padding: 0 12px 8px 0; border-bottom: 1px solid var(--line); }
.results td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.results td:first-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.results th:first-child, .results td:first-child { padding-right: 22px; }
.results .where { color: var(--slate); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--flag); font-size: 0.85rem; }
.tag-ok { background: color-mix(in srgb, var(--petrol) 10%, white); }

/* Step 3: checks */
.checks { list-style: none; margin-top: 22px; max-width: 640px; border-top: 1px solid var(--line); }
.checks li { display: grid; grid-template-columns: 28px 1fr; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.checks .ic { width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: var(--petrol); position: relative; }
.checks .ic::after { content: ""; position: absolute; left: 6px; top: 3px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.checks .todo .ic { background: var(--ochre); }
.checks .todo .ic::after { left: 8px; top: 4px; width: 2px; height: 10px; border: 0; transform: none; background: linear-gradient(#fff, #fff) 0 0 / 2px 6px no-repeat, linear-gradient(#fff, #fff) 0 8px / 2px 2px no-repeat; }
.checks small { display: block; color: var(--slate); font-size: 0.875rem; }
.principle { margin-top: 18px; color: var(--slate); max-width: 600px; }

/* Steps 4 and 5: the document and the handover */
.docwrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; margin-top: 20px; align-items: start; }
.sheet-scroll { background: var(--desk); border-radius: 14px; padding: 20px; max-height: 640px; overflow: auto; scroll-behavior: smooth; }
.sheet { background: #fff; padding: 44px 48px 56px; min-height: 620px; font-family: var(--doc); font-size: 0.95rem; line-height: 1.6; color: #1a1a1a; }
.letterhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 18px; border-bottom: 2px solid var(--accent); }
.letterhead img { height: 34px; width: auto; max-width: 180px; }
.letterhead-name { color: var(--accent); font-size: 1.05rem; }
.concept { border: 1.5px solid var(--ochre); color: #8a6417; border-radius: 4px; padding: 1px 9px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
#sheet-title { font-size: 1.45rem; line-height: 1.25; font-weight: 700; color: var(--accent); margin-top: 26px; }
.sheet .where { color: #555; margin-top: 2px; }
.titleblock { display: grid; grid-template-columns: auto 1fr; gap: 3px 18px; margin: 20px 0 6px; padding: 12px 0; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; font-size: 0.9rem; }
.titleblock dt { color: #666; }
#doc-body { counter-reset: chapter; }
#doc-body h2 { counter-increment: chapter; font-size: 1.05rem; line-height: 1.3; font-weight: 700; letter-spacing: 0; color: var(--accent); margin: 24px 0 6px; }
#doc-body h2::before { content: counter(chapter) "\2002"; }
#doc-body h3 { font-size: 0.95rem; font-weight: 700; margin: 14px 0 4px; }
#doc-body p { margin-bottom: 9px; }
#doc-body ul { margin: 0 0 9px 20px; }
.sheet mark { background: var(--flag); color: inherit; padding: 0 3px; border-radius: 3px; scroll-margin: 80px; }
.sheet mark.flash { outline: 2px solid var(--ochre); outline-offset: 1px; }

.aside h4 { font-size: 1rem; font-weight: 600; margin-bottom: 10px; }
.chapters { list-style: none; }
.chapters li { display: grid; grid-template-columns: 22px 1fr; padding: 5px 0; color: var(--slate); font-size: 0.95rem; }
.chapters li::before { content: ""; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; border: 1.5px solid var(--line); }
.chapters li.on { color: var(--carbon); }
.chapters li.on::before { background: var(--accent); border-color: var(--accent); }
.handover { display: grid; gap: 18px; }
.out-mail { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 14px; font-size: 0.92rem; }
.out-mail dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin: 10px 0; align-items: center; }
.out-mail dt { color: var(--slate); }
.out-mail dd { font-weight: 500; }
.out-mail .file { margin-top: 12px; }
.out-mail input[type="email"] { width: 100%; }
.points { list-style: none; display: grid; gap: 6px; }
.points button { width: 100%; text-align: left; background: var(--flag); border: 0; border-radius: 8px; padding: 7px 10px; font-size: 0.875rem; line-height: 1.4; cursor: pointer; }
.points button:hover { background: color-mix(in srgb, var(--ochre) 34%, white); }
.saved { color: var(--slate); font-size: 0.95rem; }

.note { margin-top: 18px; color: var(--slate); font-size: 0.95rem; max-width: 760px; }

.next { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; margin-top: 90px; padding-top: 60px; border-top: 1px solid var(--line); }
.next-copy p { margin-top: 14px; color: var(--slate); }
.steps { margin: 26px 0 0; padding-left: 22px; display: grid; gap: 14px; }
.steps li { padding-left: 6px; }
.pricing { background: var(--petrol-deep); color: var(--porcelain); border-radius: var(--radius); padding: 28px; display: grid; gap: 18px; align-content: start; }
.price { display: grid; gap: 2px; padding-bottom: 16px; border-bottom: 1px solid rgba(246, 246, 243, 0.14); }
.price:nth-child(3) { border-bottom: 0; padding-bottom: 0; }
.price-label { font-size: 0.85rem; opacity: 0.75; }
.price-value { font-size: 1.45rem; font-weight: 500; letter-spacing: -0.01em; }
.price-sub { font-size: 0.9rem; opacity: 0.75; }
.pricing .btn-primary { background: var(--porcelain); color: var(--carbon); }
.pricing .btn-primary:hover { background: #fff; }
.price-note { font-size: 0.9rem; opacity: 0.8; }

.foot { max-width: var(--shell); margin: 0 auto; padding: 30px 24px 50px; border-top: 1px solid var(--line); color: var(--slate); display: grid; gap: 10px; }
.foot strong { color: var(--carbon); font-weight: 600; }
.foot-small { font-size: 0.85rem; }

@media (max-width: 860px) {
  .next { grid-template-columns: 1fr; }
  .bar-for-label { display: none; }
  .hero { padding-top: 32px; }
}

@media (max-width: 920px) {
  .flow-body { grid-template-columns: minmax(0, 1fr); }
  .side-rail { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px 0 12px; }
  .rail { display: flex; padding: 0 18px; }
  .rail li { flex: 1 1 0; min-width: 0; }
  .rail li::before, .rail li:first-child::before { left: 8px; right: -8px; top: 12px; bottom: auto; width: auto; height: 2px; }
  .rail li:last-child::before { display: none; }
  .step { display: block; padding: 0 6px 0 0; }
  .step-mark { justify-content: flex-start; }
  .step-title { font-size: 0.85rem; white-space: nowrap; margin-top: 8px; visibility: hidden; }
  .step[aria-current="step"] .step-title { visibility: visible; }
  .step-meta, .gate { display: none; }
  .run { padding: 16px 18px; }
  .run-actions { width: 100%; justify-content: space-between; }
  .mode button { padding: 7px 11px; font-size: 0.86rem; }
  .ways { padding: 12px 18px; }
  .stage { padding: 22px 18px 26px; min-height: 0; }
  .read, .docwrap { grid-template-columns: minmax(0, 1fr); }
  .profile { max-width: 260px; }
  .sheet { padding: 28px 22px 36px; }
  .letterhead img { height: auto; max-height: 30px; max-width: 58%; }
  .sheet-scroll { padding: 10px; max-height: 520px; }
}
@media (prefers-reduced-motion: reduce) { .sheet-scroll { scroll-behavior: auto; } }
