/* Lapilo Labs — AI Shortlist Audit
   Layout idea: a measurement report, not a brochure. Left-aligned, one tally figure as the signature,
   sans for interface and numbers, serif for reading. Single light theme by choice. */
:root {
  color-scheme: light;
  --ink: #0e1b2c;        /* text, deep navy */
  --paper: #f4f6f9;      /* page background, cool off-white */
  --surface: #ffffff;    /* cards, tables */
  --blue: #1b4fd6;       /* action and "named" marks */
  --blue-deep: #0b1f3a;  /* dark bands */
  --missing: #c8391f;    /* semantic only: absent / zero */
  --line: #d3dae4;
  --muted: #55657a;
  --tint: #e8eefb;       /* blue wash for emphasis rows */
  --font-ui: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-read: "Source Serif 4", Georgia, "Times New Roman", serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: 2.25rem;
  --step-4: clamp(2.4rem, 5.2vw, 3.9rem);
  --wrap: 1120px;
  --gutter: clamp(18px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-read);
  font-size: var(--step-0);
  line-height: 1.62;
}
img, svg { max-width: 100%; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 { font-family: var(--font-ui); line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -0.015em; }
h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: var(--step-3); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 700; letter-spacing: -0.005em; }
p { margin: 0; max-width: 64ch; }
.ui { font-family: var(--font-ui); }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.num { font-family: var(--font-ui); font-variant-numeric: tabular-nums; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.75rem; }

/* 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: 1rem; padding-block: 14px; flex-wrap: wrap; }
.wordmark { font-family: var(--font-ui); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.wordmark-mark { display: inline-grid; grid-template-columns: repeat(3, 6px); gap: 3px; }
.wordmark-mark i { width: 6px; height: 6px; border-radius: 1px; background: var(--blue); }
.wordmark-mark i.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); font-family: var(--font-ui); font-size: var(--step--1); font-weight: 600; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { text-decoration: underline; }

/* Buttons */
.btn {
  font-family: var(--font-ui); font-weight: 700; font-size: 1rem; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 22px; border-radius: 6px; border: 2px solid var(--blue);
  background: var(--blue); color: #fff; text-decoration: none; cursor: pointer;
}
.btn:hover { background: #163fae; border-color: #163fae; }
.btn-quiet { background: transparent; color: var(--blue); }
.btn-quiet:hover { background: var(--tint); color: var(--blue); border-color: var(--blue); }
.btn-small { padding: 9px 14px; font-size: var(--step--1); }
.btn-on-dark { background: #fff; color: var(--blue-deep); border-color: #fff; }
.btn-on-dark:hover { background: var(--tint); border-color: var(--tint); }

/* Sections */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section-tight { padding-block: clamp(40px, 6vw, 72px); }
.band-white { background: var(--surface); border-block: 1px solid var(--line); }
.band-dark { background: var(--blue-deep); color: #eef3fb; }
.band-dark a { color: #cfe0ff; }
.band-dark .muted { color: #a9bad3; }
.lede { font-size: var(--step-1); line-height: 1.5; max-width: 56ch; }

/* Hero */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(48px, 7vw, 88px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.hero-copy { display: flex; flex-direction: column; gap: 1.35rem; }

.quickform { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; max-width: 560px; }
.quickform .btn { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-family: var(--font-ui); font-size: var(--step--1); font-weight: 600; }
.field input, .field textarea, .field select {
  font: inherit; font-family: var(--font-ui); font-size: 1rem; color: var(--ink);
  padding: 12px 13px; border: 1.5px solid #9aa8ba; border-radius: 6px; background: var(--surface); width: 100%;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--blue); }
.form-note { font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); }
.form-status { font-family: var(--font-ui); font-size: var(--step--1); border-left: 4px solid var(--blue); background: var(--tint); padding: 12px 14px; border-radius: 0 6px 6px 0; }
.form-status[data-kind="error"] { border-left-color: var(--missing); background: #fbece8; }
.form-status[hidden] { display: none; }
.form-status code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; word-break: break-word; }

/* Tally figure: the signature element */
.tally { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: clamp(18px, 2.6vw, 28px); font-family: var(--font-ui); }
.tally-q { font-family: var(--font-read); font-style: italic; font-size: 1.05rem; line-height: 1.4; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.tally-q span { display: block; font-family: var(--font-ui); font-style: normal; font-size: var(--step--1); font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.tally-rows { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; }
.tally-row { display: grid; grid-template-columns: 7.4rem 1fr auto; gap: 12px; align-items: center; }
.tally-name { font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.tally-count { font-weight: 800; text-align: right; font-size: 1.02rem; white-space: nowrap; min-width: 4.4rem; }
.cells { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; }
.cells i { aspect-ratio: 1 / 1.5; border-radius: 2px; box-shadow: inset 0 0 0 1.5px var(--line); background: transparent; }
.cells i.on { background: var(--blue); box-shadow: none; animation: fill 0.28s ease-out both; animation-delay: calc(var(--i, 0) * 38ms + 200ms); }
.tally-row.you { background: #fbece8; margin: 0 -10px; padding: 10px; border-radius: 6px; }
.tally-row.you .tally-count, .tally-row.you .tally-name { color: var(--missing); }
.tally-row.you .cells i { box-shadow: inset 0 0 0 1.5px #e3a99c; }
.tally-cap { margin-top: 14px; font-size: var(--step--1); color: var(--muted); }
@keyframes fill { from { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); } to { background: var(--blue); } }

/* Evidence list */
.evidence { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.evidence article { border-top: 3px solid var(--ink); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.evidence .figure { font-family: var(--font-ui); font-weight: 800; font-size: var(--step-3); letter-spacing: -0.03em; line-height: 1; }
.evidence .src { font-family: var(--font-ui); font-size: 0.8rem; color: var(--muted); }

/* Measures: definition list */
.measures { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.measures dl { margin: 0; display: flex; flex-direction: column; }
.measures dl > div { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 20px; padding-block: 18px; border-top: 1px solid var(--line); }
.measures dl > div:last-child { border-bottom: 1px solid var(--line); }
.measures dt { font-family: var(--font-ui); font-weight: 700; }
.measures dd { margin: 0; }

/* Tables */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table.data { border-collapse: collapse; width: 100%; min-width: 620px; font-family: var(--font-ui); font-size: 0.95rem; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data thead th { font-size: 0.8rem; font-weight: 700; color: var(--muted); background: #f9fafc; }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.you td { background: #fbece8; }
table.data tr.you td:first-child { color: var(--missing); font-weight: 700; }
.bar { display: inline-block; height: 10px; border-radius: 2px; background: var(--blue); vertical-align: middle; margin-right: 8px; min-width: 2px; }
.bar.zero { background: transparent; box-shadow: inset 0 0 0 1.5px #e3a99c; width: 10px; }
.pill { display: inline-block; font-family: var(--font-ui); font-size: 0.78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--tint); color: var(--blue); }
.pill.bad { background: #fbece8; color: var(--missing); }
.pill.ok { background: #e3f4ea; color: #146c3c; }

/* Steps: a true sequence */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); counter-reset: step; }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: 8px; border-top: 3px solid var(--blue); padding-top: 14px; }
.steps li::before { content: counter(step); font-family: var(--font-ui); font-weight: 800; font-size: var(--step-2); color: var(--blue); line-height: 1; }

/* Pricing */
.plans { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr) minmax(0, 0.9fr); gap: clamp(16px, 2vw, 24px); align-items: stretch; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: clamp(20px, 2.6vw, 30px); display: flex; flex-direction: column; gap: 14px; }
.plan-main { border: 2px solid var(--blue); box-shadow: 0 18px 40px -28px rgba(27, 79, 214, 0.55); }
.plan .price { font-family: var(--font-ui); font-weight: 800; font-size: var(--step-3); letter-spacing: -0.03em; line-height: 1; }
.plan .price small { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan ul { margin: 0; padding-left: 1.15rem; display: flex; flex-direction: column; gap: 7px; font-family: var(--font-ui); font-size: 0.97rem; line-height: 1.45; }
.plan .btn { margin-top: auto; }

/* Promise / no-promise */
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 4vw, 56px); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.checklist li { padding-left: 30px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 0.42em; width: 16px; height: 16px; border-radius: 3px; background: var(--blue); }
.checklist.no li::before { background: transparent; box-shadow: inset 0 0 0 2px var(--missing); }

/* FAQ */
.faq { display: flex; flex-direction: column; border-top: 1px solid var(--line); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); padding-block: 4px; }
.faq summary { font-family: var(--font-ui); font-weight: 700; font-size: 1.08rem; padding-block: 14px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 800; color: var(--blue); flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding-bottom: 18px; }

/* Request form block */
.request { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.request form { background: var(--surface); color: var(--ink); border-radius: 10px; padding: clamp(20px, 3vw, 32px); display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.request form .full { grid-column: 1 / -1; }

/* Footer */
.site-footer { background: var(--blue-deep); color: #a9bad3; font-family: var(--font-ui); font-size: var(--step--1); border-top: 1px solid #1d3558; }
.site-footer .wrap { padding-block: 28px; display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; }
.site-footer a { color: #cfe0ff; }
.sources { font-family: var(--font-ui); font-size: 0.82rem; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.sources p { max-width: 90ch; }

/* Plain document pages */
.doc { max-width: 760px; }
.doc h1 { font-size: var(--step-3); }
.doc h2 { font-size: var(--step-1); margin-top: 1.4rem; }
.doc ul { padding-left: 1.2rem; }

@media (max-width: 920px) {
  .hero-grid, .measures, .request, .two-col { grid-template-columns: minmax(0, 1fr); }
  .evidence { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .measures dl > div { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
@media (max-width: 560px) {
  .quickform { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .request form { grid-template-columns: minmax(0, 1fr); }
  .tally-row { grid-template-columns: 6.1rem 1fr auto; gap: 8px; }
  .tally-name { font-size: 0.84rem; }
  .tally-count { font-size: 0.9rem; min-width: 3.9rem; }
  .nav a.hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cells i.on { animation: none; }
}
@media print {
  .site-header .nav, .btn, .site-footer { display: none; }
  body { background: #fff; }
}
