/* ============================================================
   MAIN.CSS — Global Base Styles
   Project  : EV Technologies
   Scope    : Applied site-wide across ALL pages
   Note     : Define once here — do NOT repeat in section CSS.
              Only override in component/page CSS when truly needed.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Jost:wght@300;400;500;600;700;800&family=Poppins:wght@300;400;500;600;700&display=swap');
@import url('variables.css');


/* ============================================================
   1. RESET & BOX MODEL
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin    : 0;
  padding   : 0;
}

html {
  font-size  : 16px;         /* base — all rem values relative to this */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}


/* ============================================================
   2. BODY — Base
   ============================================================ */

body {
  font-family       : var(--font-secondary);
  font-size         :var(--fs-sm);;
  font-weight       : var(--fw-regular);
  line-height       : var(--lh-normal);
  color             : var(--color-text-body);
  /* background-color  : var(--color-bg-dark); */
  -webkit-font-smoothing : antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x        : hidden;
}


/* ============================================================
   3. HEADINGS — h1 through h6
   All headings use Jost (display font), bold weight, tight line-height.
   Colors and sizes set here — override only if section needs differ.
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family : var(--font-primary);
  font-weight : var(--fw-bold);
  line-height : var(--lh-tight);
  color       : var(--color-text-primary);
  letter-spacing: var(--ls-tight);
}

h1 { font-size: var(--fs-5xl); }   /* Hero titles */
h2 { font-size: var(--fs-4xl); }   /* Section titles */
h3 { font-size: var(--fs-2xl); }   /* Card / sub-section titles */
h4 { font-size: var(--fs-xl);  }
h5 { font-size: var(--fs-lg);  }
h6 { font-size: var(--fs-md);  }

/* Responsive heading sizes */
@media (max-width: 1024px) {
  h1 { font-size: var(--fs-4xl); }
  h2 { font-size: var(--fs-3xl); }
  h3 { font-size: var(--fs-xl);  }
}

@media (max-width: 768px) {
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
  h3 { font-size: var(--fs-lg);  }
  h4 { font-size: var(--fs-base);}
}


/* ============================================================
   4. PARAGRAPH & BODY TEXT
   ============================================================ */

p {
  font-size  : var(--fs-base);
  line-height: var(--lh-relaxed);
  color      : var(--color-text-body);
}

p + p {
  margin-top: var(--sp-4);
}

/* Lead paragraph — larger intro text */
.lead {
  font-size  : var(--fs-md);
  line-height: var(--lh-relaxed);
  color      : var(--color-text-body);
}

/* Small / caption text */
small,
.text-sm {
  font-size: var(--fs-sm);
}


/* ============================================================
   5. LINKS
   ============================================================ */

a {
  color          : var(--color-accent);
  text-decoration: none;
  transition     : color var(--transition-fast);
}

a:hover,
a:focus-visible {
  color: var(--color-accent-light);
}

a:focus-visible {
  outline       : 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius : var(--radius-sm);
}


/* ============================================================
   6. LISTS
   ============================================================ */

ul, ol {
  list-style: none;
}

/* Reset only — styled lists use utility classes */


/* ============================================================
   7. IMAGES & MEDIA
   ============================================================ */

img,
picture,
video,
canvas,
svg {
  display  : block;
  max-width: 100%;
  height   : auto;
}

img {
  object-fit: cover;
}


/* ============================================================
   8. FORMS — Base reset (detailed styling in components)
   ============================================================ */

input,
textarea,
select,
button {
  font-family: inherit;
  font-size  : inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}


/* ============================================================
   9. LAYOUT — Container
   ============================================================ */

.container {
  width    : 100%;
  max-width: var(--container-max);
  margin   : 0 auto;
  padding  : 0 var(--container-px);
}
.container-fluid {
  width  : 100%;
  padding: 0 var(--container-px);
}
@media (min-width: 1400px) {
  .container {
    padding: 0 calc(var(--container-px) * 2);
  }
}


/* ============================================================
   10. LAYOUT — Section
   ============================================================ */

.section {
  padding: var(--section-py) 0;
}

.section--sm {
  padding: var(--section-py-sm) 0;
}

/* Dark background section */
.section--dark {
  background-color: var(--color-bg-dark);
}

/* Alternate darker section */
.section--darker {
  background-color: var(--color-bg-darker);
}

/* Mid-navy alternate section */
.section--navy {
  background-color: var(--color-bg-section);
}

/* Light background section */
.section--light {
  background-color: var(--color-bg-light);
}

.section--light h1,
.section--light h2,
.section--light h3,
.section--light h4,
.section--light h5,
.section--light h6 {
  color: var(--color-text-heading-light);
}

.section--light p {
  color: var(--color-text-dark);
}


/* ============================================================
   11. SECTION HEADER — Reusable title block
   ============================================================ */

.section-header {
  margin-bottom: var(--sp-12);
}

.section-header--center {
  text-align: center;
}

/* Eyebrow label above section title */
.section-eyebrow {
  display       : inline-block;
  font-family   : var(--font-secondary);
  font-size     : var(--fs-sm);
  font-weight   : var(--fw-semibold);
  color         : var(--color-accent);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  margin-bottom : var(--sp-3);
}

/* Accent underline on section title */
.section-title {
  position: relative;
}

.section-title span {
  color: var(--color-accent);
}

.section-subtitle {
  margin-top : var(--sp-4);
  font-size  : var(--fs-md);
  color      : var(--color-text-muted);
  max-width  : 600px;
}

.section-header--center .section-subtitle {
  margin-left : auto;
  margin-right: auto;
}


/* ============================================================
   12. BUTTONS — Global
   ============================================================ */

.btn {
  display        : inline-flex;
  align-items    : center;
  justify-content: center;
  gap            : var(--sp-2);
  padding        : 0.75rem 1.75rem;
  font-family    : var(--font-secondary);
  font-size      : var(--fs-base);
  font-weight    : var(--fw-semibold);
  line-height    : 1;
  border-radius  : var(--radius-pill);
  border         : 2px solid transparent;
  cursor         : pointer;
  text-decoration: none;
  transition     : background-color var(--transition-base),
                   color var(--transition-base),
                   border-color var(--transition-base),
                   transform var(--transition-fast),
                   box-shadow var(--transition-base);
  white-space    : nowrap;
}

.btn:focus-visible {
  outline       : 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn:active {
  transform: scale(0.97);
}

/* Primary — Green fill */
.btn-primary {
  background-color: var(--color-accent);
  color           : #ffffff;
  border-color    : var(--color-accent);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--color-accent-dark);
  border-color    : var(--color-accent-dark);
  color           : #ffffff;
  box-shadow      : var(--shadow-accent);
}

/* Outline — Transparent with green border */
.btn-outline {
  background-color: transparent;
  color           : var(--color-accent);
  border-color    : var(--color-accent);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background-color: var(--color-accent);
  color           : #ffffff;
}

/* White outline — for use on dark hero backgrounds */
.btn-outline-white {
  background-color: transparent;
  color           : #ffffff;
  border-color    : rgba(255, 255, 255, 0.50);
}

.btn-outline-white:hover,
.btn-outline-white:focus-visible {
  background-color: #ffffff;
  color           : var(--color-bg-dark);
  border-color    : #ffffff;
}

/* Button sizes */
.btn-sm {
  padding  : 0.5rem 1.25rem;
  font-size: var(--fs-sm);
}

.btn-lg {
  padding  : 1rem 2.25rem;
  font-size: var(--fs-md);
}


/* ============================================================
   13. BADGE / TAG — Reusable label
   ============================================================ */

.badge {
  display       : inline-block;
  padding       : var(--sp-1) var(--sp-3);
  font-size     : var(--fs-xs);
  font-weight   : var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  border-radius : var(--radius-pill);
}

.badge-accent {
  background-color: var(--color-accent);
  color           : #ffffff;
}

.badge-outline {
  border     : 1px solid var(--color-accent);
  color      : var(--color-accent);
  background : transparent;
}


/* ============================================================
   14. CARD — Base card shell
   ============================================================ */

.card {
  background-color: var(--color-bg-card);
  border-radius   : var(--radius-xl);
  border          : 1px solid var(--color-border);
  overflow        : hidden;
  transition      : transform var(--transition-base),
                    box-shadow var(--transition-base);
}

.card:hover {
  transform : translateY(-4px);
  box-shadow: var(--shadow-card);
}

.card-body {
  padding: var(--sp-8);
}


/* ============================================================
   15. GRID UTILITIES
   ============================================================ */

.grid {
  display: grid;
  gap    : var(--sp-8);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
}


/* ============================================================
   16. FLEX UTILITIES
   ============================================================ */

.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-col      { display: flex; flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.gap-2         { gap: var(--sp-2); }
.gap-4         { gap: var(--sp-4); }
.gap-6         { gap: var(--sp-6); }
.gap-8         { gap: var(--sp-8); }


/* ============================================================
   17. TEXT UTILITIES
   ============================================================ */

.text-center  { text-align: center; }
.text-left    { text-align: left;   }
.text-right   { text-align: right;  }

.text-accent  { color: var(--color-accent); }
.text-muted   { color: var(--color-text-muted); }
.text-white   { color: #ffffff; }
.text-dark    { color: var(--color-text-dark); }

.text-uppercase { text-transform: uppercase; }
.text-bold      { font-weight: var(--fw-bold); }
.text-semibold  { font-weight: var(--fw-semibold); }


/* ============================================================
   18. SPACING UTILITIES
   ============================================================ */

.mt-4  { margin-top: var(--sp-4);  }
.mt-6  { margin-top: var(--sp-6);  }
.mt-8  { margin-top: var(--sp-8);  }
.mt-12 { margin-top: var(--sp-12); }
.mb-4  { margin-bottom: var(--sp-4);  }
.mb-6  { margin-bottom: var(--sp-6);  }
.mb-8  { margin-bottom: var(--sp-8);  }
.mb-12 { margin-bottom: var(--sp-12); }


/* ============================================================
   19. DIVIDER
   ============================================================ */

.divider {
  width           : 60px;
  height          : 3px;
  background-color: var(--color-accent);
  border-radius   : var(--radius-pill);
  margin          : var(--sp-4) 0;
}

.divider--center {
  margin-left : auto;
  margin-right: auto;
}


/* ============================================================
   20. ICON WRAPPER
   ============================================================ */

.icon-box {
  display         : inline-flex;
  align-items     : center;
  justify-content : center;
  width           : 56px;
  height          : 56px;
  border-radius   : var(--radius-lg);
  background-color: var(--color-accent-bg);
  color           : var(--color-accent);
  font-size       : var(--fs-xl);
  flex-shrink     : 0;
}

.icon-box--lg {
  width    : 72px;
  height   : 72px;
  font-size: var(--fs-2xl);
}


/* ============================================================
   21. OVERLAY UTILITY
   ============================================================ */

.overlay {
  position  : absolute;
  inset     : 0;
  background: var(--color-overlay-dark);
}

.overlay--darker {
  background: var(--color-overlay-darker);
}


/* ============================================================
   22. SCREEN READER ONLY — Accessibility
   ============================================================ */

.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;
}


/* ============================================================
   23. SCROLL ANIMATION — Fade in on scroll (JS triggered)
   ============================================================ */

.reveal {
  opacity  : 0;
  transform: translateY(30px);
  transition: opacity var(--transition-slow),
              transform var(--transition-slow);
}

.reveal.visible {
  opacity  : 1;
  transform: translateY(0);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity  : 1;
    transform: none;
    transition: none;
  }
}
