/* Young Earth Pools
   Bright, traditional trade-service styling.
   Tailwind (CDN) is loaded in index.html for extra utilities.
   This file is the look of the page, including the iMessage bar.
   Replace photos in images/ — do not hotlink outside pictures. */

:root {
  --canvas: #ffffff;
  --mist: #f8fafc;
  --mist-2: #f1f5f9;
  --ink: #1e293b;
  --ink-soft: #475569;
  --line: #e2e8f0;
  --pool: #0284c7;
  --pool-deep: #0369a1;
  --send: #007aff;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --display: "Libre Baskerville", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
}

img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-wrap: balance;
  margin: 0;
}

p { text-wrap: pretty; }

button, input, textarea { font: inherit; color: inherit; }

button:not(:disabled), [role="button"]:not(:disabled) { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--pool);
  outline-offset: 3px;
}

.hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top-rule { height: 4px; background: var(--pool); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: white;
  padding: 0.6rem 0.9rem;
  border-radius: 0.4rem;
}
.skip-link:focus { top: 0.75rem; }

#services, #area, #message { scroll-margin-top: 9rem; }

.wrap {
  width: min(72rem, calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
}

.header-row, .nav-row, .footer-inner {
  width: min(72rem, calc(100% - 2.5rem));
  margin-inline: auto;
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.125rem;
}

.mark {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--pool);
  position: relative;
  display: inline-block;
  flex: none;
}
.mark::before, .mark::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  height: 2px;
  border-radius: 2px;
  background: white;
}
.mark::before { top: 38%; }
.mark::after { top: 58%; }

.nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  border-top: 1px solid var(--line);
}

.nav-link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav-link:hover { color: var(--pool-deep); }

.press { transition: scale 150ms ease-out, background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out; }
.press:active:not(:disabled) { scale: 0.96; }

.call-button, .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.15rem;
  border-radius: 999px;
  font-weight: 650;
  text-decoration: none;
  line-height: 1;
}
.call-button { background: var(--pool); color: white; border: 1px solid var(--pool); }
.call-button:hover { background: var(--pool-deep); border-color: var(--pool-deep); }
.ghost-button { background: white; color: var(--ink); border: 1px solid var(--line); }
.ghost-button:hover { border-color: var(--pool); color: var(--pool-deep); }

.hero { padding: 3rem 0 3.5rem; }
.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 768px) {
  .hero-grid { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 1.15rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pool-deep);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.25rem); }
.lede, .muted { color: var(--ink-soft); }
.lede { font-size: 1.125rem; margin: 0; max-width: 38rem; }

.hero-frame, .photo-frame { overflow: hidden; background: var(--mist-2); }
.hero-frame {
  aspect-ratio: 16 / 10;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
}
.photo-frame { aspect-ratio: 3 / 2; }
.hero-frame img, .photo-frame img { width: 100%; height: 100%; object-fit: cover; }

.band { background: var(--mist); }
.section { padding: 3.5rem 0; }
.section-intro { max-width: 40rem; margin-bottom: 2rem; }
.section-intro p { margin: 0.75rem 0 0; }

.cards {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .cards { grid-template-columns: 1fr 1fr 1fr; } }

.service-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.service-body {
  padding: 1.15rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}
.service-body h3 { font-size: 1.25rem; }
.service-body p { margin: 0; color: var(--ink-soft); }
.features { margin: 0; padding-left: 1.15rem; color: var(--ink-soft); }
.features li + li { margin-top: 0.28rem; }

.text-button {
  margin-top: auto;
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--pool);
  font-weight: 700;
  text-align: left;
}
.text-button:hover { color: var(--pool-deep); text-decoration: underline; }

.towns { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 2rem 0 0; }
.town {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}

.phone-link { font-weight: 700; color: var(--pool); text-decoration: none; }
.phone-link:hover { text-decoration: underline; }

.form-panel { max-width: 36rem; }
.form-panel > p { color: var(--ink-soft); }
.lead-form { margin-top: 1.5rem; }
.imessage-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #ffffff;
  border: 1px solid #e5e5ea;
  border-radius: 1.5rem;
  padding: 0.7rem;
}
.imessage-line {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 1.35rem;
  background: #f2f2f7;
  padding: 0 1rem;
  font-size: 1rem;
  color: var(--ink);
}
.imessage-line:focus {
  outline: none;
  box-shadow: inset 0 0 0 1.5px var(--send);
}
.imessage-line::placeholder { color: #8e8e93; }
.imessage-wrap { display: flex; flex-direction: column; gap: 0.55rem; }
.imessage-bar {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  border: 0;
  background: #f2f2f7;
  border-radius: 1.5rem;
  padding: 0.25rem 0.25rem 0.25rem 0.3rem;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.04);
}
.imessage-clip, .imessage-send {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
}
.imessage-clip { background: transparent; color: var(--ink-soft); }
.imessage-clip:hover { color: var(--ink); }
.imessage-input {
  flex: 1;
  min-width: 0;
  resize: none;
  overflow: auto;
  border: 0;
  background: transparent;
  padding: 0.7rem 0.2rem;
  font-size: 1rem;
  line-height: 1.4;
  max-height: 10rem;
}
.imessage-input:focus { outline: none; }
.imessage-input::placeholder { color: #8e8e93; }
.imessage-send { background: var(--send); color: white; }
.imessage-send:hover:not(:disabled) { background: #0066d6; }
.imessage-send:disabled { opacity: 0.55; }
.imessage-send svg { display: block; }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; padding-left: 0.4rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.25rem 0.15rem 0.15rem;
  font-size: 0.85rem;
  font-weight: 450;
}
.chip img { width: 36px; height: 36px; object-fit: cover; border-radius: 999px; }
.chip button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.receipt { min-height: 1.25rem; margin: 0; padding: 0 0.55rem 0.15rem; text-align: right; color: #8e8e93; font-size: 0.8rem; }
.receipt.is-on { animation: receipt-in 220ms ease-out; }
.form-error { color: var(--ink); font-weight: 700; margin: 0; font-size: 0.95rem; }

@keyframes receipt-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.site-footer { border-top: 1px solid var(--line); background: var(--canvas); }
.footer-inner { padding: 2rem 0; color: var(--ink-soft); }
.footer-inner p { margin: 0.35rem 0; }
.footer-name { font-family: var(--display); font-size: 1.125rem; color: var(--ink); }
.fine { margin-top: 1rem; font-size: 0.9rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .receipt.is-on, .press { animation: none; transition: none; }
}
