/* Haven Building Products */

:root {
  --blue: #0052a5;
  --blue-dark: #003d7c;
  --navy: #0a1a2f;
  --red: #ad1630;
  --red-dark: #8c1027;
  --red-light: #ff8a9b;
  --white: #fff;
  --text: #3d4a5c;
  --headings: #0f1b2d;
  --surface: #fff;
  --background: #f4f7fb;

  --font-body: "Open Sans", system-ui, sans-serif;
  --font-heading: "Montserrat", system-ui, sans-serif;

  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --section-padding: clamp(3.5rem, 8vw, 6rem);
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.04), 0 18px 40px -18px rgba(15, 27, 45, 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-height: 80px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  /* Keep the footer at the bottom of short pages */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }

h1, h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--headings);
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 1.5rem + 3vw, 3.75rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.375rem); }

p { margin: 0; text-wrap: pretty; }

a {
  color: var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 200ms, text-decoration-thickness 200ms;
}
a:hover { color: var(--red-dark); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }

::selection { background: var(--blue); color: var(--white); }

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

ul { margin: 0; padding: 0; list-style: none; }

svg { fill: currentColor; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--headings);
  font-weight: 700;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--blue);
  transition: box-shadow 300ms;
}
.site-header.is-scrolled {
  box-shadow: 0 10px 30px -12px rgba(10, 26, 47, 0.45);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-height);
}
.logo { margin-right: auto; border-radius: 6px; }
.logo img { height: clamp(36px, 4vw, 46px); width: auto; }

.site-nav ul { display: flex; gap: 0.25rem; }
.site-nav a {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 200ms;
}
.site-nav a:hover { background: rgba(255, 255, 255, 0.12); color: var(--white); }
.site-nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.2); }

.header-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 6px 16px -6px rgba(173, 22, 48, 0.7);
  transition: background-color 200ms;
}
.header-phone svg { width: 15px; height: 15px; flex: none; }
.header-phone:hover { background: var(--red-dark); color: var(--white); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--white);
  transition: transform 300ms var(--ease), background-color 300ms;
}
.nav-toggle span { position: relative; }
.nav-toggle span::before,
.nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 959px) {
  .header-inner { gap: 0.75rem; }
  .nav-toggle { display: block; }
  .site-nav ul {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem var(--gutter) 1.25rem;
    background: var(--blue-dark);
    box-shadow: 0 24px 40px -20px rgba(10, 26, 47, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 250ms var(--ease), transform 250ms var(--ease), visibility 0s 250ms;
  }
  .site-nav ul.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 250ms var(--ease), transform 250ms var(--ease);
  }
  .site-nav a { padding: 0.85rem 1rem; border-radius: var(--radius-sm); font-size: 1.05rem; }
}

@media (max-width: 559px) {
  /* Icon-only call button; the number stays available to screen readers */
  .header-phone { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .header-phone span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Home hero */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.88);
  background:
    radial-gradient(ellipse 60% 70% at 78% 45%, rgba(56, 140, 230, 0.55), transparent 70%),
    linear-gradient(160deg, var(--blue) 0%, var(--blue-dark) 100%);
}
/* Faint blueprint grid */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 80% at 70% 50%, #000 20%, transparent 75%);
}
.hero h1 { color: var(--white); }
.hero h1::after {
  content: "";
  display: block;
  width: 64px;
  height: 5px;
  margin-top: 1.25rem;
  border-radius: 999px;
  background: var(--red);
}
.hero-columns {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  min-height: min(640px, 78vh);
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}
.hero-text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.hero-text p { font-size: clamp(1.05rem, 1rem + 0.25vw, 1.175rem); max-width: 60ch; color: var(--white); }
.hero-image { display: flex; justify-content: center; }
.hero-image img {
  width: min(100%, 420px);
  filter: drop-shadow(0 30px 40px rgba(5, 20, 45, 0.45));
}

@media (max-width: 767px) {
  .hero-columns { grid-template-columns: 1fr; min-height: 0; }
  .hero-image { order: -1; }
  .hero-image img { width: min(70%, 300px); }
}

/* Product sections (product pages) */

.section .container {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}
/* Alternate full-width bands so each product reads as its own section */
.feature-section { background: var(--surface); }
.feature-section:nth-child(odd of .feature-section) { background: var(--background); }
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.75rem, 5vw, 4rem);
}
.feature--image-first { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); }
.feature--image-first .feature-image { order: -1; }

.feature-text h2 { margin-bottom: 1.25rem; }
.feature-text h2::before {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  margin-bottom: 1.25rem;
  border-radius: 999px;
  background: var(--red);
}
.feature-text p { max-width: 68ch; }

.feature-image { display: flex; justify-content: center; }
.feature-image img {
  width: min(100%, 380px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 40px -20px rgba(15, 27, 45, 0.45);
}

.not-found { display: flex; flex-direction: column; gap: 1rem; min-height: 40vh; justify-content: center; }

/* Privacy policy */

.prose {
  max-width: calc(46rem + var(--gutter) * 2);
  padding-top: clamp(2.5rem, 6vw, 4rem);
  padding-bottom: var(--section-padding);
}
.prose h2 { margin: 2.5rem 0 0.75rem; font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem); }
.prose p, .prose ul { margin-bottom: 1rem; }
.prose ul { padding-left: 1.25rem; list-style: disc; }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--red); }
.prose strong { color: var(--headings); }
.prose .updated { margin-top: 0.75rem; }

@media (max-width: 767px) {
  .feature,
  .feature--image-first { grid-template-columns: 1fr; }
  .feature--image-first .feature-image { order: 0; }
  .feature-image img { width: 100%; max-width: 420px; }
}

/* Scroll reveal (only when JS is running and motion is OK) */

@media (prefers-reduced-motion: no-preference) {
  .js :is(.hero-text, .hero-image, .feature) {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  }
  .js .hero-image { transition-delay: 120ms; }
  .js :is(.hero-text, .hero-image, .feature).is-visible { opacity: 1; transform: none; }
}

/* Footer */

.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.72);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  padding-top: clamp(3rem, 7vw, 4.5rem);
  padding-bottom: clamp(2.5rem, 6vw, 3.5rem);
}
.footer-brand { display: flex; flex-direction: column; gap: 2rem; }
.footer-brand img { width: min(100%, 280px); }

.icon-list { display: flex; flex-direction: column; gap: 0.85rem; }
.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}
a.icon-link { color: var(--white); font-weight: 700; }
a.icon-link:hover { color: var(--red-light); }
.icon-badge { display: flex; flex: none; color: var(--white); }
.icon-badge svg { width: 16px; height: 16px; }

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 0.85rem 3rem;
  align-content: start;
  justify-content: end;
}
.footer-links a {
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 600;
  text-decoration: none;
}
.footer-links a:hover { color: var(--red-light); }

.copyright {
  position: relative;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.55);
}

.copyright::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}
.copyright a { color: rgba(255, 255, 255, 0.85); }
.copyright a:hover { color: var(--red-light); }
.copyright [aria-hidden] { margin: 0 0.85em; opacity: 0.5; }

@media (max-width: 559px) {
  /* Put the link on its own line instead of leaving the divider dangling */
  .copyright [aria-hidden] { display: none; }
  .copyright a { display: block; width: fit-content; margin: 0.35rem auto 0; }
}

@media (max-width: 767px) {
  /* One column: center everything */
  .footer-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .footer-brand,
  .icon-list { align-items: center; }
  .footer-links { justify-content: center; }
  .copyright { text-align: center; }
}
