/* ============================================================
   SOLAR LIGHTING INTERNATIONAL — d4-pages.css
   Design-4 SECONDARY-PAGE system (product / application pages).
   Depends on miles-base.css for tokens (:root vars) + shared
   utilities (.section-label, .hero-spark, .hero-btn-*, .hero-frame,
   .hero-blueprint-overlay). Everything here is scoped to .miles-home.
   NEVER edit miles-base.css — append page-level layout here only.
============================================================ */

/* ---- Section rhythm & grounds ---------------------------- */
.miles-home .d4-section   { padding: clamp(3rem, 4vw, 4rem) var(--gutter); }
.miles-home .d4-section--tight { padding: var(--space-lg) var(--gutter); }
.miles-home .d4-inner     { max-width: var(--wide-width); margin: 0 auto; }
.miles-home .d4-measure   { max-width: 760px; margin: 0 auto; }

/* Light-section texture: subtle, on-brand technical patterns so the light
   grounds read as considered instead of flat white space. Kept very faint. */
.miles-home .d4-ground-white {
  background-color: var(--color-white);
  background-image: radial-gradient(rgba(12, 27, 42, 0.028) 1px, transparent 1.4px);
  background-size: 26px 26px;
}
.miles-home .d4-ground-cloud {
  background-color: var(--color-cloud);
  /* faint blueprint grid echoing the Ink sections */
  background-image:
    linear-gradient(rgba(21, 94, 239, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 94, 239, 0.045) 1px, transparent 1px);
  background-size: 58px 58px;
}
.miles-home .d4-ground-ink   { background-color: var(--color-ink); color: var(--color-white); }

/* ---- Section head (eyebrow + heading + lead) ------------- */
.miles-home .d4-head { margin-bottom: var(--space-md); }
.miles-home .d4-head--center { text-align: center; }
.miles-home .d4-head--center .hero-spark { margin-left: auto; margin-right: auto; }

.miles-home .d4-h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--font-size-4xl);
  font-weight: 900;
  color: var(--color-ink);
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0 0 var(--space-sm);
}
.miles-home .d4-ground-ink .d4-h2 { color: var(--color-white); }

.miles-home .d4-lead {
  font-size: var(--font-size-lg);
  color: var(--color-slate);
  line-height: 1.65;
  margin-bottom: var(--space-md);
}
.miles-home .d4-ground-ink .d4-lead { color: rgba(255, 255, 255, 0.72); }

.miles-home .d4-body { color: var(--color-slate); line-height: 1.7; }
.miles-home .d4-body p + p { margin-top: var(--space-sm); }
.miles-home .d4-body h3 { margin-top: var(--space-md); }

/* ============================================================
   Compact hero (Ink + blueprint + glow). Shorter than the
   homepage filmstrip; one framed image OR solo copy.
============================================================ */
.miles-home .d4-hero {
  position: relative;
  overflow: hidden;
  background-color: var(--color-ink);
  color: var(--color-white);
  padding: var(--space-xl) var(--gutter);
}
.miles-home .d4-hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle at 18% 30%, rgba(26, 95, 168, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 82% 80%, rgba(41, 171, 226, 0.10) 0%, transparent 45%);
}
.miles-home .d4-hero .hero-blueprint-overlay { z-index: 1; }

.miles-home .d4-hero__stage {
  position: relative; z-index: 2;
  max-width: var(--wide-width); margin: 0 auto;
}
.miles-home .d4-hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-xl);
  align-items: center;
}
.miles-home .d4-hero__inner--solo { grid-template-columns: 1fr; max-width: 820px; }

.miles-home .d4-hero__copy { max-width: 640px; }
.miles-home .d4-hero__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: var(--color-white);
  margin: var(--space-xs) 0 var(--space-md);
}
.miles-home .d4-hero__lead {
  font-size: var(--font-size-xl);
  color: var(--color-sky-tint);
  line-height: 1.55;
  max-width: 560px;
  margin-bottom: var(--space-lg);
}
.miles-home .d4-hero__actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.miles-home .d4-hero__media .hero-frame { aspect-ratio: 4 / 3; min-height: 0; }

/* ---- Stat ticker (hero foot or standalone band) ---------- */
.miles-home .d4-ticker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
}
.miles-home .d4-ticker__item { display: flex; flex-direction: column; gap: var(--space-xs); }
.miles-home .d4-ticker__num {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
  font-size: var(--font-size-3xl);
  color: var(--color-amber);
  line-height: 1;
  letter-spacing: -0.02em;
}
.miles-home .d4-ticker__num em {
  font-style: normal;
  font-size: 0.45em;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 2px;
}
.miles-home .d4-ticker__label { font-size: var(--font-size-small); color: rgba(255, 255, 255, 0.6); }

/* ============================================================
   50/50 split (media + copy). Source order sets the side —
   put .d4-split__media first for image-left, last for image-right.
============================================================ */
.miles-home .d4-split__inner {
  max-width: var(--wide-width); margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}
.miles-home .d4-split__media .hero-frame { aspect-ratio: 16 / 10; min-height: 0; max-height: 400px; }
.miles-home .d4-split__media img.d4-plain {
  width: 100%; border-radius: var(--radius-card);
  border: 1px solid var(--color-border-light);
}

/* ---- Amber-check list (light grounds) -------------------- */
.miles-home .d4-checklist {
  list-style: none;
  display: flex; flex-direction: column; gap: var(--space-sm);
  margin-top: var(--space-md);
}
.miles-home .d4-checklist li {
  position: relative;
  padding-left: 2rem;
  padding-bottom: var(--space-sm);
  color: var(--color-slate);
  line-height: 1.5;
  border-bottom: 1px solid var(--color-border-light);
}
.miles-home .d4-checklist li:last-child { border-bottom: none; }
.miles-home .d4-checklist li::before {
  content: '';
  position: absolute; left: 0; top: 2px;
  width: 18px; height: 18px;
  background-color: var(--color-amber);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
  mask-size: contain; mask-repeat: no-repeat;
}

/* ============================================================
   Feature grid (3–4 up). Cloud cards on white ground; white
   cards on cloud ground — always a subtle contrast + hover lift.
============================================================ */
.miles-home .d4-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}
.miles-home .d4-features--3 { grid-template-columns: repeat(3, 1fr); }
.miles-home .d4-feature {
  background: var(--color-cloud);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-card);
  padding: var(--space-md);
  display: flex; flex-direction: column; gap: var(--space-xs);
  transition: transform var(--transition-mid), border-color var(--transition-mid);
}
.miles-home .d4-ground-cloud .d4-feature { background: var(--color-white); }
.miles-home .d4-feature:hover { transform: translateY(-2px); border-color: var(--color-blue-secondary); }
.miles-home .d4-feature .hero-spark { margin-bottom: var(--space-sm); }
.miles-home .d4-feature__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-ink);
  letter-spacing: -0.02em;
}
.miles-home .d4-feature__desc { font-size: var(--font-size-base); color: var(--color-slate); line-height: 1.6; }

/* ============================================================
   Spec table — Ink header, zebra Cloud rows, amber key rows.
============================================================ */
.miles-home .d4-spec-wrap {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-top: var(--space-lg);
  background: var(--color-white);
}
.miles-home .d4-spec { width: 100%; border-collapse: collapse; }
.miles-home .d4-spec thead th {
  background: var(--color-ink);
  color: var(--color-white);
  text-align: left;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: var(--font-size-small);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: var(--space-sm) var(--space-md);
}
.miles-home .d4-spec td {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--color-border-light);
  font-size: var(--font-size-base);
  line-height: 1.5;
}
.miles-home .d4-spec tbody tr:nth-child(odd) td { background: var(--color-cloud); }
.miles-home .d4-spec td:first-child { color: var(--color-slate); font-weight: 600; width: 42%; }
.miles-home .d4-spec td:last-child  { color: var(--color-ink); }
.miles-home .d4-spec td.d4-spec__amber { color: var(--color-amber-ink); font-weight: 700; }

/* ============================================================
   Framed image gallery.
============================================================ */
.miles-home .d4-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}
.miles-home .d4-gallery--2 { grid-template-columns: repeat(2, 1fr); }
.miles-home .d4-figure { margin: 0; }
.miles-home .d4-figure__frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
  transition: transform var(--transition-mid), border-color var(--transition-mid);
}
.miles-home .d4-figure__frame:hover { transform: translateY(-3px); border-color: var(--color-blue-secondary); }
.miles-home .d4-figure__frame img { width: 100%; height: 100%; object-fit: cover; }
.miles-home .d4-figure__cap {
  margin-top: var(--space-xs);
  font-size: var(--font-size-small);
  color: var(--color-slate-light);
  font-weight: 500;
}

/* ============================================================
   Dark CTA band (every page ends here → /contact/).
============================================================ */
.miles-home .d4-cta {
  position: relative;
  overflow: hidden;
  background: var(--color-ink-deep);
  padding: var(--space-xl) var(--gutter);
  text-align: center;
}
.miles-home .d4-cta::before {
  content: '';
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 15%, rgba(26, 95, 168, 0.16) 0%, transparent 60%);
}
.miles-home .d4-cta .hero-blueprint-overlay { z-index: 1; }
.miles-home .d4-cta__inner {
  position: relative; z-index: 2;
  max-width: 760px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-sm);
}
.miles-home .d4-cta .hero-spark { margin: 0 auto var(--space-xs); }
.miles-home .d4-cta__title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  color: var(--color-white);
  letter-spacing: -0.03em;
  line-height: 1.0;
}
.miles-home .d4-cta__note {
  color: rgba(255, 255, 255, 0.62);
  font-size: var(--font-size-lg);
  line-height: 1.6;
  max-width: 560px;
}
.miles-home .d4-cta__actions { margin-top: var(--space-sm); }

/* ============================================================
   Responsive
============================================================ */
@media (max-width: 1024px) {
  .miles-home .d4-features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .miles-home .d4-hero__inner  { grid-template-columns: 1fr; gap: var(--space-lg); }
  .miles-home .d4-hero__media  { order: -1; }
  .miles-home .d4-split__inner { grid-template-columns: 1fr; gap: var(--space-lg); }
  .miles-home .d4-split__media { order: -1; }
  .miles-home .d4-gallery, .miles-home .d4-gallery--2 { grid-template-columns: 1fr; }
  .miles-home .d4-ticker { grid-template-columns: repeat(2, 1fr); }
  .miles-home .d4-features--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .miles-home .d4-section { padding: var(--space-lg) var(--space-sm); }
  .miles-home .d4-hero    { padding: var(--space-lg) var(--space-sm); }
  .miles-home .d4-cta     { padding: var(--space-lg) var(--space-sm); }
  .miles-home .d4-features, .miles-home .d4-features--3 { grid-template-columns: 1fr; }
  .miles-home .d4-ticker  { grid-template-columns: repeat(2, 1fr); }
}

/* Locations hub: multi-column directory grid (overrides the checklist look) */
.miles-home .d4-loc-grid {
  list-style: none; margin: 0; padding: 0; border: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.5rem 1.25rem;
}
.miles-home .d4-loc-grid li { margin: 0; padding: 0; border: none; }
.miles-home .d4-loc-grid li::before { content: none; }
.miles-home .d4-loc-grid a {
  display: block; padding: 0.75rem 1rem; border-radius: 9px; text-decoration: none;
  color: var(--color-ink); font-weight: 600; font-size: 0.98rem;
  border: 1px solid rgba(12, 27, 42, 0.10); background: rgba(255, 255, 255, 0.65);
  transition: border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.miles-home .d4-loc-grid a:hover {
  border-color: var(--color-blue-action); color: var(--color-blue-action);
  transform: translateX(3px); box-shadow: 0 6px 18px -10px rgba(21, 94, 239, 0.5);
}
