/* ==========================================================================
   RentMath USA — Financial Editorial & Precision Calculator Design Tokens
   Palette: Architectural Ivory + Deep Financial Slate + Forest Emerald + Brass
   Typography: Newsreader (Display) + DM Sans (UI) + JetBrains Mono (Data)
   ========================================================================== */

:root {
  --bg-canvas: #faf9f6;
  --bg-surface: #ffffff;
  --bg-tray: #f1efe9;
  --bg-navy: #0f1d2b;
  --bg-navy-elevated: #172a3e;

  --text-primary: #0f1d2b;
  --text-secondary: #3f4e5e;
  --text-muted: #5a6a7a;
  --text-on-dark: #f8fafc;
  --text-on-dark-muted: #b6c5d4;

  --emerald: #0d7a5f;
  --emerald-bright: #10b981;
  --emerald-soft: rgba(13, 122, 95, 0.1);
  --brass: #a87020;
  --brass-bright: #d69838;
  --brass-soft: rgba(168, 112, 32, 0.11);
  --danger: #b91c1c;
  --danger-soft: rgba(185, 28, 28, 0.09);

  --border-subtle: rgba(15, 29, 43, 0.1);
  --border-strong: rgba(15, 29, 43, 0.22);
  --border-dark: rgba(255, 255, 255, 0.13);

  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Concentric Radii: R_outer = R_inner + padding */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 9999px;

  --shadow-sm: 0 1px 2px rgba(15, 29, 43, 0.05), 0 4px 14px rgba(15, 29, 43, 0.04);
  --shadow-md: 0 6px 16px rgba(15, 29, 43, 0.07), 0 18px 38px rgba(15, 29, 43, 0.08);
  --shadow-lg: 0 14px 32px rgba(15, 29, 43, 0.16), 0 30px 64px rgba(15, 29, 43, 0.16);

  --ease-snappy: cubic-bezier(0.22, 1, 0.36, 1);
  --container-max: 1220px;
  --nav-h: 70px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.62;
  color: var(--text-primary);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

.mono { font-family: var(--font-mono); }
.tabular { font-variant-numeric: tabular-nums; }

:focus-visible {
  outline: 2.5px solid var(--emerald);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

/* Tactile Buttons (WCAG 2.2 44px+) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 20px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 150ms var(--ease-snappy), background-color 160ms, border-color 160ms, box-shadow 160ms;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--bg-navy);
  color: var(--text-on-dark);
  box-shadow: 0 2px 8px rgba(15, 29, 43, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn-primary:hover { background: #183047; transform: translateY(-1px); }

.btn-emerald {
  background: var(--emerald);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(13, 122, 95, 0.28);
}
.btn-emerald:hover { background: #0a634d; transform: translateY(-1px); }

.btn-brass {
  background: var(--brass);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(168, 112, 32, 0.26);
}
.btn-brass:hover { background: #8f5d17; transform: translateY(-1px); }

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-outline:hover { background: var(--bg-tray); border-color: var(--bg-navy); }

.btn-ghost-dark {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.24);
}
.btn-ghost-dark:hover { background: rgba(255, 255, 255, 0.16); }

.btn-sm { min-height: 38px; padding: 8px 14px; font-size: 0.84rem; }
.btn-lg { min-height: 52px; padding: 14px 26px; font-size: 0.98rem; }

/* Editorial Typography */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--emerald);
}

.eyebrow-pill {
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--emerald-soft);
  border: 1px solid rgba(13, 122, 95, 0.24);
}

.eyebrow-brass {
  color: var(--brass);
  background: var(--brass-soft);
  border-color: rgba(168, 112, 32, 0.28);
}

.display-h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.15rem, 4.2vw + 0.5rem, 3.85rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0;
}

.display-h1 em { font-style: italic; color: var(--emerald); font-weight: 500; }

.section-h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.65rem, 2.5vw + 0.45rem, 2.55rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

.section-h2 em { font-style: italic; color: var(--emerald); font-weight: 500; }

.lead-copy {
  font-size: clamp(0.98rem, 0.35vw + 0.92rem, 1.12rem);
  line-height: 1.64;
  color: var(--text-secondary);
  max-width: 64ch;
  margin: 0;
}

@media (max-width: 640px) {
  input, select, textarea { font-size: 16px !important; }
}

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