/* ========================================================================
   RMC Engineering — Base Styles
   Modern reset + editorial typography defaults
   ======================================================================== */

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
}
* {
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}
input, button, textarea, select {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: none;
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
ul, ol {
  list-style: none;
}

/* --- Base body --- */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  font-weight: var(--fw-regular);
  letter-spacing: var(--tracking-normal);
}

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

/* Display / hero — Verdana, bold, with italic accent */
.display-hero {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 3.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: var(--fw-bold);
  font-style: normal;
}
.display-hero em {
  font-style: italic;
  color: var(--accent);
  font-weight: var(--fw-bold);
}
.display-page {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, var(--text-4xl));
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-weight: var(--fw-bold);
}
.display-page em {
  font-style: italic;
  color: var(--accent);
  font-weight: var(--fw-bold);
}
.heading-section {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, var(--text-3xl));
  line-height: 1.2;
  letter-spacing: -0.005em;
  font-weight: var(--fw-bold);
}
.heading-section em {
  font-style: italic;
  color: var(--accent);
  font-weight: var(--fw-bold);
}
.heading-sub {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-snug);
  font-weight: var(--fw-medium);
}
.heading-card {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-snug);
}

/* Body */
.lead {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--ink-soft);
  font-weight: var(--fw-regular);
  max-width: 62ch;
}
.body-text {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--ink-soft);
  max-width: 62ch;
}
.body-small {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--ink-muted);
}
.caption {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: var(--ink-muted);
  letter-spacing: var(--tracking-wide);
}

/* Editorial section labels — small caps, tracked out */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--accent);
}
.eyebrow.no-rule::before {
  display: none;
}

/* Editorial index numbers — for sections, sidebars */
.index-num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--fw-regular);
  color: var(--ink-muted);
  letter-spacing: var(--tracking-wide);
}

/* --- Container widths --- */
.container {
  width: 100%;
  max-width: var(--max-container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.container-narrow {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.container-wide {
  width: 100%;
  max-width: var(--max-wide);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.measure {
  max-width: 62ch;
}

/* --- Section rhythm --- */
.section {
  padding-top: clamp(var(--space-9), 12vw, var(--space-11));
  padding-bottom: clamp(var(--space-9), 12vw, var(--space-11));
}
.section-tight {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

/* --- Rules & dividers --- */
.rule-top {
  border-top: 1px solid var(--rule);
  padding-top: var(--space-6);
}
.rule-bottom {
  border-bottom: 1px solid var(--rule);
  padding-bottom: var(--space-6);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-none);
  transition: all var(--dur-base) var(--ease-out);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--bg);
}
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover {
  background: var(--ink);
  color: var(--bg);
}
.btn-accent {
  background: var(--accent);
  color: var(--bg);
}
.btn-accent:hover {
  background: var(--accent-hover);
}

/* Arrow indicator on buttons */
.btn .arrow {
  display: inline-block;
  transition: transform var(--dur-base) var(--ease-out);
}
.btn:hover .arrow {
  transform: translateX(4px);
}

/* --- Text links --- */
.link-text {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-faint);
  padding-bottom: 2px;
  transition: all var(--dur-base) var(--ease-out);
}
.link-text:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* --- Utility --- */
.hide-mobile { display: block; }
.show-mobile { display: none; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--ink-muted); }
.text-italic { font-style: italic; }
.mono { font-family: var(--font-mono); }
.tabular { font-variant-numeric: tabular-nums lining-nums; }

@media (max-width: 768px) {
  .hide-mobile { display: none; }
  .show-mobile { display: block; }
}

/* --- Accessibility --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@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 --- */
::selection {
  background: var(--accent);
  color: var(--bg);
}
