/* CriterionMD — global tokens & base */
:root {
  --bg: #FAFAF7;
  --paper: #FFFFFF;
  --paper-2: #F4F4EF;
  --ink: #0A0F0F;
  --ink-2: #2A3331;
  --ink-3: #5A6360;
  --ink-4: #99A19D;
  --line: #E4E4DE;
  --line-2: #EFEFE9;
  --accent: #1F5C3D;
  --accent-ink: #143C28;
  --accent-tint: #EEF3EE;
  --accent-tint-2: #DDE7DE;
  --warn: #B45A1A;
  --warn-tint: #FBEFE3;
  --danger: #8C2F2F;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 0 rgba(15,20,20,.04), 0 1px 2px rgba(15,20,20,.04);
  --shadow-md: 0 2px 4px rgba(15,20,20,.04), 0 12px 32px rgba(15,20,20,.06);
  --shadow-lg: 0 4px 8px rgba(15,20,20,.04), 0 24px 60px rgba(15,20,20,.10);
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --maxw: 1440px;
  --pad-x: 1.25in;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--accent-tint-2); color: var(--accent-ink); }

/* Layout */
.cmd-shell { min-height: 100vh; display: flex; flex-direction: column; }
.cmd-container { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad-x); padding-right: var(--pad-x); width: 100%; }
.cmd-main { flex: 1; }

/* Header */
.cmd-header {
  position: sticky; top: 0; z-index: 50;
  background:
    radial-gradient(1100px 620px at 50% -140px, rgba(32,118,79,0.82) 0%, rgba(32,118,79,0) 58%),
    radial-gradient(820px 520px at 86% 60px, rgba(21,88,60,0.82) 0%, rgba(21,88,60,0) 60%),
    linear-gradient(170deg, rgba(12,65,49,0.85) 0%, rgba(6,35,26,0.85) 100%);
  background-attachment: fixed, fixed, fixed;
  background-repeat: no-repeat;
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  box-shadow: 0 10px 30px -18px rgba(0,0,0,0.35);
}
.cmd-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.cmd-nav { display: flex; gap: 28px; align-items: center; margin: 0 44px; }
.cmd-nav a {
  font-size: 17px; color: rgba(255,255,255,0.80); font-weight: 450;
  letter-spacing: -0.005em;
  padding: 6px 0; position: relative;
  white-space: nowrap;
}
.cmd-nav a:hover { color: #fff; }
.cmd-nav a.active { color: #fff; }
.cmd-nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -22px;
  height: 1px; background: #5FD39A;
}
.cmd-header-cta { display: flex; gap: 10px; align-items: center; }
.cmd-header .btn-primary { background: #fff; color: var(--accent-ink); }
.cmd-header .btn-primary:hover { background: rgba(255,255,255,0.9); }
.cmd-header .btn-ghost {
  color: #fff;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.28);
}
.cmd-header .btn-ghost:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.5); }

/* Wordmark */
.cmd-wordmark {
  display: inline-flex; align-items: center; gap: 0;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  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;
  white-space: nowrap;
}
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(15, 20, 20, 0.05); }
.btn-outline { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink-3); }
.btn-arrow svg { transition: transform .15s ease; }
.btn-arrow:hover svg { transform: translateX(2px); }

/* Type */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 16px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); font-weight: 400;
}
.eyebrow-dot::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  background: var(--accent); border-radius: 999px;
  margin-right: 8px; vertical-align: middle;
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.028em; color: var(--ink); }
.h-display {
  font-size: clamp(40px, 5.4vw, 68px);
  line-height: 1.02; font-weight: 500; letter-spacing: -0.035em;
}
.h-1 {
  font-size: clamp(36px, 4.2vw, 56px);
  line-height: 1.06; font-weight: 500; letter-spacing: -0.03em;
}
.h-2 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.12; font-weight: 500; letter-spacing: -0.025em;
}
.h-3 {
  font-size: 24px; line-height: 1.3; font-weight: 500; letter-spacing: -0.015em;
}
.lede {
  font-size: 20px; line-height: 1.55; color: var(--ink-2); max-width: 64ch;
  font-weight: 400;
}
.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); }

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card-pad { padding: 24px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Section padding */
.section { padding: 56px 0; }
.section-tight { padding: 36px 0; }
.section-divider { border-top: 1px solid var(--line); }

/* Full-bleed background bands — create vertical rhythm between cream sections.
   Use sparingly and alternate: warm (off-white) is the workhorse, tint (soft
   green) for emphasis moments. Banded sections drop the hairline divider since
   the color change is the separator. */
.band-warm { background: var(--paper-2); }
.band-tint { background: var(--accent-tint); }
.band-warm.section-divider, .band-tint.section-divider { border-top-color: transparent; }
/* Soft seam where a band meets cream, so edges don't look like hard steps */
.band-warm, .band-tint { box-shadow: inset 0 1px 0 rgba(255,255,255,0.5); }

/* Deep emerald band — matches the hero. Light text; subtle grid texture. */
.emerald-field {
  background:
    radial-gradient(1100px 620px at 50% -140px, #20764f 0%, rgba(32,118,79,0) 58%),
    radial-gradient(820px 520px at 86% 60px, #15583c 0%, rgba(21,88,60,0) 60%),
    linear-gradient(170deg, #0c4131 0%, #06231a 100%);
  background-attachment: fixed, fixed, fixed;
  background-repeat: no-repeat;
}
.band-emerald {
  position: relative;
  background:
    radial-gradient(120% 78% at 50% -12%, #1f7350 0%, rgba(31,115,80,0) 56%),
    radial-gradient(86% 70% at 87% 12%, #165a3d 0%, rgba(22,90,61,0) 60%),
    radial-gradient(70% 60% at 8% 30%, #0f4a34 0%, rgba(15,74,52,0) 62%),
    linear-gradient(168deg, #0c4131 0%, #06231a 100%);
  color: #fff;
}
.band-emerald.section-divider { border-top-color: transparent; }
.band-emerald::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.05;
  background-image:
    linear-gradient(rgba(255,255,255,.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.7) 1px, transparent 1px);
  background-size: 42px 42px;
}
.band-emerald > .cmd-container { position: relative; z-index: 1; }

/* Footer */
.cmd-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  padding: 32px 0 20px;
  margin-top: 48px;
}
.cmd-footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
}
.cmd-footer h5 {
  font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); margin: 0 0 18px; font-weight: 400;
  font-family: var(--font-mono);
}
.cmd-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.cmd-footer a { font-size: 15px; color: var(--ink-2); }
.cmd-footer a:hover { color: var(--ink); }
.cmd-footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--ink-2);
}
.cmd-footer-bottom a { font-size: 14px; }

/* Pills, tags */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  background: var(--accent-tint); color: var(--accent-ink);
  border: 1px solid var(--accent-tint-2);
}
.pill-neutral { background: var(--paper-2); color: var(--ink-2); border-color: var(--line); }
.pill-warn { background: var(--warn-tint); color: var(--warn); border-color: #F1D9BB; }
.pill-dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: currentColor; opacity: 0.8;
}

/* Mock UI primitives */
.mock {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.mock-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--ink-3);
}
.mock-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--line); }

.im-live-dot { box-shadow: 0 0 0 0 rgba(31,92,61,0.45); }
@media (prefers-reduced-motion: no-preference) {
  .im-live-dot { animation: imLiveDot 1.8s ease-out infinite; }
}
@keyframes imLiveDot {
  0% { box-shadow: 0 0 0 0 rgba(31,92,61,0.45); }
  70% { box-shadow: 0 0 0 6px rgba(31,92,61,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,92,61,0); }
}
.crit-row {
  opacity: 0; transform: translateX(-6px);
}
@media (prefers-reduced-motion: no-preference) {
  .crit-row { animation: critRowIn .5s cubic-bezier(.2,.7,.2,1) forwards; }
}
@media (prefers-reduced-motion: reduce) {
  .crit-row { opacity: 1; transform: none; }
}
@keyframes critRowIn { to { opacity: 1; transform: translateX(0); } }

/* Subtle grid background for diagrams */
.grid-bg {
  background-image:
    linear-gradient(var(--line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}

/* Form */
.input, .textarea, .select {
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; font: inherit; font-size: 14px; color: var(--ink);
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { height: auto; padding: 12px 14px; min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.label {
  display: block; font-size: 14px; color: var(--ink-2);
  margin-bottom: 6px; font-weight: 450;
}

/* Misc */
.row { display: flex; gap: 16px; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* Header/page responsive plan — bands derived from measured natural widths
   (full nav 717, mid nav 568, tight nav ~502, wordmark 219/172, ghost 84,
   CTA 168, side pads 4.5vw capped at 1.25in):
   ≥1440      full 1.25in margins + full header        (1198 + 240 = 1438 ✓)
   1320–1439  fluid 4.5vw margins + full header        (1198 + .09w ≤ w ✓)
   1241–1319  fluid margins + mid-compressed nav       (1049 + .09w ≤ w ✓)
   926–1240   small wordmark + tight nav, ghost hidden ( 842 + .09w ≤ w ✓)
   ≤925       nav hidden                               ( 423 max ✓) */
@media (max-width: 1449px) {
  :root { --pad-x: clamp(24px, 4.5vw, 1.25in); }
}

@media (max-width: 1330px) {
  .cmd-nav { gap: 18px; }
  .cmd-nav a { font-size: 13px; }
}

@media (max-width: 1240px) {
  .cmd-header .cmd-wordmark img { height: 40px !important; }
  .cmd-nav { gap: 12px; }
  .cmd-nav a { font-size: 12.5px; }
  .cmd-header-cta .btn:not(.btn-primary) { display: none; }
}

@media (max-width: 965px) {
  .cmd-nav { display: none; }
}

@media (max-width: 720px) {
  :root { --pad-x: 24px; }
  .grid-2, .grid-3, .grid-4, .cmd-footer-grid { grid-template-columns: 1fr; }
  .section { padding: 40px 0; }
}
