/* ==========================================================================
   Bluebonnet Plumbing & Electric — Swiss Modernism / Trust & Authority
   Tokens sourced from ui-ux-pro-max design DB (Trust & Authority system),
   accent swapped to brief-locked safety yellow. Single family: Inter.
   ========================================================================== */

:root {
  /* Color — hex fallback first, OKLCH override after */
  --color-primary: #1e3a8a;
  --color-primary: oklch(0.33 0.1 262);          /* trade navy */
  --color-primary-deep: #16295e;
  --color-primary-deep: oklch(0.26 0.08 262);    /* dark sections */
  --color-accent: #ffd100;
  --color-accent: oklch(0.87 0.17 95);           /* safety yellow */
  --color-accent-press: #eec200;
  --color-accent-press: oklch(0.82 0.16 95);
  --color-bg: #f9fafc;
  --color-bg: oklch(0.985 0.004 262);            /* cool paper */
  --color-surface: #ffffff;
  --color-tint: #eef1f6;
  --color-tint: oklch(0.955 0.008 262);
  --color-ink: #171e2e;
  --color-ink: oklch(0.22 0.02 262);
  --color-ink-soft: #4a5468;
  --color-ink-soft: oklch(0.45 0.025 262);
  --color-on-dark: #f5f7fb;
  --color-on-dark-soft: #b8c2d8;
  --color-on-dark-soft: oklch(0.82 0.03 262);
  --color-border: #ccd3df;
  --color-border: oklch(0.86 0.012 262);
  --color-error: #b3261e;
  --color-error: oklch(0.45 0.17 27);
  --color-ok: #1a7f37;
  --color-ok: oklch(0.53 0.14 150);

  /* Spacing — 4pt scale */
  --space-2xs: 0.25rem;   /* 4  */
  --space-xs: 0.5rem;     /* 8  */
  --space-sm: 0.75rem;    /* 12 */
  --space-md: 1rem;       /* 16 */
  --space-lg: 1.5rem;     /* 24 */
  --space-xl: 2rem;       /* 32 */
  --space-2xl: 3rem;      /* 48 */
  --space-3xl: 4rem;      /* 64 */
  --space-4xl: 6rem;      /* 96 */

  /* Type — Inter, 1.2 ratio steps */
  --font-sans: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: clamp(1.9rem, 1.3rem + 2vw, 2.5rem);
  --text-hero: clamp(2.25rem, 1.4rem + 3.6vw, 3.9rem);
  --text-phone: clamp(2rem, 0.9rem + 5.2vw, 5rem);

  --radius: 6px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1); /* ease-out-quint */
  --shadow-card: 0 1px 2px rgb(23 30 46 / 0.06), 0 4px 12px rgb(23 30 46 / 0.06);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, dl, dd, figure, blockquote { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: var(--color-primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; border-radius: 2px; }
html { scroll-behavior: smooth; }

.container {
  max-width: 71.25rem; /* 1140 */
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 2.75rem;             /* 44px target */
  padding: 0.625rem 1.25rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--text-md);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out),
              border-color 160ms var(--ease-out), transform 160ms var(--ease-out),
              box-shadow 160ms var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); transition-duration: 60ms; }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-deep); box-shadow: 0 6px 16px rgb(23 30 46 / 0.18); }
.btn--accent { background: var(--color-accent); color: var(--color-ink); }
.btn--accent:hover { background: var(--color-accent-press); box-shadow: 0 6px 16px rgb(238 194 0 / 0.4); }
.btn--outline { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn--outline:hover { background: var(--color-primary); color: #fff; box-shadow: 0 6px 16px rgb(30 58 138 / 0.22); }
.btn--lg { min-height: 3.25rem; padding: 0.875rem 1.75rem; font-size: var(--text-lg); }

/* ---------- Utility bar ---------- */
.utility-bar {
  background: var(--color-primary-deep);
  color: var(--color-on-dark-soft);
  font-size: var(--text-xs);
}
.utility-bar__inner {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: var(--space-xs);
}
.utility-bar__licenses, .utility-bar__hours { line-height: 1.4; }
.utility-bar__hours { color: var(--color-on-dark); display: flex; align-items: center; gap: var(--space-xs); white-space: nowrap; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-accent);
  animation: pulse 2.4s var(--ease-out) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(255 209 0 / 0.5); }
  50% { box-shadow: 0 0 0 5px rgb(255 209 0 / 0); }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  min-height: 4.5rem;
}
.brand { display: flex; align-items: center; gap: var(--space-sm); text-decoration: none; }
.brand__name {
  font-weight: 800;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
  color: var(--color-ink);
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand__sub { font-weight: 500; font-size: var(--text-xs); color: var(--color-ink-soft); letter-spacing: 0.02em; }
.site-nav { display: flex; gap: var(--space-lg); margin-left: auto; }
.site-nav a {
  color: var(--color-ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-sm);
  padding: var(--space-xs) 0;
}
.site-nav a:hover { color: var(--color-primary); }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { border-bottom: 1px solid var(--color-border); }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: var(--space-3xl);
  padding-block: var(--space-4xl);
  align-items: start;
}
.hero__kicker {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}
.hero__title {
  font-size: var(--text-hero);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 16ch;
}
.hero__lead {
  margin-top: var(--space-lg);
  font-size: var(--text-lg);
  color: var(--color-ink-soft);
  max-width: 52ch;
}
.hero__phone-label {
  margin-top: var(--space-2xl);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink-soft);
}
.hero__phone {
  display: inline-block;
  margin-top: var(--space-2xs);
  font-size: var(--text-phone);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--color-ink);
  text-decoration: none;
  /* delight: safety-yellow underline draws in once on load — thick, unmissable */
  background-image: linear-gradient(var(--color-accent), var(--color-accent));
  background-repeat: no-repeat;
  background-position: left 98%;
  background-size: 0% 0.3em;
  transition: background-size 640ms var(--ease-out);
  padding-bottom: 0.14em;
}
.hero__phone.is-drawn { background-size: 100% 0.3em; }
.hero__phone:hover { color: var(--color-primary); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-md); margin-top: var(--space-xl); }

.hero__panel {
  background: var(--color-tint);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-xl);
  margin-top: var(--space-md);
}
.hero__checklist { display: grid; gap: var(--space-md); }
.hero__checklist li { display: flex; gap: var(--space-sm); font-weight: 500; line-height: 1.4; align-items: baseline; }
.check {
  flex: none;
  width: 1.05rem; height: 1.05rem;
  border-radius: 50%;
  background: var(--color-primary);
  position: relative;
  top: 0.15rem;
}
.check::after {
  content: "";
  position: absolute;
  left: 0.28rem; top: 0.22rem;
  width: 0.32rem; height: 0.5rem;
  border: solid var(--color-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.hero__panel-note {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-ink-soft);
}

/* ---------- Emergency strip ---------- */
.emergency { background: var(--color-accent); }
.emergency__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-xl);
  padding-block: var(--space-lg);
}
.emergency__label { font-weight: 700; font-size: var(--text-xl); letter-spacing: -0.01em; }
.emergency__phone {
  font-weight: 800;
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
  color: var(--color-ink);
  text-decoration: none;
  border-bottom: 3px solid var(--color-ink);
  padding-bottom: 2px;
}
.emergency__phone:hover { color: var(--color-primary-deep); border-color: var(--color-primary-deep); }

/* ---------- Sections ---------- */
.section { padding-block: var(--space-4xl); }
.section--tint { background: var(--color-tint); border-block: 1px solid var(--color-border); }
.section--dark { background: var(--color-primary-deep); color: var(--color-on-dark); }
.section__head { max-width: 44rem; margin-bottom: var(--space-2xl); }
.section__title { font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.section__intro { margin-top: var(--space-md); color: var(--color-ink-soft); font-size: var(--text-lg); }
.section--dark .section__intro { color: var(--color-on-dark-soft); }

/* ---------- Services ---------- */
.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: var(--space-lg);
}
.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.service-card__head { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.service-card__head h3 { font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.01em; }
.service-card__icon { color: var(--color-primary); flex: none; }
.service-card__list { display: grid; gap: var(--space-sm); border-top: 1px solid var(--color-border); padding-top: var(--space-lg); }
.service-card__list li { padding-left: var(--space-lg); position: relative; line-height: 1.45; }
.service-card__list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 0.5rem; height: 2px;
  background: var(--color-accent);
}
.service-card__link {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  font-weight: 600;
  align-self: start;
}

/* ---------- Trust ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--space-lg);
  margin: 0 0 var(--space-2xl);
}
.stats__item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-lg);
}
.stats__item dt { font-size: var(--text-sm); color: var(--color-ink-soft); font-weight: 500; }
.stats__item dd { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.02em; margin-top: var(--space-2xs); }
.trust__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-lg);
}
.trust-card h3 { font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--space-xs); }
.trust-card p { color: var(--color-ink-soft); line-height: 1.6; }
.reviews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-2xl);
}
.review blockquote { font-size: var(--text-md); line-height: 1.6; }
.review figcaption { margin-top: var(--space-sm); font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-soft); }

/* ---------- Areas ---------- */
.areas__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-3xl);
  align-items: start;
}
.areas__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.areas__list li {
  background: var(--color-surface);
  padding: var(--space-sm) var(--space-md);
  font-weight: 500;
  font-size: var(--text-sm);
}

/* ---------- Contact ---------- */
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-3xl);
  align-items: start;
}
.section--dark .section__title { color: var(--color-on-dark); }
.contact__phone {
  display: inline-block;
  margin-top: var(--space-xl);
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-accent);
  text-decoration: none;
}
.contact__phone:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.contact__hours { margin-top: var(--space-sm); font-size: var(--text-sm); color: var(--color-on-dark-soft); }
.section--dark :focus-visible { outline-color: var(--color-accent); }

.contact-form {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: var(--space-xl);
  display: grid;
  gap: var(--space-lg);
  color: var(--color-ink);
}
.field { display: grid; gap: var(--space-2xs); }
.field label { font-weight: 600; font-size: var(--text-sm); }
.field__optional { font-weight: 400; color: var(--color-ink-soft); }
.field input, .field select, .field textarea {
  font: inherit;
  color: inherit;
  padding: 0.625rem 0.75rem;
  min-height: 2.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  width: 100%;
}
.field textarea { resize: vertical; min-height: 5rem; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 3px solid var(--color-primary);
  outline-offset: 0;
  border-color: var(--color-primary);
}
.field.has-error input, .field.has-error select { border-color: var(--color-error); }
.field__error { font-size: var(--text-xs); color: var(--color-error); min-height: 1em; font-weight: 500; }
.contact-form__submit { width: 100%; }
.contact-form__submit:disabled { opacity: 0.6; cursor: not-allowed; }
.contact-form__note { font-size: var(--text-xs); color: var(--color-ink-soft); text-align: center; }
.contact-form.is-sent .contact-form__success { display: grid; }

.contact-form__success {
  display: none;
  place-items: center;
  gap: var(--space-sm);
  text-align: center;
  padding-block: var(--space-xl);
}
.contact-form__success svg { color: var(--color-ok); }
.contact-form__success .draw { stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw 600ms var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary-deep);
  color: var(--color-on-dark-soft);
  font-size: var(--text-sm);
  border-top: 4px solid var(--color-accent);
}
.site-footer__inner { padding-block: var(--space-2xl); display: grid; gap: var(--space-md); }
.site-footer__brand { color: var(--color-on-dark); font-weight: 700; }
.site-footer a { color: var(--color-on-dark); }
.site-footer__legal { font-size: var(--text-xs); }

/* ---------- Interaction: precise hover lifts + border emphasis ---------- */
.service-card, .stats__item, .trust-card, .areas__list li {
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out),
              border-color 200ms var(--ease-out), background-color 160ms var(--ease-out);
}
.service-card:hover, .stats__item:hover, .trust-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: 0 2px 4px rgb(23 30 46 / 0.06), 0 12px 28px rgb(23 30 46 / 0.12);
}
.trust-card {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: var(--space-lg);
  background: color-mix(in oklch, var(--color-surface) 55%, transparent);
}
.areas__list li:hover { background: var(--color-tint); color: var(--color-primary); }
.service-card__link, .site-nav a { transition: color 140ms var(--ease-out); }
.service-card__link:hover { color: var(--color-primary-deep); }

/* ---------- Emergency strip: subtle live pulse ---------- */
.emergency__label { display: inline-flex; align-items: center; gap: var(--space-sm); }
.emergency__label::before {
  content: "";
  flex: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--color-ink);
  animation: emergency-pulse 2s var(--ease-out) infinite;
}
@keyframes emergency-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(23 30 46 / 0.45); }
  60% { box-shadow: 0 0 0 7px rgb(23 30 46 / 0); }
}

/* ---------- Load / scroll motion gate (JS adds `.motion` to <html>) ---------- */
/* Content is fully visible by default; hidden states apply ONLY under .motion,
   so no-JS and reduced-motion users always see everything. */
.motion .utility-bar { transform: translateY(-100%); }
.motion .hero__copy > *,
.motion .hero__panel,
.motion .section__head,
.motion .service-card,
.motion .stats__item,
.motion .trust-card,
.motion .review,
.motion .areas__list,
.motion .areas__grid > div,
.motion .contact__copy,
.motion .contact-form,
.motion .emergency__inner > * { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .status-dot, .emergency__label::before { animation: none; }
  .hero__phone { transition: none; background-size: 100% 0.3em; }
  .contact-form__success .draw { animation: none; stroke-dashoffset: 0; }
  /* keep hover feedback as color/border emphasis, drop the movement */
  .btn:hover,
  .service-card:hover, .stats__item:hover, .trust-card:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 56rem) {
  .hero__grid, .areas__grid, .contact__grid { grid-template-columns: 1fr; gap: var(--space-2xl); }
  .hero__grid { padding-block: var(--space-3xl); }
  .section { padding-block: var(--space-3xl); }
  .utility-bar__licenses { display: none; }
  .utility-bar__inner { justify-content: center; }

  .site-header__call { margin-left: auto; }
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.75rem; height: 2.75rem;
    padding: 0.625rem;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--color-ink); border-radius: 1px; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-sm) var(--space-lg) var(--space-lg);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: var(--space-sm) 0; font-size: var(--text-md); min-height: 2.75rem; display: flex; align-items: center; }
}

@media (max-width: 34rem) {
  .site-header__call { padding-inline: 0.75rem; }
  .site-header__call-num { display: none; }
  .site-header__call svg { width: 20px; height: 20px; }
  .areas__list { grid-template-columns: repeat(2, 1fr); }
  .emergency__inner { justify-content: center; text-align: center; }
  .hero__actions .btn { flex: 1 1 100%; }
}
