/* ==========================================================================
   Stevens Industrial — design system
   Palette: graphite / bone / safety orange. Industrial, not corporate-generic.
   ========================================================================== */

:root {
  --ink:        #0e1113;
  --ink-2:      #161b1e;
  --ink-3:      #1e2529;
  --line:       #2a3237;
  --line-soft:  #e3e0da;
  --bone:       #f4f2ed;
  --bone-2:     #e9e6df;
  --paper:      #fbfaf7;
  --muted:      #6f7378;
  --muted-dark: #9aa2a8;
  --accent:     #e2571f;
  --accent-2:   #ff7a3d;
  --accent-dim: rgba(226, 87, 31, 0.12);
  --green:      #1f7a4d;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --display: "Space Grotesk", var(--sans);

  --wrap: 1180px;
  --gut: clamp(20px, 5vw, 56px);
  --radius: 3px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.6vw, 4.1rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); letter-spacing: -0.028em; }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); }
p  { margin: 0 0 1.15em; text-wrap: pretty; }

/* ---------- layout ---------- */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
.section { padding-block: clamp(64px, 9vw, 128px); }
.section--tight { padding-block: clamp(48px, 6vw, 80px); }
.section--dark { background: var(--ink); color: var(--bone); }
.section--bone { background: var(--bone); }
.rule { height: 1px; background: var(--line-soft); border: 0; margin: 0; }

/* ---------- eyebrow / labels ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.28;
}
.section--dark .eyebrow { color: var(--accent-2); }

/* ---------- header ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--paper);
  border-bottom: 1px solid var(--line-soft);
}
.masthead__inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 0 var(--gut);
  height: 68px;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}
.brand__mark {
  width: 26px; height: 26px;
  flex: none;
  background: var(--ink);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius);
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 1.6rem; }
.nav a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--muted);
  transition: color .16s;
  position: relative;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; background: var(--accent);
}
.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 8px 10px; cursor: pointer;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); margin: 3px 0; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line-soft);
    padding: 0.5rem var(--gut) 1.4rem;
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: 0.85rem 0; border-bottom: 1px solid var(--line-soft); font-size: 1rem; }
  .nav .btn { margin-top: 1rem; text-align: center; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.72rem 1.35rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .16s, border-color .16s, color .16s;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #c8470f; }
.btn--ghost { border-color: var(--line-soft); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); }
/* Ghost buttons on any dark surface — .hero is dark but carries its own class,
   so it must be listed explicitly or the label renders dark-on-dark. */
.section--dark .btn--ghost,
.hero .btn--ghost { border-color: var(--line); color: var(--bone); }
.section--dark .btn--ghost:hover,
.hero .btn--ghost:hover { border-color: var(--bone); background: rgba(244, 242, 237, 0.06); }
.btn--lg { padding: 0.95rem 1.7rem; font-size: 1rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* ---------- hero ---------- */
.hero {
  background: var(--ink);
  color: var(--bone);
  position: relative;
  overflow: hidden;
  padding-block: clamp(78px, 12vw, 150px);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.36;
  mask-image: radial-gradient(ellipse 78% 68% at 72% 32%, #000 20%, transparent 76%);
  pointer-events: none;
}
.hero__inner { position: relative; max-width: 860px; }
.hero h1 { color: #fff; margin-bottom: 0.55em; }
.hero h1 em { font-style: normal; color: var(--accent-2); }
.hero__lede {
  font-size: clamp(1.05rem, 1.7vw, 1.28rem);
  color: var(--muted-dark);
  max-width: 60ch;
  margin-bottom: 2.2rem;
}
.hero .btn-row { margin-bottom: 2.6rem; }
.hero__note {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------- metric strip ---------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border-top: 1px solid var(--line);
  position: relative;
}
.metric { padding: 1.9rem 1.6rem 1.9rem 0; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric__num {
  font-family: var(--display);
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--accent-2);
  line-height: 1;
  margin-bottom: 0.45rem;
}
.metric__label { font-size: 0.85rem; color: var(--muted-dark); line-height: 1.45; }
@media (max-width: 700px) {
  .metric { border-right: 0; border-bottom: 1px solid var(--line); padding-right: 0; }
  .metric:last-child { border-bottom: 0; }
}

/* ---------- generic grid ---------- */
.grid { display: grid; gap: clamp(20px, 3vw, 34px); }
/* Grid items default to min-width:auto, so long words inflate the minimum track
   size and drop a column. Pin it to 0 so the minmax() floor is respected. */
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
/* Explicit counts, not auto-fit: a 4-item row must never leave a 3+1 orphan.
   2-up on laptops, 4-up only when there is genuinely room. */
.grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1120px) { .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .grid--4 { grid-template-columns: 1fr; } }

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: start;
}
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }

/* ---------- cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.card__num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 0.9rem;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 0; }
.card ul { color: var(--muted); font-size: 0.92rem; margin: 0.9rem 0 0; padding-left: 1.1rem; }
.card li { margin-bottom: 0.35rem; }

/* case study card */
.case {
  display: block;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.case:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
  box-shadow: 0 14px 34px -20px rgba(14, 17, 19, 0.42);
}
.case__top {
  padding: 1.5rem 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.case__sector {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.case__year { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); }
.case__body { padding: 0.9rem 1.5rem 1.5rem; }
.case__body h3 { margin-bottom: 0.5rem; }
.case__body p { color: var(--muted); font-size: 0.94rem; margin-bottom: 1.1rem; }
.case__stat {
  border-top: 1px solid var(--line-soft);
  padding-top: 1rem;
  display: flex;
  gap: 1.8rem;
  flex-wrap: wrap;
}
.case__stat div { min-width: 0; }
.case__stat b {
  display: block;
  font-family: var(--display);
  font-size: 1.32rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.case__stat span { font-size: 0.76rem; color: var(--muted); }

/* ---------- prose ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2.4em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.9em; }
.prose ul, .prose ol { padding-left: 1.3rem; margin-bottom: 1.3em; }
.prose li { margin-bottom: 0.5rem; }
.prose strong { font-weight: 600; }
.prose a { color: var(--accent); text-underline-offset: 3px; }

.lede { font-size: 1.16rem; color: var(--muted); max-width: 62ch; }
.section--dark .lede { color: var(--muted-dark); }

/* spec table */
.spec { width: 100%; border-collapse: collapse; font-size: 0.94rem; margin: 1.6rem 0; }
.spec th, .spec td { text-align: left; padding: 0.78rem 1rem 0.78rem 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.spec th {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.spec td:first-child { font-weight: 500; width: 42%; }
.spec td b { font-family: var(--display); font-size: 1.05rem; }

/* pull quote / callout */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--bone);
  padding: 1.3rem 1.5rem;
  margin: 1.9rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout--redact {
  border-left-color: var(--muted);
  font-size: 0.9rem;
  color: var(--muted);
}

/* tag pills */
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.2rem 0 0; padding: 0; list-style: none; }
.tags li {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  padding: 0.32rem 0.65rem;
  border: 1px solid var(--line-soft);
  border-radius: 100px;
  color: var(--muted);
}
.section--dark .tags li { border-color: var(--line); color: var(--muted-dark); }

/* ---------- forms ---------- */
.form { display: grid; gap: 1.15rem; max-width: 620px; }
.field { display: grid; gap: 0.42rem; }
.field label { font-size: 0.86rem; font-weight: 500; }
.field .hint { font-size: 0.78rem; color: var(--muted); }
.field input, .field select, .field textarea {
  font-family: var(--sans);
  font-size: 0.97rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.field textarea { resize: vertical; min-height: 110px; }
.field--row { grid-template-columns: 1fr 1fr; gap: 1.15rem; display: grid; }
@media (max-width: 620px) { .field--row { grid-template-columns: 1fr; } }

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  background: var(--bone);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  font-size: 0.88rem;
  line-height: 1.55;
}
.consent input { margin-top: 0.28rem; width: 16px; height: 16px; accent-color: var(--accent); }

.form__status { font-size: 0.9rem; padding: 0.85rem 1rem; border-radius: var(--radius); display: none; }
.form__status[data-state="ok"]    { display: block; background: #e7f4ec; color: var(--green); border: 1px solid #bfe0cd; }
.form__status[data-state="error"] { display: block; background: #fdeceb; color: #a32116; border: 1px solid #f3c9c5; }

/* ---------- gate ---------- */
.gate {
  max-width: 460px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: clamp(1.8rem, 4vw, 2.6rem);
  text-align: center;
}
.gate__lock {
  width: 44px; height: 44px; margin: 0 auto 1.2rem;
  border: 1px solid var(--line-soft); border-radius: 50%;
  display: grid; place-items: center; color: var(--accent);
}
.gate .field { text-align: left; margin-bottom: 1rem; }

.vault-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.05rem 0; border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
}
.vault-item:hover .vault-item__name { color: var(--accent); }
.vault-item__ext {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em;
  padding: 0.35rem 0.5rem; border: 1px solid var(--line-soft);
  border-radius: var(--radius); color: var(--muted); flex: none;
}
.vault-item__name { font-weight: 500; transition: color .15s; }
.vault-item__meta { font-size: 0.8rem; color: var(--muted); margin-left: auto; text-align: right; flex: none; }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: var(--muted-dark); padding-block: clamp(48px, 6vw, 76px) 2rem; font-size: 0.9rem; }
.footer a { color: var(--muted-dark); text-decoration: none; }
.footer a:hover { color: var(--bone); }
.footer h4 {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; font-weight: 500;
}
.footer__grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 2.4rem; padding-bottom: 2.6rem; border-bottom: 1px solid var(--line);
}
@media (max-width: 780px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__grid ul { list-style: none; margin: 0; padding: 0; }
.footer__grid li { margin-bottom: 0.55rem; }
.footer__brand { color: var(--bone); font-family: var(--display); font-size: 1.05rem; font-weight: 600; margin-bottom: 0.8rem; }
.footer__legal {
  padding-top: 1.8rem; display: flex; flex-wrap: wrap; gap: 1.2rem;
  justify-content: space-between; font-size: 0.8rem; color: var(--muted);
}

/* ---------- misc ---------- */
.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff; padding: 0.7rem 1.1rem; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

.breadcrumb { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); margin-bottom: 1.4rem; letter-spacing: 0.06em; }
.breadcrumb a { text-decoration: none; color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
