/*
 * Grand Rapids Michigan Fence - Global Styles
 * Design tokens, reset, base typography
 */

/* =========================================================
   1. Fonts
   ========================================================= */

@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-VariableFont_wght.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-VariableFont_wght.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}


/* =========================================================
   2. Design Tokens
   ========================================================= */

:root {
  /* Colors — Brand Palette */
  --color-charcoal:      #1F1F1F;
  --color-warm-cream:    #F8FBFF;
  --color-soft-stone:    #D9ECFF;
  --color-sky-blue:      #D9ECFF;
  --color-fresh-green:   #38A169;
  --color-moss-green:    #38A169;
  --color-lime-accent:   #C6F15B;
  --color-warm-yellow:   #FFD166;
  --color-electric-blue: #176BFF;
  --color-white:         #FFFFFF;
  --color-text-muted:    #4A5568;
  --color-border:        #C8DEFF;

  /* Typography */
  --font-manrope: 'Manrope', sans-serif;
  --font-inter:   'Inter', sans-serif;

  /* Font sizes */
  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg:   1.125rem;  /* 18px */
  --text-xl:   1.25rem;   /* 20px */
  --text-2xl:  1.5rem;    /* 24px */
  --text-3xl:  1.875rem;  /* 30px */
  --text-4xl:  2.25rem;   /* 36px */
  --text-5xl:  3rem;      /* 48px */
  --text-6xl:  3.75rem;   /* 60px */

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-28: 7rem;
  --space-32: 8rem;
  /* Named scale (mirrors WP spacing) */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  2rem;
  --space-lg:  3.5rem;
  --space-xl:  5rem;
  --space-2xl: 7.5rem;
  --space-3xl: 11rem;

  /* Border radius */
  --radius-sm:   8px;
  --radius-md:   16px;
  --radius-lg:   24px;
  --radius-xl:   32px;
  --radius-full: 100px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Layout */
  --content-width: 740px;
  --wide-width:    1400px;
}


/* =========================================================
   3. Reset
   ========================================================= */

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

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

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-inter);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-charcoal);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration-color: var(--color-electric-blue);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-electric-blue);
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

p, h1, h2, h3, h4, h5, h6 {
  margin: 0;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}


/* =========================================================
   4. Base Typography
   ========================================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-manrope);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-charcoal);
}

h1 { font-size: clamp(var(--text-4xl), 5vw, var(--text-6xl)); }
h2 { font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl)); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  line-height: 1.7;
  margin-block: 0;
}

.lead {
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--color-text-muted);
}

.eyebrow {
  display: block;
  font-family: var(--font-manrope);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-electric-blue);
  margin-bottom: var(--space-3);
}

strong { font-weight: 700; }

/* Prose (long-form content sections) */
.prose h2,
.prose h3,
.prose h4 { margin-top: 2em; margin-bottom: 0.6em; }
.prose p { margin-block: 1em; }
.prose ul, .prose ol { padding-left: 1.5rem; list-style: revert; margin-block: 1em; }
.prose li { margin-block: 0.4em; line-height: 1.65; }
.prose a { color: var(--color-electric-blue); text-underline-offset: 3px; }
.prose a:hover { color: var(--color-moss-green); }

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  background: var(--color-charcoal);
  color: var(--color-white);
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-family: var(--font-manrope);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}


/* =========================================================
   5. Layout Utilities
   ========================================================= */

.container {
  width: 100%;
  max-width: var(--wide-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.container-narrow {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.section {
  padding-block: var(--space-xl);
}

.section-sm {
  padding-block: var(--space-lg);
}

.section-lg {
  padding-block: var(--space-2xl);
}

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }

/* Stack (vertical flex) */
.stack {
  display: flex;
  flex-direction: column;
}
.stack-sm  { gap: var(--space-sm); }
.stack-md  { gap: var(--space-md); }
.stack-lg  { gap: var(--space-lg); }

/* Grid utilities */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .container, .container-narrow { padding-inline: var(--space-sm); }
  .section { padding-block: var(--space-lg); }
  .section-lg { padding-block: var(--space-xl); }
}

/* Backgrounds */
.bg-cream  { background-color: var(--color-warm-cream); }
.bg-stone  { background-color: var(--color-soft-stone); }
.bg-white  { background-color: var(--color-white); }
.bg-dark   { background-color: var(--color-charcoal); }
.bg-blue   { background-color: var(--color-electric-blue); }
