/* Base type, layout primitives, buttons. Shared by every page. */

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  font-stretch: 100%;
}
@media (max-width: 640px) { body { font-size: 16px; } }

::selection { background: var(--lime); color: var(--ink); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); position: relative; }
.section-paper { background: var(--paper); }
.section-bone2 { background: var(--bone-2); }
.section-dark { background: var(--graphite); color: var(--on-dark); }
.hairline-top { border-top: 1px solid var(--line); }

/* ---------- Type ---------- */
.display, h1, h2 {
  font-stretch: var(--wide);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}
h1 { font-size: clamp(40px, 5.6vw, 72px); }
h2 { font-size: clamp(30px, 3.9vw, 50px); }
h3 {
  font-stretch: var(--semi);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.lead { font-size: clamp(18px, 1.5vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 58ch; text-wrap: pretty; }
.section-dark .lead { color: var(--on-dark-2); }
p { text-wrap: pretty; }

/* Mono "spec" labels: the lab's voice for facts */
.eyebrow, .label, .mono {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--ink-3);
}
.eyebrow::before {
  content: ""; width: 8px; height: 8px; border-radius: 2px;
  background: var(--lime); box-shadow: 0 0 0 1px rgba(20, 21, 25, .18) inset;
  flex: none;
}
.section-dark .eyebrow { color: var(--on-dark-2); }
.section-dark .eyebrow::before { box-shadow: 0 0 12px var(--lime-glow); }

/* The signature highlight: a lime bar under the words that matter */
.hl {
  font-style: normal;
  background-image: linear-gradient(var(--lime), var(--lime));
  background-repeat: no-repeat;
  background-size: 100% .26em;
  background-position: 0 90%;
  padding-inline: .04em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

.section-head { display: grid; gap: 18px; margin-bottom: clamp(36px, 5vw, 56px); max-width: 760px; }
.section-head.center { margin-inline: auto; text-align: center; justify-items: center; }

/* ---------- Links ---------- */
.textlink {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; text-decoration: none; color: var(--ink);
  background-image: linear-gradient(var(--lime), var(--lime));
  background-size: 100% 2px; background-repeat: no-repeat; background-position: 0 100%;
  padding-bottom: 2px;
  transition: background-size .25s var(--ease);
}
.textlink:hover { background-size: 100% 100%; }
.textlink .ico { width: 18px; height: 18px; transition: transform .2s var(--ease); }
.textlink:hover .ico { transform: translateX(3px); }

/* ---------- Buttons ---------- */
.btn {
  --btn-h: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--btn-h); padding: 0 22px;
  border-radius: var(--r);
  font-family: var(--font-sans); font-stretch: var(--semi); font-weight: 700; font-size: 16px; letter-spacing: -.005em;
  text-decoration: none; white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn .ico { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn-sm { --btn-h: 40px; padding: 0 16px; font-size: 14.5px; border-radius: 10px; }
.btn-block { width: 100%; }

.btn-lime { background: var(--lime); color: var(--ink); border-color: rgba(20, 21, 25, .12); box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, var(--shadow-sm); }
.btn-lime:hover { background: var(--lime-hover); }
.btn-lime:active { background: var(--lime-press); }
.btn-ink { background: var(--ink); color: var(--on-dark); }
.btn-ink:hover { background: #2A2D33; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper); border-color: #CFCBC0; }
.section-dark .btn-ghost { color: var(--on-dark); border-color: var(--line-dark); }
.section-dark .btn-ghost:hover { background: var(--graphite-2); border-color: rgba(243, 242, 237, .2); }

/* ---------- Form fields (shared) ---------- */
.field-label { font-size: 14px; font-weight: 600; }
.field {
  min-width: 0; height: 52px; padding: 0 16px; border-radius: var(--r);
  background: var(--paper); border: 1px solid #CBC7BB; font-size: 16px; color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field::placeholder { color: #9A9EA6; }
.field:hover { border-color: #ADA99C; }
.field:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(200, 240, 60, .55); }
.field[aria-invalid="true"] { border-color: #B42318; }
.form-msg { min-height: 1.45em; font-size: 14.5px; font-weight: 500; }
.form-msg:empty { min-height: 0; }
.form-msg.is-ok { color: var(--lime-deep); }
.form-msg.is-err { color: #B42318; }
/* Checkbox with a drawn box: <label class="check"><input type="checkbox"><span class="check-box">(check icon)</span><span>Label</span></label> */
.check { position: relative; display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 20px; height: 20px; margin: 0; }
.check-box {
  flex: none; width: 20px; height: 20px; margin-top: 0; display: grid; place-items: center;
  border-radius: 6px; border: 1px solid #BDB8AB; background: var(--paper);
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.check-box .ico { width: 14px; height: 14px; stroke-width: 2.8; opacity: 0; transition: opacity .12s var(--ease); }
.check input:checked + .check-box { background: var(--lime); border-color: var(--ink); }
.check input:checked + .check-box .ico { opacity: 1; }
.check input:focus-visible + .check-box { box-shadow: var(--focus); }
.btn:disabled { opacity: .6; cursor: progress; }

/* ---------- Focus ---------- */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.section-dark :focus-visible, .site-footer :focus-visible { outline-color: var(--lime); }

/* ---------- Icons ---------- */
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico-sm { width: 16px; height: 16px; }

/* ---------- Wordmark: "3MF" wide + an outlined mono "LABS" tag (ratios match _brand/social.js) ---------- */
.wm { display: inline-flex; align-items: center; gap: .42em; font-size: 22px; line-height: 1; white-space: nowrap; color: inherit; }
.wm-3mf { font-family: var(--font-sans); font-stretch: var(--wide); font-weight: 800; letter-spacing: -.03em; }
.wm-labs {
  font-family: var(--font-mono); font-weight: 600; font-size: .46em; letter-spacing: .2em;
  padding: .37em .43em .3em .61em; border: 1.5px solid currentColor; border-radius: .43em;
}

/* ---------- Utilities ---------- */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--on-dark); padding: 10px 14px; border-radius: var(--r-sm);
  text-decoration: none; font-weight: 600; transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Entrance on scroll. main.js marks what's already on screen .is-in, then adds .reveal-ready
   to <html>, so nothing is ever hidden unless the script is running. */
.reveal { transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.reveal-ready .reveal:not(.is-in) { opacity: 0; transform: translateY(18px); }
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; }
  .reveal-ready .reveal:not(.is-in) { opacity: 1; transform: none; }
}
