/* Cadmus design system. One file, no build step.
   Tokens first; components after. Light and dark from the same tokens. */

:root {
  --paper: #fbfaf7;
  --surface: #ffffff;
  --sunken: #f3f1ec;
  --ink: #17191c;
  --ink-2: #4a4f57;
  --ink-3: #5c616a;  /* >= 4.5:1 on --sunken, so small grey labels pass WCAG AA */
  --line: #e4e1d9;
  --line-strong: #cfcac0;
  --accent: #2346b8;
  --accent-ink: #ffffff;
  --accent-soft: #e8edfb;
  --focus: #2346b8;

  --ok: #1d6b3a;      --ok-soft: #e3f2e8;
  --warn: #8a5300;    --warn-soft: #fbf0dc;
  --muted: #4d5560;   --muted-soft: #eceef1;
  --bad: #9b1c1c;     --bad-soft: #fbe5e5;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;

  --r-sm: 6px; --r: 10px; --r-lg: 16px;
  --shadow: 0 1px 2px rgba(23, 25, 28, .06), 0 4px 16px rgba(23, 25, 28, .05);
  --max: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121417; --surface: #1a1d21; --sunken: #15181b;
    --ink: #eceae5; --ink-2: #c3c6cc; --ink-3: #9aa0a8;
    --line: #2b2f35; --line-strong: #3a3f46;
    --accent: #8aa4ff; --accent-ink: #0f1424; --accent-soft: #1f2846; --focus: #8aa4ff;
    --ok: #7fd49c; --ok-soft: #173323; --warn: #f2c37a; --warn-soft: #3a2c14;
    --muted: #b7bdc6; --muted-soft: #262a30; --bad: #ff9c9c; --bad-soft: #3b1a1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.6 var(--sans); text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); z-index: 10; }
.skip:focus { left: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.stack > * + * { margin-top: var(--gap, 16px); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; color: var(--ink); }
h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); margin: 0 0 16px; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); margin: 0 0 12px; }
h3 { font-size: 1.2rem; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.eyebrow { font: 600 .75rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }

/* ---- header / footer ---- */
.site-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 1.25rem/1 var(--serif); }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font: 700 15px/1 var(--serif); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: var(--r-sm); font-size: .95rem; }
.nav a:hover { background: var(--sunken); color: var(--ink); }
.nav .btn { margin-left: 6px; color: var(--accent-ink); }
.nav .btn:hover { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 640px) { .nav a:not(.btn) { display: none; } }

.site-footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 32px 0 48px; color: var(--ink-3); font-size: .875rem; }
.site-footer .cols { display: grid; gap: 20px; grid-template-columns: 2fr 1fr; }
@media (max-width: 720px) { .site-footer .cols { grid-template-columns: 1fr; } }

/* ---- buttons, inputs ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 .95rem/1 var(--sans);
  padding: 12px 18px; border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); transition: transform .06s ease, filter .15s ease; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-quiet:hover { background: var(--sunken); filter: none; }
.btn-sm { padding: 8px 12px; font-size: .875rem; }

label { font-weight: 600; display: block; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--ink-3); font-size: .875rem; }
input[type=text], input[type=email], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 11px 12px; }
textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent); border-color: var(--focus); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }

/* chips: used for keywords, examples and country checkboxes */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2); font-size: .875rem; line-height: 1.3; }
button.chip { cursor: pointer; font: inherit; font-size: .875rem; }
button.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip-accent { background: var(--accent-soft); border-color: transparent; color: var(--ink); }
.check-chip { position: relative; }
.check-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.check-chip span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: .875rem; }
.check-chip input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.check-chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---- surfaces ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow); }
.notice { border-left: 4px solid var(--warn); background: var(--warn-soft); padding: 10px 14px; border-radius: var(--r-sm); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { display: grid; gap: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
/* Vertical rhythm. `.wrap` sets horizontal padding, so section spacing must be at least as specific or it is
   silently zeroed (it was). Alternate sections sit on a band so the page reads as distinct blocks. */
section.wrap, section .wrap { padding-top: 88px; padding-bottom: 8px; }
.band { background: var(--sunken); border-block: 1px solid var(--line); margin-top: 88px; }
.band > section.wrap, .band > .wrap { padding-top: 64px; padding-bottom: 64px; }
.band + section.wrap { padding-top: 72px; }
.section-head { max-width: 680px; margin-bottom: 28px; }
.section-head .lede { margin-bottom: 0; }
@media (max-width: 640px) {
  section.wrap, section .wrap { padding-top: 56px; }
  .band { margin-top: 56px; }
  .band > section.wrap, .band > .wrap { padding-top: 44px; padding-bottom: 44px; }
}

/* ---- hero + try it ---- */
.hero { padding: 56px 0 24px; display: grid; gap: 40px; grid-template-columns: 1.05fr 1fr; align-items: start; }
@media (max-width: 920px) { .hero { grid-template-columns: 1fr; padding-top: 32px; } }
.hero-points { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; color: var(--ink-2); }
.hero-points li { display: flex; gap: 10px; align-items: baseline; }
@media (max-width: 640px) { .hero-points { display: none; } .hero { gap: 20px; } }  /* on a phone, the try box is the first screen */
.hero-points li::before { content: ""; flex: 0 0 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }
.try .examples { margin: 10px 0 14px; }
.try-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status { font-size: .875rem; color: var(--ink-3); min-height: 1.4em; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.understood { background: var(--sunken); border-radius: var(--r); padding: 14px 16px; margin: 18px 0 14px; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.result { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface); }
.result a.title { color: var(--ink); font-weight: 600; text-decoration: none; }
.result a.title:hover { color: var(--accent); text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; color: var(--ink-3); margin-top: 4px; }
.matched { margin-top: 8px; }
.matched .chip { font-size: .78rem; padding: 2px 8px; }
.reveal { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- memo card (the product) ---- */
.memo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.memo-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.memo-body { padding: 16px 20px 20px; }
.verdict { display: inline-flex; align-items: center; gap: 8px; font: 700 .75rem/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; }
.verdict::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.v-eligible { color: var(--ok); background: var(--ok-soft); }
.v-borderline { color: var(--warn); background: var(--warn-soft); }
.v-unclear { color: var(--muted); background: var(--muted-soft); }
.v-not_eligible { color: var(--bad); background: var(--bad-soft); }
.memo-title { font: 600 1.15rem/1.3 var(--serif); margin: 10px 0 4px; }
.memo-title a { color: var(--ink); text-decoration: none; }
.memo-title a:hover { color: var(--accent); text-decoration: underline; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0 4px; }
.fact { background: var(--sunken); border-radius: var(--r-sm); padding: 8px 10px; }
.fact b { display: block; font: 600 .7rem/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; }
.meter { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.meter > i { display: block; height: 100%; background: var(--ink-2); border-radius: inherit; }
.memo .sub { font: 600 .78rem/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 18px 0 8px; }
.memo ul, .memo ol { margin: 0; padding-left: 20px; }
.memo li + li { margin-top: 4px; }
.quote { margin: 8px 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-family: var(--serif); }
.quote cite { display: block; margin-top: 4px; font: .8rem var(--sans); color: var(--ink-3); font-style: normal; }
.flags li { color: var(--bad); }
.flags li span { color: var(--ink-2); }
details.more { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }

/* ---- pricing ---- */
.plan { display: flex; flex-direction: column; gap: 10px; }
.plan .price { font: 600 2rem/1 var(--serif); }
.plan .price small { font: 400 .9rem var(--sans); color: var(--ink-3); }
.plan ul { padding-left: 18px; margin: 4px 0 12px; color: var(--ink-2); }
.plan .btn { margin-top: auto; }
.plan-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
label.plan-option { display: block; cursor: pointer; font-weight: 400; margin: 0; }
label.plan-option input { position: absolute; opacity: 0; }
label.plan-option .card { box-shadow: none; transition: border-color .15s; }
label.plan-option input:checked + .card { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
label.plan-option input:focus-visible + .card { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---- tables, faq ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); background: var(--sunken); }
tr:last-child td { border-bottom: 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--ink-3); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin-top: 8px; color: var(--ink-2); }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 600 .9rem var(--sans); margin-bottom: 10px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* ---- browse: country picker, switcher, tabs ---- */
.crumbs { color: var(--ink-3); margin-bottom: 10px; }
.crumbs a { color: var(--ink-2); }
.country-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.country-head h1 { margin-bottom: 6px; }
.picker-region + .picker-region { margin-top: 18px; }
.picker-title { font: 600 .75rem/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.picker { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.picker a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); text-decoration: none; }
.picker a:hover { border-color: var(--accent); }
.picker a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.picker-count { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.picker a[aria-current="page"] .picker-count { color: inherit; }
.switcher { position: relative; }
.switcher summary { list-style: none; }
.switcher summary::-webkit-details-marker { display: none; }
.switcher-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 4; width: min(720px, calc(100vw - 40px)); max-height: 70vh; overflow: auto; }
@media (max-width: 640px) { .switcher-panel { position: static; width: auto; margin-top: 10px; } }
.tabs { display: flex; gap: 6px; margin: 14px 0 4px; }
.tabs a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2); text-decoration: none; font-size: .9rem; }
.tabs a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---- visuals: inline SVG illustrations themed by tokens ---- */
.pipeline { margin: 8px 0 36px; }
.pipeline svg { width: 100%; height: auto; display: block; }
.v-card { fill: var(--surface); stroke: var(--line-strong); }
.v-paper-fill { fill: var(--paper); }
.v-ink-fill { fill: var(--ink); }
.v-ink-line { fill: var(--ink-2); }
.v-line-fill { fill: var(--line); }
.v-accent-fill { fill: var(--accent); }
.v-accent-soft { fill: var(--accent-soft); }
.v-ok-fill { fill: var(--ok); }
.v-ok-soft { fill: var(--ok-soft); }
.v-ink3-fill { fill: var(--ink-3); }
.v-flow { fill: none; stroke: var(--line-strong); stroke-width: 1.6; stroke-dasharray: 3 4; }
.v-label { font: 600 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; fill: var(--ink-3); }
.v-text { font: 500 13.5px var(--sans); fill: var(--ink); }
.v-mark { font: 700 21px var(--serif); fill: var(--ink); }
.v-on-ink-strong { font: 600 15px var(--sans); fill: var(--paper); }
.v-on-ink { font: 13px var(--sans); fill: var(--paper); opacity: .8; }
.v-pill-ok { font: 700 10.5px var(--sans); letter-spacing: .06em; fill: var(--ok); }
.v-quote { font: italic 13px var(--serif); fill: var(--ink); }
@media (max-width: 640px) { .pipeline { margin-left: -8px; margin-right: -8px; } }

.icon { width: 26px; height: 26px; color: var(--accent); }
.icon-tile { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; margin-bottom: 14px; }
.steps.with-icons li::before { display: none; }
.steps .step-n { font: 600 .75rem/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 6px; }

.sources-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 18px 0 0; }
.src { font-size: .85rem; color: var(--ink-2); text-decoration: none; border: 1px solid var(--line); background: var(--surface); padding: 4px 10px; border-radius: 999px; }
.src small { color: var(--ink-3); font-size: .75rem; margin-left: 2px; }
.src:hover { border-color: var(--accent); color: var(--ink); }

.trust-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.trust-grid .card { box-shadow: none; }
.trust-grid h2, .trust-grid h3 { font-size: 1.05rem; margin-top: 2px; }
.trust-grid p { color: var(--ink-2); font-size: .93rem; margin: 0; }
@media (max-width: 960px) { .trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .trust-grid { grid-template-columns: 1fr; } }

.prose { max-width: 720px; }
.prose h2 { font-size: 1.45rem; margin-top: 36px; }
.prose h3 { font-size: 1.12rem; margin-top: 24px; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.updated { font-size: .85rem; color: var(--ink-3); }
.facts-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.facts-list dt { color: var(--ink-3); }
.facts-list dd { margin: 0; color: var(--ink); }

.site-footer .cols { grid-template-columns: 2fr 1fr 1fr 1fr; }
.site-footer h2 { font: 600 .75rem/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--ink-2); }
@media (max-width: 860px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }

/* Tables that become stacked cards on phones; each cell labels itself from data-label. */
@media (max-width: 640px) {
  .stack-table thead { display: none; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
  .stack-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .stack-table tr:last-child { border-bottom: 0; }
  .stack-table td { border: 0; padding: 3px 14px; }
  .stack-table td[data-label]::before { content: attr(data-label); display: block; font: 600 .7rem/1.4 var(--sans);
    letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
  .stack-table td:first-child { font-weight: 600; }
}
