/* ============================================================
   BASE — reset, typography defaults, focus, selection.
   ============================================================ */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--graphite-900);
  color: var(--chalk);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

/* The graphite surface gets a faint tooth so it reads as a
   physical drafting sheet rather than a flat fill. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

img {
  height: auto;
  object-fit: cover;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
}

/* ---- Typographic roles ------------------------------------- */

/* Archivo is loaded as a variable font so we can push the width
   axis out to 115. That expanded set is the whole reason this
   face was chosen — at default width it reads like any grotesk. */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: "wdth" 115, "wght" 800;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-display);
  text-transform: uppercase;
}

/* Every label, date, dimension and part number in the drawing
   set uses this. Tracked out and uppercase — the drafting tell. */
.mono {
  font-family: var(--font-mono);
  font-size: var(--t-caption);
  letter-spacing: var(--track-mono);
  line-height: var(--lh-mono);
  text-transform: uppercase;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.mono--wide { letter-spacing: var(--track-mono-wide); }
.mono--micro { font-size: var(--t-micro); }

.prose {
  max-width: 62ch;
  color: var(--chalk-dim);
  font-size: var(--t-body);
  line-height: var(--lh-body);
}

.prose + .prose { margin-top: var(--s-4); }

.prose strong {
  color: var(--chalk);
  font-weight: 600;
}

/* ---- Focus -------------------------------------------------
   Cyanotype ring, always visible for keyboard users. Never
   removed — this is part of the quality floor. */
:focus-visible {
  outline: 2px solid var(--cyanotype);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

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

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

.sr-only {
  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 — keyboard users land here first. */
.skip-link {
  position: absolute;
  top: var(--s-3);
  left: var(--s-3);
  z-index: 200;
  padding: var(--s-3) var(--s-4);
  background: var(--cyanotype);
  color: #fff;
  border-radius: var(--radius);
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Scrollbar, tuned to the surface rather than left default. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--graphite-900); }
::-webkit-scrollbar-thumb {
  background: var(--graphite-600);
  border: 2px solid var(--graphite-900);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: var(--slate-700); }
