/* ==========================================================================
   BASE STYLES - Reset, Typography, Utilities
   Yellow Bay Technologies
   ========================================================================== */

/* CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--bay-ink);
  background-color: var(--bg-primary);
  overflow-x: hidden;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  max-width: 65ch;
}

a {
  color: var(--bay-teal);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--bay-sky);
}

a:focus-visible {
  outline: 2px solid var(--bay-gold);
  outline-offset: 4px;
  border-radius: 2px;
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style-position: inside;
}

/* Skip to Content Link (Accessibility) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--bay-gold);
  color: var(--bay-ink);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  z-index: 10000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Container System */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.container-narrow {
  max-width: 960px;
}

.container-wide {
  max-width: 1440px;
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--gap, 2rem);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Flex Utilities */
.flex {
  display: flex;
  gap: var(--gap, 1rem);
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

/* Spacing Scale */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }
.mt-6 { margin-top: 3rem; }
.mt-7 { margin-top: 4rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }
.mb-6 { margin-bottom: 3rem; }
.mb-7 { margin-bottom: 4rem; }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 2rem; padding-bottom: 2rem; }
.py-4 { padding-top: 3rem; padding-bottom: 3rem; }
.py-5 { padding-top: 4rem; padding-bottom: 4rem; }
.py-6 { padding-top: 6rem; padding-bottom: 6rem; }

/* Text Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-small { font-size: 0.875rem; }
.text-large { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }

/* Color Utilities */
.text-gold { color: var(--bay-gold); }
.text-sky { color: var(--bay-sky); }
.text-teal { color: var(--bay-teal); }
.text-muted { color: var(--text-secondary); }

.bg-mist { background-color: var(--bay-mist); }
.bg-white { background-color: #fff; }
.bg-dark { background-color: var(--bay-ink); color: #fff; }

/* Visibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.hidden { display: none !important; }

@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 768px) {
  .hide-desktop { display: none !important; }
}

/* Section Spacing */
section {
  padding: 4rem 0;
}

@media (min-width: 768px) {
  section {
    padding: 6rem 0;
  }
}

/* Focus Visible */
:focus-visible {
  outline: 2px solid var(--bay-gold);
  outline-offset: 4px;
}

/* Selection */
::selection {
  background-color: var(--bay-gold);
  color: var(--bay-ink);
}