/* =============================================
   SHARED STYLES — style.css
   Used by ALL pages in Elite Home Services website
   ============================================= */

/* TOKENS */
:root {
  /* Spacing — 8px grid */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4rem;
  --space-8: 6rem;
  --space-9: 8rem;

  /* Typography — fluid */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.93rem + 0.36vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  --text-2xl: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  --text-3xl: clamp(2rem, 1.2rem + 3.5vw, 3.5rem);
  --text-hero: clamp(2.5rem, 1.5rem + 4.5vw, 5rem);

  /* Colors — Home Services */
  --primary: #1a1a1a;
  --accent: #ea580c;
  --accent-hover: #dc4d04;
  --accent-subtle: rgba(234, 88, 12, 0.08);
  --bg: #ffffff;
  --bg-alt: #f8f7f4;
  --bg-dark: #1a1a1a;
  --text: #1a1a1a;
  --text-muted: #666666;
  --text-light: #999999;
  --border: rgba(0,0,0,0.06);

  /* Shadows — layered */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.06), 0 4px 10px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.08), 0 8px 20px rgba(0,0,0,0.04);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 100px;

  /* Animation */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --duration: 200ms;
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
}

/* CONTAINER */
.container {
  width: min(100% - 2rem, 1200px);
  margin-inline: auto;
}

/* HEADER */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: var(--space-3) 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--duration) var(--ease-out);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 2rem, 1200px);
  margin-inline: auto;
}

.header__logo {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header__logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.header__link {
  position: relative;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--duration) var(--ease-out);
  min-height: 48px;
  display: flex;
  align-items: center;
}

.header__link::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--duration) var(--ease-out);
}

.header__link--active {
  color: var(--text);
}

.header__link--active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  min-height: 48px;
  min-width: 48px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all var(--duration) var(--ease-out);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
  min-height: 48px;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn--lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-lg);
}

/* SECTIONS */
.section {
  padding: var(--space-8) 0;
}

.section--alt {
  background: linear-gradient(180deg, var(--bg-alt) 0%, #f3f1ec 100%);
}

.section__header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-7);
}

.section__overline {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.section__title {
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--primary);
  margin-bottom: var(--space-3);
}

.section__subtitle {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 55ch;
  margin-inline: auto;
}

/* CARDS */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4);
}

.card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration) var(--ease-out);
}

.card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  color: var(--accent);
}
.card__icon svg {
  width: 24px;
  height: 24px;
}

.card__title {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2);
}

.card__text {
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: 1.6;
}

/* FOOTER */
.footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.6);
  padding: var(--space-7) 0 var(--space-5);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-6);
  width: min(100% - 2rem, 1200px);
  margin-inline: auto;
  margin-bottom: var(--space-6);
}

.footer__brand {
  font-size: var(--text-xl);
  font-weight: 800;
  color: #fff;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer__brand-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
}

.footer__text {
  font-size: var(--text-sm);
  line-height: 1.7;
  max-width: 35ch;
}

.footer__heading {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: var(--space-3);
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__link {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  transition: color var(--duration) var(--ease-out);
}

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: var(--space-4);
  text-align: center;
  font-size: var(--text-xs);
  width: min(100% - 2rem, 1200px);
  margin-inline: auto;
}

/* SCROLL REVEAL */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-group .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-group .reveal:nth-child(2) { transition-delay: 100ms; }
.reveal-group .reveal:nth-child(3) { transition-delay: 200ms; }
.reveal-group .reveal:nth-child(4) { transition-delay: 300ms; }

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* HOVER — devices that support it only */
@media (hover: hover) {
  .header__link:hover {
    color: var(--text);
  }

  .header__link:hover::after {
    width: 100%;
  }

  .btn--primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  }

  .btn--primary:active {
    transform: scale(0.97);
  }

  .btn--ghost:hover {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.2);
    transform: translateY(-2px);
  }

  .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0,0,0,0.1);
  }

  .footer__link:hover {
    color: #fff;
  }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: var(--space-4);
    gap: var(--space-3);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .header__nav.open { display: flex; }

  .header__link::after { display: none; }

  .section { padding: var(--space-6) 0; }

  .card-grid { grid-template-columns: 1fr; }

  .footer__grid { grid-template-columns: 1fr; text-align: center; }
  .footer__text { max-width: 100%; }

  .btn--lg { width: 100%; }
}

@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

/* Demo banner */
.demo-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  color: #fff;
  padding: var(--space-2) 0;
  text-align: center;
  font-size: var(--text-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.demo-banner a {
  color: #fff;
  text-decoration: underline;
  font-weight: 600;
}

.demo-banner a:hover {
  color: var(--accent);
}

/* Push header down when demo banner is present */
body:has(.demo-banner) .header {
  top: 40px;
}

body:has(.demo-banner) .hero,
body:has(.demo-banner) .page-hero {
  padding-top: calc(var(--space-9) + 100px);
}

@media (max-width: 768px) {
  .demo-banner { font-size: var(--text-xs); padding: var(--space-1) var(--space-2); }
  body:has(.demo-banner) .header { top: 36px; }
  body:has(.demo-banner) .hero,
  body:has(.demo-banner) .page-hero {
    padding-top: calc(var(--space-8) + 96px);
  }
}
