/* ==========================================================================
   American Pro Building Products, Base
   Design tokens, reset, typography
   ========================================================================== */

:root,
[data-theme="light"] {
  /* ─── Brand: Evolved Patriot ─────────────────────────────────────────── */
  /* Deep navy + warm white + a single accent red. Restrained, refined,
     unmistakably American without being campy. */

  --color-bg:                 #fbfaf7;   /* warm off-white */
  --color-surface:            #ffffff;
  --color-surface-2:          #f4f1ec;   /* warm cream */
  --color-surface-offset:     #ebe7df;
  --color-surface-dark:       #0e1f3a;   /* deep navy surface */
  --color-divider:            #e5e1d9;
  --color-border:             #d6d1c6;

  --color-text:               #0e1f3a;   /* deep navy */
  --color-text-muted:         #5b6478;
  --color-text-faint:         #98a0b1;
  --color-text-inverse:       #fbfaf7;

  --color-primary:            #0e1f3a;   /* navy is primary */
  --color-primary-hover:      #1a2f54;
  --color-primary-active:     #06122a;

  --color-accent:             #b91c2c;   /* refined heritage red */
  --color-accent-hover:       #9b1622;
  --color-accent-active:      #7a1019;
  --color-accent-soft:        #fbe9eb;

  --color-success:            #2f6b3c;

  /* ─── Type Scale (fluid) ──────────────────────────────────────────────── */
  --text-xs:    clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm:    clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base:  clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg:    clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl:    clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl:   clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl:   clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero:  clamp(3rem, 0.5rem + 7vw, 7.5rem);

  /* ─── Spacing (4px base) ──────────────────────────────────────────────── */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ─── Radius / shadows / motion ───────────────────────────────────────── */
  --radius-sm:   0.25rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(14, 31, 58, 0.06);
  --shadow-md: 0 4px 18px rgba(14, 31, 58, 0.10);
  --shadow-lg: 0 18px 48px rgba(14, 31, 58, 0.18);

  --transition-interactive: 220ms cubic-bezier(0.16, 1, 0.3, 1);

  /* ─── Layout widths ───────────────────────────────────────────────────── */
  --content-narrow:  640px;
  --content-default: 1100px;
  --content-wide:    1320px;

  /* ─── Fonts ───────────────────────────────────────────────────────────── */
  --font-display: 'Boska', 'Playfair Display', Georgia, serif;
  --font-body:    'Satoshi', 'Inter', system-ui, -apple-system, sans-serif;
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 7rem;
}

@media (max-width: 540px) {
  html { scroll-padding-top: 8rem; }
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

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

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

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

input, textarea, select {
  font: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--color-text);
}

p {
  text-wrap: pretty;
  max-width: 65ch;
}

/* Sensible default vertical rhythm for prose blocks. Components that need
   different spacing override locally. */
.prose p + p,
.prose p + ul,
.prose p + ol,
.prose ul + p,
.prose ol + p,
.prose h2 + p,
.prose h3 + p,
.prose p + h2,
.prose p + h3 { margin-top: 1rem; }

/* Sibling spacing for any paragraph followed by a list or another paragraph
   inside common content containers. Cheap insurance against zero-margin reset. */
p + p,
p + ul,
p + ol,
ul + p,
ol + p { margin-top: var(--space-4); }

::selection {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

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

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

a, button, input, textarea, select {
  transition:
    color var(--transition-interactive),
    background-color var(--transition-interactive),
    border-color var(--transition-interactive),
    transform var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

.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;
}
