/* ==========================================================================
   MF Automations — Proposals
   Design system: "compliance matrix"

   The visual language is lifted from the artifact of the trade: a compliance
   matrix. Hairline table rules, a left rail of monospace requirement IDs,
   status chips. Section markers use real solicitation vernacular (§, Exhibit,
   Addendum) rather than decorative 01/02/03 — the numbering encodes something
   true about the content.

   Colour discipline:
     gold  = action + verified. Nothing else may use it.
     flag  = a caught disqualifier. Appears deliberately, rarely.
     gate  = a hard gate marker (pass/fail screen, not a scored criterion).
   ========================================================================== */

/* ---------- faces ---------------------------------------------------------
   Syne and Instrument Sans ship here as VARIABLE fonts. Declaring the full
   axis range in one @font-face lets every weight render from a single file —
   do not add per-weight faces, it will silently download nothing extra and
   fall back to synthetic bolding.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Syne';
  src: url('/fonts/syne-500.woff2') format('woff2-variations');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('/fonts/instrument_sans-400.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains_mono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #07080C;
  --panel: #0E1018;
  --panel-2: #161820;
  --gold: #E8B84B;
  --gold-hi: #F0C85A;
  --gold-dim: rgba(232, 184, 75, .14);
  --flag: #F87171;
  --flag-dim: rgba(248, 113, 113, .13);
  --gate: #4A9EFF;
  --gate-dim: rgba(74, 158, 255, .12);
  --ok: #34D399;
  --text: #F0F0F4;
  --dim: #9098A8;
  --faint: #6C7488;
  --rule: rgba(255, 255, 255, .07);
  --rule-hi: rgba(255, 255, 255, .14);

  --display: 'Syne', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --shell: 1180px;
  --gutter: clamp(20px, 5vw, 56px);
  --rail: 108px; /* width of the monospace requirement-ID rail */
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

/* ---------- type scale ---------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.06;
  letter-spacing: -.03em;
  margin: 0;
  font-weight: 800;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); }
h2 { font-size: clamp(1.95rem, 4vw, 3rem); letter-spacing: -.028em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.22; }
h4 { font-size: 1.03rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px; }

strong, b { font-weight: 700; color: var(--text); }

/* The monospace utility voice: requirement IDs, gate labels, deadlines.
   Always uppercase, always tracked out, never larger than body copy. */
.mono {
  font-family: var(--mono);
  font-size: .715rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
}

.lede { font-size: clamp(1.06rem, 1.75vw, 1.24rem); color: var(--dim); line-height: 1.58; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.gold { color: var(--gold); }

/* ---------- shell --------------------------------------------------------- */
.shell { max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 116px); }
.section--tight { padding-block: clamp(44px, 6vw, 72px); }
.section + .section { border-top: 1px solid var(--rule); }

/* Section marker. Uses solicitation vernacular (§4, Exhibit C) because the
   content genuinely is sectioned that way — not decorative numbering. */
.marker {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 26px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.marker__id {
  font-family: var(--mono);
  font-size: .715rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--gold);
  flex: none;
}
.marker__label {
  font-family: var(--mono);
  font-size: .715rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- nav ----------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(7, 8, 12, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.nav__in { display: flex; align-items: center; gap: 12px; height: 62px; }
.nav__brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-weight: 800; letter-spacing: -.02em; font-size: 1rem; }
.nav__brand:hover { text-decoration: none; color: var(--text); }
.nav__mark {
  width: 27px; height: 27px; border-radius: 7px;
  background: var(--gold); color: var(--ink);
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: .72rem; letter-spacing: -.02em;
  flex: none;
}
.nav__brand span.sub { color: var(--faint); font-family: var(--mono); font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 400; }
.nav__links { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.nav__links a { color: var(--dim); font-size: .92rem; font-weight: 500; }
.nav__links a:hover { color: var(--text); text-decoration: none; }
.nav__links a.is-active { color: var(--text); }
@media (max-width: 860px) {
  .nav__links a:not(.btn) { display: none; }
  .nav__links { gap: 0; }
}

/* ---------- buttons ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px;
  border-radius: 9px;
  font-family: var(--body);
  font-weight: 600; font-size: .95rem; letter-spacing: -.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: var(--gold-hi); color: var(--ink); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--rule-hi); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn--lg { padding: 16px 30px; font-size: 1rem; border-radius: 10px; }
.btn--block { width: 100%; }
.btn:focus-visible, a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- status chips (the matrix vocabulary) -------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 5px; white-space: nowrap;
  border: 1px solid transparent;
}
.chip--ok   { background: rgba(52, 211, 153, .1); color: var(--ok); border-color: rgba(52, 211, 153, .26); }
.chip--gold { background: var(--gold-dim); color: var(--gold); border-color: rgba(232, 184, 75, .3); }
.chip--gate { background: var(--gate-dim); color: var(--gate); border-color: rgba(74, 158, 255, .28); }
.chip--flag { background: var(--flag-dim); color: var(--flag); border-color: rgba(248, 113, 113, .32); }
.chip--idle { background: rgba(255, 255, 255, .04); color: var(--faint); border-color: var(--rule); }

/* ---------- the document panel -------------------------------------------- */
.doc {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 13px;
  overflow: hidden;
}
.doc__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 18px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--rule);
}
.doc__title { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.doc__body { padding: 6px 0; }

/* A matrix row: [mono requirement id] [requirement text] [status chip] */
.row {
  display: grid;
  grid-template-columns: var(--rail) 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule);
}
.row:last-child { border-bottom: 0; }
.row__id { font-family: var(--mono); font-size: .7rem; letter-spacing: .07em; color: var(--faint); text-transform: uppercase; }
.row__text { font-size: .93rem; color: var(--text); line-height: 1.4; }
.row__text small { display: block; color: var(--faint); font-size: .82rem; margin-top: 2px; }
.row.is-flagged { background: var(--flag-dim); }
.row.is-flagged .row__id { color: var(--flag); }
@media (max-width: 620px) {
  .row { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .row__id { grid-column: 1 / -1; }
}

/* ---------- grids --------------------------------------------------------- */
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 24px;
}
.card__id { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--dim); font-size: .94rem; margin-bottom: 0; }

/* A measured figure. The number carries a unit and a source, never a bare
   stat — every figure on this site must be traceable to something measured. */
.figure { border-left: 2px solid var(--gold); padding-left: 16px; }
.figure__n { font-family: var(--display); font-weight: 800; font-size: clamp(1.9rem, 3.4vw, 2.5rem); letter-spacing: -.035em; line-height: 1; }
.figure__u { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-top: 9px; }

/* ---------- forms --------------------------------------------------------- */
.field { display: block; margin-bottom: 18px; }
.field__label {
  display: block;
  font-family: var(--mono); font-size: .69rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 7px;
}
.field__label .req { color: var(--gold); }
.field__hint { display: block; font-size: .82rem; color: var(--faint); margin-top: 6px; line-height: 1.45; }
.input, .select, .textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--rule-hi);
  border-radius: 9px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--body); font-size: .96rem; line-height: 1.45;
  transition: border-color .15s ease, background .15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); background: var(--panel); outline: none; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.textarea { min-height: 118px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 38px; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--flag); }
.field__error { display: none; color: var(--flag); font-size: .82rem; margin-top: 6px; font-family: var(--mono); letter-spacing: .04em; }
.field__error.is-shown { display: block; }
/* honeypot — must be unreachable to humans AND to assistive tech */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.note {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--gate);
  border-radius: 0 10px 10px 0;
  padding: 16px 18px;
  font-size: .9rem;
  color: var(--dim);
}
.note strong { color: var(--text); }
.note--gold { border-left-color: var(--gold); }
.note--flag { border-left-color: var(--flag); }

/* ---------- prose (guides / legal) ---------------------------------------- */
.prose { max-width: 720px; }
.prose h2 { margin-top: 2.2em; margin-bottom: .5em; }
.prose h3 { margin-top: 1.8em; margin-bottom: .45em; }
.prose p, .prose li { color: var(--dim); }
.prose ul, .prose ol { padding-left: 1.15em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--gold); }
.prose blockquote { margin: 1.6em 0; padding-left: 18px; border-left: 2px solid var(--gold); color: var(--text); font-size: 1.06rem; }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--panel-2); padding: 2px 6px; border-radius: 4px; color: var(--gold); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .9rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.prose th { font-family: var(--mono); font-size: .68rem; letter-spacing: .11em; text-transform: uppercase; color: var(--faint); font-weight: 400; }
.prose td { color: var(--dim); }

/* ---------- accordion (FAQ) ------------------------------------------------ */
.faq { border-top: 1px solid var(--rule); }
.faq__item { border-bottom: 1px solid var(--rule); }
.faq__q {
  width: 100%; background: none; border: 0; cursor: pointer;
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 0; text-align: left;
  color: var(--text); font-family: var(--display); font-weight: 700; font-size: 1.03rem; letter-spacing: -.015em;
}
.faq__q::after { content: '+'; margin-left: auto; color: var(--gold); font-family: var(--mono); font-size: 1.1rem; line-height: 1; flex: none; transition: transform .2s ease; }
.faq__item[open] .faq__q::after { transform: rotate(45deg); }
.faq__a { padding: 0 0 20px 0; color: var(--dim); font-size: .95rem; max-width: 680px; }
.faq__a p:last-child { margin-bottom: 0; }
summary::-webkit-details-marker { display: none; }
summary { list-style: none; }

/* ---------- footer -------------------------------------------------------- */
.foot { border-top: 1px solid var(--rule); padding-block: 48px 40px; margin-top: 20px; }
.foot__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
@media (max-width: 800px) { .foot__grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.foot h4 { font-family: var(--mono); font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); font-weight: 400; margin-bottom: 14px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 9px; }
.foot li a { color: var(--dim); font-size: .9rem; }
.foot li a:hover { color: var(--text); text-decoration: none; }
.foot__legal { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--rule); display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.foot__legal p { font-size: .82rem; color: var(--faint); margin: 0; }

/* ---------- motion --------------------------------------------------------
   One orchestrated reveal, not scattered effects. Everything obeys the
   reduced-motion preference by resetting to the final state.
   -------------------------------------------------------------------------- */
.rise { opacity: 0; transform: translateY(14px); transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1); }
.rise.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

.skip {
  position: absolute; left: -9999px;
  background: var(--gold); color: var(--ink); padding: 10px 16px; border-radius: 0 0 8px 0;
  font-weight: 600; z-index: 100;
}
.skip:focus { left: 0; top: 0; }
