/* ============================================================
   Coterra Design System — system.css
   Source of truth: planning repo branding/brand-direction.md
   Last sync: 2026-06-12
   ============================================================ */

/* ---- Adobe Typekit ---- */
/* Linked from index.html via <link rel="stylesheet" href="https://use.typekit.net/sqp4bwn.css">
   Loaded families: dm-serif-display, dm-serif-text, pacaembu (100-800) */

/* ---- Design Tokens ---- */

:root {
  /* Colors — locked Direction A palette */
  --coterra-primary:      #A0492D;
  --coterra-background:   #F5EDE0;
  --coterra-secondary:    #3F5340;
  --coterra-ink:          #1F1A14;
  --coterra-accent:       #C99843;
  --coterra-canvas-alt:   #EEE3D0;
  --coterra-error:        #7E2F18;

  /* Derived darker shades for borders + hovers */
  --coterra-primary-dark:    #7E2F18;
  --coterra-secondary-dark:  #2A3A2B;
  --coterra-accent-dark:     #A37A30;
  --coterra-canvas-alt-dark: #D9CEB8;
  --coterra-cream-dark:      #E8DDC9;
  --coterra-charcoal-deep:   #0E0B07;

  /* Soft / translucent layers */
  --coterra-ink-soft:        rgba(31, 26, 20, 0.65);
  --coterra-ink-faint:       rgba(31, 26, 20, 0.40);
  --coterra-primary-soft:    rgba(160, 73, 45, 0.10);
  --coterra-secondary-soft:  rgba(63, 83, 64, 0.12);
  --coterra-accent-soft:     rgba(201, 152, 67, 0.14);
  --coterra-cream-on-dark:   rgba(245, 237, 224, 0.85);

  /* Typography */
  --font-display:   "dm-serif-display", "Times New Roman", serif;
  --font-editorial: "dm-serif-text",    "Georgia",        serif;
  --font-ui:        "pacaembu",         system-ui,        -apple-system, sans-serif;
  --font-mono:      ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Type scale */
  --text-hero:     4rem;
  --text-h1:       3rem;
  --text-h2:       2.25rem;
  --text-h3:       1.5rem;
  --text-h4:       1.25rem;
  --text-body:     1rem;
  --text-small:    0.875rem;
  --text-micro:    0.75rem;
  --text-stat:     5rem;

  /* Line heights */
  --lh-display: 1.1;
  --lh-heading: 1.2;
  --lh-body:    1.5;
  --lh-ui:      1.45;
  --lh-tight:   1;

  /* Spacing scale (8px-based) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Radii */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-pill: 9999px;

  /* Shadows — restrained, never harsh */
  --shadow-sm: 0 1px 2px rgba(31, 26, 20, 0.06);
  --shadow-md: 0 2px 8px rgba(31, 26, 20, 0.08);
  --shadow-lg: 0 4px 16px rgba(31, 26, 20, 0.10);
  --focus-ring: 0 0 0 3px var(--coterra-primary-soft);
}

/* ---- Base ---- */

* { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--coterra-background);
  color: var(--coterra-ink);
  font-family: var(--font-ui);
  font-size: var(--text-body);
  line-height: var(--lh-ui);
}

/* ---- Typography classes ---- */

.font-display   { font-family: var(--font-display); font-weight: 400; line-height: var(--lh-display); letter-spacing: -0.01em; }
.font-editorial { font-family: var(--font-editorial); font-weight: 400; line-height: var(--lh-body); }
.font-ui        { font-family: var(--font-ui); font-weight: 400; line-height: var(--lh-ui); }
.font-mono      { font-family: var(--font-mono); }

.heading-hero { font: 400 var(--text-hero)/var(--lh-display) var(--font-display); letter-spacing: -0.02em; }
.heading-1    { font: 400 var(--text-h1)/var(--lh-display) var(--font-display); letter-spacing: -0.01em; }
.heading-2    { font: 700 var(--text-h2)/var(--lh-heading) var(--font-ui); }
.heading-3    { font: 600 var(--text-h3)/var(--lh-heading) var(--font-display); }
.heading-4    { font: 600 var(--text-h4)/var(--lh-heading) var(--font-ui); }

.body-editorial { font: 400 var(--text-body)/var(--lh-body) var(--font-editorial); }
.body-ui        { font: 400 var(--text-body)/var(--lh-ui)  var(--font-ui); }
.body-small     { font: 400 var(--text-small)/var(--lh-ui) var(--font-ui); }
.body-micro     { font: 400 var(--text-micro)/var(--lh-ui) var(--font-ui); }

.label {
  font: 600 var(--text-small)/1 var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.label-micro {
  font: 600 var(--text-micro)/1 var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- Links ---- */

.link {
  color: var(--coterra-ink);
  text-decoration: underline;
  text-decoration-color: var(--coterra-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}
.link:hover { color: var(--coterra-primary); text-decoration-color: var(--coterra-primary); }
.link:focus-visible {
  outline: none;
  background: var(--coterra-primary-soft);
  border-radius: var(--radius-sm);
}

.link-subtle {
  color: var(--coterra-ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--coterra-ink-faint);
  text-underline-offset: 3px;
}
.link-subtle:hover { color: var(--coterra-ink); text-decoration-color: var(--coterra-accent); }

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--text-body);
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:active        { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15); }

.btn-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--coterra-primary);
  color: var(--coterra-background);
  padding: var(--space-3) var(--space-6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: var(--text-small);
}
/* Radial fill on hover — circle darkens from cursor position outward */
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle 140px at var(--mx, 50%) var(--my, 50%),
                              rgba(0, 0, 0, 0.30) 0%,
                              rgba(0, 0, 0, 0) 70%);
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active        { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15); }

.btn-secondary {
  background: transparent;
  color: var(--coterra-ink);
  border-color: var(--coterra-ink);
  padding: var(--space-3) var(--space-6);
}
.btn-secondary:hover {
  background: var(--coterra-ink);
  color: var(--coterra-background);
}

.btn-ghost {
  background: transparent;
  color: var(--coterra-primary);
  padding: var(--space-3) var(--space-4);
}
.btn-ghost:hover { background: var(--coterra-primary-soft); }

/* Buttons-on-dark — invert to cream fill / primary text on hover */
.btn-on-dark {
  background: transparent;
  color: var(--coterra-background);
  border-color: var(--coterra-background);
  padding: var(--space-3) var(--space-6);
}
.btn-on-dark:hover {
  background: var(--coterra-background);
  color: var(--coterra-primary);
  border-color: var(--coterra-background);
}

.btn-sm   { padding: var(--space-2) var(--space-4); font-size: var(--text-micro); }
.btn-lg   { padding: var(--space-4) var(--space-8); font-size: var(--text-body); }
.btn-block { display: flex; width: 100%; }

.btn[disabled], .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---- Form controls ---- */

.input,
.select,
.textarea {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font: 400 var(--text-body)/var(--lh-ui) var(--font-ui);
  color: var(--coterra-ink);
  background: #FFFFFF;
  border: 1px solid var(--coterra-canvas-alt-dark);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--coterra-primary);
  box-shadow: var(--focus-ring);
}
.input::placeholder,
.textarea::placeholder { color: var(--coterra-ink-faint); }
.input[disabled],
.select[disabled],
.textarea[disabled] { background: var(--coterra-canvas-alt); cursor: not-allowed; opacity: 0.7; }

.textarea { min-height: 120px; resize: vertical; }

.input-label {
  display: block;
  margin-bottom: var(--space-2);
  font: 600 var(--text-small)/1 var(--font-ui);
  color: var(--coterra-ink);
}

.input-help {
  margin-top: var(--space-2);
  font: 400 var(--text-micro)/var(--lh-ui) var(--font-ui);
  color: var(--coterra-ink-soft);
}

.input-error-msg {
  margin-top: var(--space-2);
  font: 600 var(--text-micro)/var(--lh-ui) var(--font-ui);
  color: var(--coterra-error);
}

.input.has-error,
.select.has-error,
.textarea.has-error { border-color: var(--coterra-error); }

.input-search {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F1A14' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='0.45'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>");
  background-repeat: no-repeat;
  background-position: var(--space-3) center;
  background-size: 18px 18px;
  padding-left: calc(var(--space-3) + 24px);
}

.input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--coterra-canvas-alt-dark);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #FFFFFF;
}
.input-group:focus-within { border-color: var(--coterra-primary); box-shadow: var(--focus-ring); }
.input-group .input { border: none; border-radius: 0; box-shadow: none; }
.input-group .input:focus { box-shadow: none; }
.input-group-addon {
  display: flex; align-items: center; justify-content: center;
  padding: 0 var(--space-3);
  background: var(--coterra-canvas-alt);
  border-left: 1px solid var(--coterra-canvas-alt-dark);
  font: 400 var(--text-small)/1 var(--font-ui);
  color: var(--coterra-ink-soft);
}
.input-group-addon-prefix {
  border-left: none;
  border-right: 1px solid var(--coterra-canvas-alt-dark);
}

/* Custom checkbox / radio */
.choice {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}
.choice input[type="checkbox"],
.choice input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  background: #FFFFFF;
  border: 1px solid var(--coterra-canvas-alt-dark);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.choice input[type="checkbox"] { border-radius: var(--radius-sm); }
.choice input[type="radio"]    { border-radius: var(--radius-pill); }
.choice input:focus-visible    { outline: none; box-shadow: var(--focus-ring); border-color: var(--coterra-primary); }
.choice input:checked          { background: var(--coterra-primary); border-color: var(--coterra-primary); }
.choice input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F5EDE0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}
.choice input[type="radio"]:checked {
  background-image: radial-gradient(circle, var(--coterra-background) 30%, var(--coterra-primary) 32%);
}
.choice-label {
  font: 400 var(--text-body)/var(--lh-ui) var(--font-ui);
  color: var(--coterra-ink);
}
.choice-help {
  display: block;
  margin-top: var(--space-1);
  font: 400 var(--text-micro)/var(--lh-ui) var(--font-ui);
  color: var(--coterra-ink-soft);
}

/* Native select arrow */
.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F1A14' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 18px 18px;
  padding-right: calc(var(--space-3) + 24px);
}

/* ---- Cards (per-fill border tinting) ---- */

.card,
.card-white {
  background: #FFFFFF;
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  color: var(--coterra-ink);
}

.card-cream {
  background: var(--coterra-background);
  border: 1px solid var(--coterra-cream-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  color: var(--coterra-ink);
}

.card-oat {
  background: var(--coterra-canvas-alt);
  border: 1px solid var(--coterra-canvas-alt-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  color: var(--coterra-ink);
}

.card-terracotta {
  background: var(--coterra-primary);
  border: 1px solid var(--coterra-primary-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  color: var(--coterra-background);
}

.card-moss {
  background: var(--coterra-secondary);
  border: 1px solid var(--coterra-secondary-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  color: var(--coterra-background);
}

.card-ochre {
  background: var(--coterra-accent);
  border: 1px solid var(--coterra-accent-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  color: var(--coterra-ink);
}

.card-charcoal {
  background: var(--coterra-ink);
  border: 1px solid var(--coterra-charcoal-deep);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  color: var(--coterra-background);
}

.card-error {
  background: var(--coterra-error);
  border: 1px solid var(--coterra-charcoal-deep);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  color: var(--coterra-background);
}

.card-outline {
  background: transparent;
  border: 1px solid var(--coterra-ink);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  color: var(--coterra-ink);
}

.card-interactive {
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Card sub-elements (legend that adapts to dark backgrounds) */
.card-eyebrow {
  font: 600 var(--text-micro)/1 var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--coterra-primary);
}
.card-terracotta .card-eyebrow,
.card-moss .card-eyebrow,
.card-charcoal .card-eyebrow,
.card-error .card-eyebrow { color: var(--coterra-background); opacity: 0.72; }
.card-ochre .card-eyebrow { color: var(--coterra-ink); opacity: 0.72; }

/* ---- Badges / pills / tags ---- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font: 600 var(--text-micro)/1 var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-pill);
}

.badge-primary { background: var(--coterra-primary); color: var(--coterra-background); }
.badge-soft    { background: var(--coterra-primary-soft); color: var(--coterra-primary); }
.badge-secondary { background: var(--coterra-secondary); color: var(--coterra-background); }
.badge-accent  { background: var(--coterra-accent); color: var(--coterra-ink); }
.badge-outline { background: transparent; color: var(--coterra-ink); border: 1px solid var(--coterra-ink); }
.badge-error   { background: var(--coterra-error); color: var(--coterra-background); }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--coterra-secondary);
  margin-right: var(--space-2);
  vertical-align: 1px;
}

/* ---- Alerts / Notices ---- */

.notice {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--coterra-accent);
  background: var(--coterra-accent-soft);
}
.notice-success { border-left-color: var(--coterra-secondary); background: var(--coterra-secondary-soft); }
.notice-error   { border-left-color: var(--coterra-error); background: rgba(126, 47, 24, 0.08); }
.notice-info    { border-left-color: var(--coterra-secondary); background: var(--coterra-secondary-soft); }

/* ---- Lists ---- */

.list-topo {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list-topo li {
  position: relative;
  padding: var(--space-2) 0 var(--space-2) var(--space-8);
  font: 400 var(--text-body)/var(--lh-body) var(--font-ui);
}
.list-topo li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: calc(var(--space-2) + 0.5em);
  width: 12px;
  height: 12px;
  background: no-repeat center / contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23A0492D' stroke-width='1.2'><circle cx='6' cy='6' r='5'/><circle cx='6' cy='6' r='1.6' fill='%23A0492D' stroke='none'/></svg>");
}

.list-checked {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list-checked li {
  position: relative;
  padding: var(--space-2) 0 var(--space-2) var(--space-8);
  font: 400 var(--text-body)/var(--lh-body) var(--font-ui);
}
.list-checked li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--space-2) + 0.35em);
  width: 18px;
  height: 18px;
  background: no-repeat center / contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233F5340' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
}

.list-numbered {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: coterra-list;
}
.list-numbered li {
  position: relative;
  padding: var(--space-3) 0 var(--space-3) var(--space-12);
  border-bottom: 1px dashed rgba(31, 26, 20, 0.12);
  font: 400 var(--text-body)/var(--lh-body) var(--font-ui);
  counter-increment: coterra-list;
}
.list-numbered li:last-child { border-bottom: none; }
.list-numbered li::before {
  content: counter(coterra-list);
  position: absolute;
  left: 0;
  top: var(--space-3);
  font: 400 1.75rem/1 var(--font-display);
  color: var(--coterra-accent);
  letter-spacing: -0.02em;
}

/* ---- Quote / Blockquote ---- */

.quote {
  position: relative;
  padding: var(--space-6) 0 var(--space-6) var(--space-10);
  margin: 0;
  font: 400 1.75rem/1.3 var(--font-display);
  letter-spacing: -0.01em;
  color: var(--coterra-ink);
}
.quote::before {
  content: "\201C";
  position: absolute;
  left: 0;
  top: 0;
  font: 400 5rem/1 var(--font-display);
  color: var(--coterra-accent);
  line-height: 0.85;
}
.quote-attribution {
  display: block;
  margin-top: var(--space-4);
  font: 600 var(--text-small)/1 var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--coterra-ink-soft);
}

/* ---- Stats / Numbers ---- */

.stat-block {
  text-align: left;
}
.stat-number {
  display: block;
  font: 400 var(--text-stat)/0.9 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--coterra-primary);
}
.stat-label {
  display: block;
  margin-top: var(--space-2);
  font: 600 var(--text-micro)/1.4 var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--coterra-ink-soft);
}
.stat-context {
  display: block;
  margin-top: var(--space-3);
  font: 400 var(--text-small)/var(--lh-ui) var(--font-ui);
  color: var(--coterra-ink-soft);
  max-width: 28ch;
}

/* ---- Divider ---- */

.divider {
  height: 1px;
  background: rgba(31, 26, 20, 0.12);
  border: none;
  margin: var(--space-8) 0;
}
.divider-dashed {
  background: none;
  border-top: 1px dashed rgba(31, 26, 20, 0.18);
}
.divider-icon {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-8) 0;
  color: var(--coterra-ink-faint);
}
.divider-icon::before,
.divider-icon::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(31, 26, 20, 0.12);
}

/* ---- Tables ---- */

.table {
  width: 100%;
  border-collapse: collapse;
  font: 400 var(--text-body)/var(--lh-ui) var(--font-ui);
  color: var(--coterra-ink);
}
.table thead th {
  text-align: left;
  font: 600 var(--text-micro)/1 var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--coterra-ink-soft);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--coterra-canvas-alt-dark);
}
.table tbody td {
  padding: var(--space-4);
  border-bottom: 1px solid rgba(31, 26, 20, 0.08);
}
.table tbody tr:last-child td { border-bottom: none; }
.table-striped tbody tr:nth-child(even) td { background: var(--coterra-canvas-alt); }

/* ---- Empty state ---- */

.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  border: 1px dashed var(--coterra-canvas-alt-dark);
  border-radius: var(--radius-lg);
  background: var(--coterra-background);
}
.empty-state-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-pill);
  background: var(--coterra-canvas-alt);
  color: var(--coterra-primary);
  margin-bottom: var(--space-4);
}
.empty-state-title {
  font: 600 var(--text-h4)/1.2 var(--font-ui);
  margin: 0 0 var(--space-2);
}
.empty-state-body {
  color: var(--coterra-ink-soft);
  max-width: 40ch;
  margin: 0 auto var(--space-6);
}

/* ---- Inline code / kbd ---- */

code, .code-inline {
  font: 600 0.92em var(--font-mono);
  background: rgba(31, 26, 20, 0.06);
  color: var(--coterra-ink);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

kbd, .kbd {
  font: 600 0.85em var(--font-mono);
  background: var(--coterra-background);
  color: var(--coterra-ink);
  padding: 2px 8px;
  border: 1px solid var(--coterra-canvas-alt-dark);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
}

/* ---- Icon styling ---- */

.icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 32px; height: 32px; }
.icon-xl { width: 48px; height: 48px; }

/* ---- Avatar ---- */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--coterra-canvas-alt);
  color: var(--coterra-ink);
  font: 600 var(--text-small)/1 var(--font-ui);
  flex-shrink: 0;
}
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-body); }
.avatar-sm { width: 28px; height: 28px; font-size: var(--text-micro); }

/* ---- Color swatch (showcase only — design-system page) ---- */

.swatch {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--coterra-canvas-alt-dark);
  align-self: start;            /* prevents grid-stretch empty band */
}
.swatch-color { height: 120px; }
.swatch-meta  { padding: var(--space-4); background: #FFFFFF; }
.swatch-name  { font: 600 var(--text-small)/1.3 var(--font-ui); color: var(--coterra-ink); margin: 0 0 var(--space-1); }
.swatch-hex   { font: 400 var(--text-micro)/1.3 var(--font-mono); color: var(--coterra-ink-soft); margin: 0; }
.swatch-use   { font: 400 var(--text-micro)/1.4 var(--font-ui); color: var(--coterra-ink-soft); margin: var(--space-2) 0 0; }

/* ---- Spacing scale viz ---- */

.spacing-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px dashed rgba(31, 26, 20, 0.12);
  font: 400 var(--text-small)/1 var(--font-ui);
}
.spacing-row:last-child { border-bottom: none; }
.spacing-row-token {
  width: 120px;
  font: 600 var(--text-micro)/1 var(--font-mono);
  color: var(--coterra-ink-soft);
}
.spacing-row-bar {
  height: 16px;
  background: var(--coterra-primary);
  border-radius: var(--radius-sm);
}
.spacing-row-value {
  font: 400 var(--text-micro)/1 var(--font-mono);
  color: var(--coterra-ink-soft);
}

/* ---- Layout helpers ---- */

.container { max-width: 1100px; margin: 0 auto; padding: 0 var(--space-6); }

.section { padding: var(--space-16) 0; border-bottom: 1px solid rgba(31, 26, 20, 0.12); }
.section:last-of-type { border-bottom: none; }

.section-eyebrow {
  display: inline-block;
  margin-bottom: var(--space-4);
  padding: var(--space-1) var(--space-3);
  background: var(--coterra-primary-soft);
  color: var(--coterra-primary);
  border-radius: var(--radius-pill);
  font: 600 var(--text-micro)/1 var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.section-title { margin: 0 0 var(--space-3); }
.section-lede  { max-width: 60ch; color: var(--coterra-ink-soft); margin: 0 0 var(--space-8); }

/* Responsive grid scale:
   - Mobile portrait (default):           1 column always
   - Tablet portrait / mobile landscape:  2 columns at ≥640px
   - Tablet landscape:                    3 columns at ≥1024px (grid-3 + grid-4)
   - Desktop wide:                        4 columns at ≥1280px (grid-4 only)
*/
.grid-2, .grid-3, .grid-4 {
  display: grid;
  gap: var(--space-6);
  align-items: start;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 640px) {
  .heading-hero { font-size: 2.5rem; }
  .heading-1    { font-size: 2rem; }
  .stat-number  { font-size: 3.5rem; }
}

/* Tables inside cards overflow on mobile — wrap them in .table-scroll
   for horizontal scroll without breaking the card padding. */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(var(--space-6) * -1);
  padding: 0 var(--space-6);
  scrollbar-width: thin;
}
.table-scroll .table { min-width: 520px; }

/* ---- Mark / Logo placement ---- */

.mark-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  height: 220px;
  border: 1px solid var(--coterra-canvas-alt-dark);
}
.mark-frame-cream      { background: var(--coterra-background); }
.mark-frame-terracotta { background: var(--coterra-primary); }
.mark-frame-moss       { background: var(--coterra-secondary); }

.mark-frame img { max-height: 100%; max-width: 100%; object-fit: contain; mix-blend-mode: multiply; }
.mark-frame-terracotta img,
.mark-frame-moss img { mix-blend-mode: screen; filter: brightness(1.4); }

/* ---- Anti-list (do/don't showcase) ---- */

.anti-list { list-style: none; padding: 0; margin: 0; }
.anti-list li {
  padding: var(--space-3) 0;
  padding-left: var(--space-8);
  position: relative;
  border-bottom: 1px dashed rgba(31, 26, 20, 0.12);
  color: var(--coterra-ink-soft);
}
.anti-list li:before {
  content: "\2717";
  position: absolute;
  left: var(--space-2);
  color: var(--coterra-error);
  font-weight: 700;
}

/* ---- Footer ---- */

.system-footer {
  padding: var(--space-12) 0 var(--space-16);
  color: var(--coterra-ink-soft);
  text-align: center;
  font-size: var(--text-small);
}

/* ---- Sub-nav (in-page anchor list) ---- */

.subnav-wrapper {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--coterra-background);
  border-bottom: 1px dashed rgba(31, 26, 20, 0.18);
  box-shadow: 0 1px 0 rgba(31, 26, 20, 0.02);
}
.subnav-wrapper .container { position: relative; }
.subnav-wrapper .container::before,
.subnav-wrapper .container::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32px;
  pointer-events: none;
  z-index: 2;
}
.subnav-wrapper .container::before {
  left: var(--space-6);
  background: linear-gradient(to right, var(--coterra-background), transparent);
}
.subnav-wrapper .container::after {
  right: var(--space-6);
  background: linear-gradient(to left, var(--coterra-background), transparent);
}
.subnav {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  margin-bottom: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  position: relative;
  flex-shrink: 0;
  white-space: nowrap;
  scroll-snap-align: center;
  font: 600 var(--text-micro)/1 var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--coterra-ink-soft);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  transition: color 200ms ease;
}
.subnav a::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 0;
  height: 2px;
  background: var(--coterra-accent);
  transition: left 240ms cubic-bezier(0.2, 0.7, 0.3, 1),
              right 240ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
.subnav a:hover           { color: var(--coterra-primary); }
.subnav a:hover::after    { left: var(--space-3); right: var(--space-3); }
.subnav a.is-active       { color: var(--coterra-primary); }
.subnav a.is-active::after { left: var(--space-3); right: var(--space-3); background: var(--coterra-primary); }

/* ============================================================
   Microinteractions (locked 2026-06-12)
   ============================================================ */

/* ---- Reduced motion (surgical: kills only decorative motion; preserves
   functional transitions like focus rings and label floats for accessibility) ---- */
@media (prefers-reduced-motion: reduce) {
  .hero-mark-ripple ellipse {
    animation: none !important;
    opacity: 1 !important;
  }
  .cursor-trail-dot   { display: none !important; }
  .scroll-progress    { display: none !important; }
  .notice-slide-in,
  .notice-leaving,
  .btn-success::after,
  .btn-loading::after { animation: none !important; }
}

/* ---- Hero mark contour ripple (one-shot on load) ---- */
.hero-mark-ripple {
  display: inline-block;
  width: 120px;
  height: 120px;
}
.hero-mark-ripple ellipse {
  fill: none;
  stroke: var(--coterra-primary);
  stroke-width: 1.6;
  transform-origin: 60px 60px;
  transform-box: view-box;
  opacity: 0;
  animation: coterra-ripple 1100ms cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
/* ripple inner → outer (water-drop direction) */
.hero-mark-ripple ellipse:nth-child(6) { animation-delay: 0ms; }
.hero-mark-ripple ellipse:nth-child(5) { animation-delay: 90ms; }
.hero-mark-ripple ellipse:nth-child(4) { animation-delay: 180ms; }
.hero-mark-ripple ellipse:nth-child(3) { animation-delay: 270ms; }
.hero-mark-ripple ellipse:nth-child(2) { animation-delay: 360ms; }
.hero-mark-ripple ellipse:nth-child(1) { animation-delay: 450ms; }

@keyframes coterra-ripple {
  0%   { transform: scale(0.5); opacity: 0; }
  35%  { opacity: 0.95; }
  100% { transform: scale(1); opacity: 1; }
}

.hero-mark-ripple.is-replaying ellipse { animation: none; }

/* ---- Topographic scroll progress bar ---- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  z-index: 100;
  pointer-events: none;
}
.scroll-progress svg {
  width: 100%;
  height: 100%;
  display: block;
}
.scroll-progress path {
  fill: none;
  stroke: var(--coterra-primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  transition: stroke-dashoffset 60ms linear;
}

/* ---- Cursor contour trail (hero only) ---- */
.cursor-trail-host { position: relative; overflow: hidden; }
.cursor-trail-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.4px solid var(--coterra-primary);
  background: transparent;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: coterra-trail-fade 650ms cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes coterra-trail-fade {
  0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0.55; }
  60%  { opacity: 0.30; }
  100% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; }
}

/* ---- Dot-sequence loading state ---- */
.btn-loading {
  pointer-events: none;
  position: relative;
  color: transparent !important;
}
.btn-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 8' fill='%23F5EDE0'><circle cx='4' cy='4' r='2.5'><animate attributeName='opacity' values='1;0.25;1' dur='1s' begin='0s' repeatCount='indefinite'/></circle><circle cx='12' cy='4' r='2.5'><animate attributeName='opacity' values='1;0.25;1' dur='1s' begin='0.2s' repeatCount='indefinite'/></circle><circle cx='20' cy='4' r='2.5'><animate attributeName='opacity' values='1;0.25;1' dur='1s' begin='0.4s' repeatCount='indefinite'/></circle></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px 8px;
  z-index: 1;
}

/* ---- Submit success morph ---- */
.btn-success {
  background: var(--coterra-secondary) !important;
  color: transparent !important;
  pointer-events: none;
  position: relative;
  transition: background 240ms ease;
}
.btn-success::before { opacity: 0 !important; }
.btn-success::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F5EDE0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  opacity: 0;
  transform: scale(0.6);
  animation: success-pop 280ms cubic-bezier(0.2, 0.8, 0.4, 1.4) 80ms forwards;
  z-index: 1;
}
@keyframes success-pop {
  0%   { opacity: 0; transform: scale(0.6); }
  100% { opacity: 1; transform: scale(1); }
}

/* ---- Floating labels ---- */
.field-float {
  position: relative;
  margin-bottom: var(--space-4);
}
.field-float .input,
.field-float .textarea {
  padding-top: calc(var(--space-4) + var(--space-2));
  padding-bottom: var(--space-2);
}
.field-float .input-label {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  pointer-events: none;
  transition: top 200ms cubic-bezier(0.2, 0.7, 0.3, 1),
              transform 200ms cubic-bezier(0.2, 0.7, 0.3, 1),
              font-size 200ms ease,
              color 200ms ease,
              letter-spacing 200ms ease;
  color: var(--coterra-ink-soft);
  font-weight: 400;
  font-size: var(--text-body);
  text-transform: none;
  letter-spacing: 0;
  background: transparent;
}
.field-float .textarea ~ .input-label { top: var(--space-4); transform: none; }
.field-float .input:focus ~ .input-label,
.field-float .input:not(:placeholder-shown) ~ .input-label,
.field-float .textarea:focus ~ .input-label,
.field-float .textarea:not(:placeholder-shown) ~ .input-label {
  top: var(--space-2);
  transform: translateY(0);
  font-size: var(--text-micro);
  font-weight: 600;
  color: var(--coterra-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Contextual help text ---- */
.field-help { position: relative; }
.field-help .input-help-contextual {
  display: block;
  margin-top: var(--space-2);
  font: 400 var(--text-micro)/var(--lh-ui) var(--font-ui);
  color: var(--coterra-ink-soft);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 220ms ease, max-height 220ms ease;
}
.field-help:focus-within .input-help-contextual {
  opacity: 1;
  max-height: 60px;
}

/* ---- Fade-in inline validation ---- */
.input-validation {
  display: inline-flex;
  align-items: center;
  margin-top: var(--space-2);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 220ms ease, transform 220ms ease;
  font: 600 var(--text-micro)/1 var(--font-ui);
  pointer-events: none;
}
.input-validation.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.input-validation-success { color: var(--coterra-secondary); }
.input-validation-error   { color: var(--coterra-error); }
.input-validation svg {
  width: 14px;
  height: 14px;
  margin-right: var(--space-2);
  stroke-width: 2.5;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Smooth focus ring (timing refinement) ---- */
.input,
.select,
.textarea,
.input-group {
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

/* ---- Slide-in notice ---- */
.notice-slide-in {
  animation: notice-slide 320ms cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}
@keyframes notice-slide {
  0%   { opacity: 0; transform: translateX(24px) scale(0.97); }
  100% { opacity: 1; transform: translateX(0)    scale(1); }
}
.notice-stack > * + * { margin-top: var(--space-3); }
.notice-leaving { animation: notice-leave 280ms cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
@keyframes notice-leave {
  0%   { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(20px); }
}

/* ============================================================
   FAQ accordion (built on <details> / <summary> for a11y)
   ============================================================ */

.faq-list {
  display: flex;
  flex-direction: column;
}
.faq-item {
  border-bottom: 1px solid var(--coterra-cream-dark);
  padding: var(--space-4) 0;
}
.faq-item:first-child { padding-top: var(--space-2); }
.faq-item:last-child  { border-bottom: none; padding-bottom: var(--space-2); }

.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-6);
  padding: var(--space-2) 0;
  font: 600 var(--text-h4)/var(--lh-heading) var(--font-display);
  color: var(--coterra-ink);
  user-select: none;
  transition: color 180ms ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 4px;
  background: no-repeat center / 18px 18px url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A0492D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  transition: transform 260ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
.faq-item[open] summary::after { transform: rotate(-180deg); }
.faq-item summary:hover         { color: var(--coterra-primary); }
.faq-item summary:focus-visible { outline: none; color: var(--coterra-primary); }

.faq-answer {
  padding: var(--space-3) 0 var(--space-2);
  margin: 0;
  max-width: 64ch;
  font: 400 1.05rem/var(--lh-body) var(--font-editorial);
  color: var(--coterra-ink-soft);
}
.faq-item[open] .faq-answer {
  animation: faq-expand 260ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes faq-expand {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Slide-open height animation on the <details> content.
   Uses interpolate-size: allow-keywords + ::details-content
   (Chrome 131+, Safari 17.4+, Firefox 129+). In older browsers
   the answer still opens/closes — just without the height tween. */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }

  .faq-item::details-content {
    block-size: 0;
    overflow: clip;
    transition: block-size 320ms cubic-bezier(0.2, 0.7, 0.3, 1),
                content-visibility 320ms allow-discrete;
  }
  .faq-item[open]::details-content {
    block-size: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-item::details-content { transition: none !important; }
}

/* FAQ entry meta — for status tagging mirrored from kb/faqs.md */
.faq-meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: var(--space-3);
  font: 600 var(--text-micro)/1 var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--coterra-ink-faint);
  vertical-align: 2px;
}
.faq-meta-live     { color: var(--coterra-secondary); }
.faq-meta-building { color: var(--coterra-accent-dark); }
.faq-meta-deferred { color: var(--coterra-ink-faint); }

@media (prefers-reduced-motion: reduce) {
  .faq-item summary::after,
  .faq-item[open] .faq-answer { animation: none !important; transition: none !important; }
}
