/* =============================================================
   Serenity Smart Homes — site.css
   Base elements, page frame, header, footer, sections.
   ============================================================= */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh);
  text-rendering: optimizeLegibility;
}

img, video { max-width: 100%; height: auto; display: block; }
iframe { max-width: 100%; display: block; border: 0; }
video { width: 100%; border-radius: var(--radius); background: #000; }

h1, h2, h3, h4 {
  color: var(--fg-heading);
  line-height: var(--lh-tight);
  font-weight: 700;
  margin: 0 0 var(--s2);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
p  { margin: 0 0 var(--s2); }

a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--link-hover); }

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

.skip-link {
  position: absolute; left: var(--s2); top: -100px;
  background: var(--bg-raised); color: var(--fg);
  padding: var(--s1) var(--s2); border-radius: var(--radius-sm); z-index: 100;
}
.skip-link:focus { top: var(--s2); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Frame ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s2); }
@media (min-width: 48rem) { .wrap { padding: 0 var(--s4); } }

.section { padding: var(--s5) 0; }
@media (min-width: 48rem) { .section { padding: var(--s6) 0; } }
.section--wash    { background: var(--teal-wash); }
.section--raised  { background: var(--bg-raised); }
.section--inverse { background: var(--bg-inverse); color: var(--fg-inverse); }
.section--inverse h2, .section--inverse h3 { color: var(--fg-inverse); }
.section--inverse a:not(.btn) { color: #bfe9e4; }

.section-head { max-width: 46rem; margin: 0 auto var(--s4); text-align: center; }
.section-head p { color: var(--fg-muted); font-size: var(--fs-lg); }
.section--inverse .section-head p { color: #d4e6e4; }

/* ---------- Header ---------- */
.site-header {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.site-header__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s2); min-height: 72px;
}
.site-header__brand { display: flex; align-items: center; gap: var(--s1); text-decoration: none; color: var(--fg-heading); font-weight: 700; }
.site-header__brand img { height: 44px; width: auto; border-radius: 6px; }
.site-header__brand span { font-size: 1.125rem; }

.nav-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: var(--tap); padding: 0 var(--s2);
  font: inherit; font-weight: 700; color: var(--fg-heading);
  background: transparent; border: 2px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer;
}
.site-nav { display: none; }
.site-nav.is-open { display: block; padding-bottom: var(--s2); }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: flex; align-items: center; min-height: var(--tap);
  padding: 0 var(--s1); text-decoration: none; color: var(--fg); font-weight: 600;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--link); text-decoration: underline; }
.site-nav .btn { margin-top: var(--s1); color: var(--btn-fg); text-decoration: none; }
/* The nav-link hover and current-page rules turn text teal. On the teal
   button that hid the label, so the button keeps its white text. */
.site-nav .btn:hover, .site-nav .btn:focus, .site-nav .btn:active,
.site-nav .btn[aria-current="page"] { color: var(--btn-fg); text-decoration: none; }

@media (min-width: 62rem) {
  .nav-toggle { display: none; }
  .site-header__bar { flex-wrap: nowrap; }
  .site-nav, .site-nav.is-open { display: block; padding: 0 0 var(--s2); }
  .site-nav > ul { display: flex; align-items: center; gap: var(--s1); }
  .site-nav .btn { margin: 0 0 0 var(--s1); }
}

/* ---------- Page hero ---------- */
.hero { padding: var(--s5) 0; background: var(--teal-wash); }
.hero__grid { display: grid; gap: var(--s4); align-items: center; }
@media (min-width: 56rem) { .hero__grid--split { grid-template-columns: 1.1fr .9fr; } }
.hero__lead { font-size: var(--fs-lg); max-width: 40rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.hero__media img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; max-height: 36rem; object-fit: cover; object-position: center top; }
.hero__media video { display: block; border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; }
.hero__eyebrow { color: var(--amber); font-weight: 700; font-size: var(--fs-sm); letter-spacing: .04em; text-transform: uppercase; margin-bottom: var(--s1); }

/* Landing-page hero: a background image with a readable panel on top */
.hero--image { background-size: cover; background-position: center; padding: var(--s5) 0; }
.hero--image .hero__panel {
  background: var(--bg-raised); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: var(--s4); max-width: 40rem; margin-right: auto; text-align: center;
}
.hero--image .hero__panel img.hero__title-image { margin: 0 auto var(--s2); max-height: 140px; width: auto; }
.hero--image .hero__actions { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-inverse); color: #d4e6e4; padding: var(--s5) 0 var(--s4); font-size: var(--fs-sm); }
.site-footer a { color: #ffffff; }
.site-footer__grid { display: grid; gap: var(--s4); }
@media (min-width: 48rem) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer__title { color: #ffffff; font-size: 1.125rem; font-weight: 700; line-height: var(--lh-tight); margin: 0 0 var(--s1); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a { display: inline-flex; min-height: 40px; align-items: center; }
.site-footer__legal { border-top: 1px solid rgba(255,255,255,.18); margin-top: var(--s4); padding-top: var(--s3); display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: space-between; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
