/* MAS Dynamics - commissioning site
   Tokens: mineral paper, ink, steel, rule, verified green, open-issue amber */
:root {
  --paper: #F1F3F2;
  --paper-2: #E6EAE8;
  --ink: #172420;
  --steel: #5F6E6A;
  --rule: #D3D9D7;
  --verified: #2F7A57;
  --open: #B97A12;
  --focus: #1F5FBF;
  --measure: 68ch;
  --gutter: clamp(16px, 4vw, 48px);
  --left: clamp(16px, 9vw, 152px);
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: 2.5rem;
  --step-4: clamp(2.25rem, 4.2vw, 3.875rem);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121B18;
    --paper-2: #1A2622;
    --ink: #E4EAE7;
    --steel: #9AA8A4;
    --rule: #2C3A36;
    --verified: #5DB98A;
    --open: #E0A646;
    --focus: #7FAEFF;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--verified); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
img, svg { max-width: 100%; display: block; }
.num { font-variant-numeric: tabular-nums; }

/* Header */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 20px var(--gutter) 20px var(--left);
  border-bottom: 1px solid var(--rule);
}
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-size: 1.125rem; font-variation-settings: "wdth" 125; font-weight: 700; letter-spacing: 0.01em; }
.brand span { font-size: var(--step--1); color: var(--steel); }
.nav { display: flex; gap: 28px; flex-wrap: wrap; }
.nav a { text-decoration: none; font-size: 0.9375rem; color: var(--steel); }
.nav a[aria-current="page"], .nav a:hover { color: var(--ink); text-decoration: underline; }
.nav-toggle { display: none; }
@media (max-width: 820px) {
  .site-head { padding-left: var(--gutter); flex-wrap: wrap; }
  .nav-toggle {
    display: inline-block; background: none; border: 1px solid var(--rule); color: var(--ink);
    font: inherit; font-size: 0.9375rem; padding: 6px 12px; border-radius: 4px; cursor: pointer;
  }
  .nav { display: none; width: 100%; flex-direction: column; gap: 14px; padding-top: 12px; }
  .nav.open { display: flex; }
}

/* Layout */
main { padding: 0 var(--gutter) 0 var(--left); }
@media (max-width: 820px) { main { padding-left: var(--gutter); } }
.section { padding: clamp(56px, 9vw, 112px) 0; border-bottom: 1px solid var(--rule); }
.section:last-child { border-bottom: 0; }
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1em; }
h1, h2, h3 { font-weight: 700; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); font-variation-settings: "wdth" 118; max-width: 20ch; }
h2 { font-size: var(--step-3); font-variation-settings: "wdth" 112; max-width: 22ch; margin-bottom: 0.6em; }
h3 { font-size: var(--step-1); font-variation-settings: "wdth" 104; margin-bottom: 0.35em; }
.lead { font-size: var(--step-1); line-height: 1.45; max-width: 56ch; color: var(--ink); margin: 28px 0 0; }
.muted { color: var(--steel); }
.small { font-size: var(--step--1); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.btn {
  display: inline-block; padding: 13px 22px; border-radius: 3px; text-decoration: none;
  font-weight: 600; font-size: 0.9875rem; border: 1px solid var(--ink);
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--verified); border-color: var(--verified); color: #fff; }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { border-color: var(--verified); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; padding-top: clamp(48px, 8vw, 96px); }
@media (min-width: 1100px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; column-gap: 64px; } }
.trend { margin: 0; }
.trend svg { width: 100%; height: auto; overflow: visible; }
.trend .grid line { stroke: var(--rule); stroke-width: 1; }
.trend .sp { stroke: var(--steel); stroke-width: 1; stroke-dasharray: 4 4; }
.trend .before { fill: none; stroke: var(--open); stroke-width: 2; }
.trend .after { fill: none; stroke: var(--verified); stroke-width: 2.25; }
.trend .divider { stroke: var(--ink); stroke-width: 1; }
.trend text { fill: var(--steel); font-size: 12px; font-family: "Archivo", sans-serif; }
.trend text.strong { fill: var(--ink); font-weight: 600; }
.trend figcaption { margin-top: 14px; font-size: var(--step--1); color: var(--steel); max-width: 60ch; }
.trend .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 2.4s cubic-bezier(.4,.1,.2,1) forwards; }
.trend .after.draw { animation-delay: 2.1s; animation-duration: 1.4s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .trend .draw { animation: none; stroke-dashoffset: 0; } }

/* Services: three columns with a left rule */
.services { display: grid; gap: 40px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 40px; }
.service { border-left: 2px solid var(--ink); padding: 2px 0 0 20px; }
.service p { margin: 0 0 12px; color: var(--steel); }
.service a { font-weight: 600; font-size: 0.9375rem; }

/* Phase line: a real sequence */
.phases { list-style: none; margin: 40px 0 0; padding: 0; counter-reset: ph; display: grid; gap: 0; }
.phases li {
  counter-increment: ph; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 0 20px;
  padding: 22px 0; border-top: 1px solid var(--rule);
}
.phases li::before {
  content: counter(ph); font-variation-settings: "wdth" 125; font-weight: 700; font-size: var(--step-2);
  line-height: 1; color: var(--verified); font-variant-numeric: tabular-nums;
}
.phases h3 { margin: 0 0 4px; }
.phases p { margin: 0; color: var(--steel); max-width: 70ch; }
.phases .deliv { display: block; margin-top: 6px; font-size: var(--step--1); color: var(--ink); }
@media (min-width: 980px) {
  .phases li { grid-template-columns: 56px minmax(0, 0.8fr) minmax(0, 1.2fr); }
  .phases li > div { display: contents; }
  .phases h3 { grid-column: 2; }
  .phases p { grid-column: 3; grid-row: 1; }
}

/* Stats strip: plain sentence-like row, no gradient */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; margin-top: 32px; }
.facts div { border-top: 1px solid var(--ink); padding-top: 12px; }
.facts b { display: block; font-size: var(--step-3); font-variation-settings: "wdth" 120; line-height: 1; font-variant-numeric: tabular-nums; }
.facts span { color: var(--steel); font-size: 0.9375rem; }

/* Log table (projects, deliverables) */
.log-wrap { overflow-x: auto; margin-top: 28px; -webkit-overflow-scrolling: touch; }
table.log { border-collapse: collapse; width: 100%; min-width: 720px; font-size: 0.9375rem; }
table.log th { text-align: left; font-weight: 600; color: var(--steel); padding: 10px 14px 10px 0; border-bottom: 1px solid var(--ink); white-space: nowrap; }
table.log td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.log td:first-child { font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--verified); flex: none; }
.status.open::before { background: var(--open); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.filters button {
  font: inherit; font-size: 0.9375rem; background: transparent; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 3px; padding: 7px 14px; cursor: pointer;
}
.filters button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }

/* Glodra band */
.band { background: var(--paper-2); margin: 0 calc(-1 * var(--gutter)) 0 calc(-1 * var(--left)); padding-left: var(--left); padding-right: var(--gutter); }
@media (max-width: 820px) { .band { margin-left: calc(-1 * var(--gutter)); padding-left: var(--gutter); } }
.split { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { padding: 10px 0 10px 30px; border-bottom: 1px solid var(--rule); position: relative; }
.checklist li::before {
  content: ""; position: absolute; left: 2px; top: 16px; width: 12px; height: 6px;
  border-left: 2px solid var(--verified); border-bottom: 2px solid var(--verified); transform: rotate(-45deg);
}

/* Credentials */
.creds { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.creds li { border: 1px solid var(--rule); padding: 4px 10px; border-radius: 3px; font-size: 0.9375rem; }

/* Form */
form.contact { display: grid; gap: 18px; max-width: 640px; margin-top: 32px; }
form.contact label { display: grid; gap: 6px; font-weight: 600; font-size: 0.9375rem; }
form.contact .hint { font-weight: 400; color: var(--steel); font-size: var(--step--1); }
form.contact input, form.contact select, form.contact textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--paper);
  border: 1px solid var(--steel); border-radius: 3px; padding: 11px 12px; width: 100%;
}
form.contact textarea { min-height: 150px; resize: vertical; }
.row2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-msg { min-height: 1.5em; font-weight: 600; }
.form-msg.ok { color: var(--verified); }
.form-msg.err { color: var(--open); }

/* Footer */
.site-foot {
  padding: 48px var(--gutter) 56px var(--left); border-top: 1px solid var(--ink);
  display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); font-size: 0.9375rem;
}
@media (max-width: 820px) { .site-foot { padding-left: var(--gutter); } }
.site-foot p { margin: 0 0 6px; }
.site-foot a { color: var(--steel); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
