/* Cogniva family demo — base system
   Direction: editorial-monocle. Paper, ink, one brick accent, hairlines. */

:root {
  --bg:      oklch(98% 0.004 95);
  --surface: oklch(100% 0.002 95);
  --fg:      oklch(20% 0.018 70);
  --muted:   oklch(48% 0.012 70);
  --border:  oklch(90% 0.006 95);
  --accent:  oklch(52% 0.10 28);

  --accent-soft: color-mix(in oklch, var(--accent) 11%, var(--surface));
  --fg-soft:     color-mix(in oklch, var(--fg) 5%, var(--surface));
  --fg-mid:      color-mix(in oklch, var(--fg) 74%, var(--surface));

  --font-display: 'Iowan Old Style', 'Charter', Georgia, 'Times New Roman', serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;

  --fs-h1: clamp(42px, 5.4vw, 68px);
  --fs-h2: clamp(30px, 3.4vw, 44px);
  --fs-h3: 21px;
  --fs-lead: 18px;
  --fs-body: 16px;
  --fs-meta: 13px;

  --gap-xs: 8px;
  --gap-sm: 12px;
  --gap-md: 20px;
  --gap-lg: 32px;
  --gap-xl: 56px;
  --gap-2xl: 92px;
  --container: 1160px;
  --gutter: 32px;

  --radius: 4px;
  --radius-lg: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
::selection { background: var(--accent-soft); color: var(--fg); }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(48px, 7vw, var(--gap-2xl)); }
.section + .section { border-top: 1px solid var(--border); }
.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--gap-md); }
.row { display: flex; align-items: center; gap: var(--gap-md); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-md); }
.grid-2-1 { display: grid; grid-template-columns: 1.7fr 1fr; gap: var(--gap-xl); align-items: start; }

@media (max-width: 920px) {
  .grid-2, .grid-3, .grid-4, .grid-2-1 { grid-template-columns: 1fr; }
}

/* type */
h1, .h1 { font-family: var(--font-display); font-size: var(--fs-h1); line-height: 1.03; letter-spacing: -0.025em; margin: 0; font-weight: 600; }
h2, .h2 { font-family: var(--font-display); font-size: var(--fs-h2); line-height: 1.08; letter-spacing: -0.02em; margin: 0; font-weight: 600; }
h3, .h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; margin: 0; }
.page-title { font-family: var(--font-display); font-size: clamp(34px, 4vw, 52px); line-height: 1.04; letter-spacing: -0.02em; margin: 0; font-weight: 600; }
.lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--muted); max-width: 58ch; margin: 0; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--gap-md);
}
.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.meta { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--muted); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.rule { border: 0; border-top: 1px solid var(--border); margin: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* chrome */
.topnav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklch, var(--bg) 93%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md); padding-block: 14px; }
.brand { display: inline-flex; align-items: baseline; gap: 10px; font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand-sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.nav-links { display: flex; gap: var(--gap-lg); }
.nav-links a { font-size: 14px; color: var(--muted); }
.nav-links a:hover { color: var(--fg); }
.nav-actions { display: flex; align-items: center; gap: var(--gap-sm); }
.appbar .crumb { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.appbar .divider { width: 1px; height: 18px; background: var(--border); }
.pagefoot { padding-block: var(--gap-xl); border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.pagefoot .row-between { flex-wrap: wrap; gap: var(--gap-md); align-items: flex-start; }
.foot-note { margin: 0; max-width: 44ch; font-size: 12px; line-height: 1.6; color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: var(--gap-md); }
.foot-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.foot-links a:hover { color: var(--fg); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 15px; font-weight: 500; letter-spacing: -0.005em;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: color-mix(in oklch, var(--accent) 86%, black); border-color: color-mix(in oklch, var(--accent) 86%, black); }
.btn-secondary { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--fg); }
.btn-ghost { background: transparent; color: var(--fg); border-color: transparent; padding-inline: 6px; }
.btn-ghost:hover:not(:disabled) { color: var(--accent); }
.btn-sm { min-height: 34px; padding: 6px 13px; font-size: 13px; }
.btn-arrow::after { content: '\2192'; transition: transform .15s ease; }
.btn-arrow:hover::after { transform: translateX(2px); }
.btn-block { width: 100%; }

/* tags, status, avatar */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}
.tag-solid { background: var(--fg); border-color: var(--fg); color: var(--surface); }
.status {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.04em;
  white-space: nowrap;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none; }
.status--submitted { color: var(--fg); }
.status--submitted::before { background: var(--fg); }
.status--pending { color: var(--muted); }
.status--pending::before { border: 1px solid var(--muted); background: transparent; }
.status--progress { color: var(--fg); }
.status--progress::before { border: 1.5px solid var(--fg); background: transparent; }
.avatar {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.03em;
  color: var(--fg-mid);
}

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.card-flat { background: transparent; border: 0; padding: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--gap-md); padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.card-body { padding-top: 10px; }

/* mini form */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-family: var(--font-mono); color: var(--muted); letter-spacing: 0.03em; }
.input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 15px;
}
.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 12px);
  background: var(--fg); color: var(--surface);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 90;
  max-width: calc(100vw - 32px);
}
.toast.is-open { opacity: 1; transform: translate(-50%, 0); }

/* dialog */
dialog {
  width: min(620px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--surface);
  color: var(--fg);
}
dialog::backdrop { background: color-mix(in oklch, var(--fg) 45%, transparent); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--gap-md); padding: 22px 24px 16px; border-bottom: 1px solid var(--border); }
.dialog-body { padding: 8px 24px 24px; max-height: 60vh; overflow: auto; }
.answer-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.answer-row:last-child { border-bottom: 0; }
.answer-row p { margin: 0; font-size: 14px; }
.answer-row .num { font-size: 13px; color: var(--fg); }