/* Legacy Roofing — shared styles v2 */

:root {
  --red: #C0141C;
  --red-dark: #9A0F15;
  --red-glow: rgba(192, 20, 28, 0.15);
  --dark: #0D0F14;
  --dark-mid: #141720;
  --dark-light: #1C2030;
  --cream: #F5F2EE;
  --cream-dark: #E8E4DE;
  --white: #FFFFFF;
  --white-80: rgba(255, 255, 255, 0.8);
  --white-50: rgba(255, 255, 255, 0.5);
  --white-20: rgba(255, 255, 255, 0.2);
  --white-10: rgba(255, 255, 255, 0.1);
  --white-05: rgba(255, 255, 255, 0.05);
  --footer: #080A0E;
  --ease-premium: cubic-bezier(0.32, 0.72, 0, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "DM Sans", system-ui, sans-serif;
  background-color: var(--dark);
  color: var(--white);
}

.font-display {
  font-family: "Playfair Display", serif;
}

.font-mono-acc {
  font-family: "DM Mono", ui-monospace, monospace;
}

/* Floating pill nav */
.nav-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 20px 24px;
  pointer-events: none;
}

.nav-pill {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding: 12px 20px;
  border-radius: 9999px;
  background: rgba(13, 15, 20, 0.75);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition:
    background 0.4s cubic-bezier(0.32, 0.72, 0, 1),
    box-shadow 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.nav-pill.scrolled {
  background: rgba(13, 15, 20, 0.95);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.nav-links-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 1.75rem;
}

@media (min-width: 768px) {
  .nav-links-center {
    display: flex;
  }
}

.nav-link {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  transition: color 300ms var(--ease-premium);
}

.nav-link:hover {
  color: var(--red);
}

.nav-link.active {
  color: var(--red);
}

/* Mobile overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  background-color: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 5rem 1.5rem 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--ease-premium);
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: color 300ms var(--ease-premium);
}

.mobile-menu-close:hover {
  color: var(--white);
}

.ppd-credit {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.3s var(--ease-premium);
}

.ppd-credit:hover {
  color: var(--red);
}

.ppd-credit span {
  font-weight: 400;
}

.mobile-nav-link {
  font-family: "Playfair Display", serif;
  font-size: 1.875rem;
  color: var(--white);
  opacity: 0;
  transform: translateY(20px);
}

/* Burger — 2 bars to X */
.burger {
  position: relative;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

@media (min-width: 768px) {
  .burger {
    display: none;
  }
}

.burger-line {
  display: block;
  width: 1.25rem;
  height: 1.5px;
  background-color: var(--white);
  transition: transform 400ms var(--ease-premium), opacity 400ms var(--ease-premium);
  transform-origin: center;
}

.burger.open .burger-line:first-child {
  transform: translateY(2.75px) rotate(45deg);
}

.burger.open .burger-line:last-child {
  transform: translateY(-2.75px) rotate(-45deg);
}

/* Page progress bar */
#page-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background-color: var(--red);
  z-index: 100;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

/* Hero word mask */
.hero-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35em 0.5em;
}

.hero-words-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35em 0.5em;
}

.word-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.hero-words .word {
  display: inline-block;
  will-change: transform, opacity;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(13, 15, 20, 0.8) 0%,
    rgba(13, 15, 20, 0.7) 40%,
    rgba(13, 15, 20, 0.5) 75%,
    rgba(13, 15, 20, 0.75) 100%
  );
}

.hero-headline {
  text-shadow:
    0 2px 24px rgba(0, 0, 0, 0.6),
    0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Line draw (GSAP scales this) */
.line-draw {
  transform: scaleX(0);
  transform-origin: left center;
}

/* Card lift — services / preview cards */
.card-lift {
  transition: transform 400ms var(--ease-premium), box-shadow 400ms var(--ease-premium),
    border-color 400ms var(--ease-premium);
}

.card-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--red-glow);
}

/* Gallery */
.gallery-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 500ms var(--ease-premium);
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.gallery-item::after {
  content: attr(data-tag);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem;
  background: linear-gradient(to top, rgba(13, 15, 20, 0.9), transparent);
  font-size: 0.75rem;
  font-family: "DM Mono", monospace;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 400ms var(--ease-premium);
}

.gallery-item:hover::after {
  opacity: 1;
}

.filter-btn {
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: background-color 300ms var(--ease-premium), color 300ms var(--ease-premium),
    border-color 300ms var(--ease-premium), transform 300ms var(--ease-premium);
}

.filter-btn.active {
  background-color: var(--red);
  color: var(--white) !important;
  border-color: var(--red) !important;
}

.filter-btn:not(.active) {
  background-color: transparent;
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
}

.filter-btn:not(.active):hover {
  border-color: rgba(192, 20, 28, 0.5);
  color: var(--red);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--ease-premium);
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.5rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: transparent;
  border: 1px solid var(--white-20);
  color: var(--white);
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: border-color 300ms var(--ease-premium), color 300ms var(--ease-premium);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  border-color: var(--red);
  color: var(--red);
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

/* Scroll indicator — chevron bounce */
@keyframes hero-chevron-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

.hero-scroll-chevron {
  display: block;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1;
  color: rgba(255, 255, 255, 0.4);
  animation: hero-chevron-bounce 1.8s cubic-bezier(0.32, 0.72, 0, 1) infinite;
  will-change: transform;
}

/* Review cards — light on cream */
.review-card-light {
  background-color: var(--white);
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(13, 15, 20, 0.08);
  transition: transform 400ms var(--ease-premium), box-shadow 400ms var(--ease-premium);
}

.review-card-light:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(13, 15, 20, 0.12);
}

/* Partner logos */
.partner-logo {
  filter: grayscale(100%);
  opacity: 0.4;
  transition: filter 400ms var(--ease-premium), opacity 400ms var(--ease-premium);
}

.partner-logo:hover {
  filter: grayscale(0%);
  opacity: 1;
}

/* Form */
.form-error.hidden {
  display: none;
}

body.menu-open {
  overflow: hidden;
}

/* Masonry columns */
.gallery-masonry {
  column-count: 1;
  column-gap: 1rem;
}

@media (min-width: 640px) {
  .gallery-masonry {
    column-count: 2;
  }
}

@media (min-width: 1024px) {
  .gallery-masonry {
    column-count: 3;
  }
}
