@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Outfit:wght@400;500;600;700&display=swap');

/* ==========================================================================
   DESIGN TOKENS & SYSTEM VARIABLES
   ========================================================================== */
:root {
  /* Color Palette */
  --primary-navy: #091F40;
  --secondary-blue: #006FA0;
  --accent-color: #006FA0;
  --dark-charcoal: #1D1D1D;
  --body-text: #444444;
  --light-bg: #F4F4F4;
  --white: #FFFFFF;
  --border-color: #E2E8F0;
  --footer-bg: #091F40;
  
  /* Fonts */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Open Sans', sans-serif;
  
  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease-out;
  
  /* Layout constraints */
  --container-max-width: 1200px;
}

/* ==========================================================================
   RESET & FOUNDATION STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  color: var(--body-text);
  background-color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--dark-charcoal);
  font-weight: 600;
  line-height: 1.25;
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--secondary-blue);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  opacity: 0.85;
}

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

/* Common Containers & Grids */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.section-padding {
  padding: 5rem 0;
}

@media (max-width: 768px) {
  .section-padding {
    padding: 3rem 0;
  }
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 500;
  padding: 0.85rem 2rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: var(--transition-smooth);
}

.btn-primary {
  background-color: var(--primary-navy);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--secondary-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(9, 31, 64, 0.2);
}

.btn-secondary {
  background-color: var(--secondary-blue);
  color: var(--white);
}

.btn-secondary:hover {
  background-color: var(--primary-navy);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 111, 160, 0.2);
}

/* ==========================================================================
   NAVIGATION & HEADER
   ========================================================================== */
.top-bar {
  background-color: var(--primary-navy);
  color: var(--white);
  padding: 0.5rem 0;
  font-size: 0.85rem;
  font-family: var(--font-heading);
  z-index: 1000;
  position: relative;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-social a {
  color: var(--white);
  margin-right: 1rem;
  font-size: 1rem;
}

.top-bar-buttons a {
  background-color: var(--secondary-blue);
  color: var(--white);
  padding: 0.35rem 1rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.top-bar-buttons a:hover {
  background-color: var(--white);
  color: var(--primary-navy);
}

header {
  position: fixed;
  top: 34px; /* Perfect offset below top-bar */
  left: 0;
  right: 0;
  z-index: 999;
  background-color: transparent;
  padding: 1.25rem 0;
  transition: var(--transition-smooth);
}

header.scrolled {
  top: 0;
  background-color: var(--white);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 0.8rem 0;
}

header.scrolled .nav-link {
  color: var(--dark-charcoal);
}

header.scrolled .nav-logo img.starting-logo {
  display: none;
}

header.scrolled .nav-logo img.default-logo {
  display: block;
}

/* Logo toggling */
.nav-logo img.default-logo {
  display: none;
  height: 50px;
  width: auto;
}

.nav-logo img.starting-logo {
  display: block;
  height: 50px;
  width: auto;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-menu {
  display: flex;
  list-style: none;
  align-items: center;
}

.nav-item {
  position: relative;
  margin-left: 1.8rem;
}

.nav-link {
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  padding: 0.5rem 0;
  text-transform: uppercase;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--secondary-blue);
  transition: var(--transition-smooth);
}

.nav-link:hover::after {
  width: 100%;
}

/* Submenu layout */
.nav-item:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--white);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  min-width: 240px;
  list-style: none;
  padding: 0.75rem 0;
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition-smooth);
  z-index: 100;
}

.submenu-item a {
  display: block;
  padding: 0.6rem 1.5rem;
  color: var(--dark-charcoal);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.9rem;
}

.submenu-item a:hover {
  background-color: var(--light-bg);
  color: var(--secondary-blue);
  padding-left: 1.8rem;
}

/* Mobile Nav Toggler */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1000;
}

.mobile-nav-toggle .bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  background-color: var(--white);
  transition: var(--transition-smooth);
}

header.scrolled .mobile-nav-toggle .bar {
  background-color: var(--dark-charcoal);
}

/* Off-canvas sidebar */
.off-canvas {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background-color: var(--primary-navy);
  z-index: 10000;
  box-shadow: -5px 0 25px rgba(0,0,0,0.25);
  transition: var(--transition-smooth);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.off-canvas.active {
  right: 0;
}

.off-canvas-close {
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  margin-bottom: 2rem;
}

.off-canvas-menu {
  list-style: none;
  margin-bottom: 3rem;
}

.off-canvas-item {
  margin-bottom: 1.25rem;
}

.off-canvas-link {
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  display: block;
  padding: 0.5rem 0;
}

.off-canvas-submenu {
  list-style: none;
  padding-left: 1.25rem;
  margin-top: 0.5rem;
}

.off-canvas-submenu-item {
  margin-bottom: 0.5rem;
}

.off-canvas-submenu-item a {
  color: #CBD5E1;
  font-size: 0.95rem;
}

.off-canvas-contact-info {
  margin-top: auto;
  color: #CBD5E1;
  font-size: 0.9rem;
}

.off-canvas-contact-info h6 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.off-canvas-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.5);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.off-canvas-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   HERO / VIDEO MASTHEAD
   ========================================================================== */
.hero-masthead {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-align: center;
}

.hero-video-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(9, 31, 64, 0.7) 0%, rgba(0, 111, 160, 0.5) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 900px;
  padding: 0 1.5rem;
}

.hero-subtitle {
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
  font-family: var(--font-heading);
  font-weight: 500;
  color: #93C5FD;
}

.hero-rotating-text {
  font-size: 4rem;
  margin-bottom: 2rem;
  height: 6rem;
  overflow: hidden;
  font-weight: 700;
}

@media (max-width: 768px) {
  .hero-rotating-text {
    font-size: 2.25rem;
    height: 4rem;
  }
}

.rotating-word {
  display: none;
  animation: slideInText 0.5s ease-out forwards;
}

.rotating-word.active {
  display: block;
}

@keyframes slideInText {
  0% { transform: translateY(40px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Custom Shape Divider */
.shape-divider {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  transform: rotate(180deg);
  z-index: 4;
}

.shape-divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 120px;
}

.shape-divider .shape-fill {
  fill: var(--white);
}

/* ==========================================================================
   HOMEPAGE LAYOUTS & COMPONENTS
   ========================================================================== */
.home-intro-text {
  max-width: 800px;
  margin: 0 auto 3rem auto;
  text-align: center;
  font-size: 1.15rem;
  line-height: 1.8;
}

/* Reprocessor split layout */
.reprocessor-split {
  display: flex;
  margin-top: 4rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.reprocessor-text {
  flex: 1;
  background-color: var(--light-bg);
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.reprocessor-image {
  flex: 1;
  background-image: url('https://sdpolymers.net/wp-content/uploads/plastic-shreds.webp');
  background-size: cover;
  background-position: center;
  min-height: 400px;
}

@media (max-width: 992px) {
  .reprocessor-split {
    flex-direction: column;
  }
  .reprocessor-text {
    padding: 2.5rem;
  }
}

/* Checklist layout */
.checklist-section {
  background-color: var(--light-bg);
}

.checklist-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.checklist-image {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.checklist-items {
  list-style: none;
}

.checklist-items li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 1rem;
  font-size: 1.05rem;
  font-weight: 500;
}

.checklist-items li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--secondary-blue);
  font-weight: 700;
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  .checklist-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Promise Section */
.promise-section {
  background-image: linear-gradient(135deg, rgba(9,31,64,0.9) 0%, rgba(29,29,29,0.9) 100%), url('https://sdpolymers.net/wp-content/uploads/tire-recycle.webp');
  background-size: cover;
  background-position: center;
  color: var(--white);
  padding: 6rem 0;
}

.promise-content {
  display: flex;
  gap: 4rem;
  align-items: center;
}

.promise-heading {
  flex: 1;
  color: var(--white);
  font-size: 2.5rem;
  border-right: 3px solid var(--secondary-blue);
  padding-right: 3rem;
}

.promise-body {
  flex: 2;
  font-size: 1.25rem;
  line-height: 1.8;
}

@media (max-width: 992px) {
  .promise-content {
    flex-direction: column;
    gap: 2rem;
  }
  .promise-heading {
    border-right: none;
    border-bottom: 3px solid var(--secondary-blue);
    padding-right: 0;
    padding-bottom: 1.5rem;
  }
}

/* How Offer Section */
.offer-section {
  display: flex;
}

.offer-col {
  flex: 1;
}

.offer-content-box {
  background-color: var(--secondary-blue);
  color: var(--white);
  padding: 5rem;
}

.offer-content-box h4 {
  color: var(--white);
  font-size: 2.25rem;
  margin-bottom: 2rem;
}

.offer-content-box p {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.offer-img-box {
  background-image: url('https://sdpolymers.net/wp-content/uploads/Contact-SD-Polymers-Location.jpg');
  background-size: cover;
  background-position: center;
  min-height: 500px;
}

@media (max-width: 992px) {
  .offer-section {
    flex-direction: column;
  }
  .offer-content-box {
    padding: 3rem 1.5rem;
  }
}

/* repocess icon grid */
.icon-section {
  background-image: linear-gradient(rgba(255,255,255,0.95), rgba(255,255,255,0.95)), url('https://sdpolymers.net/wp-content/uploads/hand-pellets.webp');
  background-size: cover;
  background-position: center;
}

.icon-grid {
  display: flex;
  justify-content: center;
  gap: 6rem;
  margin-top: 3rem;
  margin-bottom: 4rem;
}

.icon-card {
  text-align: center;
  max-width: 250px;
}

.icon-card img {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem auto;
}

.icon-card h5 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.icon-card span {
  font-size: 0.95rem;
  color: var(--body-text);
  font-weight: 500;
}

@media (max-width: 768px) {
  .icon-grid {
    flex-direction: column;
    align-items: center;
    gap: 3rem;
  }
}

/* Segment Fancy Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.fancy-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  height: 300px;
  display: flex;
  align-items: flex-end;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  transition: var(--transition-smooth);
}

.fancy-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(9, 31, 64, 0.9) 100%);
  z-index: 2;
  transition: var(--transition-smooth);
}

.fancy-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(9, 31, 64, 0.2);
}

.fancy-card:hover::before {
  background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0, 111, 160, 0.95) 100%);
}

.card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 1;
  transition: var(--transition-smooth);
}

.fancy-card:hover .card-bg {
  transform: scale(1.05);
}

.card-content {
  position: relative;
  z-index: 3;
  color: var(--white);
}

.card-content h6 {
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 700;
}

@media (max-width: 992px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

/* News Section Cards */
.news-banner {
  background-image: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.6)), url('https://sdpolymers.net/wp-content/uploads/news-image2.webp');
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  padding: 6rem;
  color: var(--white);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  margin-top: 4rem;
  transition: var(--transition-smooth);
}

.news-banner:hover {
  transform: translateY(-5px);
}

.news-banner h3 {
  color: var(--white);
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.news-banner p {
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .news-banner {
    padding: 3rem 1.5rem;
  }
  .news-banner h3 {
    font-size: 1.8rem;
  }
}

/* Call to Action Banner */
.cta-banner {
  background-image: linear-gradient(135deg, rgba(0,111,160,0.85) 0%, rgba(9,31,64,0.9) 100%), url('https://sdpolymers.net/wp-content/uploads/white-polymers.webp');
  background-size: cover;
  background-position: center;
  color: var(--white);
  padding: 4rem 0;
}

.cta-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.cta-flex h6 {
  color: var(--white);
  font-size: 1.5rem;
  flex: 2;
  font-weight: 500;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  flex: 1;
  justify-content: flex-end;
}

@media (max-width: 992px) {
  .cta-flex {
    flex-direction: column;
    text-align: center;
  }
  .cta-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   SUBPAGE STYLING (ABOUT, ROOFING, CONTACT, WHY US)
   ========================================================================== */
.subpage-hero {
  position: relative;
  height: 45vh;
  min-height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-align: center;
  background-size: cover;
  background-position: center;
}

.subpage-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 10, 10, 0.55);
  z-index: 1;
}

.subpage-hero-content {
  position: relative;
  z-index: 2;
}

.subpage-hero-content h1 {
  color: var(--white);
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 1px;
}

@media (max-width: 768px) {
  .subpage-hero-content h1 {
    font-size: 2.5rem;
  }
}

/* Contact page styled form */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 3rem;
}

.contact-info-list {
  list-style: none;
}

.contact-info-list li {
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.contact-info-list h6 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--primary-navy);
}

.contact-form {
  background-color: var(--light-bg);
  padding: 3rem;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark-charcoal);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--white);
  font-family: var(--font-body);
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 3px rgba(0, 111, 160, 0.15);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

@media (max-width: 768px) {
  .contact-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .contact-form {
    padding: 2rem 1.5rem;
  }
}

/* ==========================================================================
   FOOTER STYLING
   ========================================================================== */
footer {
  background-color: var(--footer-bg);
  color: var(--white);
  padding: 5rem 0 3rem 0;
  font-family: var(--font-body);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem;
}

.footer-col h6 {
  color: #D9D9D9;
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.75rem;
}

.footer-col ul li a {
  color: #CBD5E1;
  transition: var(--transition-fast);
}

.footer-col ul li a:hover {
  color: var(--white);
  padding-left: 0.25rem;
}

.footer-col p {
  color: #CBD5E1;
  font-size: 0.95rem;
  line-height: 1.7;
}

.footer-social-links {
  margin-top: 1.5rem;
}

.footer-social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: rgba(255,255,255,0.1);
  border-radius: 50%;
  color: var(--white);
  margin-right: 0.75rem;
  transition: var(--transition-smooth);
}

.footer-social-links a:hover {
  background-color: var(--secondary-blue);
  transform: translateY(-3px);
}

.footer-logo img {
  max-width: 180px;
  margin-bottom: 1.5rem;
}

.footer-certified-wrap {
  text-align: center;
}

.footer-certified-wrap img {
  max-width: 140px;
  margin: 0 auto 1rem auto;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 4rem;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: #94A3B8;
}

.footer-bottom a {
  color: #94A3B8;
  text-decoration: underline;
}

.footer-bottom a:hover {
  color: var(--white);
}

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

@media (max-width: 576px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
