/* ==========================================================================
   mattsmachines.com — shared stylesheet (v2)
   Type matched to brand wordmark (Montserrat). White surface by default.
   Teal accent only. No em dashes anywhere.
   ========================================================================== */

:root {
  /* surface tokens */
  --paper:   #ffffff;
  --paper-2: #f3f3f0;
  --ink:     #0e1416;
  --ink-2:   #2c3236;
  --mute:    #6f747a;
  --mute-2:  #a4a8ad;
  --rule:    #dcdcd6;
  --rule-2:  #ececea;

  /* brand teal — sampled from the logo */
  --teal:      #0898a0;
  --teal-ink:  #056e75;
  --teal-soft: #d7eeef;

  /* type */
  --sans:    "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --sans-2:  "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* metrics */
  --frame-x: clamp(20px, 4vw, 64px);
  --frame-y: clamp(18px, 3vw, 36px);
  --col-max: 760px;
  --col-wide: 1120px;
}

/* surface variants */
body[data-tone="white"]     { --paper:#ffffff; --paper-2:#f3f3f0; --rule:#dcdcd6; --rule-2:#ececea; --ink:#0e1416; --ink-2:#2c3236; }
body[data-tone="paper"]     { --paper:#f5f3ed; --paper-2:#ebe7da; --rule:#d6d1c0; --rule-2:#e3dfcf; --ink:#13181a; --ink-2:#34393d; }
body[data-tone="charcoal"]  { --paper:#0e1416; --paper-2:#181f22; --rule:#262d31; --rule-2:#1d2528; --ink:#e9eded; --ink-2:#b9bfc1; --mute:#777e82; --mute-2:#535b5f; --teal:#22b9c2; --teal-ink:#7ad7dc; --teal-soft:#0f4145; }

/* accent strength */
body[data-accent="quiet"]    { --teal:#5a8488; --teal-ink:#3d6669; --teal-soft:#dee9ea; }
body[data-accent="standard"] { --teal:#0898a0; --teal-ink:#056e75; --teal-soft:#d7eeef; }
body[data-accent="bold"]     { --teal:#00abb5; --teal-ink:#007e87; --teal-soft:#caebee; }

/* reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display:block; max-width:100%; height:auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
::selection { background: var(--teal); color: #fff; }

/* type system — Montserrat to match the wordmark */
.h-display {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(30px, 5vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.018em;
  color: var(--ink);
  text-wrap: balance;
}
.h-display em {
  font-style: normal;
  color: var(--teal-ink);
  font-weight: 400;
}
.h-display b, .h-display strong {
  font-weight: 600;
}
.h-section {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(22px, 2.8vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.lede {
  font-weight: 300;
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
  max-width: 56ch;
}
.body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
  text-wrap: pretty;
}
.mono, .mono-label, .mono-mini {
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mono-label { font-size: 11px; color: var(--mute); }
.mono-mini  { font-size: 10px; color: var(--mute); letter-spacing: 0.14em; }

/* page frame */
.frame {
  position: relative;
  min-height: 100vh;
  padding: var(--frame-y) var(--frame-x);
  display: flex;
  flex-direction: column;
}

/* nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--teal-ink);
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 3px;
  border-left: 1px solid var(--rule);
  padding-left: 12px;
}
.brand-text .wm {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--teal-ink);
}
.brand-text .ll {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--mute);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  position: relative;
  padding: 4px 0;
  transition: color .18s ease;
}
.nav-links a::after {
  content:"";
  position:absolute; left:0; right:0; bottom:-1px;
  height:1px; background: var(--teal);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .25s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }

@media (max-width: 720px) {
  .nav { flex-wrap: wrap; }
  .nav-links { gap: 14px; width: 100%; justify-content: flex-start; padding-top: 8px; border-top: 1px dashed var(--rule); }
}

/* main */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(48px, 8vw, 96px) 0 clamp(48px, 7vw, 96px);
}
.col      { width: 100%; max-width: var(--col-max);  margin: 0 auto; }
.col-wide { width: 100%; max-width: var(--col-wide); margin: 0 auto; }

/* meta strip */
.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--mute);
}
.meta .dot { width: 6px; height: 6px; background: var(--teal); display: inline-block; }
.meta .pipe { width: 1px; height: 10px; background: var(--rule); display: inline-block; }

/* hero — division page big number + opening */
.div-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(20px, 4vw, 56px);
  align-items: end;
  margin-bottom: 36px;
}
.div-hero .num {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(72px, 14vw, 168px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--teal);
  font-feature-settings: "tnum";
}
.div-hero .num-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.div-hero .num-stack .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mute);
}
@media (max-width: 600px) {
  .div-hero { grid-template-columns: 1fr; gap: 12px; align-items: start; }
  .div-hero .num { font-size: 96px; }
}

/* lede paragraph */
.lede-block { margin-top: 8px; max-width: 60ch; }
.lede-block p { margin: 0; }

/* division image lead */
.lead-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: clamp(28px, 4vw, 44px);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--paper-2);
}
.lead-image .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(8,152,160,0.04) 0%, transparent 60%),
    repeating-linear-gradient(135deg, var(--paper-2) 0 8px, var(--paper) 8px 16px);
}
.lead-image .ph .tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--mute);
  text-transform: uppercase;
  background: var(--paper);
  padding: 6px 14px;
  border: 1px solid var(--rule);
}
.lead-image.livery {
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 6%;
}
.lead-image.livery img {
  max-width: min(640px, 100%);
  height: auto;
}
.lead-image .corner {
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid var(--ink-2);
}
.lead-image .corner.tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.lead-image .corner.tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.lead-image .corner.bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.lead-image .corner.br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

/* labs schematic illustration variant */
.lead-image.lead-illus { background: var(--paper); padding: 0; border: 0; }
.lead-image.lead-illus .corner { display: none; }
.lead-image.lead-illus .labs-illus { display: block; width: 100%; height: 100%; }

/* contact CTA */
.cta-row {
  margin-top: 40px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  transition: color .25s ease, border-color .25s ease;
}
.cta-row::before {
  content:""; position:absolute; inset:0;
  background: var(--teal);
  transform: translateX(-101%);
  transition: transform .35s cubic-bezier(.6,.05,.2,1);
  z-index: 0;
}
.cta-row > * { position: relative; z-index: 1; }
.cta-row:hover { color: #fff; border-color: var(--teal); }
.cta-row:hover::before { transform: translateX(0); }
.cta-row .arrow {
  display: inline-block;
  width: 14px; height: 1px;
  background: currentColor;
  position: relative;
  transition: transform .25s ease;
}
.cta-row .arrow::after, .cta-row .arrow::before {
  content:""; position:absolute; right:0; top:50%;
  width: 6px; height: 1px; background: currentColor;
  transform-origin: right center;
}
.cta-row .arrow::after  { transform: translateY(-50%) rotate(35deg); }
.cta-row .arrow::before { transform: translateY(-50%) rotate(-35deg); }
.cta-row:hover .arrow { transform: translateX(4px); }

/* tile grid (home) */
.tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  background: var(--rule);
}
.tile {
  position: relative;
  background: var(--paper);
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 16px 18px;
  gap: 8px;
  transition: background .35s ease;
}
.tile + .tile { box-shadow: -1px 0 0 var(--rule); }
.tile:hover { background: var(--paper-2); }
.tile:hover .tile-glyph { color: var(--teal); }
.tile:hover .tile-arrow { transform: translate(2px, -2px); color: var(--teal); }
.tile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--mute);
  text-transform: uppercase;
}
.tile-arrow {
  display: inline-block;
  font-family: var(--mono);
  color: var(--mute);
  transition: transform .3s ease, color .25s ease;
}
.tile-glyph {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 56%;
  height: 56%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: color .3s ease;
}
.tile-glyph svg { width: 100%; height: 100%; overflow: visible; }
.tile-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.tile-name {
  font-family: var(--sans);
  font-size: clamp(14px, 1.3vw, 18px);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
}

@media (max-width: 880px) { .tiles { grid-template-columns: repeat(2, 1fr); } .tile + .tile { box-shadow: none; } }
@media (max-width: 480px) { .tiles { grid-template-columns: 1fr; } }

/* division hero numeral with big-letter + small-tail tucked at bottom-left */
.div-hero .num {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.74;
  margin-bottom: 8px;
  gap: 4px;
}
.div-hero .num .big {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.74;
  display: block;
}
.div-hero .num .tail {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(15px, 1.3vw, 19px);
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1;
  white-space: nowrap;
  display: block;
  margin-left: 0;
}

/* operations cards (horizontal) */
.ops-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: clamp(28px, 4vw, 48px);
}
.ops-card {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: clamp(20px, 4vw, 40px);
  align-items: stretch;
  border: 1px solid var(--rule);
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  transition: border-color .25s ease, transform .25s ease;
}
.ops-card:hover { border-color: var(--ink); }
.ops-card:hover .ops-arrow { color: var(--teal-ink); transform: translate(2px,-2px); }
.ops-logo {
  width: 180px;
  aspect-ratio: 1 / 1;
  border-right: 1px solid var(--rule);
  display: grid;
  place-items: center;
  background: var(--paper-2);
  color: var(--ink);
}
.ops-logo svg { width: 56%; height: 56%; }
.ops-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 24px 0;
}
.ops-body .num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--mute);
  text-transform: uppercase;
}
.ops-body .name {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: -0.005em;
  color: var(--ink);
}
.ops-body .desc {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  color: var(--ink-2);
  max-width: 56ch;
  line-height: 1.55;
}
.ops-arrow {
  align-self: center;
  padding-right: 24px;
  font-family: var(--mono);
  font-size: 18px;
  color: var(--mute);
  transition: color .25s ease, transform .25s ease;
}
@media (max-width: 720px) {
  .ops-card { grid-template-columns: 96px 1fr auto; }
  .ops-logo { width: 96px; }
  .ops-body { padding: 18px 0; }
}

/* division facts */
.facts {
  margin-top: clamp(40px, 6vw, 72px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.fact {
  padding: 22px 20px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fact:last-child { border-right: 0; }
.fact .k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}
.fact .v {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: 0.005em;
}
@media (max-width: 600px) {
  .facts { grid-template-columns: 1fr; }
  .fact { border-right: 0; border-bottom: 1px solid var(--rule); }
  .fact:last-child { border-bottom: 0; }
}

/* footer (slim) */
footer {
  border-top: 1px solid var(--rule);
  padding-top: 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px 32px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.footer-copyright {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-copyright .glyph {
  width: 18px; height: 18px;
  object-fit: contain;
  opacity: .85;
}
.footer-meta {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.footer-meta a {
  color: var(--mute);
  transition: color .2s ease;
  position: relative;
}
.footer-meta a:hover { color: var(--ink); }
@media (max-width: 600px) {
  footer { grid-template-columns: 1fr; }
  .footer-meta { justify-content: flex-start; }
}

/* prose pages (privacy/terms/about) */
.prose h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0;
  margin: 40px 0 12px;
  color: var(--ink);
}
.prose h2::before {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  background: var(--teal);
  margin-bottom: 12px;
}
.prose p {
  margin: 0 0 14px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.75;
}
.prose strong { color: var(--ink); font-weight: 500; }
.prose a { color: var(--teal-ink); border-bottom: 1px solid var(--teal); }
.prose a:hover { color: var(--teal); }

/* contact list */
.contact-list {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}
.contact-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 24px;
  padding: 22px 0;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
}
.contact-row .key {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--mute);
}
.contact-row .val {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(20px, 2.4vw, 30px);
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color .2s ease;
}
.contact-row .val:hover { color: var(--teal-ink); }
.contact-row .ext {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--mute);
  text-transform: uppercase;
}
@media (max-width: 600px) {
  .contact-row { grid-template-columns: 1fr; gap: 6px; }
  .contact-row .ext { justify-self: start; }
}

/* utility */
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer-lg { height: clamp(48px, 7vw, 88px); }
.spacer-md { height: clamp(28px, 4vw, 48px); }

/* tweaks panel */
.tweaks {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 280px;
  background: var(--paper);
  border: 1px solid var(--ink);
  z-index: 50;
  font-family: var(--sans);
  box-shadow: 4px 4px 0 var(--ink);
  display: none;
}
.tweaks[data-open="true"] { display: block; }
.tweaks-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.tweaks-close {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px;
  color: var(--ink);
}
.tweaks-close:hover { color: var(--teal-ink); }
.tweaks-body { padding: 14px 12px 16px; display: flex; flex-direction: column; gap: 16px; }
.tw-section { display: flex; flex-direction: column; gap: 6px; }
.tw-label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute);
}
.tw-options {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  border: 1px solid var(--rule);
}
.tw-option {
  padding: 8px 6px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2); text-align: center;
  border-right: 1px solid var(--rule);
  transition: background .15s ease, color .15s ease;
  background: var(--paper);
}
.tw-option:last-child { border-right: 0; }
.tw-option:hover { background: var(--paper-2); }
.tw-option[aria-pressed="true"] {
  background: var(--ink); color: var(--paper);
}
