/* ============================================================
   HOME.CSS — Front page specific styles
   Matches hvac-best-homepage.html reference design
   ============================================================ */

/* ---- HERO ---- */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 4rem 2rem;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.35;
  animation: gridShift 20s linear infinite;
}

@keyframes gridShift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}

/* Glow blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  animation: blobPulse 8s ease-in-out infinite;
}
.blob-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(227,107,26,0.15), transparent 70%);
  top: -200px; right: -100px;
  animation-delay: 0s;
}
.blob-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(29,184,232,0.12), transparent 70%);
  bottom: -150px; left: -50px;
  animation-delay: 4s;
}

@keyframes blobPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.1); opacity: 0.8; }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--pipe);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: fadeUp 0.6s ease-out both;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--pipe);
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(4rem, 10vw, 9rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  margin-bottom: 2rem;
  animation: fadeUp 0.6s ease-out 0.1s both;
}

.hero-title .line-hot   { color: var(--pipe); }
.hero-title .line-white { color: var(--white); }
.hero-title .line-cold  { color: var(--cold); }

.hero-sub {
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 3rem;
  animation: fadeUp 0.6s ease-out 0.2s both;
}
.hero-sub strong { color: var(--white); font-weight: 400; }

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
  animation: fadeUp 0.6s ease-out 0.3s both;
}

.btn-primary {
  padding: 0.85rem 2rem;
  background: var(--pipe);
  color: var(--white);
  border: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}
.btn-primary:hover { background: #f07c30; transform: translateY(-1px); color: var(--white); }

.btn-secondary {
  padding: 0.85rem 2rem;
  background: transparent;
  color: var(--cold);
  border: 1px solid var(--cold-dim);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}
.btn-secondary:hover { border-color: var(--cold); background: rgba(29,184,232,0.08); color: var(--cold); }

/* Stats row */
.hero-stats {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  animation: fadeUp 0.6s ease-out 0.4s both;
}

.stat { display: flex; flex-direction: column; gap: 0.2rem; }

.stat-num {
  font-family: var(--font-head);
  font-size: 2.2rem;
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- SEARCH SECTION ---- */
.search-section {
  background: var(--steel-mid);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 2rem;
}

.search-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.search-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.search-bar {
  display: flex;
  max-width: 800px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: var(--cold); }

.search-bar input {
  flex: 1;
  padding: 1rem 1.5rem;
  background: var(--steel-light);
  color: var(--white);
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 1rem;
}
.search-bar input::placeholder { color: var(--muted); }

.search-bar button {
  padding: 1rem 1.8rem;
  background: var(--pipe);
  color: var(--white);
  border: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.search-bar button:hover { background: #f07c30; }

.search-tags {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.search-tag {
  padding: 0.3rem 0.8rem;
  background: var(--steel-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.2s;
}
.search-tag:hover { border-color: var(--pipe); color: var(--pipe); }

/* ---- SECTION WRAPPER ---- */
.section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-head);
  font-size: 2.2rem;
  letter-spacing: 0.05em;
  color: var(--white);
}

.section-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cold);
  text-decoration: none;
  transition: color 0.2s;
}
.section-link:hover { color: var(--white); }

/* ---- CATEGORY GRID ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.category-card {
  background: var(--steel-mid);
  padding: 2rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.category-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  width: 0;
  transition: width 0.3s;
}
.category-card.hot::after   { background: var(--pipe); }
.category-card.cold::after  { background: var(--cold); }
.category-card.green::after { background: var(--green); }

.category-card:hover          { background: var(--steel-light); }
.category-card:hover::after   { width: 100%; }

.card-icon { font-size: 2rem; line-height: 1; }

.card-title {
  font-family: var(--font-head);
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  color: var(--white);
}

.card-desc {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.6;
}

.card-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pipe);
  margin-top: auto;
}
.category-card.cold  .card-count { color: var(--cold); }
.category-card.green .card-count { color: var(--green); }

/* ---- FEATURED GRID ---- */
.featured-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.featured-main {
  background: var(--steel-mid);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.featured-main::before {
  content: 'FEATURED';
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--pipe);
  border: 1px solid var(--pipe-dim);
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
}

.featured-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cold);
  margin-bottom: 0.8rem;
}

.featured-title {
  font-family: var(--font-head);
  font-size: 2.5rem;
  letter-spacing: 0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--white);
}

.featured-body {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.featured-sidebar { display: flex; flex-direction: column; gap: 1px; }

.sidebar-item {
  background: var(--steel-mid);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  color: inherit;
  flex: 1;
}
.sidebar-item:hover { background: var(--steel-light); }

.sidebar-item-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-item-title {
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--white);
}

/* ---- CONTRACTOR SECTION ---- */
.contractor-section {
  background: var(--steel-mid);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 5rem 2rem;
}

.contractor-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.contractor-text .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cold);
  margin-bottom: 1rem;
}

.contractor-text h2 {
  font-family: var(--font-head);
  font-size: 3.5rem;
  letter-spacing: 0.03em;
  line-height: 1;
  margin-bottom: 1.5rem;
}

.contractor-text p {
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}

.state-box {
  aspect-ratio: 1;
  background: var(--steel-light);
  border: 1px solid var(--border);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.state-box:hover {
  background: var(--pipe);
  color: var(--white);
  border-color: var(--pipe);
  transform: scale(1.1);
  z-index: 1;
  position: relative;
}
.state-box.populated { border-color: var(--pipe-dim); color: var(--pipe); }

/* ---- MARKETING TOOLS ---- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.tool-card {
  background: var(--steel-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.tool-card:hover {
  border-color: var(--cold);
  transform: translateY(-2px);
}

.tool-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.badge-free { background: rgba(57,211,83,0.15);  color: var(--green); }
.badge-pro  { background: rgba(227,107,26,0.15); color: var(--pipe); }
.badge-new  { background: rgba(29,184,232,0.15); color: var(--cold); }

.tool-card h3 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
  color: var(--white);
}

.tool-card p {
  font-size: 0.83rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* ---- AI BANNER ---- */
.ai-banner {
  background: linear-gradient(135deg, rgba(29,184,232,0.08), rgba(227,107,26,0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin: 0 auto 4rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
  /* spacing from section above */
  margin-top: 0;
  margin-bottom: 4rem;
  /* full-width horizontal margin fix */
  width: calc(100% - 4rem);
  /* center it */
  left: 50%;
  position: relative;
  transform: translateX(-50%);
  left: 50%;
}

/* Simpler approach: */
.ai-banner {
  background: linear-gradient(135deg, rgba(29,184,232,0.08), rgba(227,107,26,0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 1200px;
  margin: 0 2rem 4rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
  position: static;
  transform: none;
  left: auto;
  width: auto;
}

/* For screens wider than max-w, center it */
@media (min-width: 1240px) {
  .ai-banner {
    margin-left: auto;
    margin-right: auto;
  }
}

.ai-icon {
  width: 56px; height: 56px;
  background: var(--steel-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.ai-text h3 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.ai-text p {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* ---- ANIMATIONS ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE — HOMEPAGE
   ============================================================ */
@media (max-width: 1024px) {
  .category-grid   { grid-template-columns: repeat(2, 1fr); }
  .tools-grid      { grid-template-columns: 1fr 1fr; }
  .featured-grid   { grid-template-columns: 1fr; }
  .contractor-inner{ grid-template-columns: 1fr; gap: 3rem; }
  .ai-banner       { grid-template-columns: 1fr; }
  .state-grid      { grid-template-columns: repeat(10, 1fr); }
}

@media (max-width: 768px) {
  .hero { padding: 3rem 1.5rem; min-height: 75vh; }
  .hero-stats { gap: 1.5rem; }
  .search-section { padding: 2rem 1rem; }
  .section { padding: 4rem 1rem; }
  .contractor-section { padding: 4rem 1rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .ai-banner { margin: 0 1rem 3rem; padding: 1.5rem; }
}

@media (max-width: 600px) {
  .category-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1rem; }
  .hero-actions { flex-direction: column; }
  .state-grid { grid-template-columns: repeat(5, 1fr); }
}
