/* Precision Transmission v3 — design tokens.
   COPY THIS FILE VERBATIM into the build. Do not reintroduce the v2
   system: no site-wide grid-paper background, no yellow button fill,
   no hard offset shadow, no serif body, no blue second half of H2.
   Only two font families exist on the whole site: system sans for
   headings/body/navigation, and system mono for data/model codes.
   No external font is loaded anywhere. */

:root {
  /* ---- Colour: ink + steel blue + one restrained accent ---- */
  --color-surface: #f7f8f9;          /* page background, plain, no pattern */
  --color-card: #ffffff;
  --color-ink: #12212e;              /* headings, header/footer, primary button */
  --color-ink-soft: #33475a;         /* subheadings */
  --color-muted: #47596a;            /* body secondary text */
  --color-muted-2: #647685;          /* captions, footnotes */
  --color-line: #d9dee3;             /* card/table borders */
  --color-line-strong: #12212e;      /* table header rule only */
  --color-brand: #0f4c81;            /* links, eyebrow, table header, focus ring */
  --color-brand-dark: #0b3a63;       /* link/button hover */
  --color-accent: #b7791f;           /* SMALL markers only: eyebrow rule, */
                                     /* active-tab underline, chart tick. */
                                     /* NEVER a button fill, never a large area. */
  --color-success: #1b6b3a;          /* PASS */
  --color-success-bg: #e6f2e9;
  --color-warning: #7a4d00;          /* caution panel text */
  --color-warning-bg: #fff7e0;       /* caution panel background */
  --color-warning-line: #d9a441;
  --color-danger: #9b2c2c;           /* NO FIT */
  --color-danger-bg: #fdecec;
  --color-header-text: #ffffff;
  --color-footer-text: #cbd9e1;

  /* ---- Type: exactly one stack per role ---- */
  /* Headings + body + navigation: the SAME system sans stack. */
  /* They are told apart by size/weight/line-height, never by family. */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font-sans);
  --font-body: var(--font-sans);
  /* Data only: specification numbers, model codes, ratios, torques, tables. */
  --font-data: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Type scale (desktop; mobile clamps are in the rules below) */
  --text-eyebrow: 12px;
  --text-small: 12px;
  --text-caption: 12px;
  --text-body: 16px;
  --text-body-large: 18px;
  --text-h3: 20px;
  --text-h2: 30px;
  --text-h1: 48px;
  --leading-body: 1.65;
  --leading-heading: 1.15;
  --leading-tight: 1;

  /* ---- Radius: soft, never 0 and never pill buttons ---- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* ---- Shadow: soft, diffused, never a hard offset block ---- */
  --shadow-xs: 0 1px 2px rgba(18, 33, 46, 0.08);
  --shadow-sm: 0 2px 8px rgba(18, 33, 46, 0.08);
  --shadow-md: 0 8px 24px rgba(18, 33, 46, 0.10);
  --shadow-lg: 0 16px 40px rgba(18, 33, 46, 0.12);

  /* ---- Spacing ladder: use only these steps ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  --layout-max: 1120px;
  --layout-pad: 24px;
  --layout-pad-narrow: 12px;
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-ink);
  background: var(--color-surface);
  /* NO background-image here. The grid pattern is banned site-wide. */
}
a { color: var(--color-brand); }
a:hover { color: var(--color-brand-dark); }
img, svg { max-width: 100%; height: auto; }

/* Data text: tabular numbers so torque / size columns align. */
.data, .mono, td.numeric, th.numeric {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}

/* ---- Headings: ONE colour, no coloured second half ---- */
h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--color-ink);
  line-height: var(--leading-heading);
  margin: 0 0 var(--space-3);
}
h1 {
  font-size: clamp(36px, 5vw, var(--text-h1));
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}
h2 { font-size: clamp(24px, 3.5vw, var(--text-h2)); }
/* BANNED: h2 span { color: ... } — do not re-add a blue tail to H2. */
h2 span, h3 span { color: inherit; }
h3 { font-size: var(--text-h3); }
.eyebrow {
  font-size: var(--text-eyebrow);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-brand);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 4px;
  background: var(--color-accent);
  vertical-align: middle;
  margin-right: var(--space-2);
}

/* ---- Layout ---- */
.wrap { max-width: var(--layout-max); margin: 0 auto; padding: 0 var(--layout-pad); }
section { padding: var(--space-8) 0; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-ink);
  color: var(--color-header-text);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  min-width: 0;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-header-text);
  text-decoration: none;
  min-width: 0;
}
.brand-lockup svg { width: 40px; height: 40px; flex: 0 0 auto; }
.brand-lockup b {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
/* Brand case is Title Case everywhere: "Dinsense Transmission". */
/* No ALL-CAPS header variant, no DEMO badge. */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) 0;
  min-width: 0;
}
.site-nav a {
  color: var(--color-header-text);
  text-decoration: none;
  margin: 0 var(--space-3) 0 0;
  font-family: var(--font-body); /* NOT mono: nav is body text, not data */
  font-size: 14px;
  white-space: normal;
  overflow-wrap: break-word;
}
.site-nav a:hover { text-decoration: underline; }

/* ---- Buttons: exactly two levels ---- */
/* Primary: solid ink, white text, soft shadow. No yellow fill. */
.btn, .btn-primary {
  display: inline-block;
  background: var(--color-ink);
  color: #ffffff;
  border: 2px solid var(--color-ink);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.btn:hover, .btn-primary:hover { background: var(--color-brand-dark); border-color: var(--color-brand-dark); color: #ffffff; }
/* Secondary: white, ink border, ink text. */
.btn-secondary {
  display: inline-block;
  background: #ffffff;
  color: var(--color-ink);
  border: 2px solid var(--color-ink);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--color-surface); color: var(--color-ink); }
/* Header CTA on the dark bar: white fill so it reads as the one action. */
.btn-header {
  display: inline-block;
  background: #ffffff;
  color: var(--color-ink);
  border: 2px solid #ffffff;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.btn-header:hover { background: var(--color-surface); color: var(--color-ink); }
.btn:focus-visible, .btn-primary:focus-visible, .btn-secondary:focus-visible,
.btn-header:focus-visible, a:focus-visible {
  outline: 3px solid rgba(15, 76, 129, 0.45);
  outline-offset: 2px;
}
.btn:active { transform: translateY(1px); box-shadow: var(--shadow-xs); }

/* ---- Hero: flat background only. No grid, no gradient background. ---- */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-8);
  padding: var(--space-12) 0 var(--space-8);
  align-items: start;
}
.hero h1, .hero .lead { max-width: 680px; }
.hero h1 { text-wrap: balance; }
.hero .lead { text-wrap: pretty; }
.hero p { font-size: var(--text-body-large); line-height: var(--leading-body); color: var(--color-muted); }
/* All interactive transitions use one easing curve (landing-page-design B7). */
a, button, .btn, .btn-primary, .btn-secondary, .btn-header {
  transition: color 700ms cubic-bezier(0.32,0.72,0,1), background-color 700ms cubic-bezier(0.32,0.72,0,1), border-color 700ms cubic-bezier(0.32,0.72,0,1), box-shadow 700ms cubic-bezier(0.32,0.72,0,1), transform 700ms cubic-bezier(0.32,0.72,0,1);
}

/* ---- Hero metrics: SPLIT by product line, never one combined strip ---- */
/* Two columns on desktop, stacked on mobile. No cell may mix IP65 + IP40, */
/* and no exception may live only in a footnote. See design-notes.md §3. */
.metric-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: var(--space-3) 0 var(--space-8);
}
.metric-col {
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.metric-col h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-brand); }
.metric-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--color-line);
  font-size: 14px;
}
.metric-row:first-of-type { border-top: 0; }
.metric-row b { font-family: var(--font-data); text-align: right; }

/* ---- Cards / panels ---- */
.panel {
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-4); }
.card {
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  box-shadow: var(--shadow-xs);
}
.card img, .figure img, .figure svg {
  width: 100%;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: #ffffff;
}
/* ---- Images: ONE fixed crop per slot, same asset = same crop everywhere ---- */
/* Never set a per-page height (150px here, 200px there). The ratio below */
/* is the crop; object-position is always centre unless a figure states otherwise. */
.card .figure-media { aspect-ratio: 4 / 3; object-fit: cover; object-position: center; }
.figure-hero { aspect-ratio: 4 / 3; object-fit: cover; object-position: center; }
.figure-detail { aspect-ratio: 3 / 2; object-fit: cover; object-position: center; }
.figure-drawing { aspect-ratio: 16 / 10; object-fit: contain; object-position: center; background: #ffffff; }
/* Caption template (copy verbatim, fill the three fields, delete nothing): */
/*   [Product name] | Source: [supplier catalogue / schematic placeholder] */
/*   | Applies to: [series / frames] | [Real product photo to be supplied — if true] */
.cap, figcaption {
  font-size: var(--text-caption);
  color: var(--color-muted-2);
  margin-top: var(--space-2);
  line-height: 1.55;
}

/* ---- Tables: scroll inside the wrapper, never stretch the viewport ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #ffffff; }
th, td {
  border: 1px solid var(--color-line);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
th { background: var(--color-ink); color: #ffffff; font-weight: 700; }
/* Comparison difference highlight: the differing cell only, not the whole row. */
td.diff { background: #eef4f9; font-weight: 700; }
.tag {
  font-family: var(--font-data);
  font-size: 12px;
  background: var(--color-surface);
  padding: 4px 8px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
}
.note {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-line);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  color: var(--color-warning);
}
.result-pass { background: var(--color-success-bg); color: var(--color-success); border-radius: var(--radius-md); padding: var(--space-4); }
.result-nofit { background: var(--color-danger-bg); color: var(--color-danger); border-radius: var(--radius-md); padding: var(--space-4); }

/* ---- Footer: 7 columns (see design-notes.md §2 for the exact lists) ---- */
.site-footer { background: var(--color-ink); color: var(--color-footer-text); padding: var(--space-8) 0; margin-top: var(--space-4); }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-6);
}
.footer-grid h3 {
  color: #ffffff;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.footer-grid a { color: var(--color-footer-text); text-decoration: none; display: block; margin: 0 0 var(--space-2); font-size: 14px; }
.footer-grid a:hover { color: #ffffff; text-decoration: underline; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, 0.2); margin-top: var(--space-6); padding-top: var(--space-4); font-size: var(--text-small); color: var(--color-footer-text); }

/* ---- Forms ---- */
label { display: block; font-weight: 700; margin: var(--space-4) 0 var(--space-1); }
input, select, textarea {
  width: 100%;
  padding: 12px 12px;
  border: 1.5px solid var(--color-line-strong);
  border-radius: var(--radius-md);
  background: #ffffff;
  font-size: 14px;
  font-family: var(--font-body);
}

/* ---- Narrow screens: keep the 390px no-overflow rule ---- */
@media (max-width: 1024px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 760px) {
  .hero, .metric-split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 390px) {
  .wrap { padding: 0 var(--layout-pad-narrow); }
  .site-header { padding: var(--space-3); }
  .brand-lockup b { font-size: 16px; white-space: normal; }
  .site-nav a { font-size: 12px; margin: 0 8px 0 0; }
  .panel, .metric-col { padding: var(--space-4); }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; }
}
