/* ==========================================================================
   BASE / RESET
   ========================================================================== */

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

html {
  scroll-behavior: auto; /* Lenis handles smooth scroll */
  -webkit-text-size-adjust: 100%;
}

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-ink);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 500; }
p { margin: 0; }

/* ---- Typography scale ---- */

.h-hero {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  font-weight: 500;
  color: var(--color-ink);
}

.h1 {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-tight);
  font-weight: 500;
}

.h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-tight);
  font-weight: 500;
}

.h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: var(--lh-heading);
  font-weight: 500;
}

.h4 {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  line-height: var(--lh-heading);
  font-weight: 600;
}

.body-lg { font-size: var(--fs-body-lg); line-height: var(--lh-body); color: var(--color-ink-soft); }
.body { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--color-ink-soft); }
.small { font-size: var(--fs-small); color: var(--color-ink-mute); }
.caption {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-ink-mute);
}

/* Engineering-drawing style callout — the brand's signature micro-typography */
.spec-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.02em;
  color: var(--color-accent-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}
.spec-tag::before { content: "⌀"; opacity: 0.7; }
.spec-tag.tol::before { content: "±"; }
.spec-tag.finish::before { content: "Ra"; font-size: 0.85em; }

/* ---- Layout ---- */

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

section { position: relative; }

.section-pad { padding-block: var(--section-pad); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--color-accent-dark);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--color-accent);
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-small);
  letter-spacing: 0.01em;
  padding: 1.05rem 2rem;
  border-radius: var(--radius-pill);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-ink);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-primary .btn-icon { transition: transform var(--dur-fast) var(--ease-out); }
.btn-primary:hover .btn-icon { transform: translateX(4px); }

.btn-accent {
  background: var(--gradient-steel);
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 24px 60px rgba(27,76,130,0.32); }

.btn-outline {
  background: transparent;
  color: var(--color-ink);
  border: 1.5px solid var(--color-silver-dark);
}
.btn-outline:hover { border-color: var(--color-ink); background: var(--color-surface); }

.btn-ghost {
  background: transparent;
  color: var(--color-ink);
  padding: 0.8rem 0;
  border-radius: 0;
  position: relative;
}
.btn-ghost::after {
  content: '';
  position: absolute;
  left: 0; right: 100%; bottom: 0.4rem;
  height: 1.5px;
  background: var(--color-ink);
  transition: right var(--dur-med) var(--ease-out);
}
.btn-ghost:hover::after { right: 0; }

/* ---- Cards ---- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-silver-soft);
  border-radius: var(--radius-lg);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-silver-dark);
}

/* ---- Utility ---- */

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -60px; left: var(--space-2);
  background: var(--color-ink); color: #fff;
  padding: 0.8rem 1.4rem; border-radius: var(--radius-sm);
  z-index: 1000; transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-2); }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

::selection { background: var(--color-accent); color: #fff; }
