/* ============================================================
   Michigan Custom Machines — base styles
   Brand: #0080bf (primary blue), #cd1441 (accent red),
          #212529 / #383f48 (dark), #f7f7f7 (light)
   ============================================================ */

:root {
  --mcm-blue: #0080bf;
  --mcm-blue-dark: #005f8f;
  --mcm-red: #cd1441;
  --mcm-dark: #212529;
  --mcm-charcoal: #383f48;
  --mcm-gray: #6c757d;
  --mcm-light: #f7f7f7;
  --mcm-border: #e3e3e3;
  --mcm-white: #ffffff;

  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Oswald', 'Open Sans', sans-serif;

  --max-width: 1280px;
  --radius: 2px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-body);
  color: var(--mcm-dark);
  background: var(--mcm-white);
  line-height: 1.6;
  font-size: 15px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--mcm-dark);
  margin: 0 0 0.5em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1rem; }

a {
  color: var(--mcm-blue);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--mcm-red); }

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

/* ------------------------------------------------------------
   Top utility bar
   ------------------------------------------------------------ */
.top-bar {
  background: var(--mcm-light);
  border-bottom: 1px solid var(--mcm-border);
  font-size: 12.5px;
  color: var(--mcm-charcoal);
}
.top-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.top-bar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.top-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.top-meta svg {
  color: var(--mcm-blue);
  flex-shrink: 0;
}
.top-meta a {
  color: inherit;
}
.top-meta a:hover { color: var(--mcm-blue); }

.top-email { color: var(--mcm-charcoal); }
.top-email:hover { color: var(--mcm-blue); }

/* ------------------------------------------------------------
   Main header
   ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--mcm-white);
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  border-bottom: 1px solid var(--mcm-border);
  transition: box-shadow .2s ease;
}
.site-header.scrolled {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  gap: 24px;
  transition: min-height .2s ease;
}
.site-header.scrolled .header-inner {
  min-height: 64px;
}

.site-logo img {
  height: 54px;
  width: auto;
  transition: height .2s ease;
}
.site-header.scrolled .site-logo img {
  height: 40px;
}

.nav-list > li > a {
  transition: padding .2s ease, color .15s ease;
}
.site-header.scrolled .nav-list > li > a {
  padding-top: 20px;
  padding-bottom: 20px;
}

.main-nav {
  display: flex;
  flex: 1;
  justify-content: flex-end;
}
.nav-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 2px;
  align-items: center;
}
.nav-list > li { position: relative; }
.nav-list > li > a {
  display: block;
  padding: 32px 14px;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--mcm-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.nav-list > li > a:hover { color: var(--mcm-blue); }

.nav-list .nav-cta a {
  margin-left: 14px;
  padding: 10px 22px;
  background: var(--mcm-blue);
  color: var(--mcm-white);
  border-radius: var(--radius);
  transition: background .15s ease;
}
.nav-list .nav-cta a:hover {
  background: var(--mcm-blue-dark);
  color: var(--mcm-white);
}

.nav-list .sub {
  list-style: none;
  margin: 0; padding: 8px 0;
  position: absolute;
  top: 100%; left: 0;
  min-width: 260px;
  background: var(--mcm-white);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-top: 3px solid var(--mcm-red);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all .15s ease;
}
.nav-list .has-sub:hover .sub,
.nav-list .has-sub:focus-within .sub {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-list .sub li a {
  display: block;
  padding: 10px 20px;
  font-size: 0.9rem;
  color: var(--mcm-dark);
  border-left: 3px solid transparent;
}
.nav-list .sub li a:hover {
  background: var(--mcm-light);
  border-left-color: var(--mcm-blue);
  color: var(--mcm-blue);
}

.hamburger {
  display: none;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--mcm-dark);
  margin: 5px 0;
  transition: transform .15s ease;
}

/* ------------------------------------------------------------
   Main content
   ------------------------------------------------------------ */
main { min-height: 60vh; }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.site-footer {
  background: var(--mcm-dark);
  color: rgba(255,255,255,0.70);
  font-size: 0.9rem;
  margin-top: 64px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px 40px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.3fr 1fr;
  gap: 48px;
}
.footer-col h4 {
  color: var(--mcm-white);
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--mcm-blue);
  display: inline-block;
}
.footer-col ul {
  list-style: none;
  margin: 0; padding: 0;
}
.footer-col li { margin-bottom: 6px; }
.footer-col a { color: rgba(255,255,255,0.70); }
.footer-col a:hover { color: var(--mcm-blue); }

.footer-label {
  color: rgba(255,255,255,0.5);
  font-size: 0.82rem;
  margin: 12px 0 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.footer-col address {
  font-style: normal;
  line-height: 1.5;
}
.footer-col p { margin: 0 0 6px; }

.footer-logo-link {
  display: inline-block;
}
.footer-logo {
  max-width: 200px;
  height: auto;
  display: block;
}

.footer-posts li {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  line-height: 1.3;
}
.footer-posts li:last-child { border-bottom: 0; }
.footer-post-thumb {
  display: block;
  width: 60px; height: 60px;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.05);
}
.footer-post-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.footer-post-title {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.3;
}
.footer-post-title:hover { color: var(--mcm-white); }

.footer-copyright {
  background: #161a1d;
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 16px 24px;
  font-size: 0.82rem;
}

/* ------------------------------------------------------------
   Utility / placeholder
   ------------------------------------------------------------ */
.placeholder {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 24px;
  text-align: center;
}
.placeholder h1 {
  color: var(--mcm-blue);
  font-size: 2.6rem;
}
.placeholder p { color: var(--mcm-gray); font-size: 1.05rem; }

.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--mcm-blue);
  color: var(--mcm-white);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius);
  transition: background .15s ease;
}
.btn:hover { background: var(--mcm-blue-dark); color: var(--mcm-white); }
.btn-accent { background: var(--mcm-red); }
.btn-accent:hover { background: #a90f35; }

/* ============================================================
   HOMEPAGE SECTIONS
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.text-center { text-align: center; }

.section-heading {
  font-size: 2rem;
  margin-bottom: 18px;
  position: relative;
  display: inline-block;
}
.section-heading.light { color: var(--mcm-white); }
.section-heading.text-center {
  display: block;
  text-align: center;
}
.heading-accent { color: var(--mcm-blue); }
.section-intro {
  max-width: 900px;
  margin: 0 auto 24px;
  text-align: center;
  color: var(--mcm-charcoal);
}

/* Hero slider */
.hero-slider {
  position: relative;
  overflow: hidden;
  background: var(--mcm-dark);
  height: clamp(380px, 46vw, 620px);
}
.hero-track {
  position: absolute;
  inset: 0;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .8s ease;
}
.hero-slide.active { opacity: 1; }
.hero-slide > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 55%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}
.hero-caption {
  position: absolute;
  left: 6%;
  top: 50%;
  transform: translateY(-50%);
  max-width: 580px;
  color: var(--mcm-white);
  z-index: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.hero-caption-centered {
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 860px;
  text-align: center;
}
.hero-caption-wide {
  max-width: 1040px;
}
.hero-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: rgba(255,255,255,0.9);
  margin: 0 0 16px;
  opacity: 0;
  transform: translateX(-30px);
}
.hero-caption-centered .hero-eyebrow {
  transform: translateY(-16px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.hero-eyebrow-decorated::before,
.hero-eyebrow-decorated::after {
  content: "";
  width: 60px;
  height: 12px;
  background: repeating-linear-gradient(135deg,
    rgba(255,255,255,0.6) 0 2px,
    transparent 2px 6px);
  display: inline-block;
}
.hero-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  margin: 0 0 14px;
  color: var(--mcm-white);
  opacity: 0;
  transform: translateX(-40px);
}
.hero-caption-centered .hero-title {
  transform: translateY(-24px);
}
.hero-title-xl {
  font-size: clamp(2.2rem, 5.2vw, 4rem);
  letter-spacing: 1px;
}
.hero-sub {
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  margin: 0;
  color: rgba(255,255,255,0.9);
  max-width: 520px;
  opacity: 0;
  transform: translateX(-30px);
}
.hero-caption-centered .hero-sub {
  max-width: none;
  margin: 0 auto;
  transform: translateY(-20px);
}
.hero-btn {
  display: inline-block;
  margin-top: 28px;
  padding: 14px 36px;
  border: 2px solid var(--mcm-white);
  color: var(--mcm-white);
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.92rem;
  border-radius: var(--radius);
  background: rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateY(-18px);
  transition: background .2s ease, color .2s ease;
}
.hero-btn:hover {
  background: var(--mcm-white);
  color: var(--mcm-dark);
}
.hero-slide.active .hero-eyebrow {
  animation: hero-slide-in .7s ease-out .3s forwards;
}
.hero-slide.active .hero-title {
  animation: hero-slide-in .7s ease-out .5s forwards;
}
.hero-slide.active .hero-sub {
  animation: hero-slide-in .7s ease-out .75s forwards;
}
.hero-slide.active .hero-btn {
  animation: hero-slide-in-up .7s ease-out 1s forwards;
}
@keyframes hero-slide-in {
  to { opacity: 1; transform: translateX(0); }
}
.hero-caption-centered.hero-caption-centered .hero-eyebrow,
.hero-caption-centered.hero-caption-centered .hero-title,
.hero-caption-centered.hero-caption-centered .hero-sub {
  animation-name: hero-slide-in-down;
}
@keyframes hero-slide-in-down {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes hero-slide-in-up {
  to { opacity: 1; transform: translateY(0); }
}
.hero-dots {
  position: absolute;
  bottom: 20px; left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 2;
}
.hero-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all .2s ease;
}
.hero-dot.active,
.hero-dot:hover {
  background: var(--mcm-white);
  border-color: var(--mcm-white);
}

/* Grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }

/* Partners section */
.section-partners {
  padding: 88px 0;
}
.section-partners .grid-2 { gap: 72px; }
.section-partners p {
  line-height: 1.85;
  margin-bottom: 24px;
  color: var(--mcm-charcoal);
}
.partners-logo img {
  max-width: 100%;
  margin: 0 auto;
}

/* XSTREAM section (dark) */
.section-xstream {
  background: var(--mcm-dark);
  color: rgba(255,255,255,0.85);
  padding: 64px 0;
}
.section-xstream .grid-2 { gap: 56px; }
.feature-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}
.feature-bullets li {
  position: relative;
  padding: 8px 0 8px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.feature-bullets li:last-child { border-bottom: 0; }
.feature-bullets li::before {
  content: "";
  position: absolute;
  left: 0; top: 16px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--mcm-blue);
}
.xstream-img {
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* Engineered Solutions */
.section-solutions {
  padding: 72px 0 64px;
  background: var(--mcm-white);
}
.solution-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--mcm-blue);
}
.solution-card h3 a { color: var(--mcm-blue); }
.solution-card h3 a:hover { color: var(--mcm-red); }
.solution-card p { color: var(--mcm-charcoal); font-size: 0.92rem; line-height: 1.65; }

/* Testimonial */
.section-testimonial {
  background: var(--mcm-blue);
  color: var(--mcm-white);
  padding: 40px 0;
}
.testimonial {
  margin: 0;
  text-align: center;
}
.testimonial p {
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.5;
  margin: 0 0 14px;
}
.testimonial cite {
  font-style: normal;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.5px;
  opacity: 0.92;
}

/* Industries */
.section-industries {
  padding: 72px 0;
  background: var(--mcm-light);
}
.industry-card h3 {
  font-size: 1.2rem;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--mcm-blue);
}
.industry-card h3 a { color: var(--mcm-blue); }
.industry-card h3 a:hover { color: var(--mcm-red); }
.industry-card p { color: var(--mcm-charcoal); font-size: 0.92rem; line-height: 1.6; }

/* Memberships */
.section-memberships {
  padding: 56px 0;
  background: var(--mcm-white);
  border-top: 1px solid var(--mcm-border);
  border-bottom: 1px solid var(--mcm-border);
}
.memberships-strip {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.memberships-strip img {
  max-height: 72px;
  width: auto;
  opacity: 0.85;
  transition: opacity .2s ease;
}
.memberships-strip img:hover { opacity: 1; }

/* Latest Posts */
.section-latest {
  padding: 64px 0;
  background: var(--mcm-light);
}
.posts-grid { margin-top: 24px; }
.post-card {
  background: var(--mcm-white);
  border: 1px solid var(--mcm-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s ease, transform .2s ease;
}
.post-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.post-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.post-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s ease;
}
.post-card:hover .post-thumb img { transform: scale(1.04); }
.post-card h3 {
  font-size: 1.05rem;
  padding: 16px 20px 4px;
  margin: 0;
  line-height: 1.3;
}
.post-card h3 a { color: var(--mcm-dark); }
.post-card h3 a:hover { color: var(--mcm-blue); }
.post-excerpt {
  padding: 6px 20px 0;
  color: var(--mcm-gray);
  font-size: 0.9rem;
  margin: 0;
}
.read-more {
  padding: 12px 20px 20px;
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--mcm-blue);
  font-weight: 600;
}

/* Contact form */
.section-contact {
  padding: 72px 0;
  background: var(--mcm-white);
}
.contact-form {
  max-width: 860px;
  margin: 24px auto 0;
}
.contact-form .grid-2 { gap: 20px; margin-bottom: 16px; }
.form-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}
.form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--mcm-charcoal);
  margin-bottom: 6px;
}
.form-field input,
.form-field textarea {
  border: 1px solid var(--mcm-border);
  background: var(--mcm-light);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  border-radius: var(--radius);
  transition: border-color .15s ease, background .15s ease;
}
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--mcm-blue);
  background: var(--mcm-white);
  outline: none;
}
.form-status {
  margin-top: 14px;
  font-size: 0.92rem;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 1100px) {
  .nav-list > li > a { padding: 32px 10px; font-size: 0.82rem; letter-spacing: 0.6px; }
  .site-header.scrolled .nav-list > li > a { padding-top: 20px; padding-bottom: 20px; }
  .nav-list .nav-cta a { padding: 9px 16px; margin-left: 8px; }
  .top-email { display: none; }
}

@media (max-width: 900px) {
  .top-bar-inner { padding: 6px 16px; font-size: 11.5px; }
  .top-bar-left { gap: 14px; }
  .header-inner { min-height: 60px; padding: 0 16px; }
  .site-header.scrolled .header-inner { min-height: 56px; }
  .site-logo img { height: 36px; }
  .site-header.scrolled .site-logo img { height: 34px; }
  .hamburger { display: block; }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--mcm-white);
    border-top: 1px solid var(--mcm-border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    display: none;
    flex-direction: column;
  }
  .main-nav.nav-open { display: flex; }
  .nav-list {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding: 8px 0;
  }
  .nav-list > li { width: 100%; }
  .nav-list > li > a {
    padding: 14px 24px;
    border-bottom: 1px solid var(--mcm-border);
  }
  .nav-list .nav-cta a {
    margin: 12px 24px;
    text-align: center;
  }
  .nav-list .sub {
    position: static;
    opacity: 1; visibility: visible; transform: none;
    box-shadow: none;
    border-top: 0;
    padding: 0;
    display: none;
    background: var(--mcm-light);
  }
  .nav-list .has-sub.sub-open > .sub { display: block; }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 40px 24px 32px;
  }
}

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 28px; }
  .section-partners, .section-xstream, .section-solutions,
  .section-industries, .section-latest, .section-contact { padding: 48px 0; }
}

@media (max-width: 640px) {
  .top-bar-left { flex-direction: column; align-items: flex-start; gap: 4px; }
  .footer-inner { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  .section-heading { font-size: 1.6rem; }
  .hero-slider { height: 260px; }
  .memberships-strip img { max-height: 52px; }
}

/* Tablet grid adjustments — 3-col industries stay 2-col */
@media (min-width: 641px) and (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
