/* ==========================================================================
   1. MODERN CSS RESET
   Ensures consistent sizing and behavior across all browser types.
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   2. FLUID ROOT SIZING
   Scales all webpage text together based on the screen width.
   ========================================================================== */
html {
  /* Minimum: 15px on small screens
     Fluid: 13.5px base + 0.5% of the screen width
     Maximum: 19px on giant monitors */
  font-size: clamp(15px, 13.5px + 0.5vw, 19px);
  
  /* Enables smooth scrolling when linking to page anchors */
  scroll-behavior: smooth; 
}

/* ==========================================================================
   3. GLOBAL BODY STYLES
   Sets up global defaults for the page text layout.
   ========================================================================== */
body {
  /* Inherits the fluid size from html, but applies comfortable line spacing */
  font-size: 1rem; 
  line-height: 1.6;
  
  /* System font stack for optimal readability and performance */
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: #212529;
  background-color: #f8f9fa;
  
  /* Improves text rendering across browsers */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   4. RESPONSIVE HEADINGS & PARAGRAPHS
   All sizes use 'rem' units so they multiply cleanly against the root size.
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  color: #1a1a1a;
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 0.5em; /* Dynamic spacing relative to the heading's own size */
}

/* Headings safely cascade in scale */
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }

p, ul, ol {
  margin-bottom: 1.25rem; /* Creates clean spacing between blocks of text */
}

/* ==========================================================================
   5. OTHER INTERACTIVE FLUID ELEMENTS
   ========================================================================== */
a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button, .button {
  display: inline-block;
  font-size: 1rem; /* Dynamically resizes alongside body text */
  padding: 0.5em 1.2em;
  background-color: #0066cc;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background-color: #0052a3;
}
